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": "d07fb13a-7507-4ca9-b3c9-23a17b39f128",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQzOCIsImVtYWlsIjoiZW1haWwtMzA2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5NDZ9.N4o8nW-lu366JykUdPFtJQo7GLSXsvyGo-Kd793RCA4
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": "d07fb13a-7507-4ca9-b3c9-23a17b39f128",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQzOCIsImVtYWlsIjoiZW1haWwtMzA2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5NDZ9.N4o8nW-lu366JykUdPFtJQo7GLSXsvyGo-Kd793RCA4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "60711bf4-650f-4865-8ae7-48c55b591ca3",
    "url": "/v2/user_provided_service_instances/60711bf4-650f-4865-8ae7-48c55b591ca3",
    "created_at": "2015-10-07T00:35:46Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "d07fb13a-7507-4ca9-b3c9-23a17b39f128",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/d07fb13a-7507-4ca9-b3c9-23a17b39f128",
    "service_bindings_url": "/v2/user_provided_service_instances/60711bf4-650f-4865-8ae7-48c55b591ca3/service_bindings"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/user_provided_service_instances/60711bf4-650f-4865-8ae7-48c55b591ca3
X-VCAP-Request-ID: 6bdb8f66-ff92-4938-9054-51f03f88bd84
Content-Length: 684
X-Content-Type-Options: nosniff