Home
Version 3
Routes Mapping API

Routes Mapping API

Updating a Route Mapping

PUT /v2/route_mappings/:guid

Request

Route

PUT /v2/route_mappings/9db8a7f7-3d49-458a-9797-8fac2ad0295c

Body

Name Description Default Valid Values Example Values
app_port Port on which the application should listen, and to which requests for the mapped route will be routed. Must be among those already configured for the app. If a port is not specified when mapping the route, the first one in the list of those configured for the app will be chosen.
{
  "app_port": 8889
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/route_mappings/9db8a7f7-3d49-458a-9797-8fac2ad0295c" -d '{
  "app_port": 8889
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxNiIsImVtYWlsIjoiZW1haWwtMjg1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjA1MDY2NjB9.0SpSgzrAp9jAtorjp3EmB5kWlrlzaHEx5cRhKHc5ONc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "9db8a7f7-3d49-458a-9797-8fac2ad0295c",
    "url": "/v2/route_mappings/9db8a7f7-3d49-458a-9797-8fac2ad0295c",
    "created_at": "2016-04-06T00:17:40Z",
    "updated_at": "2016-04-06T00:17:40Z"
  },
  "entity": {
    "app_port": 8889,
    "app_guid": "9db70a46-9a93-49ec-bba8-2741b87df043",
    "route_guid": "a6faab19-319b-4649-a43a-3611457485a7",
    "app_url": "/v2/apps/9db70a46-9a93-49ec-bba8-2741b87df043",
    "route_url": "/v2/routes/a6faab19-319b-4649-a43a-3611457485a7"
  }
}

Headers

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