Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/38cf8a97-f987-41c1-8e4e-f23409b5d3a1

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-39956e71-7de8-49a6-8e6a-78ec807b6403
space_guid The guid of the associated space
  • guid-73669dfe-26a0-4c39-ace1-13fa0885a1f2
host The host portion of the route
port The port of the route. Supported for domains of TCP router groups only.
  • 1024-65535
  • 50000
path The path for a route as raw text. 1) Paths must be between 2 and 128 characters 2) Paths must start with a / 3) Paths must not contain a "?"
  • /apps/v1/path
  • /apps/v2/path
{
  "port": 10000
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTk1IiwiZW1haWwiOiJlbWFpbC02MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQ4MDM4OTQ3fQ.0gkUjM6ug3M51TTVIs7l_tyhm3AnASOxpmk30U3KZr4
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/38cf8a97-f987-41c1-8e4e-f23409b5d3a1" -d '{
  "port": 10000
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTk1IiwiZW1haWwiOiJlbWFpbC02MEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQ4MDM4OTQ3fQ.0gkUjM6ug3M51TTVIs7l_tyhm3AnASOxpmk30U3KZr4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "38cf8a97-f987-41c1-8e4e-f23409b5d3a1",
    "url": "/v2/routes/38cf8a97-f987-41c1-8e4e-f23409b5d3a1",
    "created_at": "2015-11-13T17:02:26Z",
    "updated_at": "2015-11-13T17:02:26Z"
  },
  "entity": {
    "host": "host-6",
    "path": "",
    "domain_guid": "536dced2-f194-48c8-942c-0935f3071bcd",
    "space_guid": "c3e20b4c-b48a-4552-939e-63d7a618bb85",
    "service_instance_guid": null,
    "port": 10000,
    "domain_url": "/v2/domains/536dced2-f194-48c8-942c-0935f3071bcd",
    "space_url": "/v2/spaces/c3e20b4c-b48a-4552-939e-63d7a618bb85",
    "apps_url": "/v2/routes/38cf8a97-f987-41c1-8e4e-f23409b5d3a1/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 
Content-Length: 657
X-Content-Type-Options: nosniff