User Provided Service Instances API

Creating a User Provided Service Instance

POST /v2/user_provided_service_instances/

Request

Route

POST /v2/user_provided_service_instances

Body

Name Description Default Valid Values Example Values
name A name for the service instance
  • my-user-provided-instance
space_guid The guid of the space in which the instance will be created
syslog_drain_url URL to which logs will be streamed for bound applications.
  • syslog://example.com
credentials A hash exposed in the VCAP_SERVICES environment variable for bound applications.
  • {:somekey=>"somevalue"}
route_service_url URL to which requests for bound routes will be forwarded.
  • https://logger.example.com
tags A list of tags for the service instance. Max characters: 2048 []
  • ["db"]
  • ["accounting", "mongodb"]
{
  "space_guid": "d5d30998-48ea-4499-9d10-80a8af005aca",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com",
  "route_service_url": "https://logger.example.com",
  "tags": ["accounting", "mongodb"]
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MyIsImVtYWlsIjoiZW1haWwtMTQ4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTN9.3e7tZmyp9P6Ca_KFYwIg_6e4zO6k96Avm0y6ghyV7LU
Host: example.org
Content-Type: application/json
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/user_provided_service_instances" -d '{
  "space_guid": "d5d30998-48ea-4499-9d10-80a8af005aca",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com",
  "route_service_url": "https://logger.example.com",
  "tags": ["accounting", "mongodb"]
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MyIsImVtYWlsIjoiZW1haWwtMTQ4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTN9.3e7tZmyp9P6Ca_KFYwIg_6e4zO6k96Avm0y6ghyV7LU" \
	-H "Host: example.org" \
	-H "Content-Type: application/json" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "d7facf53-dbff-470c-a032-9ea9b8be12f1",
    "url": "/v2/user_provided_service_instances/d7facf53-dbff-470c-a032-9ea9b8be12f1",
    "created_at": "2016-06-08T16:41:33Z",
    "updated_at": "2016-06-08T16:41:26Z"
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "d5d30998-48ea-4499-9d10-80a8af005aca",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "route_service_url": "https://logger.example.com",
    "tags": ["accounting", "mongodb"],
    "space_url": "/v2/spaces/d5d30998-48ea-4499-9d10-80a8af005aca",
    "service_bindings_url": "/v2/user_provided_service_instances/d7facf53-dbff-470c-a032-9ea9b8be12f1/service_bindings",
    "routes_url": "/v2/user_provided_service_instances/d7facf53-dbff-470c-a032-9ea9b8be12f1/routes"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/user_provided_service_instances/d7facf53-dbff-470c-a032-9ea9b8be12f1
X-VCAP-Request-ID: 424525dc-4ab6-4ec0-abd4-ad1de31d0907
Content-Length: 840
X-Content-Type-Options: nosniff