Creates an instruction with given parameters
| Param name | Description |
|---|---|
|
instruction required |
Object containing information about the instruction to be created Value: Must be a Hash |
|
pretty optional |
Return a pretty formatted response if true, Default is false Value: Must be a Boolean |
|
is_oem optional |
Create instruction in child account by oem user if is_oem flag is true. Value: Must be a Boolean |
|
child_organisation_key optional |
Organisation key of child account where oem user wants to create instruction. Required field if is_oem is present. Value: Must be a String |
Request - create instruction with parameters - name, definition and description
curl -X POST -H "Content-Type:application/json" -H "X-Auth-Token:olezAZXGQn9MutnfNerKDQ" -d '{"instruction":{"name":"Increase Pressure 20 PSI","definition":{"add_pressure":20},"description":"Increases pressure by 20 PSI"}}' https://api.datonis.io/api/v3/instructions
Response (containing details of the instruction created )
{
"instruction": {
"definition": {
"add_pressure": 20
},
"description": "Increases pressure by 20 PSI",
"instruction_key": "2ab8dfe1b4",
"max_retries": 0,
"name": "Increase Pressure 20 PSI",
"timeout": 15,
"created_at": 1448430636,
"updated_at": 1448430636
}
}
Request - create instruction with parameters - name, definition, description, max_retries (execution retries) and timeout (timeout in seconds for instruction acknowledgement)
curl -X POST -H "Content-Type:application/json" -H "X-Auth-Token:olezAZXGQn9MutnfNerKDQ" -d '{"instruction":{"name":"Increase Pressure 20 PSI","definition":{"add_pressure":20},"description":"Increases pressure by 20 PSI","max_retries":3,"timeout":30}}' https://api.datonis.io/api/v3/instructions
Response (containing details of the instruction created)
{
"instruction": {
"definition": {
"add_pressure": 20
},
"description": "Increases pressure by 20 PSI",
"instruction_key": "2ab8dfe1b4",
"max_retries": 3,
"name": "Increase Pressure 20 PSI",
"timeout": 30,
"created_at": 1448430636,
"updated_at": 1448430636
}
}