Update documentation

refs #9105
This commit is contained in:
Michael Friedrich 2015-10-29 17:31:15 +01:00
parent 4d784dd075
commit a3e8cf8fb1
2 changed files with 69 additions and 1 deletions

View 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

View 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.