Skip to content

Commit 763f8c4

Browse files
georgi-lozevSamze
andcommitted
Add service instance generic extensions
Signed-off-by: Sam Gunaratne <[email protected]> Co-authored-by: Sam Gunaratne <[email protected]>
1 parent 6539dcc commit 763f8c4

File tree

1 file changed

+70
-1
lines changed

1 file changed

+70
-1
lines changed

spec.md

Lines changed: 70 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)
@@ -505,6 +506,7 @@ how Platforms might expose these values to their users.
505506
| schemas | [Schemas](#schemas-object) | Schema definitions for Service Instances and Service Bindings for the Service Plan. |
506507
| maximum_polling_duration | integer | A duration, in seconds, that the Platform SHOULD use as the Service's [maximum polling duration](#polling-interval-and-duration). |
507508
| 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. |
509+
| 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. |
508510

509511
\* Fields with an asterisk are REQUIRED.
510512

@@ -550,6 +552,16 @@ schema being used.
550552
| version | string | This MUST be a string conforming to a semantic version. The Platform MAY use this field to determine whether a maintenance update is available for a Service Instance. |
551553
| description | string | This SHOULD be a string describing the impact of the maintenance update, for example, important version changes, configuration changes, default value changes, etc. The Platform MAY present this information to the user before they trigger the maintenance update. |
552554

555+
##### Extensions Object
556+
557+
| Response Field | Type | Description |
558+
| --- | --- | --- |
559+
| 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`. |
560+
| description | string | A short user-facing description of the Service Instance Extension. If present, MUST be a non-empty string. |
561+
| 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](#platform-to-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. |
562+
563+
\* Fields with an asterisk are REQUIRED.
564+
553565
```
554566
{
555567
"services": [{
@@ -646,7 +658,15 @@ schema being used.
646658
"maintenance_info": {
647659
"version": "2.1.1+abcdef",
648660
"description": "OS image update.\nExpect downtime."
649-
}
661+
},
662+
"extensions": [{
663+
"id": "urn:osbext:/v1/backup-and-restore",
664+
"openapi_url": "http://example.com/extensions/backup_restore.yaml"
665+
},
666+
{
667+
"id": "urn:osbext:/v1/ping",
668+
"openapi_url": "/extensions/ping.yaml"
669+
}]
650670
}, {
651671
"name": "fake-plan-2",
652672
"id": "0f4008b5-XXXX-XXXX-XXXX-dace631cd648",
@@ -1250,6 +1270,55 @@ For success responses, the following fields are defined:
12501270
}
12511271
```
12521272

1273+
## Service Instance Extensions
1274+
1275+
Service Instance Extensions allow Service Broker authors to define new endpoints
1276+
that act on a Service Instance. This allows Service Broker authors to
1277+
extend the specification for Service specific operations. For example,
1278+
Backup, Restore, Start, Stop and Ping.
1279+
1280+
If the Service Broker has declared Service Instance extensions in the [Catalog](#catalog-management)
1281+
then this route is used as the basepath to trigger the extension(s). The extension path(s)
1282+
relative to this route are defined in the OpenAPI document returned
1283+
in the [Extensions object](#extensions-object).
1284+
1285+
#### Route
1286+
`/v2/service_instances/:instance_id/extensions/:extension_path`
1287+
1288+
`:instance_id` MUST be the ID of a previously provisioned Service Instance.
1289+
1290+
`:extension_path` MUST be the namespace specific string(NSS) part of the extension URN plus the path in the OpenAPI document.
1291+
1292+
For example a Service Broker MAY define a Service Instance Extension in the [Catalog](#catalog-management):
1293+
1294+
```json
1295+
{
1296+
"id": "urn:osbext:/custom-extension",
1297+
"openapi_url": "/extensions/custom-extension.yaml"
1298+
}
1299+
```
1300+
1301+
Which refers to the following OpenAPI document:
1302+
1303+
```yaml
1304+
openapi: "3.0.0"
1305+
info:
1306+
version: 1.0.0
1307+
title: My Service Extension
1308+
paths:
1309+
/backup:
1310+
post:
1311+
summary: Backup of a Service Instance
1312+
operationId: backup
1313+
tags:
1314+
- backup
1315+
responses:
1316+
'202':
1317+
description: Backup accepted
1318+
```
1319+
1320+
In this case the broker MUST handle `POST` requests to
1321+
`/v2/service_instances/:instance_id/extensions/custom-extension/backup`.
12531322

12541323
## Binding
12551324

0 commit comments

Comments
 (0)