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

Route

POST /v2/user_provided_service_instances

Body

{
  "space_guid": "cc62d416-1837-4df7-89b9-b4633a7e2b97",
  "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": "cc62d416-1837-4df7-89b9-b4633a7e2b97",
  "name": "my-user-provided-instance",
  "credentials": {
    "somekey": "somevalue"
  },
  "syslog_drain_url": "syslog://example.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTgiLCJlbWFpbCI6ImVtYWlsLThAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQxNjUyNjY5NH0.W_pm8pD65QfS4iN8Omjhe_kQ9xy1FFhp98uxRTl45Q0" \
	-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/8b3e1641-e20f-453e-ae68-8c2cd34a1f87
X-VCAP-Request-ID: cde7591f-8f66-4a66-ad33-ce3260939ca8
Content-Length: 689
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "8b3e1641-e20f-453e-ae68-8c2cd34a1f87",
    "url": "/v2/user_provided_service_instances/8b3e1641-e20f-453e-ae68-8c2cd34a1f87",
    "created_at": "2014-11-13T23:38:14+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "my-user-provided-instance",
    "credentials": {
      "somekey": "somevalue"
    },
    "space_guid": "cc62d416-1837-4df7-89b9-b4633a7e2b97",
    "type": "user_provided_service_instance",
    "syslog_drain_url": "syslog://example.com",
    "space_url": "/v2/spaces/cc62d416-1837-4df7-89b9-b4633a7e2b97",
    "service_bindings_url": "/v2/user_provided_service_instances/8b3e1641-e20f-453e-ae68-8c2cd34a1f87/service_bindings"
  }
}