Executors Endpoints

Base path: /api/1/executors

Executors are scheduled jobs that are related with an attack, so in the given date the job will execute the attack. The only way to create executors is through chaosmonkey.api.plans_blueprint()

Evey executor has 4 main properties:

  1. id: unique identifier
  2. next_run_time: The time and date that the executor is going to be executed
  3. plan_id: id of the plan that created the executor
  4. executed: if the executor has been executed

Example:

{
    "id": "3b373155577b4d1bbc62216ffea013a4",
    "plan_id": "3ec72048cab04b76bdf2cfd4bc81cd1e",
    "next_run_time": "2017-01-25T10:12:1485339145",
    "executed": false
}
GET /api/1/executors/

Get a list of scheduled executors

Example response:

{
    "executors":[
        {
            "_links":{
                "self":{
                    "href":"/api/1/executors/3b373155577b4d1bbc62216ffea013a4"
                },
                "update":{
                    "href":"/api/1/executors/3b373155577b4d1bbc62216ffea013a4"
                },
                "delete":{
                    "href":"/api/1/executors/3b373155577b4d1bbc62216ffea013a4"
                }
            },
            "id":"3b373155577b4d1bbc62216ffea013a4",
            "plan_id":"3ec72048cab04b76bdf2cfd4bc81cd1e",
            "next_run_time":"2017-01-25T10:12:1485339145",
            "executed": false
        }
    ]
}
Param:executed. Control when to show all executors (true) or only not executed (false). Defaults to false
Return:chaosmonkey.api.hal.document()
PUT /api/1/executors/(string: executor_id)

Update a executor to change its date. To provide a new date use the format in the example bellow. The format is used to create a DateTrigger from the apscheduler.

TODO: create more Triggers

Example request:

PUT /api/1/executors/3b373155577b4d1bbc62216ffea013a4
Body:
    {
      "type" : "date",
      "args" : {
        "date": "2017-10-23T19:19"
      }
    }

Example response:

{
  "id": "3b373155577b4d1bbc62216ffea013a4",
  "plan_id": "3ec72048cab04b76bdf2cfd4bc81cd1e",
  "next_run_time": "2017-10-23T19:19:1508786354",
  "executed": false,
  "_links": {
    "self": {
      "href": "/api/1/executors/3b373155577b4d1bbc62216ffea013a4"
    },
    "update":{
      "href":"/api/1/executors/3b373155577b4d1bbc62216ffea013a4"
    },
    "delete":{
      "href":"/api/1/executors/3b373155577b4d1bbc62216ffea013a4"
    }
  }
}
Return:chaosmonkey.api.hal.document()
DELETE /api/1/executors/(string: executor_id)

Delete an executor

Example request:

DEL /api/1/executors/6890192d8b6c40e5af16f13aa036c7dc