Skip to content

Commit

Permalink
move attributes to metadata and return metadata on fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
rsampaio committed Oct 27, 2020
1 parent 3306c7f commit 646212c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 18 deletions.
6 changes: 4 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,8 @@ components:
$ref: '#/components/schemas/Object'
maintenance_info:
$ref: '#/components/schemas/MaintenanceInfo'
metadata:
$ref: '#/components/schemas/ServiceInstanceMetadata'

ServiceInstanceProvisionRequest:
type: object
Expand Down Expand Up @@ -784,8 +786,6 @@ components:
properties:
dashboard_url:
type: string
attributes:
type: object
metadata:
$ref: '#/components/schemas/ServiceInstanceMetadata'

Expand All @@ -804,6 +804,8 @@ components:
properties:
labels:
type: object
attributes:
type: object

ServiceInstanceUpdateRequest:
type: object
Expand Down
41 changes: 27 additions & 14 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1004,30 +1004,23 @@ For success responses, the following fields are defined:
| dashboard_url | string | The URL of a web-based management user interface for the Service Instance; we refer to this as a service dashboard. The URL MUST contain enough information for the dashboard to identify the resource being accessed (`9189kdfsk0vfnku` in the example below). Note: a Service Broker that wishes to return `dashboard_url` for a Service Instance MUST return it with the initial response to the provision request, even if the service is provisioned asynchronously. If present, MUST be a string or null. |
| operation | string | For asynchronous responses, Service Brokers MAY return an identifier representing the operation. The value of this field MUST be provided by the Platform with requests to the [Polling Last Operation for Service Instances](#polling-last-operation-for-service-instances) endpoint in a percent-encoded query parameter. If present, MAY be null, and MUST NOT contain more than 10,000 characters. |
| metadata | [ServiceInstanceMetadata](#service-instance-metadata) object | An OPTIONAL object containing metadata for the Service Instance. |
| attributes | object | An OPTIONAL object containing attributes generated by the Broker, attributes will be available in the response body when fetching information about a Service Instance. |
```
{
"dashboard_url": "http://example-dashboard.example.com/9189kdfsk0vfnku",
"operation": "task_10",
"attributes": {
"broker.generated.attribute1": "value1",
"broker.generated.attribute2": "value2"
}
"metadata": {
"labels": {
"key1" : "value1",
"key2" : "value2"
},
attributes: {
"broker.generated.attr1": "value1",
"broker.generated.attr2": "value2"
}
}
}
```

##### Service Instance Metadata

| Response Field | Type | Description |
| --- | --- | --- |
| labels | object | Labels are broker specified key-value pairs specifying attributes of Service Instances that are meaningful and relevant to Platform users, but do not directly imply behaviour changes by the Platform. Platforms that support metadata labels MAY chose to update those, and if they do, they SHOULD replace all existing metadata labels with the labels received during provision or update. The Platform SHOULD ignore labels that do not adhere to the Platforms syntax. |

## Fetching a Service Instance

If `"instances_retrievable" :true` is declared for a Service Offering in the
Expand Down Expand Up @@ -1084,6 +1077,7 @@ For success responses, the following fields are defined:
| dashboard_url | string | The URL of a web-based management user interface for the Service Instance; we refer to this as a service dashboard. The URL MUST contain enough information for the dashboard to identify the resource being accessed (`9189kdfsk0vfnku` in the example below). Note: a Service Broker that wishes to return `dashboard_url` for a Service Instance MUST return it with the initial response to the provision request, even if the service is provisioned asynchronously. |
| parameters | object | Configuration parameters for the Service Instance. |
| maintenance_info | [Maintenance Info](#maintenance-info-object) | If a Service Broker provides maintenance information for a Service Plan in its [Catalog](#catalog-management), a Broker MAY return the maintenance information currently associated with the Service Instance. Any field except for `maintenance_info.version` SHOULD be ignored by the Platform. This field MAY be used by the Platform to inform the end-user of unattended maintenances that were triggered out-of-band and applied to the Service Instance. |
| metadata | [ServiceInstanceMetadata](#service-instance-metadata) object | An OPTIONAL object containing metadata for the Service Instance. |

Service Brokers MAY choose to not return some or all parameters when a Service Instance is fetched - for example,
if it contains sensitive information.
Expand All @@ -1093,9 +1087,16 @@ if it contains sensitive information.
"dashboard_url": "http://example-dashboard.example.com/9189kdfsk0vfnku",
"parameters": {
"billing-account": "abcde12345"
}
"attributes": {
"platfom.generated.attribute": "attribute-value",
},
"metadata": {
"labels": {
"key1" : "value1",
"key2" : "value2"
},
attributes: {
"broker.generated.attr1": "value1",
"broker.generated.attr2": "value2"
}
}
}
```
Expand Down Expand Up @@ -1293,11 +1294,23 @@ For success responses, the following fields are defined:
"labels": {
"key1" : "value1",
"key2" : "value2"
},
attributes: {
"broker.generated.attr1": "value1",
"broker.generated.attr2": "value2"
}
}
}
```

### Service Instance Metadata

| Response Field | Type | Description |
| --- | --- | --- |
| labels | object | Labels are broker specified key-value pairs specifying attributes of Service Instances that are meaningful and relevant to Platform users, but do not directly imply behaviour changes by the Platform. Platforms that support metadata labels MAY chose to update those, and if they do, they SHOULD replace all existing metadata labels with the labels received during provision or update. The Platform SHOULD ignore labels that do not adhere to the Platforms syntax. |
| attributes | object | Attributes are Broker specific key-value pairs generated by the Broker that MAY imply behavior changes by the Platform. Platforms that support attributes MAY chose to update attributes and the new value will be updated in the response body of the FETCH Service Instances. The Platform SHOULD ignore attributes that do not adhere to the Platform supported attribute list. |


## Binding

If `"bindable": true` is declared for a Service Offering or Service Plan in the
Expand Down
6 changes: 4 additions & 2 deletions swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ definitions:
type: object
maintenance_info:
$ref: '#/definitions/MaintenanceInfo'
metadata:
$ref: '#/definitions/ServiceInstanceMetadata'
ServiceInstanceProvisionRequest:
type: object
required:
Expand Down Expand Up @@ -636,8 +638,6 @@ definitions:
properties:
dashboard_url:
type: string
attributes:
type: object
metadata:
$ref: '#/definitions/ServiceInstanceMetadata'
ServiceInstanceAsyncOperation:
Expand Down Expand Up @@ -809,6 +809,8 @@ definitions:
properties:
labels:
type: object
attributes:
type: object
MaintenanceInfo:
type: object
properties:
Expand Down

0 comments on commit 646212c

Please sign in to comment.