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.eyJ1c2VyX2lkIjoidWFhLWlkLTIyMiIsImVtYWlsIjoiZW1haWwtMTYzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQzMTAxMzN9.RpLQ3cLJY7H8Eq4xWIpsQdRnxK1MTueY1MQCf6ERIh8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/user_provided_service_instances

Body

{
  "space_guid": "00792a82-3465-451f-85a7-a1c7961fc960",
  "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": "00792a82-3465-451f-85a7-a1c7961fc960",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyMiIsImVtYWlsIjoiZW1haWwtMTYzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQzMTAxMzN9.RpLQ3cLJY7H8Eq4xWIpsQdRnxK1MTueY1MQCf6ERIh8" \
	-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/b18f4bf6-34eb-4f0c-b65b-4d5632000d40
X-VCAP-Request-ID: 9bb2f7ab-280b-4020-b1dd-da4779056c11
Content-Length: 684
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "b18f4bf6-34eb-4f0c-b65b-4d5632000d40",
    "url": "/v2/user_provided_service_instances/b18f4bf6-34eb-4f0c-b65b-4d5632000d40",
    "created_at": "2015-02-12T01:42:13Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "00792a82-3465-451f-85a7-a1c7961fc960",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/00792a82-3465-451f-85a7-a1c7961fc960",
    "service_bindings_url": "/v2/user_provided_service_instances/b18f4bf6-34eb-4f0c-b65b-4d5632000d40/service_bindings"
  }
}