Home
Version 3
User Provided Service Instances API

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 The url for the syslog_drain to direct to
  • syslog://example.com
credentials A hash that can be used to store credentials
  • {:somekey=>"somevalue"}
{
  "space_guid": "e89c571c-7f69-4933-989b-3534dc5144d5",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2OSIsImVtYWlsIjoiZW1haWwtMTc5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMDZ9.o8o5PlfLEQ-NgIEhPBoXP2Qx1KCD_dIPCmN0khBvOao
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/user_provided_service_instances" -d '{
  "space_guid": "e89c571c-7f69-4933-989b-3534dc5144d5",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2OSIsImVtYWlsIjoiZW1haWwtMTc5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMDZ9.o8o5PlfLEQ-NgIEhPBoXP2Qx1KCD_dIPCmN0khBvOao" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "5773c806-57ea-4213-9146-4030739b8174",
    "url": "/v2/user_provided_service_instances/5773c806-57ea-4213-9146-4030739b8174",
    "created_at": "2015-08-06T00:36:46Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "e89c571c-7f69-4933-989b-3534dc5144d5",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/e89c571c-7f69-4933-989b-3534dc5144d5",
    "service_bindings_url": "/v2/user_provided_service_instances/5773c806-57ea-4213-9146-4030739b8174/service_bindings"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/user_provided_service_instances/5773c806-57ea-4213-9146-4030739b8174
X-VCAP-Request-ID: f18d3706-9f7d-483b-9050-1121493b7222
Content-Length: 684
X-Content-Type-Options: nosniff