Home
Version 3
Service Instances API

Service Instances API

Creating a Service Instance

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.eyJ1c2VyX2lkIjoidWFhLWlkLTMzMiIsImVtYWlsIjoiZW1haWwtMjM1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzV9.OsYtqogxVXINHRVPHfwZO-rjxKqxv18ffeu642pMnKQ
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/service_instances

Body

{
  "space_guid": "ee417c45-62f9-4a14-a667-999c19dfd6c4",
  "name": "my-service-instance",
  "service_plan_guid": "72eadeb4-dadb-4031-8b5e-ed450e222dcb"
}

cURL

curl "https://api.[your-domain.com]/v2/service_instances" -d '{
  "space_guid": "ee417c45-62f9-4a14-a667-999c19dfd6c4",
  "name": "my-service-instance",
  "service_plan_guid": "72eadeb4-dadb-4031-8b5e-ed450e222dcb"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMzMiIsImVtYWlsIjoiZW1haWwtMjM1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzV9.OsYtqogxVXINHRVPHfwZO-rjxKqxv18ffeu642pMnKQ" \
	-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/dd87a52e-da61-457d-99b7-af3d97667e7d
X-VCAP-Request-ID: 05ee72ed-6590-454b-8255-e64090aab465
Content-Length: 994
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "dd87a52e-da61-457d-99b7-af3d97667e7d",
    "url": "/v2/service_instances/dd87a52e-da61-457d-99b7-af3d97667e7d",
    "created_at": "2015-02-10T01:42:55Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {
      "creds-key-502": "creds-val-502"
    },
    "service_plan_guid": "72eadeb4-dadb-4031-8b5e-ed450e222dcb",
    "space_guid": "ee417c45-62f9-4a14-a667-999c19dfd6c4",
    "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/ee417c45-62f9-4a14-a667-999c19dfd6c4",
    "service_plan_url": "/v2/service_plans/72eadeb4-dadb-4031-8b5e-ed450e222dcb",
    "service_bindings_url": "/v2/service_instances/dd87a52e-da61-457d-99b7-af3d97667e7d/service_bindings"
  }
}