Summary
IAG Native Netmiko send_command
Description
Transactional Netmiko send_command wrapper which accepts all function parameters
Route
POST /automationgateway/netmikoSendCommandExec
Roles
admin
Parameters
DetailsExampleSchema
Name |
Type |
Required |
Description |
host |
string |
yes |
netmiko device name |
commandString |
string |
yes |
The command to be executed on the remote device |
expectString |
string |
no |
Regular expression pattern to use for determining end of output. If left blank will default to being based on router prompt. |
delayFactor |
number |
no |
Multiplying factor used to adjust delays (default to 1). |
maxLoops |
number |
no |
Controls wait time in conjunction with delay_factor. Will default to be based upon the timeout in netmiko device |
stripPrompt |
boolean |
no |
Remove the trailing router prompt from the output (default to True). |
stripCommand |
boolean |
no |
Remove the echo of the command from the output (default to True). |
normalize |
boolean |
no |
Ensure the proper enter is sent at end of command (default to True). |
useTextfsm |
boolean |
no |
Process command output through TextFSM template (default to False). |
textfsmTemplate |
string |
no |
Name of template to parse output with; can be fully qualified path, relative path, or name of file in current directory. (default to None). |
useTtp |
boolean |
no |
Process command output through TTP template (default to False). |
ttpTemplate |
string |
no |
Name of template to parse output with; can be fully qualified path, relative path, or name of file in current directory. (default to None). |
useGenie |
boolean |
no |
Process command output through PyATS/Genie parser (default to False). |
cmdVerify |
boolean |
no |
Verify command echo before proceeding (default to True). |
Copied to Clipboard
{
"host": "xr9kv-atl",
"commandString": "show version",
"expectString": "^iosx?",
"delayFactor": 0,
"maxLoops": 0,
"stripPrompt": true,
"stripCommand": false,
"normalize": true,
"useTextfsm": true,
"textfsmTemplate": "/path",
"useTtp": false,
"ttpTemplate": "/path",
"useGenie": false,
"cmdVerify": false
}
Copied to Clipboard
{
"type": "object",
"properties": {
"host": {
"title": "host",
"type": "string",
"$ref": "deviceData#/definitions/deviceName"
},
"commandString": {
"title": "commandString",
"type": "string",
"examples": [
"show version"
]
},
"expectString": {
"title": "expectString",
"type": "string",
"examples": [
"^iosx?"
]
},
"delayFactor": {
"title": "delayFactor",
"type": "number",
"examples": [
0
]
},
"maxLoops": {
"title": "maxLoops",
"type": "number",
"examples": [
0
]
},
"stripPrompt": {
"title": "stripPrompt",
"type": "boolean",
"examples": [
true,
false
]
},
"stripCommand": {
"title": "stripCommand",
"type": "boolean",
"examples": [
true,
false
]
},
"normalize": {
"title": "normalize",
"type": "boolean",
"examples": [
true,
false
]
},
"useTextfsm": {
"title": "useTextfsm",
"type": "boolean",
"examples": [
true,
false
]
},
"textfsmTemplate": {
"title": "textfsmTemplate",
"type": "string",
"examples": [
"/path"
]
},
"useTtp": {
"title": "useTtp",
"type": "boolean",
"examples": [
true,
false
]
},
"ttpTemplate": {
"title": "ttpTemplate",
"type": "string",
"examples": [
"/path"
]
},
"useGenie": {
"title": "useGenie",
"type": "boolean",
"examples": [
true,
false
]
},
"cmdVerify": {
"title": "cmdVerify",
"type": "boolean",
"examples": [
true,
false
]
}
},
"required": [
"host",
"commandString"
],
"additionalProperties": false
}
Return
DetailsExampleSchema
Name |
Type |
Description |
result |
object |
A JSON Object containing status, code and the result |
Copied to Clipboard
{
"command_string": "show version",
"error_msg": "TCP connection to device failed",
"host": "netmiko",
"status": "FAILURE"
}
Copied to Clipboard
{
"properties": {
"command_string": {
"type": "string",
"examples": [
"show version"
]
},
"error_msg": {
"type": "string",
"examples": [
"TCP connection to device failed"
]
},
"host": {
"type": "string",
"examples": [
"netmiko"
]
},
"status": {
"enum": [
"SUCCESS",
"FAILURE"
],
"type": "string"
}
},
"type": "object"
}