Home
Version 3
Service Plans API

Service Plans API

Creating a Service Plan (deprecated)

POST /v2/service_plans

Fields

Name Description Default Valid Values Example Values
guid The guid of the service plan
name The name of the service plan
  • 100mb
free A boolean describing if the service plan is free
  • true
  • false
description A description of the service plan
  • Let's you put data in your database!
extra A JSON string with additional data about the plan
  • {"cost": "$2.00"}
unique_id A guid for the service plan in the service broker (not the same as the cloud controller guid)
public A boolean describing that the plan is visible to the all users true
service_guid The guid of the related service
  • deadbeef
active A boolean that determines whether plans can be used to create new instances.
  • true
  • false

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTg4IiwiZW1haWwiOiJlbWFpbC01OUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0MzEwMTIyfQ.x-lnjtsRmz_ut5VsNUn7QlL2GrGlYkB1RoXI7Rzw2E4
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/service_plans

Body

{
  "name": "100mb",
  "free": true,
  "description": "Let's you put data in your database!",
  "service_guid": "702b4449-7bd6-4be1-9cb4-88f5b86e315d"
}

cURL

curl "https://api.[your-domain.com]/v2/service_plans" -d '{
  "name": "100mb",
  "free": true,
  "description": "Let\u0027s you put data in your database!",
  "service_guid": "702b4449-7bd6-4be1-9cb4-88f5b86e315d"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTg4IiwiZW1haWwiOiJlbWFpbC01OUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0MzEwMTIyfQ.x-lnjtsRmz_ut5VsNUn7QlL2GrGlYkB1RoXI7Rzw2E4" \
	-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/service_plans/16c430ac-d7a9-48b5-8855-e2eb56135a31
X-VCAP-Request-ID: 74541a48-87b7-4f6b-a840-c2ad500c7a56
Content-Length: 678
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "16c430ac-d7a9-48b5-8855-e2eb56135a31",
    "url": "/v2/service_plans/16c430ac-d7a9-48b5-8855-e2eb56135a31",
    "created_at": "2015-02-12T01:42:02Z",
    "updated_at": null
  },
  "entity": {
    "name": "100mb",
    "free": true,
    "description": "Let's you put data in your database!",
    "service_guid": "702b4449-7bd6-4be1-9cb4-88f5b86e315d",
    "extra": null,
    "unique_id": "f3b3efd6-5295-454f-beea-e2e800334077",
    "public": true,
    "active": true,
    "service_url": "/v2/services/702b4449-7bd6-4be1-9cb4-88f5b86e315d",
    "service_instances_url": "/v2/service_plans/16c430ac-d7a9-48b5-8855-e2eb56135a31/service_instances"
  }
}