Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service broker create binding schema #866

Merged
merged 1 commit into from
Aug 4, 2017

Conversation

Samze
Copy link
Contributor

@Samze Samze commented Aug 4, 2017

Why

The Open Service Broker API is proposing allowing brokers to define JSON schema for their configuration parameters. This will allow tooling to validate parameters and UIs to auto generate forms.

Schemas are to be defined as part of the catalog on a plan and support create/update parameters on a service instance and create parameters on a service binding (update does not exist yet).

The updated spec can be found here.

Example of what a new catalog with schemas will look like:

{
     ....
	"plans": [{
		"name": "fake-plan-1",
		"id": "d3031751-XXXX-XXXX-XXXX-a42377d3320e",
		"description": "Shared fake Server, 5tb persistent disk, 40 max concurrent connections",
		"schemas": {
			"service_instance": {
				"create": {
					"parameters": {
						"$schema": "http://json-schema.org/draft-04/schema#",
						"type": "object",
						"properties": {
							"billing-account": {
								"description": "Billing account number used to charge use of shared fake server.",
								"type": "string"
							}
						}
					}
				},
				"update": {
					"parameters": {
						"$schema": "http://json-schema.org/draft-04/schema#",
						"type": "object",
						"properties": {
							"billing-account": {
								"description": "Billing account number used to charge use of shared fake server.",
								"type": "string"
							}
						}
					}
				}
			},
			"service_binding": {
				"create": {
					"parameters": {
						"$schema": "http://json-schema.org/draft-04/schema#",
						"type": "object",
						"properties": {
							"billing-account": {
								"description": "Billing account number used to charge use of shared fake server.",
								"type": "string"
							}
						}
					}
				}
			}
		}
	}]
}

What

This PR just adds basic support for create binding schemas (create instance schemas functionality merged in #834 & update instance schema merged in #865). Schemas are parsed during registration, stored in the service plan model and retrieved on the /v2/service_plan/:guid api endpoint. If a broker does not provide a schema, then we default to an empty schema.

  • Add create_binding_schema to plan model object
  • Add migration to service_plans to include text blob for create_binding_schema
  • Add support for create binding schema to catalog objects retrieved from broker.
  • Change service_plans presenter to support create binding schemas
  • Added create binding schema tests to the 2.13 service broker api spec

Notes

  1. This PR is an extension of the Service broker create instance schemas #834 & Service Broker Create Service Instance Schema Validation #847 & Service broker update instance schemas #865
  2. We have no updated the docs yet as this is still an experimental change.
    Feedback appreciated!

PR

  • I have viewed signed and have submitted the Contributor License Agreement
  • I have made this pull request to the master branch
  • I have run all the unit tests using bundle exec rake
  • I have run CF Acceptance Tests on bosh lite
    Sam

[#145580773]

Signed-off-by: Alex Blease <[email protected]>
@cfdreddbot
Copy link

Hey Samze!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/149960857

The labels on this github issue will be updated when the story is started.

@tusing tusing merged commit c12ec74 into cloudfoundry:master Aug 4, 2017
@tusing
Copy link
Contributor

tusing commented Aug 4, 2017

Thanks for the PR, @Samze!

@matt-royal && @tusing - CF CAPI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants