{"type":"api","title":"Live Execution of a Script","meta":{"id":"/apps/pubhub/media/orbital-api/eae5ef1abc124f2d904b17b1697b2df180e92067/6031b5a0-67fa-3480-bf75-857e24b55963","info":{"description":"Documentation of the Orbital API\n\nTo authenticate:\n\n\nFollow steps 1 through 3 from the SecureX Authorization section of this article to generate a SecureX Token.\nhttps://developer.cisco.com/docs/secure-endpoint/#!authentication\n\n\nclick \"Authorize\" button\nIn \"Value\" - enter token from above, prefixed with \"Bearer \" (no quotes)\nClick \"Authorize\", followed by \"Close\"\n\nNow the \"Try it out\" button can work","title":"Orbital API","version":"0.0.1"},"security":[{"AuthorizationHeader":[]}],"openapi":"3.0.3","servers":[{"description":"North America","url":"https://enterprise.orbital.amp.cisco.com/v0"},{"description":"Asia, Pacific, Japan, and China","url":"https://apjc.orbital.amp.cisco.com/v0"},{"description":"Europe","url":"https://eu.orbital.amp.cisco.com/v0"}],"securitySchemes":{"AuthorizationHeader":{"description":"Ex: Bearer \\\u003ctoken\\\u003e","in":"header","name":"authorization","type":"apiKey"}}},"spec":{"description":"Live Execution of a Script","operationId":"idOfLiveScript","requestBody":{"content":{"application/json":{"schema":{"properties":{"cidr":{"example":"netmask:10.0.0.0/24","type":"string"},"expiryinminutes":{"description":"script expiry in minutes","example":"60","type":"string"},"name":{"description":"defined script name","example":"sample livescript name","maxLength":65536,"minLength":1,"type":"string"},"nodes":{"items":{"type":"string"},"type":"array","$$ref":"#/components/schemas/Nodes"},"nodeversions":{"description":"Versions allows us to marshal a []string to PostgresQL","items":{"type":"string"},"type":"array","$$ref":"#/components/schemas/Versions"},"os":{"items":{"type":"string"},"type":"array","$$ref":"#/components/schemas/OSArray"},"requestdurationsec":{"description":"maximum time (seconds) to wait for collecting results","example":"5","type":"string"},"script":{"properties":{"args":{"description":"script arguments","items":{"properties":{"ArgType":{"example":"ORBITAL_BASIC_STRING","type":"string"},"Description":{"example":"name of the person","type":"string"},"Name":{"example":"age","type":"string"},"Optional":{"example":false,"type":"boolean"},"Value":{"example":"23","type":"string"}},"required":["Name","Value"],"type":"object","$$ref":"#/components/schemas/ScriptArgs"},"type":"array"},"catalog_id":{"description":"Catalog id of pre-defined stock script, needed if Content is not defined","example":"org:Yahednsxacd","maxLength":65536,"minLength":1,"type":"string"},"content":{"description":"Script content encoded in base64","example":"cHJpbnQoImhlbGxvIHt7IC5maXJzdF9uYW1lIH19Iik=","maxLength":65536,"minLength":1,"type":"string"},"label":{"description":"user labels","type":"string"},"name":{"description":"script name","example":"hello world script","maxLength":65536,"minLength":1,"type":"string"},"timeout":{"description":"Script timeout in seconds","example":600,"format":"int32","type":"integer"}},"type":"object","$$ref":"#/components/schemas/ScriptInput"}},"required":["nodes","os"],"type":"object","$$ref":"#/components/schemas/LiveScriptRequest"}}},"description":"Parameter required to create live script\nMust provide script content or catalog_id but not both","x-originalParamName":"Body"},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"errors":{"description":"errors generated during the script run","items":{"type":"string"},"type":"array"},"result_id":{"example":"123","type":"string"},"results":{"description":"the results of the script run","items":{"properties":{"activeIp":{"example":"192.168.0.10","type":"string"},"exit_code":{"example":0,"format":"int64","type":"integer"},"hostname":{"example":"test_host","type":"string"},"nodeId":{"example":"node-a","type":"string"},"reported":{"description":"the time the endpoint reported results for this run","format":"date-time","type":"string"},"stderr":{"description":"the captured stderr from the endpoint","type":"string"},"stdout":{"example":"hello bob","type":"string"}},"type":"object","$$ref":"#/components/schemas/LiveScriptOutput"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/LiveScriptOutputResponse"}}},"description":"Live Script Execution.","$$ref":"#/components/responses/LiveScriptResponse"},"400":{"content":{"application/json":{"schema":{"properties":{"errors":{"example":["fail to set timeout, make sure timeout value is valid"],"items":{"type":"string"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/ErrorMsg400LiveScriptPost"}}},"description":"Live Script Error 400 Post Response","$$ref":"#/components/responses/ErrorMsg400LiveScriptPost"},"401":{"content":{"application/json":{"schema":{"properties":{"errors":{"example":["authentication required"],"items":{"type":"string"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/ErrorMsg401MissingToken"}}},"description":"Script Error 401 Response","$$ref":"#/components/responses/ErrorMsg401"},"403":{"content":{"application/json":{"schema":{"properties":{"errors":{"example":["access to this feature is not permitted"],"items":{"type":"string"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/ErrorMsg403Forbidden"}}},"description":"Script Error 403 Response","$$ref":"#/components/responses/ErrorMsg403Forbid"}},"summary":"Live Execution of a Script","tags":["Scripts"],"__originalOperationId":"idOfLiveScript","security":[{"AuthorizationHeader":[]}],"method":"post","path":"/script/run"}}