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

Route

POST /v2/user_provided_service_instances

Body

{
  "space_guid": "13bb2102-ac12-42b3-b63c-1c047e868c13",
  "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": "13bb2102-ac12-42b3-b63c-1c047e868c13",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2MSIsImVtYWlsIjoiZW1haWwtMTg2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTU3NTQxNDR9.nmTiThM7DORafuowOmn4CxM3-kIFZ8Zc8I9kqakKomI" \
	-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/e43e31ef-5e9e-4ef5-bb73-e755a94da2f7
X-VCAP-Request-ID: ad8c8689-307b-409f-9165-b0f7993116f8
Content-Length: 689
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "e43e31ef-5e9e-4ef5-bb73-e755a94da2f7",
    "url": "/v2/user_provided_service_instances/e43e31ef-5e9e-4ef5-bb73-e755a94da2f7",
    "created_at": "2014-11-05T01:02:24+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "13bb2102-ac12-42b3-b63c-1c047e868c13",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/13bb2102-ac12-42b3-b63c-1c047e868c13",
    "service_bindings_url": "/v2/user_provided_service_instances/e43e31ef-5e9e-4ef5-bb73-e755a94da2f7/service_bindings"
  }
}