This chapter will start with a general overview followed by
detailed information about specific endpoints.
-### <a id="icinga2-api-requests></a> Requests
+### <a id="icinga2-api-requests"></a> Requests
Any tool capable of making HTTP requests can communicate with
the API, for example [curl](http://curl.haxx.se).
PUT | Create a new object. The PUT request must include all attributes required to create a new object.
DELETE | Remove an object created by the API. The DELETE method is idempotent and does not require any check if the object actually exists.
-### <a id="icinga2-api-http-statuses></a> HTTP Statuses
+### <a id="icinga2-api-http-statuses"></a> HTTP Statuses
The API will return standard [HTTP statuses](https://www.ietf.org/rfc/rfc2616.txt)
including error codes.
troubleshooting.
-### <a id="icinga2-api-responses></a> Responses
+### <a id="icinga2-api-responses"></a> Responses
Succesful requests will send back a response body containing a `results`
list. Depending on the number of affected objects in your request, the
}
-### <a id="icinga2-api-authentication></a> Authentication
+### <a id="icinga2-api-authentication"></a> Authentication
There are two different ways for authenticating against the Icinga 2 API:
In case you will get `Unauthorized` make sure to check the API user credentials.
-### <a id="icinga2-api-permissions></a> Permissions
+### <a id="icinga2-api-permissions"></a> Permissions
**TODO** https://dev.icinga.org/issues/9088
-### <a id="icinga2-api-parameters></a> Parameters
+### <a id="icinga2-api-parameters"></a> Parameters
Depending on the request method there are two ways of
passing parameters to the request:
**TODO**
-#### <a id="icinga2-api-filters></a> Filters
+#### <a id="icinga2-api-filters"></a> Filters
Use the same syntax as for apply rule expressions
for filtering specific objects.
-### <a id="icinga2-api-output-format></a>Output Format
+### <a id="icinga2-api-output-format"></a>Output Format
The request and reponse body contain a JSON encoded string.
-### <a id="icinga2-api-version></a>Version
+### <a id="icinga2-api-version"></a>Version
Each url contains the version string as prefix (currently "/v1").
-### <a id="icinga2-api-url-overview></a>Url Overview
+### <a id="icinga2-api-url-overview"></a>Url Overview
The Icinga 2 API provides multiple url endpoints
-## <a id="icinga2-api-actions></a> Actions
+## <a id="icinga2-api-actions"></a> Actions
There are several actions available for Icinga 2 provided by the `actions` url endpoint.
-## <a id="icinga2-api-config-management></a> Configuration Management
+## <a id="icinga2-api-config-management"></a> Configuration Management
`/v1/config`
**TODO** Depends on https://dev.icinga.org/issues/9953
-## <a id="icinga2-api-events></a> Events
+## <a id="icinga2-api-events"></a> Events
**TODO**
-## <a id="icinga2-api-hosts></a> Hosts
+## <a id="icinga2-api-hosts"></a> Hosts
All object attributes are prefixed with their respective object type.
Output listing and url parameters use the same syntax.
-### <a id="icinga2-api-hosts-list></a> List All Hosts
+### <a id="icinga2-api-hosts-list"></a> List All Hosts
Send a `GET` request to `/v1/hosts` to list all host objects and
their attributes.
$ curl -u root:icinga -k -s 'https://localhost:5665/v1/hosts' -X GET
-### <a id="icinga2-api-hosts-create></a> Create New Host Object
+### <a id="icinga2-api-hosts-create"></a> Create New Host Object
New objects must be created by sending a PUT request. The following
parameters need to be passed inside the JSON body:
]
}
-### <a id="icinga2-api-hosts-show></a> Show Host
+### <a id="icinga2-api-hosts-show"></a> Show Host
Send a `GET` request including the host name inside the url:
]
}
-### <a id="icinga2-api-hosts-modify></a> Modify Host
+### <a id="icinga2-api-hosts-modify"></a> Modify Host
Existing objects must be modifed by sending a `POST` request. The following
parameters need to be passed inside the JSON body:
]
}
-### <a id="icinga2-api-hosts-delete></a> Delete Host
+### <a id="icinga2-api-hosts-delete"></a> Delete Host
You can delete objects created using the API by sending a `DELETE`
request. Specify the object name inside the url.
- [6-object-types.md, Object Types]
- [7-icinga-template-library.md, Icinga Template Library]
- [8-cli-commands.md, CLI Commands]
-- [9-monitoring-remote-systems.md, Monitoring Remote Systems]
-- [10-icinga2-client.md, Icinga 2 Client]
-- [11-agent-based-checks.md, Additional Agent-based Checks]
-- [12-distributed-monitoring-ha.md, Distributed Monitoring and High Availability]
-- [13-addons-plugins.md, Addons and Plugins]
-- [14-alternative-frontends.md, Alternative Frontends]
-- [15-livestatus.md, Livestatus]
-- [16-troubleshooting.md, Troubleshooting]
-- [17-upgrading-icinga-2.md, Upgrading Icinga 2]
-- [18-migrating-from-icinga-1x.md, Migrating from Icinga 1.x]
-- [19-language-reference.md, Language Reference]
-- [20-library-reference.md, Library Reference]
-- [21-debug.md, Debug]
-- [22-appendix.md, Appendix]
+- [9-icinga2-api.md, Icinga 2 API]
+- [10-monitoring-remote-systems.md, Monitoring Remote Systems]
+- [11-icinga2-client.md, Icinga 2 Client]
+- [12-agent-based-checks.md, Additional Agent-based Checks]
+- [13-distributed-monitoring-ha.md, Distributed Monitoring and High Availability]
+- [14-addons-plugins.md, Addons and Plugins]
+- [15-alternative-frontends.md, Alternative Frontends]
+- [16-livestatus.md, Livestatus]
+- [17-troubleshooting.md, Troubleshooting]
+- [18-upgrading-icinga-2.md, Upgrading Icinga 2]
+- [19-migrating-from-icinga-1x.md, Migrating from Icinga 1.x]
+- [20-language-reference.md, Language Reference]
+- [21-library-reference.md, Library Reference]
+- [22-debug.md, Debug]
+- [23-appendix.md, Appendix]
theme: readthedocs
markdown_extensions: [smarty]
extra_javascript: [scroll.js]