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=b36e7b7b-0dde-4165-bb95-7bcda8053048

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: b36e7b7b-0dde-4165-bb95-7bcda8053048

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.eyJ1c2VyX2lkIjoidWFhLWlkLTQ0MiIsImVtYWlsIjoiZW1haWwtMzA0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3Mjl9.BPjKdwHR1fL3zTeoG6xZV4wew_qlUuf3WwcHk_g_vjQ
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/app_usage_events?results-per-page=1&after_guid=b36e7b7b-0dde-4165-bb95-7bcda8053048" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ0MiIsImVtYWlsIjoiZW1haWwtMzA0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3Mjl9.BPjKdwHR1fL3zTeoG6xZV4wew_qlUuf3WwcHk_g_vjQ" \
	-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=b36e7b7b-0dde-4165-bb95-7bcda8053048&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "06fb6ff1-b184-4316-8b29-bbcf1a020876",
        "url": "/v2/app_usage_events/06fb6ff1-b184-4316-8b29-bbcf1a020876",
        "created_at": "2016-05-12T00:45: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-0cef30ad-d052-4f76-90e7-3a2b9389e818",
        "app_name": "name-2493",
        "space_guid": "guid-5479b66d-8930-4467-9f3f-46ddfcbff206",
        "space_name": "name-2494",
        "org_guid": "guid-4f9f59b5-5390-4c90-80a8-bcf5dd2c65a6",
        "buildpack_guid": "guid-fa1545ab-bc90-459c-9a97-2867f701b816",
        "buildpack_name": "name-2495",
        "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: 8a791405-2be4-4474-948b-4fed0dd5b6a2
Content-Length: 1286
X-Content-Type-Options: nosniff