diff --git a/doc/6-object-types.md b/doc/6-object-types.md index 78536497e..ea8ce9e03 100644 --- a/doc/6-object-types.md +++ b/doc/6-object-types.md @@ -202,6 +202,29 @@ Configuration Attributes: ----------------|---------------- spool\_dir |**Optional.** The directory which contains the check result files. Defaults to LocalStateDir + "/lib/icinga2/spool/checkresults/". +## Comment + +Comments created at runtime are represented as objects. + +Example: + + object Comment "localhost!my-comment" { + host_name = "localhost" + author = "icingaadmin" + text = "This is a comment." + } + +Configuration Attributes: + + Name |Description + ----------------|---------------- + host_name | **Required.** The name of the host this comment belongs to. + service_name | **Optional.** The short name of the service this comment belongs to. If omitted this comment object is treated as host comment. + author | **Required.** The author's name. + text | **Required.** The comment text. + entry_time | **Optional.** The unix timestamp when this comment was added. + entry_type | **Optional.** The comment type (`User` = 1, `Downtime` = 2, `Flapping` = 3, `Acknowledgement` = 4). + expire_time | **Optional.** The comment's expire time as unix timestamp. ## CompatLogger @@ -321,6 +344,41 @@ Dependency objects have composite names, i.e. their names are based on the `chil name you specified. This means you can define more than one object with the same (short) name as long as one of the `child_host_name` and `child_service_name` attributes has a different value. +## Downtime + +Downtimes created at runtime are represented as objects. + +Example: + + object Downtime "localhost!my-downtime" { + host_name = "localhost" + author = "icingaadmin" + text = "This is a comment." + } + +Configuration Attributes: + + Name |Description + ----------------|---------------- + host_name | **Required.** The name of the host this comment belongs to. + service_name | **Optional.** The short name of the service this comment belongs to. If omitted this comment object is treated as host comment. + author | **Required.** The author's name. + comment | **Required.** The comment text. + start_time | **Required.** The start time as unix timestamp. + end_time | **Required.** The end time as unix timestamp. + duration | **Required.** The duration as number. + entry_time | **Optional.** The unix timestamp when this downtime was added. + fixed | **Optional.** Whether the downtime is fixed (true) or flexible (false). Defaults to flexible. Details in the [advanced topics chapter](5-advanced-topics.md#fixed-flexible-downtimes). + triggers | **Optional.** List of downtimes which should be triggered by this downtime. + +Runtime Attributes: + + Name |Description + ----------------|---------------- + trigger_time | The unix timestamp when this downtime was triggered. + triggered_by | The name of the downtime this downtime was triggered by. + + ## Endpoint diff --git a/doc/9-icinga2-api.md b/doc/9-icinga2-api.md index faa08c5c8..fd89447a4 100644 --- a/doc/9-icinga2-api.md +++ b/doc/9-icinga2-api.md @@ -253,6 +253,13 @@ or as key-value pairs in a JSON-formatted payload or a mix of both. All actions return a 200 `OK` or an appropriate error code for each action performed on each object matching the supplied filter. +Actions which affect the Icinga Application itself such as disabling +notification on a program-wide basis must be applied by updating the +[IcingaApplication object](9-icinga2-api.md#icinga2-api-config-objects) +called `app`. + + $ curl -k -s -u root:icinga -X POST 'https://localhost:5665/v1/objects/icingaapplications/app' -d '{ "attrs": { "enable_notifications": false } }' + ### process-check-result Send a `POST` request to the URL endpoint `/v1/actions/process-check-result`. @@ -639,6 +646,9 @@ provided by [config object types](6-object-types.md#object-types): /v1/objects/zones | Endpoint for retrieving and updating [Zone](6-object-types.md#objecttype-zone) objects. /v1/objects/endpoints | Endpoint for retrieving and updating [Endpoint](6-object-types.md#objecttype-endpoint) objects. /v1/objects/timeperiods | Endpoint for retrieving and updating [TimePeriod](6-object-types.md#objecttype-timeperiod) objects. + /v1/objects/icingaapplications | Endpoint for retrieving and updating [IcingaApplication](6-object-types.md#objecttype-icingaapplication) objects. + /v1/objects/comments | Endpoint for retrieving and updating [Comment](6-object-types.md#objecttype-comment) objects. + /v1/objects/downtimes | Endpoint for retrieving and updating [Downtime](6-object-types.md#objecttype-downtime) objects. All object attributes are prefixed with their respective object type. @@ -820,7 +830,7 @@ Example for existing object `google.com`: } -#### Delete Host +#### Delete Object You can delete objects created using the API by sending a `DELETE` request. Specify the object name inside the url.