- 02 Apr 2024
-
DarkLight
-
PDF
Subsequent Index Validation
- Updated on 02 Apr 2024
-
DarkLight
-
PDF
Index Collection Status
After running the index creation API, you should validate the indexes are created successfully. For large collections, such as jobs and tasks, the index creation process may take some time, so the progress information available in GET /indexes/:collectionName/status
can show how far along it is as well as when the process is completely finished.
Deprecated Node Script (npm run index)
While the API solution above is the preferred way to manage indexing, there is currently another way to create indexes. The legacy mechanism is to use the npm run index
node script in the various applications that support it.
The applications that support this method are:
- Command Templates/MOP
- Service Catalog
- Workflow Engine
Example
The following outlines how to work with the npm run index
script in Workflow Engine.
cd /opt/pronghorn/current/node_modules/@itential/app-workflow_engine
npm run index
Verify Automation Engine Indexes
Once the Automation Engine scripts have completed, run the following commands on MongoDB to verify the indexes have been created.
Commands
db.jobs.getIndexes()
db.tasks.getIndexes()
db.workflows.getIndexes()
Example
$ mongo mongo01.zone1.itential.io:27017/pronghorn --ssl -u pronghorn
MongoDB shell version v3.4.18
Enter password:
connecting to: mongodb://mongo01.zone1.itential.io:27017/pronghorn
MongoDB server version: 3.4.18
rs0:PRIMARY> db.jobs.getIndexes()
[{
"v": 2,
"key": {
"_id": 1
},
"name": "_id_",
"ns": "pronghorn.jobs"
},
{
"v": 2,
"key": {
"name": 1,
"type": 1,
"groups": 1,
"status": 1,
"metrics.start_time": -1,
"metrics.progress": 1,
"metrics.user": 1
},
"name": "name_1_type_1_groups_1_status_1_metrics.start_time_-1_metrics.progress_1_metrics.user_1",
"ns": "pronghorn.jobs",
"background": true
},
{
"v": 2,
"key": {
"name": 1,
"type": 1,
"watchers": 1,
"status": 1,
"metrics.start_time": -1,
"metrics.progress": 1,
"metrics.user": 1
},
"name": "name_1_type_1_watchers_1_status_1_metrics.start_time_-1_metrics.progress_1_metrics.user_1",
"ns": "pronghorn.jobs",
"background": true
}
]
rs0: PRIMARY > db.tasks.getIndexes()[{
"v": 2,
"key": {
"_id": 1
},
"name": "_id_",
"ns": "pronghorn.tasks"
}, {
"v": 2,
"key": {
"name": 1,
"status": 1,
"groups": 1,
"type": 1,
"job.name": 1,
"job._id": 1,
"job.task": 1,
"metrics.owner": 1,
"metrics.start_time": -1
},
"name": "name_1_status_1_groups_1_type_1_job.name_1_job._id_1_job.task_1_metrics.owner_1_metrics.start_time_-1",
"ns": "pronghorn.tasks",
"background": true
},
{
"key": {
"status": 1,
"locked": 1
},
"background": true,
}, {
"key": {
"job._id": 1,
"job.task": 1
},
"background": true
}]
rs0: PRIMARY > db.workflows.getIndexes()[{
"v": 2,
"key": {
"_id": 1
},
"name": "_id_",
"ns": "pronghorn.workflows"
}, {
"v": 2,
"unique": true,
"key": {
"name": 1,
"type": 1
},
"name": "name_1_type_1",
"ns": "pronghorn.workflows",
"background": true
}, {
"v": 2,
"key": {
"groups": 1,
"created": -1,
"created_by": 1,
"last_updated": -1,
"last_updated_by": 1
},
"name": "groups_1_created_-1_created_by_1_last_updated_-1_last_updated_by_1",
"ns": "pronghorn.workflows",
"background": true
}]
Command Template/MOP Indexes
The final set of indexes for the Command Template/MOP application may be applied using the following npm
script.
Example
$ cd /opt/pronghorn/current/node_modules/@itential/app-mop
$ npm run index
...
...
Service Catalog Indexes
The final set of indexes for the Service Catalog application may be applied using the following npm
script.
Example
$ cd /opt/pronghorn/current/node_modules/@itential/app-service_catalog
$ npm run index
...
...