Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Assigning a droplet as an App's current droplet

PUT /v3/apps/:guid/current_droplet

Request

Route

PUT /v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f/current_droplet

Body

Name Description Default Valid Values Example Values
droplet_guid GUID of the Staged Droplet to be used for the App
{
  "droplet_guid": "guid-f59ce8a2-0e20-49fa-aa6f-36e75b6ce8bb"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE3NyIsImVtYWlsIjoiZW1haWwtMTE1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTE0MTM2ODR9.fOw3eIYjwkdO16STNVEjckZPUCI8K54YbYC1eLmb40I
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f/current_droplet" -d '{
  "droplet_guid": "guid-f59ce8a2-0e20-49fa-aa6f-36e75b6ce8bb"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE3NyIsImVtYWlsIjoiZW1haWwtMTE1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTE0MTM2ODR9.fOw3eIYjwkdO16STNVEjckZPUCI8K54YbYC1eLmb40I" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-757b06fc-99a9-49b6-b782-7bd25867842f",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2015-12-22T18:28:04Z",
  "updated_at": "2015-12-22T18:28:04Z",
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "name-584",
      "stack": "name-585"
    }
  },
  "environment_variables": {

  },
  "links": {
    "self": {
      "href": "/v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f"
    },
    "space": {
      "href": "/v2/spaces/7bb2da4f-5602-4504-9fb0-38648db4fca7"
    },
    "processes": {
      "href": "/v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f/processes"
    },
    "routes": {
      "href": "/v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f/routes"
    },
    "packages": {
      "href": "/v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f/packages"
    },
    "droplet": {
      "href": "/v3/droplets/guid-f59ce8a2-0e20-49fa-aa6f-36e75b6ce8bb"
    },
    "droplets": {
      "href": "/v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f/droplets"
    },
    "start": {
      "href": "/v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-757b06fc-99a9-49b6-b782-7bd25867842f/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
X-Runtime: 0.038857
Content-Length: 1444