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.eyJ1c2VyX2lkIjoidWFhLWlkLTEwNCIsImVtYWlsIjoiZW1haWwtNzVAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyMjk5MDg3MH0.D0Zp9xhgeZ13CdlRdUQzT_nSZh2ET5lP3zyME92PN8c
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": "2a6f859f-5fe1-4d50-9301-b9c84280e2ac",
  "name": "my-service-instance",
  "service_plan_guid": "aee94419-edbb-432d-9f93-7f13bca4d9c2"
}

cURL

curl "https://api.[your-domain.com]/v2/service_instances?accepts_incomplete=true" -d '{
  "space_guid": "2a6f859f-5fe1-4d50-9301-b9c84280e2ac",
  "name": "my-service-instance",
  "service_plan_guid": "aee94419-edbb-432d-9f93-7f13bca4d9c2"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwNCIsImVtYWlsIjoiZW1haWwtNzVAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyMjk5MDg3MH0.D0Zp9xhgeZ13CdlRdUQzT_nSZh2ET5lP3zyME92PN8c" \
	-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/8da8b84d-f245-449a-9248-453a3686cfa6
X-VCAP-Request-ID: fa5c894a-3dfc-4f15-9db2-436fa3767140
Content-Length: 893
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "8da8b84d-f245-449a-9248-453a3686cfa6",
    "url": "/v2/service_instances/8da8b84d-f245-449a-9248-453a3686cfa6",
    "created_at": "2015-01-27T19:14:30Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {
      "creds-key-167": "creds-val-167"
    },
    "service_plan_guid": "aee94419-edbb-432d-9f93-7f13bca4d9c2",
    "space_guid": "2a6f859f-5fe1-4d50-9301-b9c84280e2ac",
    "gateway_data": "CONFIGURATION",
    "dashboard_url": "http://dashboard.example.com",
    "type": "managed_service_instance",
    "state": null,
    "state_description": null,
    "space_url": "/v2/spaces/2a6f859f-5fe1-4d50-9301-b9c84280e2ac",
    "service_plan_url": "/v2/service_plans/aee94419-edbb-432d-9f93-7f13bca4d9c2",
    "service_bindings_url": "/v2/service_instances/8da8b84d-f245-449a-9248-453a3686cfa6/service_bindings"
  }
}