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-f474429d-4989-41ee-8ffe-bfc54ec16242/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-6ac59b80-a23e-4f95-8f16-313331aeeeb2"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwOSIsImVtYWlsIjoiZW1haWwtMTQ0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODB9.2Hp1LAGZz3y9Wqn-odGAxrAuYZYnCS7fPkjw0pVzwHk
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-f474429d-4989-41ee-8ffe-bfc54ec16242/current_droplet" -d '{
  "droplet_guid": "guid-6ac59b80-a23e-4f95-8f16-313331aeeeb2"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwOSIsImVtYWlsIjoiZW1haWwtMTQ0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODB9.2Hp1LAGZz3y9Wqn-odGAxrAuYZYnCS7fPkjw0pVzwHk" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-f474429d-4989-41ee-8ffe-bfc54ec16242",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2016-01-13T17:29:40Z",
  "updated_at": "2016-01-13T17:29:40Z",
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "name-655",
      "stack": "name-656"
    }
  },
  "environment_variables": {

  },
  "links": {
    "self": {
      "href": "/v3/apps/guid-f474429d-4989-41ee-8ffe-bfc54ec16242"
    },
    "space": {
      "href": "/v2/spaces/402e8c74-71f5-492e-92bc-173bc4d85f4f"
    },
    "processes": {
      "href": "/v3/apps/guid-f474429d-4989-41ee-8ffe-bfc54ec16242/processes"
    },
    "routes": {
      "href": "/v3/apps/guid-f474429d-4989-41ee-8ffe-bfc54ec16242/routes"
    },
    "packages": {
      "href": "/v3/apps/guid-f474429d-4989-41ee-8ffe-bfc54ec16242/packages"
    },
    "droplet": {
      "href": "/v3/droplets/guid-6ac59b80-a23e-4f95-8f16-313331aeeeb2"
    },
    "droplets": {
      "href": "/v3/apps/guid-f474429d-4989-41ee-8ffe-bfc54ec16242/droplets"
    },
    "start": {
      "href": "/v3/apps/guid-f474429d-4989-41ee-8ffe-bfc54ec16242/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-f474429d-4989-41ee-8ffe-bfc54ec16242/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-f474429d-4989-41ee-8ffe-bfc54ec16242/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.039725
Content-Length: 1444