Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/0d436273-2f67-4f3f-bece-0c10d4f11d5f

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-d2889d8a-672f-4f77-b161-b46aa0a7bd64
space_guid The guid of the associated space
  • guid-e1df98ea-22a0-47a3-b86a-1519fbd577df
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.eyJ1c2VyX2lkIjoidWFhLWlkLTM5NiIsImVtYWlsIjoiZW1haWwtMjY3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5OTB9._Ryxx66n8a1W7HDYoMVryOeq215lL4NpH_cVYsWut8A
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/0d436273-2f67-4f3f-bece-0c10d4f11d5f" -d '{
  "port": 10000
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5NiIsImVtYWlsIjoiZW1haWwtMjY3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5OTB9._Ryxx66n8a1W7HDYoMVryOeq215lL4NpH_cVYsWut8A" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "0d436273-2f67-4f3f-bece-0c10d4f11d5f",
    "url": "/v2/routes/0d436273-2f67-4f3f-bece-0c10d4f11d5f",
    "created_at": "2016-01-13T17:29:50Z",
    "updated_at": "2016-01-13T17:29:50Z"
  },
  "entity": {
    "host": "host-17",
    "path": "",
    "domain_guid": "1f70a889-42f0-473f-b095-89b812009c92",
    "space_guid": "a65f9022-f5ce-4419-b930-be462c86d098",
    "service_instance_guid": null,
    "port": 10000,
    "domain_url": "/v2/domains/1f70a889-42f0-473f-b095-89b812009c92",
    "space_url": "/v2/spaces/a65f9022-f5ce-4419-b930-be462c86d098",
    "apps_url": "/v2/routes/0d436273-2f67-4f3f-bece-0c10d4f11d5f/apps"
  }
}

Headers

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