Home
Version 3
Service Bindings API

Service Bindings API

Create a Service Binding

POST /v2/service_bindings

Request

Route

POST /v2/service_bindings

Body

Name Description Default Valid Values Example Values
service_instance_guid The guid of the service instance to bind
app_guid The guid of the app to bind
binding_options A hash of options that are passed to v1 brokers
parameters Arbitrary parameters to pass along to the service broker. Must be a JSON object
{
  "service_instance_guid": "e61869b5-e28e-49d4-9315-797b350a0c92",
  "app_guid": "8bea984f-82ab-411c-9c38-8dc111bf5610",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIxNyIsImVtYWlsIjoiZW1haWwtMTQ1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3MTZ9.fqLRZrWmzjDyamNPAdqP__YajS5ez_IBkQOWZaFGlio
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/service_bindings" -d '{
  "service_instance_guid": "e61869b5-e28e-49d4-9315-797b350a0c92",
  "app_guid": "8bea984f-82ab-411c-9c38-8dc111bf5610",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIxNyIsImVtYWlsIjoiZW1haWwtMTQ1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3MTZ9.fqLRZrWmzjDyamNPAdqP__YajS5ez_IBkQOWZaFGlio" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "8ed4029b-251a-41d3-95ee-55cf3a1817d4",
    "url": "/v2/service_bindings/8ed4029b-251a-41d3-95ee-55cf3a1817d4",
    "created_at": "2016-05-12T00:45:16Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "8bea984f-82ab-411c-9c38-8dc111bf5610",
    "service_instance_guid": "e61869b5-e28e-49d4-9315-797b350a0c92",
    "credentials": {
      "creds-key-32": "creds-val-32"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "volume_mounts": [

    ],
    "app_url": "/v2/apps/8bea984f-82ab-411c-9c38-8dc111bf5610",
    "service_instance_url": "/v2/user_provided_service_instances/e61869b5-e28e-49d4-9315-797b350a0c92"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/8ed4029b-251a-41d3-95ee-55cf3a1817d4
X-VCAP-Request-ID: 34e09345-026e-4775-987c-bd7fbe6bd333
Content-Length: 732
X-Content-Type-Options: nosniff