From ac24a16cb89ca456a95d5f86b89a720427b5549e Mon Sep 17 00:00:00 2001 From: Marek Michali Date: Wed, 23 Oct 2024 10:06:59 +0200 Subject: [PATCH 1/3] Update swagger with bindings --- resources/keb/files/swagger.yaml | 149 +++++++------------------------ 1 file changed, 32 insertions(+), 117 deletions(-) diff --git a/resources/keb/files/swagger.yaml b/resources/keb/files/swagger.yaml index f3f588775e..6d79441f94 100644 --- a/resources/keb/files/swagger.yaml +++ b/resources/keb/files/swagger.yaml @@ -679,63 +679,6 @@ paths: schema: $ref: '#/components/schemas/Error' - /oauth/v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation: - get: - summary: last requested operation state for service binding - security: - - oAuth2ClientCredentials: ["broker:write"] - tags: - - Bindings (not implemented) - operationId: serviceBinding.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: binding_id - in: path - description: binding id of service binding 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/LastOperationResource' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '410': - description: Gone - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /oauth/v2/service_instances/{instance_id}/service_bindings/{binding_id}: put: summary: generation of a service binding @@ -758,37 +701,26 @@ paths: required: true schema: type: string - - name: accepts_incomplete - in: query - description: asynchronous operations supported - schema: - type: boolean requestBody: description: parameters for the requested service binding required: true content: application/json: schema: - $ref: '#/components/schemas/ServiceBindingRequest' + $ref: '#/components/schemas/ServiceBindingPutRequest' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServiceBinding' + $ref: '#/components/schemas/ServiceBindingPutRequestResponse' '201': description: Created content: application/json: schema: - $ref: '#/components/schemas/ServiceBinding' - '202': - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncOperation' + $ref: '#/components/schemas/ServiceBindingPutRequestResponse' '400': description: Bad Request content: @@ -1316,26 +1248,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ServiceBindingRequest' + $ref: '#/components/schemas/ServiceBindingPutRequest' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServiceBinding' + $ref: '#/components/schemas/ServiceBindingPutRequestResponse' '201': description: Created content: application/json: schema: - $ref: '#/components/schemas/ServiceBinding' - '202': - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncOperation' + $ref: '#/components/schemas/ServiceBindingPutRequestResponse' '400': description: Bad Request content: @@ -2236,21 +2162,15 @@ components: type: string route_service_url: type: string - volume_mounts: - type: array - items: - $ref: '#/components/schemas/ServiceBindingVolumeMount' parameters: $ref: '#/components/schemas/Object' - ServiceBindingRequest: + ServiceBindingPutRequest: type: object required: - service_id - plan_id properties: - context: - $ref: '#/components/schemas/Context' service_id: type: string format: uuid @@ -2260,46 +2180,33 @@ components: format: uuid example: 054ac2c2-318f-45dd-855c-eee41513d40d parameters: - $ref: '#/components/schemas/Object' + $ref: '#/components/schemas/BindingParameters' - ServiceBinding: + ServiceBindingPutRequestResponse: 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' + $ref: '#/components/schemas/ServiceBindingKubeconfig' + metadata: + $ref: '#/components/schemas/ServiceBindingMetadata' - ServiceBindingVolumeMount: + ServiceBindingKubeconfig: type: object required: - - driver - - container_dir - - mode - - device_type - - device + - kubeconfig properties: - driver: - type: string - container_dir: - type: string - mode: + kubeconfig: type: string - enum: - - r - - rw - device_type: + + ServiceBindingMetadata: + type: object + required: + - expires_at + properties: + expires_at: type: string - enum: - - shared - device: - $ref: '#/components/schemas/ServiceBindingVolumeMountDevice' + format: date-time + example: 2022-10-18T13:52:24.598517Z ServiceBindingVolumeMountDevice: type: object @@ -2387,6 +2294,14 @@ components: Object: type: object + + BindingParameters: + type: object + properties: + expiration_seconds: + type: integer + default: 600 + description: Specifies the duration in seconds after which the binding will be expired Error: description: "See [Service Broker Errors](https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#service-broker-errors) for more details." From 671e74e97d3e2a3719f843b67d6713e009da59d5 Mon Sep 17 00:00:00 2001 From: Marek Michali Date: Wed, 23 Oct 2024 13:35:10 +0200 Subject: [PATCH 2/3] Update next endpoints --- resources/keb/files/swagger.yaml | 93 +------------------------------- 1 file changed, 1 insertion(+), 92 deletions(-) diff --git a/resources/keb/files/swagger.yaml b/resources/keb/files/swagger.yaml index 6d79441f94..f3b34bb2b8 100644 --- a/resources/keb/files/swagger.yaml +++ b/resources/keb/files/swagger.yaml @@ -772,11 +772,6 @@ paths: required: true schema: type: string - - name: accepts_incomplete - in: query - description: asynchronous operations supported - schema: - type: boolean responses: '200': description: OK @@ -784,12 +779,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Object' - '202': - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncOperation' '400': description: Bad Request content: @@ -1146,69 +1135,6 @@ paths: schema: $ref: '#/components/schemas/Error' - /oauth/{region}/v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation: - get: - summary: last requested operation state for service binding - security: - - oAuth2ClientCredentials: ["broker:write"] - tags: - - Bindings (not implemented) - operationId: serviceBinding.region.lastOperation.get - parameters: - - $ref: '#/components/parameters/APIVersion' - - name: region - in: path - description: the region id - required: true - schema: - type: string - - name: instance_id - in: path - description: instance id of instance to find last operation applied to it - required: true - schema: - type: string - - name: binding_id - in: path - description: binding id of service binding 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/LastOperationResource' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '410': - description: Gone - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /oauth/{region}/v2/service_instances/{instance_id}/service_bindings/{binding_id}: put: summary: generation of a service binding @@ -1319,11 +1245,6 @@ paths: required: true schema: type: string - - name: accepts_incomplete - in: query - description: asynchronous operations supported - schema: - type: boolean responses: '200': description: OK @@ -1331,12 +1252,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Object' - '202': - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncOperation' '400': description: Bad Request content: @@ -2157,13 +2072,7 @@ components: type: object properties: credentials: - $ref: '#/components/schemas/Object' - syslog_drain_url: - type: string - route_service_url: - type: string - parameters: - $ref: '#/components/schemas/Object' + $ref: '#/components/schemas/ServiceBindingKubeconfig' ServiceBindingPutRequest: type: object From 492f97e97939829e99ca28ce874697c9d681ff88 Mon Sep 17 00:00:00 2001 From: Marek Michali Date: Thu, 24 Oct 2024 08:21:25 +0200 Subject: [PATCH 3/3] Error codes --- resources/keb/files/swagger.yaml | 101 ++++++++++++++++++++----------- 1 file changed, 66 insertions(+), 35 deletions(-) diff --git a/resources/keb/files/swagger.yaml b/resources/keb/files/swagger.yaml index f3b34bb2b8..b9bb1236f9 100644 --- a/resources/keb/files/swagger.yaml +++ b/resources/keb/files/swagger.yaml @@ -681,11 +681,11 @@ paths: /oauth/v2/service_instances/{instance_id}/service_bindings/{binding_id}: put: - summary: generation of a service binding + summary: create a service binding security: - oAuth2ClientCredentials: ["broker:write"] tags: - - Bindings (not implemented) + - Bindings operationId: serviceBinding.binding parameters: - $ref: '#/components/parameters/APIVersion' @@ -707,26 +707,32 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ServiceBindingPutRequest' + $ref: '#/components/schemas/ServiceBindingProvisionRequest' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServiceBindingPutRequestResponse' + $ref: '#/components/schemas/ServiceBindingProvision' '201': description: Created content: application/json: schema: - $ref: '#/components/schemas/ServiceBindingPutRequestResponse' + $ref: '#/components/schemas/ServiceBindingProvision' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '409': description: Conflict content: @@ -739,12 +745,18 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' delete: - summary: deprovision of a service binding + summary: delete a service binding security: - oAuth2ClientCredentials: ["broker:write"] tags: - - Bindings (not implemented) + - Bindings operationId: serviceBinding.unbinding parameters: - $ref: '#/components/parameters/APIVersion' @@ -779,24 +791,24 @@ paths: application/json: schema: $ref: '#/components/schemas/Object' - '400': - description: Bad Request + '410': + description: Gone content: application/json: schema: - $ref: '#/components/schemas/Error' - '410': - description: Gone + $ref: '#/components/schemas/Object' + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' get: - summary: gets a service binding + summary: get a service binding security: - oAuth2ClientCredentials: ["broker:write"] tags: - - Bindings (not implemented) + - Bindings operationId: serviceBinding.get parameters: - $ref: '#/components/parameters/APIVersion' @@ -825,6 +837,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /oauth/{region}/v2/catalog: get: @@ -1137,11 +1155,11 @@ paths: /oauth/{region}/v2/service_instances/{instance_id}/service_bindings/{binding_id}: put: - summary: generation of a service binding + summary: create a service binding security: - oAuth2ClientCredentials: ["broker:write"] tags: - - Bindings (not implemented) + - Bindings operationId: serviceBinding.region.binding parameters: - $ref: '#/components/parameters/APIVersion' @@ -1163,37 +1181,38 @@ paths: required: true schema: type: string - - name: accepts_incomplete - in: query - description: asynchronous operations supported - schema: - type: boolean requestBody: description: parameters for the requested service binding required: true content: application/json: schema: - $ref: '#/components/schemas/ServiceBindingPutRequest' + $ref: '#/components/schemas/ServiceBindingProvisionRequest' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServiceBindingPutRequestResponse' + $ref: '#/components/schemas/ServiceBindingProvision' '201': description: Created content: application/json: schema: - $ref: '#/components/schemas/ServiceBindingPutRequestResponse' + $ref: '#/components/schemas/ServiceBindingProvision' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '409': description: Conflict content: @@ -1206,12 +1225,18 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' delete: - summary: deprovision of a service binding + summary: delete a service binding security: - oAuth2ClientCredentials: ["broker:write"] tags: - - Bindings (not implemented) + - Bindings operationId: serviceBinding.region.unbinding parameters: - $ref: '#/components/parameters/APIVersion' @@ -1252,24 +1277,24 @@ paths: application/json: schema: $ref: '#/components/schemas/Object' - '400': - description: Bad Request + '410': + description: Gone content: application/json: schema: - $ref: '#/components/schemas/Error' - '410': - description: Gone + $ref: '#/components/schemas/Object' + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' get: - summary: gets a service binding + summary: get a service binding security: - oAuth2ClientCredentials: ["broker:write"] tags: - - Bindings (not implemented) + - Bindings operationId: serviceBinding.region.get parameters: - $ref: '#/components/parameters/APIVersion' @@ -1304,6 +1329,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' components: parameters: @@ -2074,7 +2105,7 @@ components: credentials: $ref: '#/components/schemas/ServiceBindingKubeconfig' - ServiceBindingPutRequest: + ServiceBindingProvisionRequest: type: object required: - service_id @@ -2091,7 +2122,7 @@ components: parameters: $ref: '#/components/schemas/BindingParameters' - ServiceBindingPutRequestResponse: + ServiceBindingProvision: type: object properties: credentials: