diff --git a/.gitignore b/.gitignore index 676cc33c48d..83fd8c83911 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ #generic development files www/index.html +#api html documentation +doc/API/centreon-api-v2.html + #backend development and project files .idea/ vendor/ diff --git a/doc/API/README.MD b/doc/API/README.MD new file mode 100644 index 00000000000..70392489773 --- /dev/null +++ b/doc/API/README.MD @@ -0,0 +1,8 @@ +# API Documentation Guide + +## How to build ? + +```console +npm install -g redoc-cli +redoc-cli bundle --options.hideDownloadButton=true centreon-api-v2.yaml -o centreon-api-v2.html +``` diff --git a/doc/API/centreon-api-v2.html b/doc/API/centreon-api-v2.html deleted file mode 100644 index c155361bc7f..00000000000 --- a/doc/API/centreon-api-v2.html +++ /dev/null @@ -1,785 +0,0 @@ - - - -
- -There are two modes of authentication:
-Entry point to retrieve an authentication token.
-Authentication schema
-security | object |
OK
-Unauthorized
-{- "security": {
- "credentials": {
- "login": "admin",
- "password": "centreon"
}
}
}
{- "contact": {
- "id": 3,
- "name": "Admin",
- "alias": "admin",
- "email": "admin@localhost",
- "is_admin": true
}, - "security": {
- "token": "9ed937d3911d212eae59300ac6977352"
}
}
OK
-Forbidden
-Internal Server Error
-{- "url": "proxy.internal.company.org",
- "port": 3128,
- "user": "proxy-user",
- "password": "proxy-pass"
}
url required | string URL of the proxy - |
port required | integer [ 0 .. 65535 ] Port of the proxy - |
user required | string Login used to connect to proxy - |
password required | string Password used to connect to proxy - |
Command Sent
-Forbidden
-Internal Server Error
-{- "url": "proxy.internal.company.org",
- "port": 3128,
- "user": "proxy-user",
- "password": "proxy-pass"
}
{- "code": 403,
- "message": "You are not authorized to access this resource"
}
List all monitoring servers configurations.
-The available parameters to search / sort_by are:
-search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 2,
- "name": "Central",
- "address": "127.0.0.1",
- "is_localhost": true,
- "is_default": true,
- "ssh_port": 22,
- "last_restart": "2020-03-04T14:37:20Z",
- "engine_start_command": "service centengine start",
- "engine_stop_command": "service centengine stop",
- "engine_restart_command": "service centengine restart",
- "engine_reload_command": "service centengine reload",
- "nagios_bin": "/usr/sbin/centengine",
- "nagiostats_bin": "/usr/sbin/centenginestats",
- "broker_reload_command": "service cbd reload",
- "centreonbroker_cfg_path": "/etc/centreon-broker",
- "centreonbroker_module_path": "/usr/share/centreon/lib/centreon-broker",
- "centreonbroker_logs_path": null,
- "centreonconnector_path": "/usr/lib64/centreon-connector",
- "init_script_centreontrapd": "centreontrapd",
- "snmp_trapd_path_conf": "/etc/snmp/centreon_traps/",
- "remote_id": null,
- "remote_server_centcore_ssh_proxy": true,
- "is_updated": true,
- "is_activate": true
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
List all the hosts in real-time monitoring.
-The available parameters to search / sort_by are:
-show_service | boolean Default: false Example: show_service=true Allows to display services belonging to items - |
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 12,
- "alias": "Central",
- "display_name": "Central",
- "name": "Central",
- "state": 0,
- "services": [
- {
- "id": 5,
- "description": "Ping",
- "display_name": "Ping",
- "state": 0
}
], - "poller_id": 1,
- "acknowledged": false,
- "address_ip": "127.0.0.1",
- "check_attempt": 1,
- "checked": true,
- "execution_time": 0.070906,
- "icon_image": "ppm/operatingsystems-linux-snmp-linux-128.png",
- "icon_image_alt": "",
- "last_check": "2020-03-04T14:37:20Z",
- "last_hard_state_change": "2020-03-04T14:37:20Z",
- "last_state_change": "2020-03-04T14:37:20Z",
- "last_time_down": "2020-03-04T14:37:20Z",
- "last_time_unreachable": "2020-03-04T14:37:20Z",
- "last_time_up": "2020-03-04T14:37:20Z",
- "last_update": "2020-03-04T14:37:20Z",
- "max_check_attempts": 3,
- "output": "OK - 127.0.0.1 rta 0.100ms lost 0%\n",
- "passive_checks": false,
- "state_type": 0,
- "timezone": ":Europe/Paris",
- "scheduled_downtime_depth": 0,
- "criticality": 10
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
Return a single host with full details and some details about its services.
-host_id required | integer <int64> Example: 12 ID of the host - |
OK
-Forbidden
-Not Found
-Internal Server Error
-{- "id": 12,
- "alias": "Central",
- "display_name": "Central",
- "name": "Central",
- "state": 0,
- "services": [
- {
- "id": 5,
- "description": "Ping",
- "display_name": "Ping",
- "state": 0
}
], - "poller_id": 1,
- "acknowledged": false,
- "address_ip": "127.0.0.1",
- "check_attempt": 1,
- "checked": true,
- "execution_time": 0.070906,
- "icon_image": "ppm/operatingsystems-linux-snmp-linux-128.png",
- "icon_image_alt": "",
- "last_check": "2020-03-04T14:37:20Z",
- "last_hard_state_change": "2020-03-04T14:37:20Z",
- "last_state_change": "2020-03-04T14:37:20Z",
- "last_time_down": "2020-03-04T14:37:20Z",
- "last_time_unreachable": "2020-03-04T14:37:20Z",
- "last_time_up": "2020-03-04T14:37:20Z",
- "last_update": "2020-03-04T14:37:20Z",
- "max_check_attempts": 3,
- "output": "OK - 127.0.0.1 rta 0.100ms lost 0%\n",
- "passive_checks": false,
- "state_type": 0,
- "timezone": ":Europe/Paris",
- "scheduled_downtime_depth": 0,
- "criticality": 10,
- "active_checks": true,
- "check_command": "base_host_alive",
- "check_interval": 5,
- "check_period": "24x7",
- "check_type": 0,
- "last_hard_state": "2020-03-04T14:37:20Z",
- "last_notification": "2020-03-04T14:37:20Z",
- "latency": 0.005,
- "next_check": "2020-03-04T14:37:20Z",
- "next_host_notification": 0,
- "notification_interval": 30,
- "notification_number": 3,
- "notify": true,
- "notify_on_down": true,
- "notify_on_downtime": false,
- "notify_on_flapping": false,
- "notify_on_recovery": true,
- "notify_on_unreachable": false
}
List all the services in real-time monitoring.
-The available parameters to search / sort_by are:
-search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 5,
- "description": "Ping",
- "display_name": "Ping",
- "state": 0,
- "check_attempt": 1,
- "icon_image": "",
- "icon_image_alt": "",
- "last_check": "2020-03-04T14:37:20Z",
- "last_state_change": "2020-03-04T14:37:20Z",
- "max_check_attempts": 3,
- "output": "OK - 127.0.0.1 rta 0.025ms lost 0%\n",
- "state_type": 1,
- "criticality": 10,
- "hosts": {
- "id": 12,
- "alias": "Central",
- "display_name": "Central",
- "name": "Central",
- "state": 0
}
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
List all services related to a host in real-time monitoring.
-The available parameters to search / sort_by are:
-host_id required | integer <int64> Example: 12 ID of the host - |
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Not Found
-Internal Server Error
-{- "result": [
- {
- "id": 5,
- "description": "Ping",
- "display_name": "Ping",
- "state": 0,
- "check_attempt": 1,
- "icon_image": "",
- "icon_image_alt": "",
- "last_check": "2020-03-04T14:37:20Z",
- "last_state_change": "2020-03-04T14:37:20Z",
- "max_check_attempts": 3,
- "output": "OK - 127.0.0.1 rta 0.025ms lost 0%\n",
- "state_type": 1,
- "criticality": 10
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
Return a single service with full details.
-host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
OK
-Forbidden
-Not Found
-Internal Server Error
-{- "id": 5,
- "description": "Ping",
- "display_name": "Ping",
- "state": 0,
- "check_attempt": 1,
- "icon_image": "",
- "icon_image_alt": "",
- "last_check": "2020-03-04T14:37:20Z",
- "last_state_change": "2020-03-04T14:37:20Z",
- "max_check_attempts": 3,
- "output": "OK - 127.0.0.1 rta 0.025ms lost 0%\n",
- "state_type": 1,
- "criticality": 10,
- "check_command": "base_centreon_ping",
- "check_interval": 5,
- "check_period": "24x7",
- "check_type": 0,
- "command_line": "/usr/lib64/nagios/plugins/check_icmp -H 127.0.0.1 -n 5 -w 200,20% -c 400,50%",
- "execution_time": 0.179335,
- "is_acknowledged": false,
- "is_active_check": true,
- "is_checked": true,
- "last_hard_state_change": "2020-03-04T14:37:20Z",
- "last_notification": "2020-03-04T14:37:20Z",
- "last_time_critical": "2020-03-04T14:37:20Z",
- "last_time_ok": "2020-03-04T14:37:20Z",
- "last_time_unknown": "2020-03-04T14:37:20Z",
- "last_time_warning": "2020-03-04T14:37:20Z",
- "last_update": "2020-03-04T14:37:20Z",
- "latency": 0.031,
- "next_check": "2020-03-04T14:37:20Z",
- "performance_data": "rta=0.025ms;200.000;400.000;0; rtmax=0.061ms;;;; rtmin=0.015ms;;;; pl=0%;20;50;0;100 ",
- "scheduled_downtime_depth": 0
}
List all the host groups in real-time monitoring by host id
-limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 28,
- "name": "All",
- "host": {
- "id": 12,
- "alias": "Central",
- "display_name": "Central",
- "name": "Central",
- "state": 0,
- "services": [
- {
- "id": 5,
- "description": "Ping",
- "display_name": "Ping",
- "state": 0
}
]
}
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
List all the host groups in real-time monitoring.
-The available parameters to search / sort_by are:
-show_host | boolean Default: false Example: show_host=true Allows to display hosts belonging to items - |
show_service | boolean Default: false Example: show_service=true Allows to display services belonging to items - |
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 28,
- "name": "All",
- "host": {
- "id": 12,
- "alias": "Central",
- "display_name": "Central",
- "name": "Central",
- "state": 0,
- "services": [
- {
- "id": 5,
- "description": "Ping",
- "display_name": "Ping",
- "state": 0
}
]
}
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
Return a list of service groups for host-service pair.
-host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
OK
-Forbidden
-Not Found
-Internal Server Error
-{- "id": 13,
- "name": "MySG",
- "host": {
- "id": 12,
- "alias": "Central",
- "display_name": "Central",
- "name": "Central",
- "state": 0,
- "services": [
- {
- "id": 5,
- "description": "Ping",
- "display_name": "Ping",
- "state": 0
}
]
}
}
List all the service groups in real-time monitoring.
-The available parameters to search / sort_by are:
-show_service | boolean Default: false Example: show_service=true Allows to display services belonging to items - |
show_host | boolean Default: false Example: show_host=true Allows to display hosts belonging to items - |
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 13,
- "name": "MySG",
- "host": {
- "id": 12,
- "alias": "Central",
- "display_name": "Central",
- "name": "Central",
- "state": 0,
- "services": [
- {
- "id": 5,
- "description": "Ping",
- "display_name": "Ping",
- "state": 0
}
]
}
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 34,
- "author_id": 3,
- "comment": "Acknowledged by admin",
- "deletion_time": "2020-03-04T14:37:20Z",
- "entry_time": "2020-03-04T14:37:20Z",
- "host_id": 12,
- "poller_id": 1,
- "is_notify_contacts": false,
- "is_persistent_comment": true,
- "is_sticky": true,
- "state": 1,
- "service_id": 5
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
Display one acknowledgement.
-acknowledgement_id required | integer <int64> Example: 227 ID of the acknowledgement - |
OK
-Forbidden
-Not Found
-Internal Server Error
-{- "id": 34,
- "author_id": 3,
- "comment": "Acknowledged by admin",
- "deletion_time": "2020-03-04T14:37:20Z",
- "entry_time": "2020-03-04T14:37:20Z",
- "host_id": 12,
- "poller_id": 1,
- "is_notify_contacts": false,
- "is_persistent_comment": true,
- "is_sticky": true,
- "state": 1,
- "service_id": 5
}
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 34,
- "author_id": 3,
- "comment": "Acknowledged by admin",
- "deletion_time": "2020-03-04T14:37:20Z",
- "entry_time": "2020-03-04T14:37:20Z",
- "host_id": 12,
- "poller_id": 1,
- "is_notify_contacts": false,
- "is_persistent_comment": true,
- "is_sticky": true,
- "state": 1
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 34,
- "author_id": 3,
- "comment": "Acknowledged by admin",
- "deletion_time": "2020-03-04T14:37:20Z",
- "entry_time": "2020-03-04T14:37:20Z",
- "host_id": 12,
- "poller_id": 1,
- "is_notify_contacts": false,
- "is_persistent_comment": true,
- "is_sticky": true,
- "state": 1,
- "service_id": 5
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
host_id required | integer <int64> Example: 12 ID of the host - |
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 34,
- "author_id": 3,
- "comment": "Acknowledged by admin",
- "deletion_time": "2020-03-04T14:37:20Z",
- "entry_time": "2020-03-04T14:37:20Z",
- "host_id": 12,
- "poller_id": 1,
- "is_notify_contacts": false,
- "is_persistent_comment": true,
- "is_sticky": true,
- "state": 1
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
host_id required | integer <int64> Example: 12 ID of the host - |
comment | string Short description of the acknowledgement - |
is_notify_contacts | boolean Indicates whether notification is sent to the contacts linked to the host or service - |
is_persistent_comment | boolean Indicates whether acknowledgement is maintained in the case of a restart of the scheduler - |
is_sticky | boolean Indicates whether acknowledgement is maintained in the case of a change of status - |
Command Sent
-Forbidden
-Internal Server Error
-{- "comment": "Acknowledged by admin",
- "is_notify_contacts": false,
- "is_persistent_comment": true,
- "is_sticky": true
}
{- "code": 403,
- "message": "You are not authorized to access this resource"
}
host_id required | integer <int64> Example: 12 ID of the host - |
Command Sent
-Forbidden
-Internal Server Error
-{- "code": 403,
- "message": "You are not authorized to access this resource"
}
host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 34,
- "author_id": 3,
- "comment": "Acknowledged by admin",
- "deletion_time": "2020-03-04T14:37:20Z",
- "entry_time": "2020-03-04T14:37:20Z",
- "host_id": 12,
- "poller_id": 1,
- "is_notify_contacts": false,
- "is_persistent_comment": true,
- "is_sticky": true,
- "state": 1,
- "service_id": 5
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
comment | string Short description of the acknowledgement - |
is_notify_contacts | boolean Indicates whether notification is sent to the contacts linked to the host or service - |
is_persistent_comment | boolean Indicates whether acknowledgement is maintained in the case of a restart of the scheduler - |
is_sticky | boolean Indicates whether acknowledgement is maintained in the case of a change of status - |
Command Sent
-Forbidden
-Internal Server Error
-{- "comment": "Acknowledged by admin",
- "is_notify_contacts": false,
- "is_persistent_comment": true,
- "is_sticky": true
}
{- "code": 403,
- "message": "You are not authorized to access this resource"
}
host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
Command Sent
-Forbidden
-Internal Server Error
-{- "code": 403,
- "message": "You are not authorized to access this resource"
}
List all downtimes
-The available parameters to search / sort_by are:
-search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 329,
- "author_id": 3,
- "host_id": 12,
- "comment": "Downtime set by admin",
- "duration": 7200,
- "entry_time": "2020-03-04T14:37:20Z",
- "start_time": "2020-03-04T14:37:20Z",
- "end_time": "2020-03-04T14:37:20Z",
- "deletion_time": null,
- "actual_start_time": "2020-03-04T14:37:20Z",
- "actual_end_time": null,
- "is_started": true,
- "is_cancelled": false,
- "is_fixed": true,
- "service_id": 5
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
Display one downtime.
-downtime_id required | integer <int64> Example: 329 ID of the downtime - |
OK
-Forbidden
-Not Found
-Internal Server Error
-{- "id": 329,
- "author_id": 3,
- "host_id": 12,
- "comment": "Downtime set by admin",
- "duration": 7200,
- "entry_time": "2020-03-04T14:37:20Z",
- "start_time": "2020-03-04T14:37:20Z",
- "end_time": "2020-03-04T14:37:20Z",
- "deletion_time": null,
- "actual_start_time": "2020-03-04T14:37:20Z",
- "actual_end_time": null,
- "is_started": true,
- "is_cancelled": false,
- "is_fixed": true,
- "service_id": 5
}
Cancel a downtime.
-downtime_id required | integer <int64> Example: 329 ID of the downtime - |
Command Sent
-Forbidden
-Not Found
-Internal Server Error
-{- "code": 403,
- "message": "You are not authorized to access this resource"
}
List all downtimes of hosts
-The available parameters to search / sort_by are:
-search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 329,
- "author_id": 3,
- "host_id": 12,
- "comment": "Downtime set by admin",
- "duration": 7200,
- "entry_time": "2020-03-04T14:37:20Z",
- "start_time": "2020-03-04T14:37:20Z",
- "end_time": "2020-03-04T14:37:20Z",
- "deletion_time": null,
- "actual_start_time": "2020-03-04T14:37:20Z",
- "actual_end_time": null,
- "is_started": true,
- "is_cancelled": false,
- "is_fixed": true
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
List all downtimes of services
-The available parameters to search / sort_by are:
-search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 329,
- "author_id": 3,
- "host_id": 12,
- "comment": "Downtime set by admin",
- "duration": 7200,
- "entry_time": "2020-03-04T14:37:20Z",
- "start_time": "2020-03-04T14:37:20Z",
- "end_time": "2020-03-04T14:37:20Z",
- "deletion_time": null,
- "actual_start_time": "2020-03-04T14:37:20Z",
- "actual_end_time": null,
- "is_started": true,
- "is_cancelled": false,
- "is_fixed": true,
- "service_id": 5
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
List all downtimes of a host.
-The available parameters to search / sort_by are:
-host_id required | integer <int64> Example: 12 ID of the host - |
show_service | boolean Default: false Example: show_service=true Allows to display services belonging to items - |
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 329,
- "author_id": 3,
- "host_id": 12,
- "comment": "Downtime set by admin",
- "duration": 7200,
- "entry_time": "2020-03-04T14:37:20Z",
- "start_time": "2020-03-04T14:37:20Z",
- "end_time": "2020-03-04T14:37:20Z",
- "deletion_time": null,
- "actual_start_time": "2020-03-04T14:37:20Z",
- "actual_end_time": null,
- "is_started": true,
- "is_cancelled": false,
- "is_fixed": true
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
Add a downtime on a host.
-host_id required | integer <int64> Example: 12 ID of the host - |
start_time | string <date-time> Scheduled start date of the downtime (ISO8601) - |
end_time | string <date-time> Scheduled end date of the downtime (ISO8601) - |
is_fixed | boolean Indicates whether the downtime is fixed - |
duration | integer Downtime duration in seconds - |
author_id | integer ID of the contact who requested the downtime - |
comment | string Comment of the downtime - |
with_services | boolean Indicates whether we should add the downtime on the host-related services - |
Command Sent
-Forbidden
-Internal Server Error
-{- "start_time": "2020-03-04T14:37:20Z",
- "end_time": "2020-03-04T14:37:20Z",
- "is_fixed": true,
- "duration": 3600,
- "author_id": 3,
- "comment": "Downtime set by admin",
- "with_services": true
}
{- "code": 403,
- "message": "You are not authorized to access this resource"
}
List all downtimes of a service.
-The available parameters to search / sort_by are:
-host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
search | object |
limit | integer >= 1 Default: 10 Example: limit=20 Number of items per pages - |
page | integer >= 1 Default: 1 Example: page=4 Number of the requested page - |
sort_by | object Example: sort_by={"host.name":"ASC"} Sort the resulted data by its properties - |
OK
-Forbidden
-Internal Server Error
-{- "result": [
- {
- "id": 329,
- "author_id": 3,
- "host_id": 12,
- "comment": "Downtime set by admin",
- "duration": 7200,
- "entry_time": "2020-03-04T14:37:20Z",
- "start_time": "2020-03-04T14:37:20Z",
- "end_time": "2020-03-04T14:37:20Z",
- "deletion_time": null,
- "actual_start_time": "2020-03-04T14:37:20Z",
- "actual_end_time": null,
- "is_started": true,
- "is_cancelled": false,
- "is_fixed": true,
- "service_id": 5
}
], - "meta": {
- "page": 1,
- "limit": 10,
- "search": { },
- "sort_by": { },
- "total": 1
}
}
Add a downtime on a service.
-host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
start_time | string <date-time> Scheduled start date of the downtime (ISO8601) - |
end_time | string <date-time> Scheduled end date of the downtime (ISO8601) - |
is_fixed | boolean Indicates whether the downtime is fixed - |
duration | integer Downtime duration in seconds - |
author_id | integer ID of the contact who requested the downtime - |
comment | string Comment of the downtime - |
Command Sent
-Forbidden
-Internal Server Error
-{- "start_time": "2020-03-04T14:37:20Z",
- "end_time": "2020-03-04T14:37:20Z",
- "is_fixed": true,
- "duration": 3600,
- "author_id": 3,
- "comment": "Downtime set by admin"
}
{- "code": 403,
- "message": "You are not authorized to access this resource"
}
Schedule immediate check on chosen host
-host_id required | integer <int64> Example: 12 ID of the host - |
is_forced | boolean Indicates whether the check is forced (do not take into account the check timeperiod) - |
Command Sent
-Forbidden
-Host not found
-Internal Server Error
-{- "is_forced": true
}
{- "code": 403,
- "message": "You are not authorized to access this resource"
}
Schedule immediate check on chosen service
-host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
is_forced | boolean Indicates whether the check is forced (do not take into account the check timeperiod) - |
Command Sent
-Forbidden
-Host or service not found
-Internal Server Error
-{- "is_forced": true
}
{- "code": 403,
- "message": "You are not authorized to access this resource"
}
Get metrics data from a service between given interval
-host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
start required | string <date-time> Example: 2020-02-18T00:00:00 start of the interval (ISO8601) - |
end required | string <date-time> Example: 2020-02-18T12:00:00 end of the interval (ISO8601) - |
OK
-Forbidden
-Host or service not found
-Internal Server Error
-{- "global": {
- "title": "graph title",
- "start": 1581987121,
- "end": 1581987721,
- "vertical-label": "Value",
- "base": "1024",
- "width": "550",
- "height": "140",
- "lower-limit": "0",
- "scaled": 1,
- "multiple_services": false
}, - "metrics": [
- {
- "index_id": "4",
- "metric_id": "29",
- "metric": "cpu",
- "metric_legend": "cpu",
- "unit": "%",
- "hidden": 0,
- "min": "0",
- "max": "100",
- "virtual": 0,
- "ds_data": {
- "ds_min": "1",
- "ds_max": "1",
- "ds_minmax_int": null,
- "ds_last": "1",
- "ds_average": "1",
- "ds_total": null,
- "ds_tickness": "1",
- "ds_color_line_mode": "1",
- "ds_color_line": "#666600"
}, - "legend": "cpu (%)",
- "stack": 0,
- "warn": null,
- "warn_low": null,
- "crit": null,
- "crit_low": null,
- "ds_color_area_warn": "#ff9a13",
- "ds_color_area_crit": "#e00b3d",
- "ds_order": 0,
- "data": [
- 1,
- null,
- 1
], - "prints": [
- [
- "Last:1.00"
]
], - "minimum_value": 1,
- "maximum_value": 1
}
], - "times": [
- 1581987121,
- 1581987181,
- 1581987241
]
}
Get status data from a service between given interval
-host_id required | integer <int64> Example: 12 ID of the host - |
service_id required | integer <int64> Example: 5 ID of the service - |
start required | string <date-time> Example: 2020-02-18T00:00:00 start of the interval (ISO8601) - |
end required | string <date-time> Example: 2020-02-18T12:00:00 end of the interval (ISO8601) - |
OK
-Forbidden
-Host or service not found
-Internal Server Error
-{- "critical": [
- {
- "start": 1581987121,
- "end": 1581987181
}
], - "warning": [
- {
- "start": 1581987121,
- "end": 1581987181
}
], - "ok": [
- {
- "start": 1581987121,
- "end": 1581987181
}
], - "unknown": [
- {
- "start": 1581987121,
- "end": 1581987181
}
]
}