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": "eb3f1fdd-2e6a-47a4-a728-abd9848d9dd5",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxOCIsImVtYWlsIjoiZW1haWwtMzEwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzY4Mjk4MDJ9.uf68fmLQ2Ly8esfyjxEldTqPe6Sw82QXLgpl81pFbOs
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": "eb3f1fdd-2e6a-47a4-a728-abd9848d9dd5",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxOCIsImVtYWlsIjoiZW1haWwtMzEwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzY4Mjk4MDJ9.uf68fmLQ2Ly8esfyjxEldTqPe6Sw82QXLgpl81pFbOs" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "549bde14-4828-406c-8a8c-d4972a05e73b",
    "url": "/v2/user_provided_service_instances/549bde14-4828-406c-8a8c-d4972a05e73b",
    "created_at": "2015-07-06T23:23:22Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "eb3f1fdd-2e6a-47a4-a728-abd9848d9dd5",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/eb3f1fdd-2e6a-47a4-a728-abd9848d9dd5",
    "service_bindings_url": "/v2/user_provided_service_instances/549bde14-4828-406c-8a8c-d4972a05e73b/service_bindings"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/user_provided_service_instances/549bde14-4828-406c-8a8c-d4972a05e73b
X-VCAP-Request-ID: eac156df-742b-4a9a-998f-832213bcc284
Content-Length: 684
X-Content-Type-Options: nosniff