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

Route

POST /v2/user_provided_service_instances

Body

{
  "space_guid": "d4e02f6d-581d-4ae6-b12e-6aff95b3d4d7",
  "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": "d4e02f6d-581d-4ae6-b12e-6aff95b3d4d7",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI4OCIsImVtYWlsIjoiZW1haWwtMTkxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQxMzczNzN9.E4OMSqcaQIImJ565LSif6Xe6u71yIQ1N7FDoRs55A74" \
	-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/1578a2ba-1497-4ad6-b6cd-58ca5406a70e
X-VCAP-Request-ID: f8ff0fc3-85cf-47e4-b026-6f8fa587a29c
Content-Length: 684
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "1578a2ba-1497-4ad6-b6cd-58ca5406a70e",
    "url": "/v2/user_provided_service_instances/1578a2ba-1497-4ad6-b6cd-58ca5406a70e",
    "created_at": "2015-02-10T01:42:53Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "d4e02f6d-581d-4ae6-b12e-6aff95b3d4d7",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/d4e02f6d-581d-4ae6-b12e-6aff95b3d4d7",
    "service_bindings_url": "/v2/user_provided_service_instances/1578a2ba-1497-4ad6-b6cd-58ca5406a70e/service_bindings"
  }
}