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=bbe02fb2-8f82-45e3-a53c-96a1b0c46cb4

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
  • 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: bbe02fb2-8f82-45e3-a53c-96a1b0c46cb4

Body

Name Description Default Valid Values Example Values
guid The guid of the event.
state The desired state of the service.
  • CREATED
  • DELETED
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.
serivce_label The name of the service.

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI1OCIsImVtYWlsIjoiZW1haWwtMTc5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNDZ9.aRaNs7u3ciJAyJjmpMWcj5KR9xLhu2HkOoNygZf-7v4
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/service_usage_events?results-per-page=1&after_guid=bbe02fb2-8f82-45e3-a53c-96a1b0c46cb4" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI1OCIsImVtYWlsIjoiZW1haWwtMTc5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNDZ9.aRaNs7u3ciJAyJjmpMWcj5KR9xLhu2HkOoNygZf-7v4" \
	-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=bbe02fb2-8f82-45e3-a53c-96a1b0c46cb4&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "31915f84-a16b-4a33-9d88-3469e25b89c5",
        "url": "/v2/service_usage_events/31915f84-a16b-4a33-9d88-3469e25b89c5",
        "created_at": "2015-04-15T00:55:46Z"
      },
      "entity": {
        "state": "CREATED",
        "org_guid": "guid-6e122bc2-43ea-4977-80cd-9c467067062e",
        "space_guid": "guid-522307f4-5cd1-478f-a1db-1c1c7c48de4c",
        "space_name": "name-1790",
        "service_instance_guid": "guid-2ab53dfc-fbfb-42b8-9345-8f6b63ceb964",
        "service_instance_name": "name-1791",
        "service_instance_type": "type-5",
        "service_plan_guid": "guid-881b471b-5768-48cd-abb1-8639e384bf65",
        "service_plan_name": "name-1792",
        "service_guid": "guid-401fd513-4f21-44ac-be6d-717f00b57f9c",
        "service_label": "label-45"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: bbeeb926-882d-45ea-8163-61f2779370a0
Content-Length: 1053
X-Content-Type-Options: nosniff