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-2c45de17-317b-43cf-ac96-12b27ec58bc7/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-564aaa2e-4648-4272-ab3b-42da1e397415"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTciLCJlbWFpbCI6ImVtYWlsLTZAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0NzExNjgyNH0.Nq5E8sbeeV5a1_kd-YPWnuNInZzBvbQi9qUemXloX0M
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-2c45de17-317b-43cf-ac96-12b27ec58bc7/current_droplet" -d '{
  "droplet_guid": "guid-564aaa2e-4648-4272-ab3b-42da1e397415"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTciLCJlbWFpbCI6ImVtYWlsLTZAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0NzExNjgyNH0.Nq5E8sbeeV5a1_kd-YPWnuNInZzBvbQi9qUemXloX0M" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-2c45de17-317b-43cf-ac96-12b27ec58bc7",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2015-11-03T00:53:44Z",
  "updated_at": "2015-11-03T00:53:44Z",
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "name-61",
      "stack": "name-62"
    }
  },
  "environment_variables": {

  },
  "links": {
    "self": {
      "href": "/v3/apps/guid-2c45de17-317b-43cf-ac96-12b27ec58bc7"
    },
    "space": {
      "href": "/v2/spaces/0ce7ed7a-48e1-49db-98e3-75405587d15d"
    },
    "processes": {
      "href": "/v3/apps/guid-2c45de17-317b-43cf-ac96-12b27ec58bc7/processes"
    },
    "routes": {
      "href": "/v3/apps/guid-2c45de17-317b-43cf-ac96-12b27ec58bc7/routes"
    },
    "packages": {
      "href": "/v3/apps/guid-2c45de17-317b-43cf-ac96-12b27ec58bc7/packages"
    },
    "droplet": {
      "href": "/v3/droplets/guid-564aaa2e-4648-4272-ab3b-42da1e397415"
    },
    "droplets": {
      "href": "/v3/apps/guid-2c45de17-317b-43cf-ac96-12b27ec58bc7/droplets"
    },
    "start": {
      "href": "/v3/apps/guid-2c45de17-317b-43cf-ac96-12b27ec58bc7/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-2c45de17-317b-43cf-ac96-12b27ec58bc7/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-2c45de17-317b-43cf-ac96-12b27ec58bc7/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 507ee75a-4c89-4805-b7aa-9ca602cc8638
Content-Length: 1442
X-Content-Type-Options: nosniff