Home
Version 3
Services API

Services API

Creating a Service (deprecated)

POST /v2/services

Request

Route

POST /v2/services

Body

Name Description Default Valid Values Example Values
guid The guid of the service
label The name of the service
  • SomeMysqlService
description A short blurb describing the service
  • Mysql stores things for you
long_description A longer description of the service
  • Mysql is a database. It stores things. Use it in your apps...
info_url A url that points to an info page for the service
  • http://info.somemysqlservice.com
documentation_url A url that points to a documentation page for the service
  • http://docs.somemysqlservice.com
timeout A timeout used by the v1 service gateway client
active A boolean describing that the service can be provisioned by users false
bindable A boolean describing that the service can be bound to applications true
extra A JSON field with extra data pertaining to the service
  • {"providerDisplayName": "MyServiceProvider"}
unique_id A guid that identifies the service with the broker (not the same as the guid above)
tags A list of tags for the service. Max characters: 2048 []
  • database
  • mysql
requires A list of dependencies for services. The presence of "syslog_drain" indicates that on binding an instance of the service to an application, logs for the app will be streamed to a url provided by the service. The presence of "route_forwarding" indicates that on binding an instance of the service to a route, requests for the route may be processed by the service before being forwarded to an application mapped to the route. []
  • syslog_drain
  • route_forwarding
provider The name of the service provider (used only by v1 service gateways)
  • MySql Provider
version The version of the service (used only by v1 service gateways)
  • 2.0
url The url of ther service provider (used only by v1 service gateways)
  • http://myql.provider.com
service_broker_guid The guid of the v2 service broker associated with the service
plan_updateable A boolean describing that an instance of this service can be updated to a different plan false
{
  "label": "SomeMysqlService",
  "description": "Mysql stores things for you",
  "provider": "MySql Provider",
  "version": "2.0",
  "url": "http://myql.provider.com"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2NiIsImVtYWlsIjoiZW1haWwtMjY4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MzV9.syZ1BdqMcV47nda-Xan5AVDj1Nxi-BSxZc_fSDyETQM
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/services" -d '{
  "label": "SomeMysqlService",
  "description": "Mysql stores things for you",
  "provider": "MySql Provider",
  "version": "2.0",
  "url": "http://myql.provider.com"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2NiIsImVtYWlsIjoiZW1haWwtMjY4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MzV9.syZ1BdqMcV47nda-Xan5AVDj1Nxi-BSxZc_fSDyETQM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "de2b0418-2932-4291-ba25-c55bfb1daa62",
    "url": "/v2/services/de2b0418-2932-4291-ba25-c55bfb1daa62",
    "created_at": "2015-11-30T23:38:55Z",
    "updated_at": null
  },
  "entity": {
    "label": "SomeMysqlService",
    "provider": "MySql Provider",
    "url": "http://myql.provider.com",
    "description": "Mysql stores things for you",
    "long_description": null,
    "version": "2.0",
    "info_url": null,
    "active": false,
    "bindable": true,
    "unique_id": null,
    "extra": null,
    "tags": [

    ],
    "requires": [

    ],
    "documentation_url": null,
    "service_broker_guid": null,
    "plan_updateable": false,
    "service_plans_url": "/v2/services/de2b0418-2932-4291-ba25-c55bfb1daa62/service_plans"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/services/de2b0418-2932-4291-ba25-c55bfb1daa62
X-VCAP-Request-ID: 
Content-Length: 771
X-Content-Type-Options: nosniff