Summary
Run single command from template
Description
Run a single command from a template on a devices.
Route
POST /mop/RunCommandTemplateSingleCommand
Roles
admin
apiwrite
Parameters
DetailsExampleSchema
Name |
Type |
Required |
Description |
templateId |
string |
yes |
Id of command template to be run. |
commandIndex |
number |
yes |
Index of the command in the template |
variables |
object |
yes |
Variables to be run with the Command Template. |
devices |
array |
yes |
Devices to run the Command Template against. |
Copied to Clipboard
{
"templateId": "ASR1K-MOP",
"commandIndex": 0,
"variables": {
"device_name": "my-device1"
},
"devices": [
"Device 2",
"Device 1"
]
}
Copied to Clipboard
{
"type": "object",
"properties": {
"templateId": {
"$ref": "mopTemplateDoc#/definitions/_id"
},
"commandIndex": {
"title": "commandIndex",
"type": "integer",
"examples": [
0
]
},
"variables": {
"$ref": "mopTemplateDoc#/definitions/variables"
},
"devices": {
"$ref": "mopTemplateDoc#/definitions/devices"
}
},
"required": [
"templateId",
"commandIndex",
"variables",
"devices"
],
"additionalProperties": false
}
Return
DetailsExampleSchema
Name |
Type |
Description |
command_result |
object |
Result of the Command Template run. |
Copied to Clipboard
{
"raw": "show version",
"all_pass_flag": false,
"evaluated": "show version",
"rules": [
{
"rule": "show version",
"eval": "contains",
"raw": "show version",
"result": false
},
{
"rule": "show version",
"eval": "contains",
"raw": "show version",
"result": false
}
],
"device": "device1",
"response": "version: 10.0.0",
"result": true
}