The /event/service/ endpoint is used to add and remove services from events. Services can also be added to events via the /event/list/ endpoint when the event is created, or by submitting a PUT request to the /event/list/ endpoint after the event is created. The following parameters are supported on this endpoint:
INPUT PARAMETERS | |
event |
The resource_uri of the event. |
service |
The resource_uri of the service. |
Examples
List event_services (List method, GET)
curl --header "Authorization:ApiKey testuser:256ee09ded99b29036fac4de96acedb7e8af7bf7" https://www.statusdashboard.com/api/v1/event/service/
{ "meta": { "limit": 10, "next": null, "offset": 0, "previous": null, "total_count": 2 }, "objects": [ { "event": "/api/v1/event/list/71/", "resource_uri": "/api/v1/event/service/64/", "service": { "description": "http://owa.domain.com", "group": "North America DataCenter", "hidden": false, "hidden_notifications": false, "resource_uri": "/api/v1/service/151/", "service_name": "Exchange Server" } }, { "event": "/api/v1/event/list/71/", "resource_uri": "/api/v1/event/service/65/", "service": { "description": "", "group": "North America DataCenter", "hidden": false, "hidden_notifications": false, "resource_uri": "/api/v1/service/152/", "service_name": "File Server" } } ] }
Upon success, you'll receive back an HTTP 200 (OK) indicating that the API call succeeded.
Add an event_service (List method, POST)
curl --header "Content-Type: application/json" --header "Authorization:ApiKey testuser:256ee09ded99b29036fac4de96acedb7e8af7bf7" -X POST --data '{"event":"/api/v1/event/list/71/","service":"/api/v1/service/150/"}' https://www.statusdashboard.com/api/v1/event/service/
{ "event": "/api/v1/event/list/71/", "resource_uri": "/api/v1/event/service/66/", "service": { "description": "", "group": "North America DataCenter", "hidden": false, "hidden_notifications": false, "resource_uri": "/api/v1/service/150/", "service_name": "Web Site" } }
Upon success, you'll receive back an HTTP 201 (created) along with details about the resource you just created.
Delete an event_service (Detail method, DELETE)
curl --header "Authorization:ApiKey testuser:256ee09ded99b29036fac4de96acedb7e8af7bf7" -X DELETE https://www.statusdashboard.com/api/v1/event/service/64/
Upon success, you'll receive back an HTTP 204 (No Content) indicating that the request was fulfilled but there is no data to display.