]> granicus.if.org Git - icinga2/commitdiff
Update documentation
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 29 Oct 2015 16:31:15 +0000 (17:31 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 29 Oct 2015 16:31:15 +0000 (17:31 +0100)
refs #9105

doc/6-object-types.md
doc/9-icinga2-api.md

index 78536497e745ea6246d4351ad5aac0ec2d1c3402..ea8ce9e03b3a7d6a76a4ef0a9e5e44f50c20bdee 100644 (file)
@@ -202,6 +202,29 @@ Configuration Attributes:
   ----------------|----------------
   spool\_dir      |**Optional.** The directory which contains the check result files. Defaults to LocalStateDir + "/lib/icinga2/spool/checkresults/".
 
+## <a id="objecttype-comment"></a> 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.
 
 ## <a id="objecttype-compatlogger"></a> 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.
 
+## <a id="objecttype-downtime"></a> 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.
+
+
 
 ## <a id="objecttype-endpoint"></a> Endpoint
 
index faa08c5c812002b531320f999cc1b3a00bc90457..fd89447a4a7f031b9eb2a324df90f6deb44cbab4 100644 (file)
@@ -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 } }'
+
 ### <a id="icinga2-api-actions-process-check-result"></a> 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`:
     }
 
 
-#### <a id="icinga2-api-hosts-delete"></a> Delete Host
+#### <a id="icinga2-api-objects-delete"></a> Delete Object
 
 You can delete objects created using the API by sending a `DELETE`
 request. Specify the object name inside the url.