diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index af4cfe01..50f32d37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,6 +59,10 @@ It is expected that during this implementation phase there will be changes made to the design and proposed specification edits to accurately represent the current status of the proposal. +If the proposal adds or changes an object model or resource endpoint definition, +it is expected that the PR will also include the necessary updates to the +[Open API document](openapi.yaml). + Once support for the change has been implemented, a PR should be sent to this repo for the change to the Open Service Broker API specification. By this point, the API interactions should be well understood and there should be no diff --git a/openapi.yaml b/openapi.yaml new file mode 100644 index 00000000..f126b5ac --- /dev/null +++ b/openapi.yaml @@ -0,0 +1,700 @@ +# This is the Open API interface for Open Service Broker API. Every attempt will +# be made to make the Open API version of OSB API accurately represent the +# written specification. If the spec and this document conflict, the spec is +# the authority. + +openapi: "3.0.0" + +info: + title: Open Service Broker API + description: The Open Service Broker API defines an HTTP(S) interface between Platforms and Service Brokers. + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + contact: + name: Open Service Broker API + url: https://www.openservicebrokerapi.org/ + email: open-service-broker-api@googlegroups.com + version: v2.13 + +servers: + - url: http://example.com + description: Broker Endpoint + - url: http://localhost:3000 + description: OSB Checker - MockOSB + +paths: + /v2/catalog: + get: + summary: get the catalog of services that the service broker offers + tags: + - Catalog + operationId: catalog.get + parameters: + - $ref: '#/components/parameters/APIVersion' + responses: + '200': + description: catalog response + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + + /v2/service_instances/{instance_id}: + put: + summary: provision a service instance + tags: + - ServiceInstances + operationId: serviceInstance.provision + parameters: + - $ref: '#/components/parameters/APIVersion' + - $ref: '#/components/parameters/OriginatingIdentity' + - name: instance_id + in: path + description: instance id of instance to provision + required: true + schema: + type: string + - name: accepts_incomplete + in: query + description: asynchronous operations supported + schema: + type: boolean + requestBody: + description: parameters for the requested service instance provision + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceInstanceProvisionRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceInstanceProvision' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceInstanceProvision' + '202': + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceInstanceProvision' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '422': + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: + summary: update a service instance + tags: + - ServiceInstances + operationId: serviceInstance.update + parameters: + - $ref: '#/components/parameters/APIVersion' + - $ref: '#/components/parameters/OriginatingIdentity' + - name: instance_id + in: path + description: instance id of instance to update + required: true + schema: + type: string + - name: accepts_incomplete + in: query + description: asynchronous operations supported + schema: + type: boolean + requestBody: + description: parameters for the requested service instance update + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceInstanceUpdateRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '202': + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/AsyncOperation' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '422': + description: Unprocessable entity + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + summary: deprovision a service instance + tags: + - ServiceInstances + operationId: serviceInstance.deprovision + parameters: + - $ref: '#/components/parameters/APIVersion' + - $ref: '#/components/parameters/OriginatingIdentity' + - name: instance_id + in: path + description: id of instance being deleted + required: true + schema: + type: string + - name: service_id + in: query + description: id of the service associated with the instance being deleted + required: true + schema: + type: string + - name: plan_id + in: query + description: id of the plan associated with the instance being deleted + required: true + schema: + type: string + - name: accepts_incomplete + in: query + description: asynchronous deprovision supported + schema: + type: boolean + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '202': + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/AsyncOperation' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '410': + description: Gone + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '422': + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v2/service_instances/{instance_id}/last_operation: + get: + summary: last requested operation state for service instance + tags: + - ServiceInstances + operationId: serviceInstance.lastOperation.get + parameters: + - $ref: '#/components/parameters/APIVersion' + - name: instance_id + in: path + description: instance id of instance to find last operation applied to it + required: true + schema: + type: string + - name: service_id + in: query + description: id of the service associated with the instance + schema: + type: string + - name: plan_id + in: query + description: id of the plan associated with the instance + schema: + type: string + - name: operation + in: query + description: a provided identifier for the operation + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceInstanceLastOperation' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '410': + description: Gone + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + + /v2/service_instances/{instance_id}/service_bindings/{binding_id}: + put: + summary: generation of a service binding + tags: + - ServiceBindings + operationId: serviceBinding.binding + parameters: + - $ref: '#/components/parameters/APIVersion' + - $ref: '#/components/parameters/OriginatingIdentity' + - name: instance_id + in: path + description: instance id of instance to create a binding on + required: true + schema: + type: string + - name: binding_id + in: path + description: binding id of binding to create + required: true + schema: + type: string + requestBody: + description: parameters for the requested service binding + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceBindingRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceBinding' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceBinding' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '422': + description: Unprocessable Entity + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + summary: deprovision of a service binding + tags: + - ServiceBindings + operationId: serviceBinding.unbinding + parameters: + - $ref: '#/components/parameters/APIVersion' + - $ref: '#/components/parameters/OriginatingIdentity' + - name: instance_id + in: path + description: id of the instance associated with the binding being deleted + required: true + schema: + type: string + - name: binding_id + in: path + description: id of the binding being deleted + required: true + schema: + type: string + - name: service_id + in: query + description: id of the service associated with the instance for which a binding is being deleted + required: true + schema: + type: string + - name: plan_id + in: query + description: id of the plan associated with the instance for which a binding is being deleted + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + '410': + description: Gone + content: + application/json: + schema: + $ref: '#/components/schemas/Object' + +components: + parameters: + APIVersion: + name: X-Broker-API-Version + in: header + description: version number of the Service Broker API that the Platform will use + required: true + schema: + type: string + default: '2.13' + + OriginatingIdentity: + name: X-Broker-API-Originating-Identity + in: header + description: identity of the user that initiated the request from the Platform + schema: + type: string + + schemas: + Catalog: + type: object + properties: + services: + type: array + items: + $ref: '#/components/schemas/Service' + + Service: + type: object + required: + - name + - id + - description + - bindable + - plans + properties: + name: + type: string + id: + type: string + description: + type: string + tags: + type: array + items: + type: string + requires: + type: array + items: + type: string + enum: + - syslog_drain + - route_forwarding + - volume_mount + bindable: + type: boolean + metadata: + $ref: '#/components/schemas/Metadata' + dashboard_client: + $ref: '#/components/schemas/DashboardClient' + plan_updateable: + type: boolean + plans: + type: array + items: + $ref: '#/components/schemas/Plan' + + DashboardClient: + type: object + properties: + id: + type: string + secret: + type: string + redirect_uri: + type: string + + Plan: + type: object + required: + - id + - name + - description + properties: + id: + type: string + name: + type: string + description: + type: string + metadata: + $ref: '#/components/schemas/Metadata' + free: + type: boolean + default: true + bindable: + type: boolean + schemas: + $ref: '#/components/schemas/SchemasObject' + + SchemasObject: + type: object + properties: + service_instance: + $ref: '#/components/schemas/ServiceInstanceSchemaObject' + service_binding: + $ref: '#/components/schemas/ServiceBindingSchemaObject' + + ServiceInstanceSchemaObject: + type: object + properties: + create: + $ref: '#/components/schemas/SchemaParameters' + update: + $ref: '#/components/schemas/SchemaParameters' + + ServiceBindingSchemaObject: + type: object + properties: + create: + $ref: '#/components/schemas/SchemaParameters' + + SchemaParameters: + type: object + properties: + parameters: + $ref: '#/components/schemas/JSONSchemaObject' + + JSONSchemaObject: + type: object + + ServiceInstanceProvisionRequest: + type: object + required: + - service_id + - plan_id + - organization_guid + - space_guid + properties: + service_id: + type: string + plan_id: + type: string + context: + $ref: '#/components/schemas/Context' + organization_guid: + type: string + deprecated: true + space_guid: + type: string + deprecated: true + parameters: + $ref: '#/components/schemas/Object' + + ServiceInstanceProvision: + type: object + properties: + dashboard_url: + type: string + operation: + type: string # could be a link object to last operation + + ServiceInstanceUpdateRequest: + type: object + required: + - service_id + properties: + context: + $ref: '#/components/schemas/Context' + service_id: + type: string + plan_id: + type: string + parameters: + $ref: '#/components/schemas/Object' + previous_values: + $ref: '#/components/schemas/ServiceInstancePreviousValues' + + ServiceInstancePreviousValues: + type: object + properties: + service_id: + type: string + deprecated: true + plan_id: + type: string + organization_id: + type: string + deprecated: true + space_id: + type: string + deprecated: true + + AsyncOperation: + type: object + properties: + operation: + type: string + + ServiceInstanceLastOperation: + type: object + required: + - state + properties: + state: + type: string + enum: + - in progress + - succeeded + - failed + description: + type: string + + ServiceBindingRequest: + type: object + required: + - service_id + - plan_id + properties: + context: + $ref: '#/components/schemas/Context' + service_id: + type: string + plan_id: + type: string + app_guid: + type: string + deprecated: true + bind_resource: + $ref: '#/components/schemas/ServiceBindingResouceObject' + parameters: + $ref: '#/components/schemas/Object' + + ServiceBindingResouceObject: + type: object + properties: + app_guid: + type: string + route: + type: string + + ServiceBinding: + type: object + properties: + credentials: + $ref: '#/components/schemas/Object' + syslog_drain_url: + type: string + route_service_url: + type: string + volume_mounts: + type: array + items: + $ref: '#/components/schemas/ServiceBindingVolumeMount' + + ServiceBindingVolumeMount: + type: object + required: + - driver + - container_dir + - mode + - device_type + - device + properties: + driver: + type: string + container_dir: + type: string + mode: + type: string + enum: + - r + - rw + device_type: + type: string + enum: + - shared + device: + $ref: '#/components/schemas/ServiceBindingVolumeMountDevice' + + ServiceBindingVolumeMountDevice: + type: object + required: + - volume_id + properties: + volume_id: + type: string + mount_config: + $ref: '#/components/schemas/Object' + + Context: + description: "See [Context Conventions](https://github.com/openservicebrokerapi/servicebroker/blob/master/profile.md#context-object) for more details." + type: object + + Metadata: + description: "See [Service Metadata Conventions](https://github.com/openservicebrokerapi/servicebroker/blob/master/profile.md#service-metadata) for more details." + type: object + + Object: + type: object + + Error: + type: object + properties: + error: + type: string + description: + type: string + + securitySchemes: + basicAuth: + type: http + scheme: basic + +security: + - basicAuth: [] + +externalDocs: + description: The offical Open Service Broker API specification + url: https://github.com/openservicebrokerapi/servicebroker/