Version 1 Apis are available as json stateless end-points.
You may expect HTTP 200 response with "err" field null upon success and HTTP 400 response with "err" field set otherwise.
This method set downtime status for provided host. Downtime starts now and and lasts until removal.
A scheduled downtime host do not fire alerts anymore but still receive and process datas from daemon (if daemon and host are alive).
You may use scheduled downtime periods for maintenance on your end.
You may also use them for on-demand servers (Amazon AWS on-demand instances and related) by scheduling downtime upon server shutdown, and removing it upon server restart.
Api uri: https://knock.center/api/v1/request
Input parameter | Type | Description |
---|---|---|
req_type | str | Request type |
acc_namespace | str | Your namespace |
acc_key | str | Your namespace api key |
host_name | str | Host name |
Output parameter | Type | Description |
---|---|---|
err | str,None | None is success, error description otherwise (which comes with an HTTP 400 response). |
resp_type | str | Response type |
host_name | str | Host name |
is_schedule_down | bool | True if host is in schedule downtime, False otherwise |
root@linux:~# curl 'https://knock.center/api/v1/request' --data '{"req_type": "host_schedule_down_set", "acc_namespace": "xxxxxx", "acc_key": "yyyyyy", "host_name": "zzzzzzz"}' -H 'Pragma: no-cache' -H 'Accept-Encoding: gzip, deflate, lzma' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Cache-Control: no-cache'
{"is_schedule_down":true,"resp_type":"host_schedule_down_set","host_name":"zzzzzzz","err":null}
root@linux:~#
This method unset downtime status for provided host.
Api uri: https://knock.center/api/v1/request
Input parameter | Type | Description |
---|---|---|
req_type | str | Request type |
acc_namespace | str | Your namespace |
acc_key | str | Your namespace api key |
host_name | str | Host name |
Output parameter | Type | Description |
---|---|---|
err | str,None | None is success, error description otherwise (which comes with an HTTP 400 response). |
resp_type | str | Response type |
host_name | str | Host name |
is_schedule_down | bool | True if host is in schedule downtime, False otherwise |
root@linux:~# curl 'https://knock.center/api/v1/request' --data '{"req_type": "host_schedule_down_unset", "acc_namespace": "xxxxxx", "acc_key": "yyyyyy", "host_name": "zzzzzzz"}' -H 'Pragma: no-cache' -H 'Accept-Encoding: gzip, deflate, lzma' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Cache-Control: no-cache'
{"is_schedule_down":false,"resp_type":"host_schedule_down_unset","host_name":"zzzzzzz","err":null}
root@linux:~#
This method retrieve downtime status for provided host.
Api uri: https://knock.center/api/v1/request
Input parameter | Type | Description |
---|---|---|
req_type | str | Request type |
acc_namespace | str | Your namespace |
acc_key | str | Your namespace api key |
host_name | str | Host name |
Output parameter | Type | Description |
---|---|---|
err | str,None | None is success, error description otherwise (which comes with an HTTP 400 response). |
resp_type | str | Response type |
host_name | str | Host name |
is_schedule_down | bool | True if host is in schedule downtime, False otherwise |
root@linux:~# curl 'https://knock.center/api/v1/request' --data '{"req_type": "host_schedule_down_get", "acc_namespace": "xxxxxx", "acc_key": "yyyyyy", "host_name": "zzzzzzz"}' -H 'Pragma: no-cache' -H 'Accept-Encoding: gzip, deflate, lzma' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Cache-Control: no-cache'
{"is_schedule_down":false,"resp_type":"host_schedule_down_get","host_name":"zzzzzzz","err":null}
root@linux:~#