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": "56fdf0b6-37cf-47be-8326-c3fcefb6d353",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTY4IiwiZW1haWwiOiJlbWFpbC0zOUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI5NjY0MTM0fQ._RKu7lNJcT8pf7F51AWHoaj8IQEuGB9589HQJ8CQ5Fg
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": "56fdf0b6-37cf-47be-8326-c3fcefb6d353",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTY4IiwiZW1haWwiOiJlbWFpbC0zOUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI5NjY0MTM0fQ._RKu7lNJcT8pf7F51AWHoaj8IQEuGB9589HQJ8CQ5Fg" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "155984a6-5c68-42b1-bd7e-a5657570433a",
    "url": "/v2/user_provided_service_instances/155984a6-5c68-42b1-bd7e-a5657570433a",
    "created_at": "2015-04-15T00:55:34Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "56fdf0b6-37cf-47be-8326-c3fcefb6d353",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/56fdf0b6-37cf-47be-8326-c3fcefb6d353",
    "service_bindings_url": "/v2/user_provided_service_instances/155984a6-5c68-42b1-bd7e-a5657570433a/service_bindings"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/user_provided_service_instances/155984a6-5c68-42b1-bd7e-a5657570433a
X-VCAP-Request-ID: 63c0b83a-679a-4f0c-b6dc-079c6004e25b
Content-Length: 684
X-Content-Type-Options: nosniff