{"type":"api","title":"Parse command output","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-2/76fd4bb9d069fd2530d7a02f0b3a4ca00eccfd35/773d8c2d-0de2-3906-8d3f-8a19d6895750","info":{"title":"Crosswork Workflow Manager Solutions - Automations","description":"The automation service acts as an orchestrator, handling the scheduling, execution,\nbatch processing, and monitoring of MOPs and their activities. The API provides endpoints for managing these operations.","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"https://www.cisco.com/public/sw-license-agreement.html"},"version":"7.2.0"},"x-parser-conf":{"overview":{"markdownPath":"reference/CWM-SOLUTIONS/automations-api.overview.md"}},"openapi":"3.0.1","servers":[{"url":"https://crosswork-ip:30603/crosswork/cwms/automations/v1"}]},"spec":{"tags":["Workflow Utilities"],"summary":"Parse command output","description":"This API helps parsing of semi-structured device command outputs using\nTextFSM templates. It takes both a TextFSM template and command output,\nand generates the FSM output. For more information about TextFSM, visit\nTextFSM Wiki [https://github.com/google/textfsm/wiki].","operationId":"parseCmdOutput","requestBody":{"description":"Command output and textFSM template","content":{"application/json":{"schema":{"type":"object","properties":{"input":{"type":"string","description":"Input string","example":"Value1,Value2,Value3\n1,2,3"},"template":{"type":"string","description":"Template string","example":"Value1,Value2,Value3\n{{Value1}},{{Value2}},{{Value3}}"}},"description":"parse request object","$$ref":"#/components/schemas/ParseRequest"},"examples":{"isisAdjacencyParsing":{"summary":"Parse ISIS adjacency information from Nokia SR router","value":{"input":"\n\r\n===============================================================================\r\nRtr Base ISIS Instance 0 Adjacency \r\n===============================================================================\r\nSystem ID Usage State Hold Interface MT-ID\r\n-------------------------------------------------------------------------------\r\ncr10.yyz-PTX10002 L2 Up 25 ae10.0 0\r\ncr11.yyz-PTX10001 L2 Up 22 ae20.0 0\r\n-------------------------------------------------------------------------------\r\nAdjacencies : 2\r\n===============================================================================\r\n\r\n[/]\r\nA:cnc-poc@P1S1.yyz-SR2se# ","template":"Value ISIS_ID (\\S+)\nValue STATE (\\S+)\n\nStart\n ^${ISIS_ID}\\s+\\S+\\s+${STATE}\\s+\\d+\\s+\\S+\\s+\\d+ -\u003e Record"}},"invalidXROutput":{"summary":"Handle invalid command output from Cisco IOS-XR","value":{"input":"{\"tailf-ned-cisco-ios-xr-stats:output\":{\"result\":\"\\r\\n\\r ^\\r\\n% Invalid input detected at '^' marker.\\r\\nRP/0/RP0/CPU0:spitfire248#\"}}","template":"Value InterfaceType (.*?)\nValue Total (\\d+)\nValue Up (\\d+)\nValue Down (\\d+)\nValue AdminDown (\\d+)\n\nStart\n ^${InterfaceType}\\s+${Total}\\s+${Up}\\s+${Down}\\s+${AdminDown} -\u003e Record"}},"ldpNeighborParsing":{"summary":"Parse LDP neighbor information with no matching entries","value":{"input":"\n\r\n===============================================================================\r\nLDP Interfaces\r\n===============================================================================\r\nInterface Adm/Opr \r\n Sub-Interface(s) Adm/Opr Hello Hold KA KA Transport\r\n Fctr Time Fctr Time Address\r\n-------------------------------------------------------------------------------\r\nNo Matching Entries Found\r\n===============================================================================\r\n\r\n[/]\r\nA:cnc-poc@P1S1.yyz-SR2se# ","template":"Value NEIGHBOR (\\S+)\nValue STATUS (Up|Down|Init|Unknown)\n\nStart\n ^Neighbor\\s+Interface\\s+Hello -\u003e Next\n ^-+ -\u003e Next\n ^${NEIGHBOR}\\s+\\S+\\s+${STATUS} -\u003e Record\n ^-+ -\u003e End"}}}}},"required":true},"responses":{"200":{"description":"Parsed output","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","description":"A structure to hold the error details","properties":{"code":{"type":"integer","description":"HTTP status code"},"message":{"type":"string","description":"Error message"},"status":{"type":"string","description":"Status"},"statusInt":{"type":"integer","description":"Status integer"}},"$$ref":"#/components/schemas/AutomationsError"}}}},"406":{"description":"API requests are not acceptable at this time","content":{"application/json":{"schema":{"type":"object","description":"A structure to hold the standard response","properties":{"code":{"type":"integer","description":"HTTP status code"},"key":{"type":"string","description":"Key to retrieve the job details"},"message":{"type":"string","description":"Message"},"status":{"type":"string","description":"Status"},"statusInt":{"type":"integer","description":"Status integer"}},"$$ref":"#/components/schemas/StandardResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"A structure to hold the error details","properties":{"code":{"type":"integer","description":"HTTP status code"},"message":{"type":"string","description":"Error message"},"status":{"type":"string","description":"Status"},"statusInt":{"type":"integer","description":"Status integer"}},"$$ref":"#/components/schemas/AutomationsError"}}}}},"x-codegen-request-body-name":"body","__originalOperationId":"parseCmdOutput","method":"post","path":"/cwms-utils/parse-text"}}