Skip to content

Commit 5cba556

Browse files
Samzegeorgi-lozev
andcommitted
Generic extensions
Co-authored-by: Georgi Lozev <[email protected]>
1 parent 4979811 commit 5cba556

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

spec.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- [Provisioning](#provisioning)
2626
- [Fetching a Service Instance](#fetching-a-service-instance)
2727
- [Updating a Service Instance](#updating-a-service-instance)
28+
- [Service Instance Extensions](#service-instance-extensions)
2829
- [Binding](#binding)
2930
- [Types of Binding](#types-of-binding)
3031
- [Fetching a Service Binding](#fetching-a-service-binding)
@@ -486,6 +487,7 @@ how Platforms might expose these values to their users.
486487
| schemas | [Schemas](#schemas-object) | Schema definitions for Service Instances and Service Bindings for the Service Plan. |
487488
| maximum_polling_duration | integer | A duration, in seconds, that the Platform SHOULD use as the Service's [maximum polling duration](#polling-interval-and-duration). |
488489
| maintenance_info | [Maintenance Info](#maintenance-info-object) | Maintenance information for a Service Instance which is provisioned using the Service Plan. If provided, a version string MUST be provided and platforms MAY use this when [Provisioning](#provisioning) or [Updating](#updating-a-service-instance) a Service Instance. |
490+
| extensions | array of [Extension](#extensions-object) objects | An array of extensions that the Service Broker MAY return. If specified, the extensions are available on created Service Instances of this Service Plan. |
489491

490492
\* Fields with an asterisk are REQUIRED.
491493

@@ -533,6 +535,16 @@ schema being used.
533535

534536
\* Fields with an asterisk are REQUIRED.
535537

538+
##### Extensions Object
539+
540+
| Response Field | Type | Description |
541+
| --- | --- | --- |
542+
| id* | string | A Uniform Resource Name ([URN](https://tools.ietf.org/html/rfc2141)) that uniquely identifies the extension. It MUST include the namespace identifier(NID) `osbext` and a specific string(NSS) for the extension. For example `urn:osbext:/v1/backup`. |
543+
| description | string | A short description of the service instance extension. If present, MUST be a non-empty string. |
544+
| openapi_url* | string | A URI pointing to a valid [OpenAPI 3.0+](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md) document describing the API extension(s) available on each Service Instance of the Service Plan. If this is an absolute URI then it MUST have no authentication and be publicly available. If this is a relative URI then it is assumed to be hosted on the Service Broker and behind the [Service Broker Authentication](#service-broker-authentication). All [Path Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#pathsObject) MUST be hosted by the Service Broker and MUST be relative to the URL `/v2/service_instances/:instance_id/extensions/:nss` where `:nss` is the namespace specific string(NSS) part of the extension `id`. The Service Broker MUST use the same authentication method used for other Open Service Broker API endpoints.|
545+
546+
\* Fields with an asterisk are REQUIRED.
547+
536548
```
537549
{
538550
"services": [{
@@ -629,7 +641,19 @@ schema being used.
629641
"maintenance_info": {
630642
"version": "2.1.1+abcdef",
631643
"description": "OS image update.\nExpect downtime."
632-
}
644+
},
645+
"extensions": [
646+
{
647+
"id": "urn:osbext:/v1/backup-and-restore",
648+
"description": "backup and restore service instance data",
649+
"openapi_url": "http://example.com/extensions/backup_restore.yaml"
650+
},
651+
{
652+
"id": "urn:osbext:/v1/ping",
653+
"description": "check the health of a service instance",
654+
"openapi_url": "/extensions/ping.yaml"
655+
}
656+
]
633657
}, {
634658
"name": "fake-plan-2",
635659
"id": "0f4008b5-XXXX-XXXX-XXXX-dace631cd648",
@@ -1274,6 +1298,56 @@ For success responses, the following fields are defined:
12741298
}
12751299
```
12761300

1301+
## Service Instance Extensions
1302+
1303+
Service Instance Extensions allow Service Broker authors to define new endpoints
1304+
that act on a Service Instance. This allows Service Broker authors to
1305+
extend the specification for Service specific operations. For example,
1306+
Backup, Restore, Start, Stop and Ping.
1307+
1308+
If the Service Broker has declared Service Instance extensions in the [Catalog](#catalog-management)
1309+
then this route is used as the basepath to trigger the extension(s). The extension path(s)
1310+
relative to this route are defined in the OpenAPI document returned
1311+
in the [Extensions object](#extensions-object).
1312+
1313+
#### Route
1314+
`/v2/service_instances/:instance_id/extensions/:extension_path`
1315+
1316+
`:instance_id` MUST be the ID of a previously provisioned Service Instance.
1317+
1318+
`:extension_path` MUST be the namespace specific string(NSS) part of the extension URN plus the path in the OpenAPI document.
1319+
1320+
For example a Service Broker may define a Service Instance Extension in the [Catalog](#catalog-management):
1321+
1322+
```json
1323+
{
1324+
"id": "urn:osbext:/custom-extension",
1325+
"description": "Allows backing up of service instance data",
1326+
"openapi_url": "/extensions/custom-extension.yaml"
1327+
}
1328+
```
1329+
1330+
Which refers to the following OpenAPI document:
1331+
1332+
```yaml
1333+
openapi: "3.0.0"
1334+
info:
1335+
version: 1.0.0
1336+
title: My Service Extension
1337+
paths:
1338+
/backup:
1339+
post:
1340+
summary: Backup of a service instance
1341+
operationId: backup
1342+
tags:
1343+
- backup
1344+
responses:
1345+
'202':
1346+
description: Backup accepted
1347+
```
1348+
1349+
In this case the broker MUST handle `POST` requests to
1350+
`/v2/service_instances/:instance_id/extensions/custom-extension/backup`.
12771351

12781352
## Binding
12791353

0 commit comments

Comments
 (0)