Home
Version 3
Service Instances API

Service Instances API

Creating a Service Instance asynchronously

POST /v2/service_instances/

Fields

Name Description Default Valid Values Example Values
name A name for the service instance
  • my-service-instance
service_plan_guid The guid of the service plan to associate with the instance
space_guid The guid of the space in which the instance will be created
gateway_data Configuration information for the broker gateway in v1 services

Parameters

Name Description Valid Values Example Values
accepts_incomplete Set to `true` if the client allows asynchronous provisioning. The cloud controller may respond before the service is ready for use.
  • true
  • false

Request

Headers

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

Route

POST /v2/service_instances?accepts_incomplete=true

Query Parameters

accepts_incomplete: true

Body

{
  "space_guid": "17f2c89c-1e50-4770-9746-c1a06e5aa943",
  "name": "my-service-instance",
  "service_plan_guid": "b554c5af-6f0b-4c5b-8574-01e626a65e1a"
}

cURL

curl "https://api.[your-domain.com]/v2/service_instances?accepts_incomplete=true" -d '{
  "space_guid": "17f2c89c-1e50-4770-9746-c1a06e5aa943",
  "name": "my-service-instance",
  "service_plan_guid": "b554c5af-6f0b-4c5b-8574-01e626a65e1a"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIxNiIsImVtYWlsIjoiZW1haWwtMTQ4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQ0NzE2OTd9.wPuGEMNt7JfmwiA4mosHANHg4Pc5Y1F4AzLh4f4z7XQ" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_instances/a06746c7-168e-4656-99b3-4164c63d80f1
X-VCAP-Request-ID: 8143c3d4-b15f-4758-92eb-74687d0ea20f
Content-Length: 994
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "a06746c7-168e-4656-99b3-4164c63d80f1",
    "url": "/v2/service_instances/a06746c7-168e-4656-99b3-4164c63d80f1",
    "created_at": "2015-02-13T22:34:57Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {
      "creds-key-329": "creds-val-329"
    },
    "service_plan_guid": "b554c5af-6f0b-4c5b-8574-01e626a65e1a",
    "space_guid": "17f2c89c-1e50-4770-9746-c1a06e5aa943",
    "gateway_data": "CONFIGURATION",
    "dashboard_url": "http://dashboard.example.com",
    "type": "managed_service_instance",
    "last_operation": {
      "type": "create",
      "state": "succeeded",
      "description": "",
      "updated_at": "2015-02-13T22:34:57Z"
    },
    "space_url": "/v2/spaces/17f2c89c-1e50-4770-9746-c1a06e5aa943",
    "service_plan_url": "/v2/service_plans/b554c5af-6f0b-4c5b-8574-01e626a65e1a",
    "service_bindings_url": "/v2/service_instances/a06746c7-168e-4656-99b3-4164c63d80f1/service_bindings"
  }
}