Creating a Route
POST /v2/routes/
Request
Route
POST /v2/routes
Body
Name |
Description |
Default |
Valid Values |
Example Values |
guid
|
The guid of the route.
|
|
|
|
domain_guid
|
The guid of the associated domain
|
|
|
- guid-12c79f6c-ad5d-47d2-a176-c5b25cbffd82
|
space_guid
|
The guid of the associated space
|
|
|
- guid-d16757ec-8e19-45b4-b81c-7ce00771fa99
|
host
|
The host portion of the route
|
|
|
|
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
|
{
"domain_guid": "cea335ae-1896-4350-83b4-b7020c605762",
"space_guid": "754919fd-a2d6-423c-998b-25b6f1cc0d20",
"path": "/apps/v1/path"
}
Headers
cURL
curl "https://api.[your-domain.com]/v2/routes" -d '{
"domain_guid": "cea335ae-1896-4350-83b4-b7020c605762",
"space_guid": "754919fd-a2d6-423c-998b-25b6f1cc0d20",
"path": "/apps/v1/path"
}' -X POST \
-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxMSIsImVtYWlsIjoiZW1haWwtMzAzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzY4Mjk4MDF9.x_gkhsVG-RUAk_5uV-KwSrA8cwijngE_U3k4ULuuRFM" \
-H "Host: example.org" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Cookie: "
Response
Status
201 Created
Body
{
"metadata": {
"guid": "a18ca95c-db9e-4153-bde3-60fe4f6cf08b",
"url": "/v2/routes/a18ca95c-db9e-4153-bde3-60fe4f6cf08b",
"created_at": "2015-07-06T23:23:21Z",
"updated_at": null
},
"entity": {
"host": "",
"path": "/apps/v1/path",
"domain_guid": "cea335ae-1896-4350-83b4-b7020c605762",
"space_guid": "754919fd-a2d6-423c-998b-25b6f1cc0d20",
"domain_url": "/v2/domains/cea335ae-1896-4350-83b4-b7020c605762",
"space_url": "/v2/spaces/754919fd-a2d6-423c-998b-25b6f1cc0d20",
"apps_url": "/v2/routes/a18ca95c-db9e-4153-bde3-60fe4f6cf08b/apps"
}
}
Headers