Home
Version 3
Apps API

Apps API

Associate Route with the App

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

Request

Route

PUT /v2/apps/697e0674-1d2b-4816-822d-3dd30412924c/routes/a901fd6b-31ed-46cb-8bff-6bb307620b20

Parameters

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

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTYyIiwiZW1haWwiOiJlbWFpbC02MUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjI1fQ.UDRv6aNfVEhbQaB7KuvXMSt4eX3WSIwOgeThaSRG9WY
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/apps/697e0674-1d2b-4816-822d-3dd30412924c/routes/a901fd6b-31ed-46cb-8bff-6bb307620b20" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTYyIiwiZW1haWwiOiJlbWFpbC02MUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjI1fQ.UDRv6aNfVEhbQaB7KuvXMSt4eX3WSIwOgeThaSRG9WY" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "697e0674-1d2b-4816-822d-3dd30412924c",
    "url": "/v2/apps/697e0674-1d2b-4816-822d-3dd30412924c",
    "created_at": "2016-02-19T02:03:45Z",
    "updated_at": "2016-02-19T02:03:45Z"
  },
  "entity": {
    "name": "name-416",
    "production": false,
    "space_guid": "0bbd4eb9-5aed-4066-ad06-59c100987d12",
    "stack_guid": "f9d3af93-1b53-48f9-8ad4-6138cc08cecf",
    "buildpack": null,
    "detected_buildpack": null,
    "environment_json": null,
    "memory": 1024,
    "instances": 1,
    "disk_quota": 1024,
    "state": "STOPPED",
    "version": "d943f242-4835-4c77-a8f5-4678d10b1283",
    "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": "2016-02-19T02:03:45Z",
    "detected_start_command": "",
    "enable_ssh": true,
    "docker_credentials_json": {
      "redacted_message": "[PRIVATE DATA HIDDEN]"
    },
    "ports": null,
    "space_url": "/v2/spaces/0bbd4eb9-5aed-4066-ad06-59c100987d12",
    "stack_url": "/v2/stacks/f9d3af93-1b53-48f9-8ad4-6138cc08cecf",
    "events_url": "/v2/apps/697e0674-1d2b-4816-822d-3dd30412924c/events",
    "service_bindings_url": "/v2/apps/697e0674-1d2b-4816-822d-3dd30412924c/service_bindings",
    "routes_url": "/v2/apps/697e0674-1d2b-4816-822d-3dd30412924c/routes",
    "route_mappings_url": "/v2/apps/697e0674-1d2b-4816-822d-3dd30412924c/route_mappings"
  }
}

Headers

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