JSON Apis

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.

host_schedule_down_set

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 parameterTypeDescription
req_typestrRequest type
acc_namespacestrYour namespace
acc_keystrYour namespace api key
host_namestrHost name
Output parameterTypeDescription
errstr,NoneNone is success, error description otherwise (which comes with an HTTP 400 response).
resp_typestrResponse type
host_namestrHost name
is_schedule_downboolTrue if host is in schedule downtime, False otherwise
Call sample:

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:~#
                        

host_schedule_down_unset

This method unset downtime status for provided host.

Api uri: https://knock.center/api/v1/request

Input parameterTypeDescription
req_typestrRequest type
acc_namespacestrYour namespace
acc_keystrYour namespace api key
host_namestrHost name
Output parameterTypeDescription
errstr,NoneNone is success, error description otherwise (which comes with an HTTP 400 response).
resp_typestrResponse type
host_namestrHost name
is_schedule_downboolTrue if host is in schedule downtime, False otherwise
Call sample:

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:~#
                        

host_schedule_down_get

This method retrieve downtime status for provided host.

Api uri: https://knock.center/api/v1/request

Input parameterTypeDescription
req_typestrRequest type
acc_namespacestrYour namespace
acc_keystrYour namespace api key
host_namestrHost name
Output parameterTypeDescription
errstr,NoneNone is success, error description otherwise (which comes with an HTTP 400 response).
resp_typestrResponse type
host_namestrHost name
is_schedule_downboolTrue if host is in schedule downtime, False otherwise
Call sample:

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:~#