Home
Version 3
Service Usage Events API

Service Usage Events API

List Service Usage Events

GET /v2/service_usage_events

Events are sorted by internal database IDs. This order may differ from created_at. Events close to the current time should not be processed because other events may still have open transactions that will change their order in the results.

Request

Route

GET /v2/service_usage_events?results-per-page=1&after_guid=24d957dc-048f-4610-9b68-1c36c95953af

Parameters

Name Description Valid Values Example Values
q Parameters used to filter the result set.
Format queries as <filter><op><value>
Valid ops: : >= <= < > IN
Valid filters: service_instance_type, service_guid
  • q=filter:value
  • q=filter>value
  • q=filter IN a,b,c
page Page of results to fetch
results-per-page Number of results per page
order-direction Order of the results: asc (default) or desc
inline-relations-depth 0 - don't inline any relations and return URLs. Otherwise, inline to depth N.
orphan-relations 0 - de-duplicate object entries in response
exclude-relations comma-delimited list of relations to drop from response
include-relations comma-delimited list of the only relations to include in response
after_guid Restrict results to Service Usage Events after the one with the given guid
results-per-page: 1
after_guid: 24d957dc-048f-4610-9b68-1c36c95953af

Body

Name Description Default Valid Values Example Values
guid The guid of the event.
state The desired state of the service.
  • CREATED
  • DELETED
  • UPDATED
org_guid The GUID of the organization.
space_guid The GUID of the space.
space_name The name of the space.
service_instance_guid The GUID of the service instance.
service_instance_name The name of the service instance.
service_instance_type The type of the service instance.
  • managed_service_instance
  • user_provided_service_instance
service_plan_guid The GUID for the service plan.
service_plan_name The name for the service plan.
service_guid The GUID of the service.
created_at The timestamp of the event creation.
service_label The name of the service.

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTc5IiwiZW1haWwiOiJlbWFpbC00NEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQ0MjYwNjM5fQ.An0G3yWxYbZgGl5VOT0fKFMwqN0BAhtjw0EGJxisfis
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/service_usage_events?results-per-page=1&after_guid=24d957dc-048f-4610-9b68-1c36c95953af" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTc5IiwiZW1haWwiOiJlbWFpbC00NEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQ0MjYwNjM5fQ.An0G3yWxYbZgGl5VOT0fKFMwqN0BAhtjw0EGJxisfis" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "total_results": 2,
  "total_pages": 2,
  "prev_url": null,
  "next_url": "/v2/service_usage_events?after_guid=24d957dc-048f-4610-9b68-1c36c95953af&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "55b9ac4a-fa0b-4dda-a38c-74ebc6f2d180",
        "url": "/v2/service_usage_events/55b9ac4a-fa0b-4dda-a38c-74ebc6f2d180",
        "created_at": "2015-09-30T23:30:38Z"
      },
      "entity": {
        "state": "CREATED",
        "org_guid": "guid-f5f394ca-02bf-4b47-b71d-dcb37cd2dd7d",
        "space_guid": "guid-d50de245-e1df-40d5-81ed-7d908020e250",
        "space_name": "name-1108",
        "service_instance_guid": "guid-a181a0eb-ef91-4fee-a918-ba884065c405",
        "service_instance_name": "name-1109",
        "service_instance_type": "type-8",
        "service_plan_guid": "guid-f52c6990-9883-4d25-be17-175bab7bfab3",
        "service_plan_name": "name-1110",
        "service_guid": "guid-55b4fb04-4692-478e-96fc-f92f8eb27d60",
        "service_label": "label-24"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 41efad7c-07c0-4da3-b033-bba4e3304ebc
Content-Length: 1053
X-Content-Type-Options: nosniff