Creating a Space
POST /v2/spaces/
Request
Route
POST /v2/spaces
Body
Name |
Description |
Default |
Valid Values |
Example Values |
name
|
The name of the space
|
|
|
- development
- demo
- production
|
organization_guid
|
The guid of the associated organization
|
|
|
- guid-8e32f591-a37f-4f3a-aa5a-c1d553c2a5a5
|
developer_guids
|
The list of the associated developers
|
|
|
|
manager_guids
|
The list of the associated managers
|
|
|
|
auditor_guids
|
The list of the associated auditors
|
|
|
|
domain_guids
|
The list of the associated domains
|
|
|
|
security_group_guids
|
The list of the associated security groups
|
|
|
|
space_quota_definition_guid
|
The guid of the associated space quota definition
|
|
|
|
allow_ssh
|
Whether or not Space Developers can enable ssh on apps in the space
|
|
|
|
{
"name": "development",
"organization_guid": "058622bd-0df7-45b5-aa37-318f69156851"
}
Headers
cURL
curl "https://api.[your-domain.com]/v2/spaces" -d '{
"name": "development",
"organization_guid": "058622bd-0df7-45b5-aa37-318f69156851"
}' -X POST \
-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExNSIsImVtYWlsIjoiZW1haWwtNjRAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMTY0NjYzMH0.cyK_yTyxFOK-tgDQGPmvj50vYE4ouqTlw_QfymwsVV0" \
-H "Host: example.org" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Cookie: "
Response
Status
201 Created
Body
{
"metadata": {
"guid": "fe61e733-a351-4308-9744-204661f13e50",
"url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50",
"created_at": "2015-05-07T23:37:10Z",
"updated_at": null
},
"entity": {
"name": "development",
"organization_guid": "058622bd-0df7-45b5-aa37-318f69156851",
"space_quota_definition_guid": null,
"allow_ssh": true,
"organization_url": "/v2/organizations/058622bd-0df7-45b5-aa37-318f69156851",
"developers_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/developers",
"managers_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/managers",
"auditors_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/auditors",
"apps_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/apps",
"routes_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/routes",
"domains_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/domains",
"service_instances_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/service_instances",
"app_events_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/app_events",
"events_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/events",
"security_groups_url": "/v2/spaces/fe61e733-a351-4308-9744-204661f13e50/security_groups"
}
}
Headers
Audit Records Created By The Request
Audit Record: audit.space.create
Attribute Name |
Value |
id
|
146
|
guid
|
1bc14a3e-a312-4585-96ce-cd1477e9eca2
|
created_at
|
2015-05-07 23:37:10 UTC
|
updated_at
|
|
timestamp
|
2015-05-07 23:37:10 UTC
|
type
|
audit.space.create
|
actor
|
uaa-id-115
|
actor_type
|
user
|
actee
|
fe61e733-a351-4308-9744-204661f13e50
|
actee_type
|
space
|
metadata
|
{
"request": {
"name": "development",
"organization_guid": "058622bd-0df7-45b5-aa37-318f69156851",
"allow_ssh": true
}
}
|
space_id
|
149
|
organization_guid
|
058622bd-0df7-45b5-aa37-318f69156851
|
space_guid
|
fe61e733-a351-4308-9744-204661f13e50
|
actor_name
|
email-64@somedomain.com
|
actee_name
|
development
|