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=e686b46b-e585-4cd2-b61e-f87113cf35bc

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: e686b46b-e585-4cd2-b61e-f87113cf35bc

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.eyJ1c2VyX2lkIjoidWFhLWlkLTg4IiwiZW1haWwiOiJlbWFpbC01MkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDYxMzc0NjI1fQ.zDbtz0yt3NrA0QhRG6mJlijt4cxfMqzOIkmlr1slDjs
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/app_usage_events?results-per-page=1&after_guid=e686b46b-e585-4cd2-b61e-f87113cf35bc" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTg4IiwiZW1haWwiOiJlbWFpbC01MkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDYxMzc0NjI1fQ.zDbtz0yt3NrA0QhRG6mJlijt4cxfMqzOIkmlr1slDjs" \
	-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=e686b46b-e585-4cd2-b61e-f87113cf35bc&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "06ab0481-d1bb-47cf-bc0b-02b3ce822782",
        "url": "/v2/app_usage_events/06ab0481-d1bb-47cf-bc0b-02b3ce822782",
        "created_at": "2016-04-16T01:23:45Z"
      },
      "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-4ec7ea87-0895-4017-805b-e79026b0a7a7",
        "app_name": "name-127",
        "space_guid": "guid-1835b5c3-7eda-432f-ab48-879cbde27b56",
        "space_name": "name-128",
        "org_guid": "guid-5d34e265-7ff0-4ba5-8ec2-404f6057e994",
        "buildpack_guid": "guid-1f608cbf-077e-444c-9d92-8c41912d32d2",
        "buildpack_name": "name-129",
        "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: 9cc7504e-3eec-477b-bbb6-7f8fae59e6f9
Content-Length: 1283
X-Content-Type-Options: nosniff