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": "aefeb7b8-dda1-4041-9838-a9de76ca25ca",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTcxIiwiZW1haWwiOiJlbWFpbC03MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDMyMzEzNjA4fQ.7UaFapA9_GTlcyZhwiO39LcOBvvi-VHyu4cLBtBTbH4
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": "aefeb7b8-dda1-4041-9838-a9de76ca25ca",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTcxIiwiZW1haWwiOiJlbWFpbC03MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDMyMzEzNjA4fQ.7UaFapA9_GTlcyZhwiO39LcOBvvi-VHyu4cLBtBTbH4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "497fb615-8ed9-4622-8038-a97cf0e3f7f4",
    "url": "/v2/user_provided_service_instances/497fb615-8ed9-4622-8038-a97cf0e3f7f4",
    "created_at": "2015-05-15T16:53:28Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "aefeb7b8-dda1-4041-9838-a9de76ca25ca",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/aefeb7b8-dda1-4041-9838-a9de76ca25ca",
    "service_bindings_url": "/v2/user_provided_service_instances/497fb615-8ed9-4622-8038-a97cf0e3f7f4/service_bindings"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/user_provided_service_instances/497fb615-8ed9-4622-8038-a97cf0e3f7f4
X-VCAP-Request-ID: 5b01fe68-b7d7-4c90-92a1-3c5e0339ad76
Content-Length: 684
X-Content-Type-Options: nosniff