openapi: 3.2.0 info: title: Cloud Foundry V3 Service Usage Events API description: '# Welcome to the Experimental Cloud Foundry V3 API Docs!' version: latest license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html contact: name: Cloud Foundry url: https://www.cloudfoundry.org/ servers: - url: https://api.example.local description: Cloud Foundry V3 API server security: - oauth: - cloud_controller.read - cloud_controller.write tags: - name: Service Usage Events description: Service usage events are a record of changes in the usage of services. paths: /v3/service_usage_events: get: summary: List service usage events description: Retrieve all service usage events the user has access to. operationId: listServiceUsageEvents tags: - Service Usage Events parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - $ref: '#/components/parameters/OrderBy' - $ref: '#/components/parameters/CreatedAts' - name: after_guid in: query description: Filters out events before and including the event with the given guid. schema: type: string - name: guids in: query description: Comma-delimited list of usage event guids to filter by. schema: type: array items: type: string - name: service_instance_types in: query description: Comma-delimited list of service instance types to filter by; valid values are `managed_service_instance` and `user_provided_service_instance` schema: type: array items: type: string enum: - managed_service_instance - user_provided_service_instance - name: service_offering_guids in: query description: Comma-delimited list of service offering guids to filter by schema: type: array items: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceUsageEventList' examples: default: summary: default value: pagination: total_results: 2 total_pages: 2 first: href: https://api.example.org<%= path %>?page=1&per_page=1 last: href: https://api.example.org<%= path %>?page=2&per_page=1 next: href: https://api.example.org<%= path %>?page=2&per_page=1 previous: null resources: - guid: 123e4567-e89b-12d3-a456-426614174000 created_at: '2020-05-28T12:34:56Z' updated_at: '2020-05-28T12:34:56Z' state: CREATED space: guid: 123e4567-e89b-12d3-a456-426614174000 name: name-1664 organization: guid: 123e4567-e89b-12d3-a456-426614174000 service_instance: guid: 123e4567-e89b-12d3-a456-426614174000 name: name-1982 type: managed_service_instance service_plan: guid: 123e4567-e89b-12d3-a456-426614174000 name: name-1983 service_offering: guid: 123e4567-e89b-12d3-a456-426614174000 name: label-64 service_broker: guid: 123e4567-e89b-12d3-a456-426614174000 name: name-2929 links: self: href: https://api.example.org/v3/service_usage_events/c9976002-96f4-435a-888e-db1e1178df62 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '409': $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/UnprocessableEntity' '500': $ref: '#/components/responses/500' '502': $ref: '#/components/responses/BadGateway' '503': $ref: '#/components/responses/ServiceUnavailable' /v3/service_usage_events/{guid}: get: summary: Get a service usage event description: Retrieve a service usage event. operationId: getServiceUsageEvent tags: - Service Usage Events parameters: - $ref: '#/components/parameters/Guid' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ServiceUsageEvent' examples: default: summary: default value: guid: 123e4567-e89b-12d3-a456-426614174000 created_at: '2020-05-28T12:34:56Z' updated_at: '2020-05-28T12:34:56Z' state: CREATED space: guid: 123e4567-e89b-12d3-a456-426614174000 name: name-1664 organization: guid: 123e4567-e89b-12d3-a456-426614174000 service_instance: guid: 123e4567-e89b-12d3-a456-426614174000 name: name-1982 type: managed_service_instance service_plan: guid: 123e4567-e89b-12d3-a456-426614174000 name: name-1983 service_offering: guid: 123e4567-e89b-12d3-a456-426614174000 name: label-64 service_broker: guid: 123e4567-e89b-12d3-a456-426614174000 name: name-2929 links: self: href: https://api.example.org/v3/service_usage_events/c9976002-96f4-435a-888e-db1e1178df62 '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /v3/service_usage_events/actions/destructively_purge_all_and_reseed: post: summary: Purge and seed service usage events description: Destroys all existing events. Populates new usage events, one for each existing service instance. All populated events will have a `created_at` value of current time. There is the potential race condition if service instances are currently being created or deleted. The seeded usage events will have the same guid as the service instance. operationId: purgeAndSeedServiceUsageEvents tags: - Service Usage Events responses: '200': description: OK '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/UnprocessableEntity' '500': $ref: '#/components/responses/500' '503': $ref: '#/components/responses/ServiceUnavailable' components: schemas: Link: type: object properties: href: type: string description: The URL of the link method: type: string description: An optional field containing the HTTP method to be used when following the URL required: - href description: 'Each link is keyed by its type and will include a href for the URL and an optional method for links that cannot be followed using GET. ' Error: type: object properties: code: type: integer description: A numeric code for this error detail: type: string description: Detailed description of the error title: type: string description: Name of the error Errors: type: object properties: errors: type: array items: $ref: '#/components/schemas/Error' description: 'An error response will always return a list of error objects. Errors appear on the job resource for asynchronous operations. Clients should use the code and title fields for programmatically handling specific errors. The message in the detail field is subject to change over time. ' ServiceUsageEvent: type: object allOf: - $ref: '#/components/schemas/BaseSchema' - properties: links: type: object properties: self: $ref: '#/components/schemas/Link' description: The URL to get this service usage event ServiceUsageEventList: type: object properties: pagination: $ref: '#/components/schemas/Pagination' resources: type: array items: $ref: '#/components/schemas/ServiceUsageEvent' Pagination: type: object properties: total_results: type: integer description: The total number of results available total_pages: type: integer description: The total number of pages available first: allOf: - $ref: '#/components/schemas/Link' - description: The first page of results last: allOf: - $ref: '#/components/schemas/Link' - description: The last page of results next: oneOf: - $ref: '#/components/schemas/Link' - type: 'null' description: The next page of results previous: oneOf: - $ref: '#/components/schemas/Link' - type: 'null' description: The previous page of results description: 'Pagination is a technique used to divide a large set of results into smaller, more manageable sets. This allows clients to retrieve results in smaller chunks, reducing the amount of data transferred and improving performance. The pagination object is a JSON object that contains information about the pagination state of the results. It includes the total number of results available, the total number of pages available, and links to the first, last, next, and previous pages of results. ' BaseSchema: type: object properties: guid: type: string format: uuid description: The unique identifier for the resource created_at: type: string format: date-time description: The ISO8601 compatible date and time when resource was created updated_at: type: string format: date-time description: The ISO8601 compatible date and time when resource was last updated description: 'A resource represents an individual object within the system, such as an app or a service. It is represented as a JSON object. A resource consists of several required resource fields and other attributes specific to the resource. See Resources and Experimental Resources for specific resources. ' responses: Forbidden: description: Forbidden content: application/json: schema: $ref: '#/components/schemas/Errors' NotFound: description: Not Found content: application/json: schema: $ref: '#/components/schemas/Errors' UnprocessableEntity: description: Unprocessable Entity content: application/json: schema: $ref: '#/components/schemas/Errors' BadGateway: description: Bad Gateway content: application/json: schema: $ref: '#/components/schemas/Error' BadRequest: description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Errors' text/html: schema: type: string Unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Errors' Conflict: description: Conflict content: application/json: schema: $ref: '#/components/schemas/Errors' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/Errors' ServiceUnavailable: description: Service Unavailable content: application/json: schema: $ref: '#/components/schemas/Errors' parameters: OrderBy: name: order_by in: query required: false schema: type: string description: 'Value to sort by. Defaults to ascending; prepend with `-` to sort descending. ' example: created_at Guid: name: guid in: path required: true schema: type: string format: uuid description: The unique identifier for the resource PerPage: name: per_page in: query required: false schema: type: integer description: Number of results per page, valid values are 1 through 5000 example: 50 Page: name: page in: query required: false schema: type: integer description: Page to display; valid values are integers >= 1 example: 1 CreatedAts: name: created_ats in: query required: false schema: type: string description: 'Timestamp to filter by. When filtering on equality, several comma-delimited timestamps may be passed. Also supports filtering with [relational operators](#relational-operators). ' example: '2021-01-01T00:00:00Z' securitySchemes: oauth: type: oauth2 flows: implicit: authorizationUrl: https://uaa.cloudfoundry.local/api-oauth/dialog scopes: cloud_controller.admin: This scope provides read and write access to all resources cloud_controller.admin_read_only: This scope provides read only access to all resources cloud_controller.global_auditor: This scope provides read access to all resources cloud_controller.read: Read access to the Cloud Controller cloud_controller.write: Write access to the Cloud Controller cloud_controller.update_build_state: This scope allows its bearer to update the state of a build; currently only used when updating builds cloud_controller_service_permissions.read: This scope provides read only access for service instance permissions bearer: type: http scheme: bearer bearerFormat: JWT description: Bearer JWT token authentication