Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/a06c01a8-b28f-42c9-b077-0485d642a489

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-6fb74064-c8aa-4e34-8876-751421fded30
space_guid The guid of the associated space
  • guid-663b3daa-10ef-45e5-9c67-d09c81649cb5
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.eyJ1c2VyX2lkIjoidWFhLWlkLTIzMyIsImVtYWlsIjoiZW1haWwtMTY5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyNzN9.SkWP-eXLmufv8wP-o0u9iH2TY5bPS0gGQIlQ_h-W5dA
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/a06c01a8-b28f-42c9-b077-0485d642a489" -d '{
  "port": 10000
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIzMyIsImVtYWlsIjoiZW1haWwtMTY5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyNzN9.SkWP-eXLmufv8wP-o0u9iH2TY5bPS0gGQIlQ_h-W5dA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "a06c01a8-b28f-42c9-b077-0485d642a489",
    "url": "/v2/routes/a06c01a8-b28f-42c9-b077-0485d642a489",
    "created_at": "2016-01-19T19:41:12Z",
    "updated_at": "2016-01-19T19:41:12Z"
  },
  "entity": {
    "host": "host-14",
    "path": "",
    "domain_guid": "484bd5b5-3077-46d0-812d-b784832b4e7a",
    "space_guid": "d6ff1e97-5827-470a-bc86-3c187492ed9d",
    "service_instance_guid": null,
    "port": 10000,
    "domain_url": "/v2/domains/484bd5b5-3077-46d0-812d-b784832b4e7a",
    "space_url": "/v2/spaces/d6ff1e97-5827-470a-bc86-3c187492ed9d",
    "apps_url": "/v2/routes/a06c01a8-b28f-42c9-b077-0485d642a489/apps"
  }
}

Headers

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