Summary
Run an Analytics Template
Description
Run an Analytic Template.
Route
POST /mop/runAnalyticsTemplate
Roles
admin
engineering
support
apiwrite
Parameters
DetailsExampleSchema
Name |
Type |
Required |
Description |
pre |
object |
yes |
Pre command to run with the Analytic Template. (output of running a Command Template) |
post |
object |
yes |
Post command to run with the Analytic Template. (output of running a Command Template) |
analytic_template_name |
string |
yes |
Name of the Analytic Template to run. |
variables |
object |
yes |
Variables to run with the Analytic Template. |
Copied to Clipboard
{
"pre": {
"command": "show version",
"commands_results": "Cisco IOS Software, Version 1.2.3"
},
"post": {
"command": "show version",
"commands_results": "Cisco IOS Software, Version 1.2.3"
},
"analytic_template_name": "test",
"variables": {
"device_name": "my-device1"
}
}
Copied to Clipboard
{
"type": "object",
"properties": {
"pre": {
"title": "pre",
"type": "object",
"properties": {
"command": {
"type": "string"
},
"commands_results": {
"type": "string"
}
},
"examples": [
{
"command": "show version",
"commands_results": "Cisco IOS Software, Version 1.2.3"
}
]
},
"post": {
"title": "post",
"type": "object",
"properties": {
"command": {
"type": "string"
},
"commands_results": {
"type": "string"
}
},
"examples": [
{
"command": "show version",
"commands_results": "Cisco IOS Software, Version 1.2.3"
}
]
},
"analytic_template_name": {
"title": "analytic_template_name",
"type": "string",
"examples": [
"test"
]
},
"variables": {
"$ref": "mopTemplateDoc#/definitions/variables"
}
},
"required": [
"pre",
"post",
"analytic_template_name",
"variables"
],
"additionalProperties": false
}
Return
DetailsExampleSchema
Name |
Type |
Description |
analytic_template_results |
object |
Result of running Analytic Template |
Copied to Clipboard
{
"name": "ASR1K-MOP",
"_id": "ASR1K-MOP",
"namespace": null,
"os": "cisco-ios",
"passRule": true,
"prepostCommands": [
{
"preRawCommand": "show running-config ip prefix-list",
"postRawCommand": "show running-config ip prefix-list",
"passRule": true,
"rules": [
{
"type": "regex",
"preRegex": "",
"postRegex": "",
"evaluation": "="
}
],
"preCommandResHTML": "Test a command or the template to get results here",
"postCommandResHTML": "Test a command or the template to get results here"
},
{
"preRawCommand": "show running-config ip prefix-list",
"postRawCommand": "show running-config ip prefix-list",
"passRule": false,
"rules": [
{
"type": "regex",
"preRegex": "",
"postRegex": "",
"evaluation": "="
},
{
"type": "regex",
"preRegex": "",
"postRegex": "",
"evaluation": "="
}
],
"preCommandResHTML": "Test a command or the template to get results here",
"postCommandResHTML": "Test a command or the template to get results here"
},
{
"preRawCommand": "show running-config ip prefix-list",
"postRawCommand": "show running-config ip prefix-list",
"passRule": false,
"rules": [
{
"type": "regex",
"preRegex": "",
"postRegex": "",
"evaluation": "="
},
{
"type": "regex",
"preRegex": "",
"postRegex": "",
"evaluation": "="
},
{
"type": "regex",
"preRegex": "",
"postRegex": "",
"evaluation": "="
},
{
"type": "regex",
"preRegex": "",
"postRegex": "",
"evaluation": "="
}
],
"preCommandResHTML": "Test a command or the template to get results here",
"postCommandResHTML": "Test a command or the template to get results here"
}
],
"created": 1508182880981,
"createdBy": "exampleUser",
"lastUpdated": 1508182880981,
"lastUpdatedBy": "exampleUser"
}