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-56598e3d-ff42-4534-8ba0-147358c9511a/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-7b5cb225-f84c-478d-9a0b-466a8497b92a"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-56598e3d-ff42-4534-8ba0-147358c9511a/current_droplet" -d '{
  "desired_droplet_guid": "guid-7b5cb225-f84c-478d-9a0b-466a8497b92a"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE0MiIsImVtYWlsIjoiZW1haWwtOTFAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMTY0NjYzMn0.SUcETrXedEYRCgb5sSkd9QR7N5OV7rnODaWwB9mz_AQ" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-56598e3d-ff42-4534-8ba0-147358c9511a",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2015-05-07T23:37:12Z",
  "updated_at": "2015-05-07T23:37:12Z",
  "environment_variables": {

  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-56598e3d-ff42-4534-8ba0-147358c9511a"
    },
    "processes": {
      "href": "/v3/apps/guid-56598e3d-ff42-4534-8ba0-147358c9511a/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-56598e3d-ff42-4534-8ba0-147358c9511a/packages"
    },
    "space": {
      "href": "/v2/spaces/f7f0e8b1-8c26-4ddf-a179-58caab257b91"
    },
    "desired_droplet": {
      "href": "/v3/droplets/guid-7b5cb225-f84c-478d-9a0b-466a8497b92a"
    },
    "start": {
      "href": "/v3/apps/guid-56598e3d-ff42-4534-8ba0-147358c9511a/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-56598e3d-ff42-4534-8ba0-147358c9511a/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-56598e3d-ff42-4534-8ba0-147358c9511a/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: df4664f2-3e92-48fa-bc82-fbb92358ffa9
Content-Length: 1131
X-Content-Type-Options: nosniff