From: Michael Friedrich Date: Tue, 10 Nov 2015 15:13:37 +0000 (+0100) Subject: Add documentation for /v1/types X-Git-Tag: v2.4.0~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c6123028d23721ef77f686a296c82482d1777b6;p=icinga2 Add documentation for /v1/types fixes #10588 --- diff --git a/doc/9-icinga2-api.md b/doc/9-icinga2-api.md index b17dbaf1f..78bd7c185 100644 --- a/doc/9-icinga2-api.md +++ b/doc/9-icinga2-api.md @@ -1280,6 +1280,55 @@ Fetch the `startup.log` file and check the config validation errors: The output is similar to the manual [configuration validation](8-cli-commands.md#config-validation). +## Types + +You can retrieve the configuration object types by sending a `GET` request to URL +endpoint `/v1/types`. + +Each response entry in the results array contains the following attributes: + + Attribute | Type | Description + ---------------|--------------|--------------------- + name | string | The type name. + plural_name | string | The plural name. + fields | dictionary | Available fields including details on e.g. the type and attribute accessibility. + abstract | boolean | Whether objects of this type are abstract. + base | boolean | The base type this type inherits from (e.g. `Service` inherits fields and prototype methods from `Checkable`). + prototype_keys | string array | Available prototype methods. + +In order to view a specific configuration object type specify its name inside the URL path: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/types/Object' | python -m json.tool + { + "results": [ + { + "abstract": false, + "fields": { + "type": { + "array_rank": 0.0, + "attributes": { + "config": false, + "navigation": false, + "no_user_modify": false, + "no_user_view": false, + "required": false, + "state": false + }, + "id": 0.0, + "type": "String" + } + }, + "name": "Object", + "plural_name": "Objects", + "prototype_keys": [ + "clone", + "notify_attribute", + "to_string" + ] + } + ] + } + ## Console