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 URL to which logs will be streamed for bound applications.
  • syslog://example.com
credentials A hash exposed in the VCAP_SERVICES environment variable for bound applications.
  • {:somekey=>"somevalue"}
route_service_url URL to which requests for bound routes will be forwarded.
  • https://logger.example.com
{
  "space_guid": "237579bb-1ea5-4f0e-97ab-649b182fa7a6",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com",
  "route_service_url": "https://logger.example.com"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMyNCIsImVtYWlsIjoiZW1haWwtMjI2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDh9.QCGTW_kHleBRU2NY_6TeftMlRsZfiWXxAnLEtKnEwKs
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": "237579bb-1ea5-4f0e-97ab-649b182fa7a6",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com",
  "route_service_url": "https://logger.example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMyNCIsImVtYWlsIjoiZW1haWwtMjI2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDh9.QCGTW_kHleBRU2NY_6TeftMlRsZfiWXxAnLEtKnEwKs" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "91e0bb1d-dd97-44c1-b6be-8856ae44771e",
    "url": "/v2/user_provided_service_instances/91e0bb1d-dd97-44c1-b6be-8856ae44771e",
    "created_at": "2016-04-22T19:33:28Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "237579bb-1ea5-4f0e-97ab-649b182fa7a6",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "route_service_url": "https://logger.example.com",
    "space_url": "/v2/spaces/237579bb-1ea5-4f0e-97ab-649b182fa7a6",
    "service_bindings_url": "/v2/user_provided_service_instances/91e0bb1d-dd97-44c1-b6be-8856ae44771e/service_bindings",
    "routes_url": "/v2/user_provided_service_instances/91e0bb1d-dd97-44c1-b6be-8856ae44771e/routes"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/user_provided_service_instances/91e0bb1d-dd97-44c1-b6be-8856ae44771e
X-VCAP-Request-ID: eac24d77-1d80-44a1-9e0e-8aee5259c455
Content-Length: 840
X-Content-Type-Options: nosniff