Home
Version 3
Apps API

Apps API

Associate Route with the App

PUT /v2/apps/:guid/routes/:route_guid

Request

Route

PUT /v2/apps/4e4be48b-0b4e-4388-9e4a-cc07be502994/routes/5f5c8002-5771-4437-97b2-7fa1dafd0033

Parameters

Name Description Valid Values Example Values
guid The guid of the App
route_guid The guid of the route

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyOCIsImVtYWlsIjoiZW1haWwtMTYwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMDl9.qgGAlmktdq66MBkb53Gn8mtnK5Nf9Ina6_4Ki-876V0
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/apps/4e4be48b-0b4e-4388-9e4a-cc07be502994/routes/5f5c8002-5771-4437-97b2-7fa1dafd0033" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyOCIsImVtYWlsIjoiZW1haWwtMTYwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMDl9.qgGAlmktdq66MBkb53Gn8mtnK5Nf9Ina6_4Ki-876V0" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "4e4be48b-0b4e-4388-9e4a-cc07be502994",
    "url": "/v2/apps/4e4be48b-0b4e-4388-9e4a-cc07be502994",
    "created_at": "2015-10-13T17:31:49Z",
    "updated_at": "2015-10-13T17:31:49Z"
  },
  "entity": {
    "name": "name-836",
    "production": false,
    "space_guid": "5cfb359c-372f-49c6-8806-0b93fc5af2df",
    "stack_guid": "e9ae3d55-004f-4318-a075-2ae5e5a3a3fe",
    "buildpack": null,
    "detected_buildpack": null,
    "environment_json": null,
    "memory": 1024,
    "instances": 1,
    "disk_quota": 1024,
    "state": "STOPPED",
    "version": "82097994-172b-4aa2-9847-540426d83781",
    "command": null,
    "console": false,
    "debug": null,
    "staging_task_id": null,
    "package_state": "PENDING",
    "health_check_type": "port",
    "health_check_timeout": null,
    "staging_failed_reason": null,
    "staging_failed_description": null,
    "diego": false,
    "docker_image": null,
    "package_updated_at": "2015-10-13T17:31:49Z",
    "detected_start_command": "",
    "enable_ssh": true,
    "docker_credentials_json": {
      "redacted_message": "[PRIVATE DATA HIDDEN]"
    },
    "space_url": "/v2/spaces/5cfb359c-372f-49c6-8806-0b93fc5af2df",
    "stack_url": "/v2/stacks/e9ae3d55-004f-4318-a075-2ae5e5a3a3fe",
    "events_url": "/v2/apps/4e4be48b-0b4e-4388-9e4a-cc07be502994/events",
    "service_bindings_url": "/v2/apps/4e4be48b-0b4e-4388-9e4a-cc07be502994/service_bindings",
    "routes_url": "/v2/apps/4e4be48b-0b4e-4388-9e4a-cc07be502994/routes"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 4daeb887-c97e-4de5-ae49-aaa0d77fe82f
Content-Length: 1516
X-Content-Type-Options: nosniff