Home
Version 3
Service Instances API

Service Instances API

Creating a Service Instance

POST /v2/service_instances/

Request

Route

POST /v2/service_instances?accepts_incomplete=true

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
accepts_incomplete: true

Body

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
parameters Arbitrary parameters to pass along to the service broker. Must be a JSON object
gateway_data Configuration information for the broker gateway in v1 services
tags A list of tags for the service instance. Max characters: 2048 []
  • ["db"]
  • ["accounting", "mongodb"]
{
  "space_guid": "f9582120-5be8-45fb-b75c-4607d6559d70",
  "name": "my-service-instance",
  "service_plan_guid": "f43a0cfe-515d-4f54-9aef-13c427438ffb",
  "parameters": {
    "the_service_broker": "wants this object"
  },
  "tags": [
    "accounting",
    "mongodb"
  ]
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMyMCIsImVtYWlsIjoiZW1haWwtMjIwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODd9.vgyZVIhD3bS0S519yiGuWj72l-TKu2IW5U5mBuRYV3U
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/service_instances?accepts_incomplete=true" -d '{
  "space_guid": "f9582120-5be8-45fb-b75c-4607d6559d70",
  "name": "my-service-instance",
  "service_plan_guid": "f43a0cfe-515d-4f54-9aef-13c427438ffb",
  "parameters": {
    "the_service_broker": "wants this object"
  },
  "tags": [
    "accounting",
    "mongodb"
  ]
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMyMCIsImVtYWlsIjoiZW1haWwtMjIwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODd9.vgyZVIhD3bS0S519yiGuWj72l-TKu2IW5U5mBuRYV3U" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

202 Accepted

Body

Name Description Valid Values
name The human-readable name of the service instance.
credentials The service broker-provided credentials to use this service.
service_plan_guid The service plan GUID that this service instance is utilizing.
space_guid The space GUID that this service instance belongs to.
gateway_data
dashboard_url The service broker-provided URL to access administrative features of the service instance. May be null.
type The type of service instance.
  • managed_service_instance
  • user_provided_service_instance
last_operation The status of the last operation requested on the service instance. May be null.
last_operation.type The type of operation that was last performed or currently being performed on the service instance
  • create
  • update
  • delete
last_operation.state The status of the last operation or current operation being performed on the service instance.
  • in progress
  • succeeded
  • failed
last_operation.description The service broker-provided description of the operation. May be null.
last_operation.updated_at The timestamp that the Cloud Controller last checked the service instance state from the broker.
space_url The relative path to the space resource that this service instance belongs to.
service_plan_url The relative path to the service plan resource that this service instance belongs to.
service_binding_url The relative path to the service bindings that this service instance is bound to.
routes_url Routes bound to the service instance. Requests to these routes will be forwarded to the service instance.
tags A list of tags for the service instance
{
  "metadata": {
    "guid": "c4341c97-24a8-4a8c-996f-fd47f7fab0ef",
    "url": "/v2/service_instances/c4341c97-24a8-4a8c-996f-fd47f7fab0ef",
    "created_at": "2016-01-13T17:29:47Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {

    },
    "service_plan_guid": "f43a0cfe-515d-4f54-9aef-13c427438ffb",
    "space_guid": "f9582120-5be8-45fb-b75c-4607d6559d70",
    "gateway_data": null,
    "dashboard_url": null,
    "type": "managed_service_instance",
    "last_operation": {
      "type": "create",
      "state": "in progress",
      "description": "",
      "updated_at": null,
      "created_at": "2016-01-13T17:29:47Z"
    },
    "tags": [
      "accounting",
      "mongodb"
    ],
    "space_url": "/v2/spaces/f9582120-5be8-45fb-b75c-4607d6559d70",
    "service_plan_url": "/v2/service_plans/f43a0cfe-515d-4f54-9aef-13c427438ffb",
    "service_bindings_url": "/v2/service_instances/c4341c97-24a8-4a8c-996f-fd47f7fab0ef/service_bindings",
    "service_keys_url": "/v2/service_instances/c4341c97-24a8-4a8c-996f-fd47f7fab0ef/service_keys",
    "routes_url": "/v2/service_instances/c4341c97-24a8-4a8c-996f-fd47f7fab0ef/routes"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_instances/c4341c97-24a8-4a8c-996f-fd47f7fab0ef
X-VCAP-Request-ID: 
Content-Length: 1190
X-Content-Type-Options: nosniff