Home
Version 3
Apps API

Apps API

Associate Route with the App

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

Request

Route

PUT /v2/apps/91fb9b23-8da8-493d-8141-070282817457/routes/1fbabfc8-7462-4cbb-9f03-3ebfe256161b

Parameters

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

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/apps/91fb9b23-8da8-493d-8141-070282817457/routes/1fbabfc8-7462-4cbb-9f03-3ebfe256161b" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1NyIsImVtYWlsIjoiZW1haWwtMTI1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDB9.0Ep1Nts2Wlh5DR7AqX9UfBYdCfxEz4237NZkINEmulA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "91fb9b23-8da8-493d-8141-070282817457",
    "url": "/v2/apps/91fb9b23-8da8-493d-8141-070282817457",
    "created_at": "2016-04-22T19:33:19Z",
    "updated_at": "2016-04-22T19:33:19Z"
  },
  "entity": {
    "name": "name-560",
    "production": false,
    "space_guid": "ed2a6893-26bc-4e87-9934-fbf6e9944f60",
    "stack_guid": "e305cb3c-d68e-4b96-acf7-61b3b6c1744b",
    "buildpack": null,
    "detected_buildpack": null,
    "environment_json": null,
    "memory": 1024,
    "instances": 1,
    "disk_quota": 1024,
    "state": "STOPPED",
    "version": "c7b39123-cbc7-4932-8ad2-b7ecb1ca426e",
    "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-04-22T19:33:19Z",
    "detected_start_command": "",
    "enable_ssh": true,
    "docker_credentials_json": {
      "redacted_message": "[PRIVATE DATA HIDDEN]"
    },
    "ports": null,
    "space_url": "/v2/spaces/ed2a6893-26bc-4e87-9934-fbf6e9944f60",
    "stack_url": "/v2/stacks/e305cb3c-d68e-4b96-acf7-61b3b6c1744b",
    "routes_url": "/v2/apps/91fb9b23-8da8-493d-8141-070282817457/routes",
    "events_url": "/v2/apps/91fb9b23-8da8-493d-8141-070282817457/events",
    "service_bindings_url": "/v2/apps/91fb9b23-8da8-493d-8141-070282817457/service_bindings",
    "route_mappings_url": "/v2/apps/91fb9b23-8da8-493d-8141-070282817457/route_mappings"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 7580d3ee-d65d-4125-8ed8-0aadce1b87c0
Content-Length: 1625
X-Content-Type-Options: nosniff