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-a1efb75f-c6a7-4f51-b1a2-747c591e28cd/current_droplet

Parameters

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

Body

Name Description Default Valid Values Example Values
{
  "desired_droplet_guid": "guid-550ab068-df1b-4372-8e82-adb67aa073f8"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-a1efb75f-c6a7-4f51-b1a2-747c591e28cd/current_droplet" -d '{
  "desired_droplet_guid": "guid-550ab068-df1b-4372-8e82-adb67aa073f8"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1MSIsImVtYWlsIjoiZW1haWwtMjY3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzUxMDI4NjR9.c6Zi2r93cgWctWbv2IxsjykJ1AUlYUa3UpYgjmRENYk" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-a1efb75f-c6a7-4f51-b1a2-747c591e28cd",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2015-06-16T23:41:04Z",
  "updated_at": "2015-06-16T23:41:04Z",
  "environment_variables": {

  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-a1efb75f-c6a7-4f51-b1a2-747c591e28cd"
    },
    "processes": {
      "href": "/v3/apps/guid-a1efb75f-c6a7-4f51-b1a2-747c591e28cd/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-a1efb75f-c6a7-4f51-b1a2-747c591e28cd/packages"
    },
    "space": {
      "href": "/v2/spaces/af1dbf98-f749-4fdc-ba56-7b78ae582a76"
    },
    "desired_droplet": {
      "href": "/v3/droplets/guid-550ab068-df1b-4372-8e82-adb67aa073f8"
    },
    "start": {
      "href": "/v3/apps/guid-a1efb75f-c6a7-4f51-b1a2-747c591e28cd/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-a1efb75f-c6a7-4f51-b1a2-747c591e28cd/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-a1efb75f-c6a7-4f51-b1a2-747c591e28cd/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 14f0c8a3-8729-4647-8ee2-37d4ec61f427
Content-Length: 1131
X-Content-Type-Options: nosniff