Home
Version 3
Space Quota Definitions API

Space Quota Definitions API

Creating a Space Quota Definition

POST /v2/space_quota_definitions

Request

Route

POST /v2/space_quota_definitions

Body

Name Description Default Valid Values Example Values
name The name for the Space Quota Definition.
  • gold_quota
non_basic_services_allowed If a space can have non basic services
  • true
  • false
total_services How many services a space can have. (-1 represents an unlimited amount)
  • -1
  • 5
  • 201
total_routes How many routes a space can have. (-1 represents an unlimited amount)
  • -1
  • 10
  • 23
total_reserved_route_ports How many routes a space can have that use a reserved port. These routes count toward total_routes. (-1 represents an unlimited amount) 0
  • -1
  • 10
  • 20
memory_limit How much memory in megabytes a space can have.
  • 5120
  • 10024
total_service_keys How many service keys an organization can have. (-1 represents an unlimited amount) -1
  • -1
  • 5
  • 201
instance_memory_limit The maximum amount of memory in megabytes an application instance can have. (-1 represents an unlimited amount) -1
  • -1
  • 10024
app_instance_limit How many app instances a space can create. (-1 represents an unlimited amount) -1
  • -1
  • 10
  • 23
organization_guid The owning organization of the space quota
  • guid-c67d48d0-623f-4c00-a0ce-4914d662926c
app_task_limit The number of tasks that can be run per app. (-1 represents an unlimited amount) 5
  • -1
  • 5
  • 10
{
  "name": "gold_quota",
  "non_basic_services_allowed": true,
  "total_services": -1,
  "total_routes": 10,
  "memory_limit": 5120,
  "organization_guid": "9a66f0f2-c558-4aeb-bcec-b6d61be96d5b",
  "total_reserved_route_ports": 5
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExMyIsImVtYWlsIjoiZW1haWwtODFAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ2MTk1ODM5NX0.JnFqky9k57iI86TMgLOaneAe723xDtoDH-XV43qFC80
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/space_quota_definitions" -d '{
  "name": "gold_quota",
  "non_basic_services_allowed": true,
  "total_services": -1,
  "total_routes": 10,
  "memory_limit": 5120,
  "organization_guid": "9a66f0f2-c558-4aeb-bcec-b6d61be96d5b",
  "total_reserved_route_ports": 5
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExMyIsImVtYWlsIjoiZW1haWwtODFAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ2MTk1ODM5NX0.JnFqky9k57iI86TMgLOaneAe723xDtoDH-XV43qFC80" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "5762a6ed-bcac-4631-983e-36fa04e68990",
    "url": "/v2/space_quota_definitions/5762a6ed-bcac-4631-983e-36fa04e68990",
    "created_at": "2016-04-22T19:33:15Z",
    "updated_at": null
  },
  "entity": {
    "name": "gold_quota",
    "organization_guid": "9a66f0f2-c558-4aeb-bcec-b6d61be96d5b",
    "non_basic_services_allowed": true,
    "total_services": -1,
    "total_routes": 10,
    "memory_limit": 5120,
    "instance_memory_limit": -1,
    "app_instance_limit": -1,
    "app_task_limit": 5,
    "total_service_keys": -1,
    "total_reserved_route_ports": 5,
    "organization_url": "/v2/organizations/9a66f0f2-c558-4aeb-bcec-b6d61be96d5b",
    "spaces_url": "/v2/space_quota_definitions/5762a6ed-bcac-4631-983e-36fa04e68990/spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/space_quota_definitions/5762a6ed-bcac-4631-983e-36fa04e68990
X-VCAP-Request-ID: c71fdb75-4447-4cf8-9120-2d6cec7be0fb
Content-Length: 774
X-Content-Type-Options: nosniff