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.eyJ1c2VyX2lkIjoidWFhLWlkLTk3IiwiZW1haWwiOiJlbWFpbC02OEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0MzEwMTIzfQ.72G7aQ-IOSMfogwUlZCq9HQt-1nnSgo4PMTQmE2mJlU
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": "68636519-e80b-4bee-b745-3c504da2933c",
  "name": "my-service-instance",
  "service_plan_guid": "2496083e-bddc-4ffd-8ab7-09d6e2f92ddb"
}

cURL

curl "https://api.[your-domain.com]/v2/service_instances?accepts_incomplete=true" -d '{
  "space_guid": "68636519-e80b-4bee-b745-3c504da2933c",
  "name": "my-service-instance",
  "service_plan_guid": "2496083e-bddc-4ffd-8ab7-09d6e2f92ddb"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTk3IiwiZW1haWwiOiJlbWFpbC02OEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0MzEwMTIzfQ.72G7aQ-IOSMfogwUlZCq9HQt-1nnSgo4PMTQmE2mJlU" \
	-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/e031f3a2-8b41-422e-97ab-64c5683df88d
X-VCAP-Request-ID: 706bde43-e3bd-4795-9301-397315550ba4
Content-Length: 994
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "e031f3a2-8b41-422e-97ab-64c5683df88d",
    "url": "/v2/service_instances/e031f3a2-8b41-422e-97ab-64c5683df88d",
    "created_at": "2015-02-12T01:42:03Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {
      "creds-key-145": "creds-val-145"
    },
    "service_plan_guid": "2496083e-bddc-4ffd-8ab7-09d6e2f92ddb",
    "space_guid": "68636519-e80b-4bee-b745-3c504da2933c",
    "gateway_data": "CONFIGURATION",
    "dashboard_url": "http://dashboard.example.com",
    "type": "managed_service_instance",
    "last_operation": {
      "type": "create",
      "state": "succeeded",
      "description": "",
      "updated_at": "2015-02-12T01:42:03Z"
    },
    "space_url": "/v2/spaces/68636519-e80b-4bee-b745-3c504da2933c",
    "service_plan_url": "/v2/service_plans/2496083e-bddc-4ffd-8ab7-09d6e2f92ddb",
    "service_bindings_url": "/v2/service_instances/e031f3a2-8b41-422e-97ab-64c5683df88d/service_bindings"
  }
}