List all App Usage Events
GET /v2/app_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.
Fields
Name |
Description |
Default |
Valid Values |
Example Values |
guid
|
The guid of the event.
|
|
|
|
state
|
The desired state of the app or 'BUILDPACK_SET' when buildpack info has been set.
|
|
- STARTED
- STOPPED
- BUILDPACK_SET
|
|
package_state
|
The state of the package.
|
|
|
|
instance_count
|
How many instance of the app.
|
|
|
|
memory_in_mb_per_instance
|
How much memory per app instance.
|
|
|
|
app_guid
|
The GUID of the app.
|
|
|
|
app_name
|
The name of the app.
|
|
|
|
org_guid
|
The GUID of the organization.
|
|
|
|
space_guid
|
The GUID of the space.
|
|
|
|
space_name
|
The name of the space.
|
|
|
|
buildpack_guid
|
The GUID of the buildpack used to stage the app.
|
|
|
|
buildpack_name
|
The name of the buildpack or the URL of the custom buildpack used to stage the app.
|
|
|
- https://example.com/buildpack.git
- admin_buildpack
|
created_at
|
The timestamp when the event is recorded. It is possible that later events may have earlier created_at values.
|
|
|
|
Parameters
Name |
Description |
Valid Values |
Example Values |
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 App Usage Events after the one with the given guid
|
|
|
Request
Headers
Route
GET /v2/app_usage_events?results-per-page=1&after_guid=1c13f51a-3d8d-4a12-901b-0d9049f6b22d
Query Parameters
results-per-page: 1
after_guid: 1c13f51a-3d8d-4a12-901b-0d9049f6b22d
cURL
curl "https://api.[your-domain.com]/v2/app_usage_events?results-per-page=1&after_guid=1c13f51a-3d8d-4a12-901b-0d9049f6b22d" -X GET \
-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MCIsImVtYWlsIjoiZW1haWwtMjcyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzl9.fPQ2YNl2Sp2_JvkbRO27pB2ypY_5rRQ3gP3_hRKn1Tg" \
-H "Host: example.org" \
-H "Cookie: "
Response
Headers
Status
200 OK
Body
{
"total_results": 2,
"total_pages": 2,
"prev_url": null,
"next_url": "/v2/app_usage_events?after_guid=1c13f51a-3d8d-4a12-901b-0d9049f6b22d&order-direction=asc&page=2&results-per-page=1",
"resources": [
{
"metadata": {
"guid": "923d9be3-0d4a-4c1a-beb2-191d1b7ae2d9",
"url": "/v2/app_usage_events/923d9be3-0d4a-4c1a-beb2-191d1b7ae2d9",
"created_at": "2015-02-10T01:42:59Z"
},
"entity": {
"state": "STARTED",
"memory_in_mb_per_instance": 564,
"instance_count": 1,
"app_guid": "guid-a2d3d8c6-0292-4dee-857a-1f6b765907bd",
"app_name": "name-1990",
"space_guid": "guid-278ed5d4-4691-4d98-9a94-aaefc08436e6",
"space_name": "name-1991",
"org_guid": "guid-dc32c7c5-5336-4091-9e5b-d79967ce6985",
"buildpack_guid": "guid-ce0e879d-ffcf-48f7-bf57-ef1766ce186a",
"buildpack_name": "name-1992",
"package_state": "STAGED"
}
}
]
}