{"type":"api","title":"Schedule a Mop Job","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/c0404d8d-ff8e-36e9-bb59-ee336d247534","info":{"title":"Crosswork Change Automation API","version":"7.1.0","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"http://www.cisco.com/public/sw-license-agreement.html"},"description":"A web server dedicated to RESTful queries into the Crosswork Change Automation application."},"x-parser-conf":{"overview":{"markdownPath":"reference/CAHI/change_automation.overview.md"}},"openapi":"3.1.0","servers":[{"url":"https://{server_ip}:30603/crosswork/nca/v1","description":"Generated server url"}]},"spec":{"summary":"Schedule a Mop Job","operationId":"NCA_PostMopJob","tags":["NCA"],"requestBody":{"description":"Argument to schedule a Mop Job with params","required":true,"content":{"application/json":{"schema":{"type":"object","description":"Change Automation Mop Job Create Request","properties":{"mop_id":{"type":"string","title":"ID of the mop to be executed","description":"ID of the mop to be executed"},"check_start_time":{"type":"integer","format":"uint64","description":"Time at which pre-checks should start for the job. Default is now, i.e. as\nsoon as possible."},"exec_start_time":{"type":"integer","format":"uint64","description":"Time at which the actual execution, i.e. maintenance tasks should begin.\nDefault is now, i.e. as soon as possible."},"execution_params":{"type":"string","description":"JSON object specifying the execution parameters for the MoP job."},"execution_policy":{"title":"JSON formatted string of playbook execution policy","type":"object","description":"Change Automation Mop Execution Policy","properties":{"execution_strategy":{"title":"Type of execution of playbook","type":"string","enum":["STRATEGY_UNKNOWN","STRATEGY_CONTINUOUS","STRATEGY_SINGLE_STEP","STRATEGY_DRY_RUN"],"default":"STRATEGY_UNKNOWN","description":"Mop Execution Policy Exec Strategy Type","$$ref":"#/components/schemas/MopExecutionPolicyExecStrategyType"},"pause_on_tasks":{"type":"array","description":"ID's of the tasks on which the execution should pause when in single\nstepping mode","items":{"type":"integer","format":"int64"},"title":"ID's of the tasks on which the execution should pause when in single\nstepping mode"},"on_failure":{"title":"Action that the user wishes to take on task failure","type":"string","enum":["ON_FAILURE_UNKNOWN","ON_FAILURE_PAUSE","ON_FAILURE_COMPLETE_ROLLBACK","ON_FAILURE_ABORT"],"default":"ON_FAILURE_UNKNOWN","description":"Mop Execution Policy On Failure Action Type","$$ref":"#/components/schemas/MopExecutionPolicyOnFailureActionType"},"collect_syslog":{"type":"boolean","title":"Denotes whether to collect device syslogs or not","description":"Denotes whether to collect device syslogs or not"},"timeout":{"type":"string","title":"MoP timeout","description":"MoP timeout"}},"$$ref":"#/components/schemas/change_automationMopExecutionPolicy"},"device_group":{"type":"string","description":"Device group name (DLM tag). One job will be executed in parallel for\neach device in this group. Can only be used with playbooks targeting one\ndevice at a time. Either device group or devices must be specified."},"devices":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"description":"List of device hostnames."}},"description":"List of devices on which the job will be executed.\nIf multiple devices are provided for a playbook targeting one device at a\ntime, one job will be executed in parallel for each device in list. If\nmultiple devices are provided for a playbook targeting multiple devices, one\njob will be executed. Either device group or devices must be specified.","$$ref":"#/components/schemas/change_automationDevicesIds"},"submitter":{"type":"string","description":"The user who submitted the request."},"name":{"type":"string","description":"Name for the job set."},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for the job set."},"device_user":{"type":"string","description":"Username to be used for device authentication."},"device_pass":{"type":"string","description":"Password to be used for device authentication."},"device_secondary_pass":{"type":"string","description":"Secondary password to be used for device authentication."}},"$$ref":"#/components/schemas/change_automationMopJobCreateReq"},"example":{"mop_id":"router_check_accessibility","devices":{"ids":[]},"check_start_time":0,"exec_start_time":0,"wae_threshold":"90","name":"test-run","tags":[],"device_user":"","device_pass":"","execution_params":"{\"1\": {},\"2\": {} }","execution_policy":{"execution_strategy":"STRATEGY_CONTINUOUS","on_failure":"ON_FAILURE_ABORT","collect_syslog":false,"timeout":"600s"}}}}},"responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"type":"object","description":"Change Automation Mop Job Create Response","properties":{"execution_id":{"type":"string","description":"A unique ID to track the MoP job created. If a device group and or series\nwas requested, this will empty."},"set_id":{"type":"string","description":"A unique ID to track the set of MoP job(s) created."},"created_at":{"type":"string","format":"uint64","description":"Time at which job got scheduled for execution."},"created_by":{"type":"string","description":"The user who created the request."}},"example":{"execution_id":"1687426280907-75acbf9b-044b-44fe-bc5f-7b9cf107b825","set_id":"5c38ecf9-c32d-4a97-bebd-08f50571ef3a","created_by":"admin"},"$$ref":"#/components/schemas/change_automationMopJobCreateResp"}}}},"400":{"description":"Bad Request. The request is malformed in some way and the server cannot process it.","content":{"application/json":{"schema":{"type":"object","description":"Change Automation Error 400","required":["code","severity","message"],"properties":{"code":{"type":"string","description":"HTTP return code","example":"400"},"severity":{"type":"string","description":"Error severity level","enum":["Critical","Warning","Fatal"]},"message":{"type":"string","description":"Error message","example":"top level error string"},"data":{"type":"string","description":"Details of the error","example":"detailed description of the error"}},"example":{"code":"400","severity":"Critical","message":"error message","data":"detailed description of the error"},"$$ref":"#/components/schemas/change_automationError400"}}}},"500":{"description":"Internal Server Error. The server could not fulfill the request.","content":{"application/json":{"schema":{"type":"object","description":"Change Automation Error 500","required":["code","severity","message"],"properties":{"code":{"type":"string","description":"HTTP return code","example":"500"},"severity":{"type":"string","description":"Error severity level","enum":["Critical","Warning","Fatal"]},"message":{"type":"string","description":"Error message","example":"top level error string"},"data":{"type":"string","description":"Error detailed description"}},"example":{"code":"500","severity":"Critical","message":"error message","data":"Server Error. detailed description of the error"},"$$ref":"#/components/schemas/change_automationError500"}}}}},"method":"post","path":"/mopjobs"}}