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-3c6e1ef3-1e9d-4000-b8c3-acd51d3793a1/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-83ef0322-95eb-4772-8814-8a364fc825b2"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-3c6e1ef3-1e9d-4000-b8c3-acd51d3793a1/current_droplet" -d '{
  "desired_droplet_guid": "guid-83ef0322-95eb-4772-8814-8a364fc825b2"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwMSIsImVtYWlsIjoiZW1haWwtMTIyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNDB9.sL8o0qc0W3vmcYY_woqp0FcGcHAVJpVxDQ7GvtJVBBo" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-3c6e1ef3-1e9d-4000-b8c3-acd51d3793a1",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2015-04-15T00:55:40Z",
  "updated_at": "2015-04-15T00:55:40Z",
  "environment_variables": {

  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-3c6e1ef3-1e9d-4000-b8c3-acd51d3793a1"
    },
    "processes": {
      "href": "/v3/apps/guid-3c6e1ef3-1e9d-4000-b8c3-acd51d3793a1/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-3c6e1ef3-1e9d-4000-b8c3-acd51d3793a1/packages"
    },
    "space": {
      "href": "/v2/spaces/12ed109f-2015-4f62-84dd-f68ecf6ccce1"
    },
    "desired_droplet": {
      "href": "/v3/droplets/guid-83ef0322-95eb-4772-8814-8a364fc825b2"
    },
    "start": {
      "href": "/v3/apps/guid-3c6e1ef3-1e9d-4000-b8c3-acd51d3793a1/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-3c6e1ef3-1e9d-4000-b8c3-acd51d3793a1/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-3c6e1ef3-1e9d-4000-b8c3-acd51d3793a1/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 7aedcac6-af5a-4a93-abc0-2c3535904920
Content-Length: 1131
X-Content-Type-Options: nosniff