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/

Fields

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"}

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTU1IiwiZW1haWwiOiJlbWFpbC00OEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE3NDYyMzUzfQ.Jx3b3WalvmboRGNL1G19g5Rk9yMCgBbheyT7C5PRLRs
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/user_provided_service_instances

Body

{
  "space_guid": "172a98b2-484d-4fcc-a740-067d9a58b0ca",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}

cURL

curl "https://api.[your-domain.com]/v2/user_provided_service_instances" -d '{
  "space_guid": "172a98b2-484d-4fcc-a740-067d9a58b0ca",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTU1IiwiZW1haWwiOiJlbWFpbC00OEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE3NDYyMzUzfQ.Jx3b3WalvmboRGNL1G19g5Rk9yMCgBbheyT7C5PRLRs" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/user_provided_service_instances/dc5b362a-fc57-43d6-8729-16ecd1824681
X-VCAP-Request-ID: 2b863ce2-c038-4ac3-a776-926d4d919d2a
Content-Length: 689
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "dc5b362a-fc57-43d6-8729-16ecd1824681",
    "url": "/v2/user_provided_service_instances/dc5b362a-fc57-43d6-8729-16ecd1824681",
    "created_at": "2014-11-24T19:32:33+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "172a98b2-484d-4fcc-a740-067d9a58b0ca",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/172a98b2-484d-4fcc-a740-067d9a58b0ca",
    "service_bindings_url": "/v2/user_provided_service_instances/dc5b362a-fc57-43d6-8729-16ecd1824681/service_bindings"
  }
}