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-38643e85-9a99-4a76-b026-1cbaac336cef/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-19f65ef6-11b7-4a26-8551-c0e453f7ed49"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2NiIsImVtYWlsIjoiZW1haWwtMjEyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzI3NzQ5OTR9.ayrjry1t5T7ejaHWNOv-a42C2wVHz7lODzz3CD0YCRk
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-38643e85-9a99-4a76-b026-1cbaac336cef/current_droplet" -d '{
  "desired_droplet_guid": "guid-19f65ef6-11b7-4a26-8551-c0e453f7ed49"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2NiIsImVtYWlsIjoiZW1haWwtMjEyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzI3NzQ5OTR9.ayrjry1t5T7ejaHWNOv-a42C2wVHz7lODzz3CD0YCRk" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-38643e85-9a99-4a76-b026-1cbaac336cef",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2015-05-21T01:03:14Z",
  "updated_at": "2015-05-21T01:03:14Z",
  "environment_variables": {

  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-38643e85-9a99-4a76-b026-1cbaac336cef"
    },
    "processes": {
      "href": "/v3/apps/guid-38643e85-9a99-4a76-b026-1cbaac336cef/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-38643e85-9a99-4a76-b026-1cbaac336cef/packages"
    },
    "space": {
      "href": "/v2/spaces/5943aac0-2ad8-4006-8834-7ff6e3ec0494"
    },
    "desired_droplet": {
      "href": "/v3/droplets/guid-19f65ef6-11b7-4a26-8551-c0e453f7ed49"
    },
    "start": {
      "href": "/v3/apps/guid-38643e85-9a99-4a76-b026-1cbaac336cef/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-38643e85-9a99-4a76-b026-1cbaac336cef/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-38643e85-9a99-4a76-b026-1cbaac336cef/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: e5971b9a-7130-4469-bcca-71dc54d0b099
Content-Length: 1131
X-Content-Type-Options: nosniff