Fix formatting in API docs

Indent curl command to get the appropriated code highlight.
This commit is contained in:
Glauco Vinicius 2017-07-05 16:10:10 -03:00 committed by Michael Friedrich
parent 8c8cf4bfe7
commit 41fe01dbc3
1 changed files with 2 additions and 2 deletions

View File

@ -518,13 +518,13 @@ In case you want to fetch all [comments](9-object-types.md#objecttype-comment)
for hosts and services, you can use the following query URL (similar example for hosts and services, you can use the following query URL (similar example
for downtimes): for downtimes):
https://localhost:5665/v1/objects/comments?joins=host&joins=service https://localhost:5665/v1/objects/comments?joins=host&joins=service
This is another example for listing all service objects which are unhandled problems (state is not OK This is another example for listing all service objects which are unhandled problems (state is not OK
and no downtime or acknowledgement set). We're using [X-HTTP-Method-Override](12-icinga2-api.md#icinga2-api-requests-method-override) and no downtime or acknowledgement set). We're using [X-HTTP-Method-Override](12-icinga2-api.md#icinga2-api-requests-method-override)
here because we want to pass all query attributes in the request body. here because we want to pass all query attributes in the request body.
$ curl -k -s -u root:icinga -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://127.0.0.1:5665/v1/objects/services' \ $ curl -k -s -u root:icinga -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://127.0.0.1:5665/v1/objects/services' \
-d '{ "joins": [ "host.name", "host.address" ], "attrs": [ "name", "state", "downtime_depth", "acknowledgement" ], "filter": "service.state != ServiceOK && service.downtime_depth == 0.0 && service.acknowledgement == 0.0" }' | python -m json.tool -d '{ "joins": [ "host.name", "host.address" ], "attrs": [ "name", "state", "downtime_depth", "acknowledgement" ], "filter": "service.state != ServiceOK && service.downtime_depth == 0.0 && service.acknowledgement == 0.0" }' | python -m json.tool
{ {