From 3b4c008c8109976944655a2f232d1151ab38858d Mon Sep 17 00:00:00 2001 From: Mattia Codato Date: Tue, 25 Aug 2020 17:35:34 +0200 Subject: [PATCH] Fix doc --- doc/12-icinga2-api.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/12-icinga2-api.md b/doc/12-icinga2-api.md index e5720e0c8..379153bd0 100644 --- a/doc/12-icinga2-api.md +++ b/doc/12-icinga2-api.md @@ -1535,9 +1535,9 @@ $ curl -k -s -u root:icinga -H 'Accept: application/json' \ } ``` -### execute-command +### execute-command -This API can be used to execute a particular check/notification/event-command on a particular +Executes a particular check/notification/event-command on a particular endpoint in the context of a particular checkable. Send a `POST` request to the URL endpoint `/v1/actions/execute-command`. @@ -1546,18 +1546,18 @@ Send a `POST` request to the URL endpoint `/v1/actions/execute-command`. --------------|------------|-------------- ttl | Number | **Required.** The time to live of the execution expressed in seconds. command_type | String | **Optional.** The command type: `CheckCommand` or `EventCommand` or `NotificationCommand`. Default: `EventCommand` - command | String | **Optional.** The command to execute. Its type must the same as `command_type`. It can be a macro string. Default: depending on the `command_type` it can be `$check_command$`, `$event_command$` or `$notification_command$` - endpoint | String | **Optional.** The endpoint to execute the command on. It can be a macro string. Default: `$command_endpoint`. - macros | Dictionary | **Optional**. A serialized object used to resolve the macro strings. Default: `{}` + command | String | **Optional.** The command to execute. Its type must the same as `command_type`. It can be a macro string. Default: depending on the `command_type` it's either `$check_command$`, `$event_command$` or `$notification_command$` + endpoint | String | **Optional.** The endpoint to execute the command on. It can be a macro string. Default: `$command_endpoint$`. + macros | Dictionary | **Optional**. A serialized object used to resolve the macro strings. It overrides also macros of other parameter. e.g. {"http_ssl": false}. Default: `{}` user | String | **Optional.** The user used for the notification command. notification | String | **Optional.** The notification used for the notification command. Example: ``` - $ curl -k -s -u root:icinga -H 'Accept: application/json' \ + $ curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \ -X POST 'https://localhost:5665/v1/actions/execute-command' \ - -d '{"type":"Service", "service": "agent!custom_service", "ttl":"15", "macros": { "command_endpoint":"master", "ls_dir":"/tmp/foo" }, "command": "custom_command", "command_type": "CheckCommand" }' + -d '{"type": "Service", "service": "agent!custom_service", "ttl": 15, "macros": { "command_endpoint": "master", "ls_dir": "/tmp/foo" }, "command": "custom_command", "command_type": "CheckCommand" }' { "results": [ {