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

Route

POST /v2/user_provided_service_instances

Body

{
  "space_guid": "b58d5d77-6874-4bd6-98e2-df89be585659",
  "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": "b58d5d77-6874-4bd6-98e2-df89be585659",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2NCIsImVtYWlsIjoiZW1haWwtMjA1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjI5OTA4Nzl9.MAXSBnlsuNCHzY54tyDF34FUSBAg3lnVStBEUGqZJpE" \
	-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/1667e81d-110a-406f-9f64-1c97700086a4
X-VCAP-Request-ID: 76dfe6bd-9e4e-45ab-9042-049a9d393c31
Content-Length: 684
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "1667e81d-110a-406f-9f64-1c97700086a4",
    "url": "/v2/user_provided_service_instances/1667e81d-110a-406f-9f64-1c97700086a4",
    "created_at": "2015-01-27T19:14:39Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "b58d5d77-6874-4bd6-98e2-df89be585659",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/b58d5d77-6874-4bd6-98e2-df89be585659",
    "service_bindings_url": "/v2/user_provided_service_instances/1667e81d-110a-406f-9f64-1c97700086a4/service_bindings"
  }
}