Home
Version 3
Spaces API

Spaces API

Update a Space

PUT /v2/spaces/:guid

Request

Route

PUT /v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c

Parameters

Name Description Valid Values Example Values
guid The guid of the Space

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-d2367e01-ea4d-4695-9264-477dffe175db
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
allow_ssh Whether or not Space Developers can enable ssh on apps in the space
{
  "name": "New Space Name"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3OSIsImVtYWlsIjoiZW1haWwtMTc1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3MTh9.4eLGnYrcDGfz_mSx8dWb2oS66bcxvWMofsXh4RY7OoY
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c" -d '{
  "name": "New Space Name"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3OSIsImVtYWlsIjoiZW1haWwtMTc1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3MTh9.4eLGnYrcDGfz_mSx8dWb2oS66bcxvWMofsXh4RY7OoY" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "c9cf8272-a276-42f9-aa20-4000b8b5e29c",
    "url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c",
    "created_at": "2016-05-12T00:45:18Z",
    "updated_at": "2016-05-12T00:45:18Z"
  },
  "entity": {
    "name": "New Space Name",
    "organization_guid": "057f4b46-da9e-4fd9-b5ba-9ffc40d92f7c",
    "space_quota_definition_guid": null,
    "allow_ssh": true,
    "organization_url": "/v2/organizations/057f4b46-da9e-4fd9-b5ba-9ffc40d92f7c",
    "developers_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/developers",
    "managers_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/managers",
    "auditors_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/auditors",
    "apps_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/apps",
    "routes_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/routes",
    "domains_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/domains",
    "service_instances_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/service_instances",
    "app_events_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/app_events",
    "events_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/events",
    "security_groups_url": "/v2/spaces/c9cf8272-a276-42f9-aa20-4000b8b5e29c/security_groups"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 68944f27-1e52-4295-8b7d-62fc061131f2
Content-Length: 1301
X-Content-Type-Options: nosniff

Audit Records Created By The Request

Audit Record: audit.space.update

Attribute Name Value
id 185
guid 1143398f-262b-4545-bb20-f6d5d9e9157b
created_at 2016-05-12 00:45:18 UTC
updated_at
timestamp 2016-05-12 00:45:18 UTC
type audit.space.update
actor uaa-id-279
actor_type user
actee c9cf8272-a276-42f9-aa20-4000b8b5e29c
actee_type space
metadata
{
  "request": {
    "name": "New Space Name"
  }
}
space_id
organization_guid 057f4b46-da9e-4fd9-b5ba-9ffc40d92f7c
space_guid c9cf8272-a276-42f9-aa20-4000b8b5e29c
actor_name email-175@somedomain.com
actee_name New Space Name