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=5a3416b0-cf3c-425a-a14c-45a317c497ed

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: 5a3416b0-cf3c-425a-a14c-45a317c497ed

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.eyJ1c2VyX2lkIjoidWFhLWlkLTE4NCIsImVtYWlsIjoiZW1haWwtMTM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTN9.WJpYrqT6mYQtACQQ02kxr3dUMZV9EI6GDBu0ErNXlvU
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/app_usage_events?results-per-page=1&after_guid=5a3416b0-cf3c-425a-a14c-45a317c497ed" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4NCIsImVtYWlsIjoiZW1haWwtMTM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTN9.WJpYrqT6mYQtACQQ02kxr3dUMZV9EI6GDBu0ErNXlvU" \
	-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=5a3416b0-cf3c-425a-a14c-45a317c497ed&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "b32241a5-5508-4d42-893c-360e42a300b6",
        "url": "/v2/app_usage_events/b32241a5-5508-4d42-893c-360e42a300b6",
        "created_at": "2016-06-08T16:41:33Z"
      },
      "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-d9fbb7f8-cba5-44a2-b720-c24f1fe5e1c4",
        "app_name": "name-1663",
        "space_guid": "guid-5e28f12f-9d80-473e-b826-537b148eb338",
        "space_name": "name-1664",
        "org_guid": "guid-036444f4-f2f5-4ea8-a353-e73330ca0f0a",
        "buildpack_guid": "guid-df37754c-819b-4697-a523-4b457d3c83dd",
        "buildpack_name": "name-1665",
        "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: 42349fc5-4aef-4253-9893-e3ff8ab5c137
Content-Length: 1286
X-Content-Type-Options: nosniff