Home
Version 3
Apps API

Apps API

Associate Route with the App

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

Request

Route

PUT /v2/apps/254e2154-ed4f-494e-9809-b8dca8820c03/routes/b0f93c35-d130-4927-bdd1-b5fc2c48fc00

Parameters

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

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/apps/254e2154-ed4f-494e-9809-b8dca8820c03/routes/b0f93c35-d130-4927-bdd1-b5fc2c48fc00" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OCIsImVtYWlsIjoiZW1haWwtMTUyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDU1NTc5NDl9.pvN0ydtzl0Q8CUMCLGYjuVT_ljJTc5mhm6Avf_pZiuA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "254e2154-ed4f-494e-9809-b8dca8820c03",
    "url": "/v2/apps/254e2154-ed4f-494e-9809-b8dca8820c03",
    "created_at": "2015-10-15T23:52:29Z",
    "updated_at": "2015-10-15T23:52:29Z"
  },
  "entity": {
    "name": "name-1689",
    "production": false,
    "space_guid": "74e1cc77-c46b-4579-99fe-2edb8e204e67",
    "stack_guid": "69c01d26-be2f-43e8-b5e3-228f28e01135",
    "buildpack": null,
    "detected_buildpack": null,
    "environment_json": null,
    "memory": 1024,
    "instances": 1,
    "disk_quota": 1024,
    "state": "STOPPED",
    "version": "24d23125-0901-4dae-b7ea-7948984a7a78",
    "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-15T23:52:29Z",
    "detected_start_command": "",
    "enable_ssh": true,
    "docker_credentials_json": {
      "redacted_message": "[PRIVATE DATA HIDDEN]"
    },
    "space_url": "/v2/spaces/74e1cc77-c46b-4579-99fe-2edb8e204e67",
    "stack_url": "/v2/stacks/69c01d26-be2f-43e8-b5e3-228f28e01135",
    "events_url": "/v2/apps/254e2154-ed4f-494e-9809-b8dca8820c03/events",
    "service_bindings_url": "/v2/apps/254e2154-ed4f-494e-9809-b8dca8820c03/service_bindings",
    "routes_url": "/v2/apps/254e2154-ed4f-494e-9809-b8dca8820c03/routes"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 40ccf048-2dbd-4071-802d-35d003359d96
Content-Length: 1517
X-Content-Type-Options: nosniff