Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Assigning a droplet as an App's current droplet

PUT /v3/apps/:guid/current_droplet

Request

Route

PUT /v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/current_droplet

Body

Name Description Default Valid Values Example Values
droplet_guid GUID of the Staged Droplet to be used for the App
{
  "droplet_guid": "guid-6649c4a3-9521-4c57-aa4a-2c359cc9f957"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIzNCIsImVtYWlsIjoiZW1haWwtMTk0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NDN9.ON9vfu2j05K3sm2FMTg-b5qarqZpsSQMBBN-UPfk4ZI
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/current_droplet" -d '{
  "droplet_guid": "guid-6649c4a3-9521-4c57-aa4a-2c359cc9f957"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIzNCIsImVtYWlsIjoiZW1haWwtMTk0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NDN9.ON9vfu2j05K3sm2FMTg-b5qarqZpsSQMBBN-UPfk4ZI" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2016-03-14T22:30:43Z",
  "updated_at": "2016-03-14T22:30:43Z",
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "name-2081",
      "stack": "name-2082"
    }
  },
  "environment_variables": {

  },
  "links": {
    "self": {
      "href": "/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27"
    },
    "space": {
      "href": "/v2/spaces/144f5276-d0f6-4409-bf7d-e2d879601695"
    },
    "processes": {
      "href": "/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/processes"
    },
    "route_mappings": {
      "href": "/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/route_mappings"
    },
    "packages": {
      "href": "/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/packages"
    },
    "droplet": {
      "href": "/v3/droplets/guid-6649c4a3-9521-4c57-aa4a-2c359cc9f957"
    },
    "droplets": {
      "href": "/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/droplets"
    },
    "tasks": {
      "href": "/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/tasks"
    },
    "start": {
      "href": "/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-9dc01a6e-b8f7-432f-9700-3aa1cd352e27/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
X-Runtime: 0.047196
Content-Length: 1557