Set container mode
PATCH
/container/<containerId>/mode
Description
Set the container mode. Success (204) is also returned when the container was already in the desired mode.
Path parameters
Param | Description |
---|---|
containerId |
Container Id. |
Query parameters
none
Body
Param | Type | Required | Description |
---|---|---|---|
mode |
string | Yes | One of normal , maintenance or disabled . |
duration |
integer | No | Duration for the mode in minutes. Accepts a value between 1 and 480 and only works when the mode is set to either maintenance or disabled . If duration is not given, the mode is changed indefinitely. |
Return codes
Error code | Reason |
---|---|
204 |
Success. |
400 |
Invalid body. |
401 |
Invalid or missing token. |
403 |
Insufficient permissions (required: API +ASSET_MANAGEMENT ). |
404 |
Container not found. |
409 |
Too many open alerts. (mode "normal" is only allowed with less than 500 open alerts) |
Example
Curl request:
curl \
-X PATCH 'https://api.infrasonar.com/container/123/mode' \
-H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-H 'Content-Type: application/json' \
--data-raw '{
"mode": "maintenance"
}'