Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Assigning a droplet as a an Apps current droplet

PUT /v3/apps/:guid/current_droplet

Request

Route

PUT /v3/apps/guid-721d67f5-7346-4ca9-8bc1-2c8b967a9f23/current_droplet

Parameters

Name Description Valid Values Example Values
desired_droplet_guid GUID of the Droplet to be used for the App

Body

Name Description Default Valid Values Example Values
{
  "desired_droplet_guid": "guid-7e7b9055-daa1-4b5d-acf7-db95ef4b8252"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-721d67f5-7346-4ca9-8bc1-2c8b967a9f23/current_droplet" -d '{
  "desired_droplet_guid": "guid-7e7b9055-daa1-4b5d-acf7-db95ef4b8252"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMwMCIsImVtYWlsIjoiZW1haWwtMjI3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzIzMTM2MjF9.T3JFtdQ3QZnepVF6xKPPQOSj3CnlqLmgACPY3eZgewE" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-721d67f5-7346-4ca9-8bc1-2c8b967a9f23",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2015-05-15T16:53:41Z",
  "updated_at": "2015-05-15T16:53:41Z",
  "environment_variables": {

  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-721d67f5-7346-4ca9-8bc1-2c8b967a9f23"
    },
    "processes": {
      "href": "/v3/apps/guid-721d67f5-7346-4ca9-8bc1-2c8b967a9f23/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-721d67f5-7346-4ca9-8bc1-2c8b967a9f23/packages"
    },
    "space": {
      "href": "/v2/spaces/b42a21c6-2749-4035-a72b-e12c9f727308"
    },
    "desired_droplet": {
      "href": "/v3/droplets/guid-7e7b9055-daa1-4b5d-acf7-db95ef4b8252"
    },
    "start": {
      "href": "/v3/apps/guid-721d67f5-7346-4ca9-8bc1-2c8b967a9f23/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-721d67f5-7346-4ca9-8bc1-2c8b967a9f23/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-721d67f5-7346-4ca9-8bc1-2c8b967a9f23/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 0ad7c818-a3f5-4504-a635-b735ee65fd5a
Content-Length: 1131
X-Content-Type-Options: nosniff