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.eyJ1c2VyX2lkIjoidWFhLWlkLTMzMyIsImVtYWlsIjoiZW1haWwtMjM2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzV9.sDwbzXc0SV5xaFAOhQn_WwB3wW3aayLV5O5QyByL_Ko
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": "3bafbb4f-6f3e-4695-9d98-c32705f29710",
  "name": "my-service-instance",
  "service_plan_guid": "81191423-3900-43b9-bb34-16c98d17892a"
}

cURL

curl "https://api.[your-domain.com]/v2/service_instances?accepts_incomplete=true" -d '{
  "space_guid": "3bafbb4f-6f3e-4695-9d98-c32705f29710",
  "name": "my-service-instance",
  "service_plan_guid": "81191423-3900-43b9-bb34-16c98d17892a"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMzMyIsImVtYWlsIjoiZW1haWwtMjM2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzV9.sDwbzXc0SV5xaFAOhQn_WwB3wW3aayLV5O5QyByL_Ko" \
	-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/33c73b8f-8d55-410a-b9b1-aca389a9bf60
X-VCAP-Request-ID: fe56339c-f289-43b0-9061-eb653b4b2abe
Content-Length: 994
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "33c73b8f-8d55-410a-b9b1-aca389a9bf60",
    "url": "/v2/service_instances/33c73b8f-8d55-410a-b9b1-aca389a9bf60",
    "created_at": "2015-02-10T01:42:55Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {
      "creds-key-505": "creds-val-505"
    },
    "service_plan_guid": "81191423-3900-43b9-bb34-16c98d17892a",
    "space_guid": "3bafbb4f-6f3e-4695-9d98-c32705f29710",
    "gateway_data": "CONFIGURATION",
    "dashboard_url": "http://dashboard.example.com",
    "type": "managed_service_instance",
    "last_operation": {
      "type": "create",
      "state": "succeeded",
      "description": "",
      "updated_at": "2015-02-10T01:42:55Z"
    },
    "space_url": "/v2/spaces/3bafbb4f-6f3e-4695-9d98-c32705f29710",
    "service_plan_url": "/v2/service_plans/81191423-3900-43b9-bb34-16c98d17892a",
    "service_bindings_url": "/v2/service_instances/33c73b8f-8d55-410a-b9b1-aca389a9bf60/service_bindings"
  }
}