Home
Version 3
App Usage Events API

App Usage Events API

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.

Request

Route

GET /v2/app_usage_events?results-per-page=1&after_guid=8f20e47b-8981-4126-81b4-d149a8a6310a

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
results-per-page: 1
after_guid: 8f20e47b-8981-4126-81b4-d149a8a6310a

Body

Name Description Default Valid Values Example Values
app_guid The GUID of the app.
app_name The name of the app.
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.
guid The guid of the event.
instance_count The number of instance of an application
memory_in_mb_per_instance Memory usage per app instance.
  • 128
  • 256
  • 512
org_guid The GUID of the organization.
package_state The state of the package.
  • PENDING
  • STAGED
  • FAILED
parent_app_guid The GUID for a parent v3 application if one exists
parent_app_name The name for a parent v3 application if one exists
previous_instance_count The number of instance of an application previously
previous_memory_in_mb_per_instance Previous memory usage per app instance.
  • 128
  • 256
  • 512
previous_package_state The previous state of the package.
  • PENDING
  • STAGED
  • FAILED
previous_state The previous desired state of the app or 'BUILDPACK_SET' when buildpack info has been set.
  • STARTED
  • STOPPED
  • BUILDPACK_SET
  • TASK_STARTED
  • TASK_STOPPED
process_type The process_type for applications.
space_guid The GUID of the space.
space_name The name of the space.
state The desired state of the app or 'BUILDPACK_SET' when buildpack info has been set.
  • STARTED
  • STOPPED
  • BUILDPACK_SET
  • TASK_STARTED
  • TASK_STOPPED
task_guid The GUID of the task if one exists.
task_name The NAME of the task if one exists.

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM0NSIsImVtYWlsIjoiZW1haWwtMjQ3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDl9.t7-utHYdocfixWhQExXggCrEq4Cxfpe-DOeQzRxHFls
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/app_usage_events?results-per-page=1&after_guid=8f20e47b-8981-4126-81b4-d149a8a6310a" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM0NSIsImVtYWlsIjoiZW1haWwtMjQ3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDl9.t7-utHYdocfixWhQExXggCrEq4Cxfpe-DOeQzRxHFls" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "total_results": 2,
  "total_pages": 2,
  "prev_url": null,
  "next_url": "/v2/app_usage_events?after_guid=8f20e47b-8981-4126-81b4-d149a8a6310a&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "aa9c552c-1073-45f9-b0e0-d5410d5d3c76",
        "url": "/v2/app_usage_events/aa9c552c-1073-45f9-b0e0-d5410d5d3c76",
        "created_at": "2016-04-22T19:33:29Z"
      },
      "entity": {
        "state": "STARTED",
        "previous_state": null,
        "memory_in_mb_per_instance": 564,
        "previous_memory_in_mb_per_instance": null,
        "instance_count": 1,
        "previous_instance_count": null,
        "app_guid": "guid-22c4eb54-82da-47b1-9d4d-2d36b388c56b",
        "app_name": "name-1153",
        "space_guid": "guid-e59c5bef-8323-4fbd-9d89-3cc7c414d478",
        "space_name": "name-1154",
        "org_guid": "guid-37994ec6-b1e2-4c9f-82cc-9fc6c89f81de",
        "buildpack_guid": "guid-0364e3ca-a1cf-401e-a2ab-f8f0ffa8e500",
        "buildpack_name": "name-1155",
        "package_state": "STAGED",
        "previous_package_state": null,
        "parent_app_guid": null,
        "parent_app_name": null,
        "process_type": "web",
        "task_name": null,
        "task_guid": null
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: a46df2ee-fc54-4b19-99e8-6585164d1602
Content-Length: 1286
X-Content-Type-Options: nosniff