Using Cloudflare Service Broker for PCF

Using Cloudflare Service Broker for PCF

Example cURL Calls

In the examples below, the following attributes are replaced with the corresponding values:

  • username is username
  • password is password
  • broker-url is localhost
  • port is 9000
  • instance_id is 1

Service

curl -H "X-Broker-API-Version: 2.10" http://username:password@localhost:9000/v2/catalog

Provision

curl http://username:password@localhost:9000/v2/service_instances/1 -d '{
  "organization_guid": "org-guid-here",
  "plan_id":           "plan-guid-here",
  "service_id":        "service-guid-here",
  "space_guid":        "space-guid-here",
  "parameters":        {
    "x-auth-key": "mykey",
    "x-auth-email": "email@email.com"
  }
}' -X PUT -H "X-Broker-API-Version: 2.10" -H "Content-Type: application/json"

Deprovision

curl 'http://username:password@localhost:9000/v2/service_instances/1?service_id=service-id-here&plan_id=plan-id-here' -X DELETE -H "X-Broker-API-Version: 2.10"

Bind

  • Assumed binding_id as 2
curl http://username:password@localhost:9000/v2/service_instances/1/service_bindings/2 -d '{
  "plan_id":      "plan-guid-here",
  "service_id":   "service-guid-here",
  "app_guid":     "app-guid-here",
  "bind_resource":     {
    "app_guid": "app-guid-here"
  },
  "parameters":        {
    "domain": "domain.com"
  }
}' -X PUT

Unbind

  • Assumed binding_id as 2
curl 'http://username:password@localhost:9000/v2/service_instances/1/service_bindings/2?service_id=service-id-here&plan_id=plan-id-here' -X DELETE -H "X-Broker-API-Version: 2.10"

Last Operation (Not Supported)

curl http://username:password@localhost:9000/v2/service_instances/1/last_operation

Update (Not Supported)

curl http://username:password@localhost:9000/v2/service_instances/1 -d '{
  "service_id": "service-guid-here",
  "plan_id": "plan-guid-here",
  "parameters":        {
    "parameter1": 1,
    "parameter2": "value"
  },
  "previous_values": {
    "plan_id": "old-plan-guid-here",
    "service_id": "service-guid-here",
    "organization_id": "org-guid-here",
    "space_id": "space-guid-here"
  }
}' -X PATCH -H "X-Broker-API-Version: 2.10" -H "Content-Type: application/json"
Create a pull request or raise an issue on the source for this page in GitHub