APIs to manage custom actions. Custom actions allow you to define custom scripts and commands that can be executed on devices.
Retrieve all custom actions for the tenant
Success
Bad Request
{- "content": {
- "count": 0,
- "next": "string",
- "previous": "string",
- "results": [
- {
- "name": "string",
- "type": "button",
- "state": "draft",
- "position_in_blueprints": "none",
- "position_in_device_settings": "none",
- "properties": { },
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "options": [
- {
- "label": "string",
- "key": "4adfe27e-63d3-45b9-8238-62b6ed6fdb5e",
- "scripts": [
- {
- "linux": null
}
]
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": 0,
- "updated_by": 0
}
]
}, - "message": "string",
- "code": 0
}
Create a new custom action
Success
Bad Request
Conflict - Custom Action name already exists
Internal Server Error
{- "name": "string",
- "type": "button",
- "state": "draft",
- "position_in_blueprints": "none",
- "position_in_device_settings": "none",
- "properties": { },
- "options": [
- {
- "label": "string",
- "key": "4adfe27e-63d3-45b9-8238-62b6ed6fdb5e",
- "scripts": [
- {
- "linux": {
- "script": "string",
- "interpreter": "string"
}
}
]
}
]
}
{- "content": {
- "name": "string",
- "type": "button",
- "state": "draft",
- "position_in_blueprints": "none",
- "position_in_device_settings": "none",
- "properties": { },
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "options": [
- {
- "label": "string",
- "key": "4adfe27e-63d3-45b9-8238-62b6ed6fdb5e",
- "scripts": [
- {
- "linux": {
- "script_id": "74e7d8c3-daa9-40c1-ac0e-b64bfab79c57"
}
}
]
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": 0,
- "updated_by": 0
}, - "message": "string",
- "code": 201
}
Retrieve a custom action by ID
Success
Custom Action not found
{- "content": {
- "name": "string",
- "type": "button",
- "state": "draft",
- "position_in_blueprints": "none",
- "position_in_device_settings": "none",
- "properties": { },
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "options": [
- {
- "label": "string",
- "key": "4adfe27e-63d3-45b9-8238-62b6ed6fdb5e",
- "scripts": [
- {
- "linux": {
- "script_id": "74e7d8c3-daa9-40c1-ac0e-b64bfab79c57"
}
}
]
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": 0,
- "updated_by": 0
}, - "message": "string",
- "code": 200
}
Update a custom action by ID
Success
Bad Request (validation error or invalid state transition)
Custom Action not found
Conflict - Custom Action name already exists
Internal Server Error
{- "name": "string",
- "type": "button",
- "state": "draft",
- "position_in_blueprints": "none",
- "position_in_device_settings": "none",
- "properties": { },
- "options": [
- {
- "label": "string",
- "key": "4adfe27e-63d3-45b9-8238-62b6ed6fdb5e",
- "scripts": [
- {
- "linux": {
- "script": "string",
- "interpreter": "string"
}
}
]
}
]
}
{- "content": {
- "name": "string",
- "type": "button",
- "state": "draft",
- "position_in_blueprints": "none",
- "position_in_device_settings": "none",
- "properties": { },
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "options": [
- {
- "label": "string",
- "key": "4adfe27e-63d3-45b9-8238-62b6ed6fdb5e",
- "scripts": [
- {
- "linux": {
- "script_id": "74e7d8c3-daa9-40c1-ac0e-b64bfab79c57"
}
}
]
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by": 0,
- "updated_by": 0
}, - "message": "string",
- "code": 200
}
Delete a custom action by ID
Success
Bad Request - Cannot delete active custom action
Custom Action not found
Internal Server Error
{- "message": "string",
- "code": 200
}
Retrieve script content by ID
Success
Permission denied
Script not found
Internal Server Error
{- "content": {
- "script": "string",
- "interpreter": "string"
}, - "message": "string",
- "code": 200
}