Brooklyn Service Broker - new features part 1

This summer, we’ve been busy adding new features to the Brooklyn Service Broker that make use of some of the new additions to the service broker API.  We’ve added support for parameterized services in two important ways: first, supplying configuration to blueprints; and secondly, as a means of submitting a blueprint without adding it to Brooklyn’s catalog first.  We’ve added asynchronous provisioning for a cleaner interaction experience, and finally, we’ve added a mechanism for defining plans inside catalog blueprints themselves rather than simply using locations.

Parameterized services

Introduced in 2.5, parameterized services allow users to submit a JSON object with a provision command.  In the Brooklyn Service Broker, we pass this JSON into a brooklyn.config section of the generated blueprint. E.g.

$cf create-service br_mongodb aws_california mongodb-aws -c '{"mongodb.server.port":"20000"}'

generates the following blueprint to be deployed on Brooklyn:

{"services":["type":"com.cloudsoft.development.mongodb:1.0"],
"locations": ["aws-california"],"brooklyn.config":{"mongodb.server.port":"20000"}}

This allows us to avoid filling the catalog with lots of slightly differently configured blueprints.  For a full list of configuration options see the catalog of Brooklyn Entities.

Asynchronous provisioning

In previous versions, the status of the provisioning brooklyn service could be queried through an additional endpoint – either using a curl command or through the brooklyn plugin – so that the service is not bound before all sensors are ready.  But with the addition of the asynchronous operations API this is handled natively.

$cf create-service br_mongodb aws_california mongodb-aws
Creating service instance mongodb-aws in org me / space development as admin...
OK

Create in progress. Use 'cf services' or 'cf service mongodb-aws' to check operation status.

$cf services
Getting services in org me / space development as admin...
OK
name        service         plan               bound apps   last operation   
mongodb-aws br_mongodb      aws_california                  create in progress

Once the service is ready

$cf services
Getting services in org me / space development as admin...
OK
name        service         plan               bound apps   last operation
mongodb-aws br_mongodb      aws_california                  create succeeded

Video

To wrap up this post here is a video these features in action.

Next

In part 2 we are going to look at defining plans inside the Brooklyn Catalog entry in YAML, and launching a user-defined-service bypassing Brooklyn’s catalog all together for rapid development of services.

Thanks

Special thanks go out to Scott Frederick who help out with adding Parameterized Services to the spring-boot-cf-service-broker project on which the Brooklyn Service Broker depends, and to Josh Kruck for Asynchronous Operations to the same project.