Home
Version 3
Routes API

Routes API

Update a Route

PUT /v2/routes/:guid

Request

Route

PUT /v2/routes/cc03177a-69b4-454b-8a2f-679aab49d06f

Body

Name Description Default Valid Values Example Values
guid The guid of the route.
domain_guid The guid of the associated domain
  • guid-9b1037cb-3e80-4144-8232-b24bde5a806f
space_guid The guid of the associated space
  • guid-d0f32e5d-6de3-4fa1-aa23-50d01ca4902f
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": 12000
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTY5IiwiZW1haWwiOiJlbWFpbC02N0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQ3MTE2ODMzfQ.9o1gVp42ssllTObjkh04035JZXWBMrhJrH9VFc6H-t8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/routes/cc03177a-69b4-454b-8a2f-679aab49d06f" -d '{
  "port": 12000
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTY5IiwiZW1haWwiOiJlbWFpbC02N0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQ3MTE2ODMzfQ.9o1gVp42ssllTObjkh04035JZXWBMrhJrH9VFc6H-t8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "cc03177a-69b4-454b-8a2f-679aab49d06f",
    "url": "/v2/routes/cc03177a-69b4-454b-8a2f-679aab49d06f",
    "created_at": "2015-11-03T00:53:53Z",
    "updated_at": "2015-11-03T00:53:53Z"
  },
  "entity": {
    "host": "host-15",
    "path": "",
    "domain_guid": "f55960a5-214d-48a2-82bf-de625f13fea5",
    "space_guid": "bf65db54-f77e-474d-a258-16a19922e697",
    "service_instance_guid": null,
    "port": 12000,
    "domain_url": "/v2/domains/f55960a5-214d-48a2-82bf-de625f13fea5",
    "space_url": "/v2/spaces/bf65db54-f77e-474d-a258-16a19922e697",
    "apps_url": "/v2/routes/cc03177a-69b4-454b-8a2f-679aab49d06f/apps"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: d6a43d95-1f33-429d-9158-4b0cc5f79afb
Content-Length: 658
X-Content-Type-Options: nosniff