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-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/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-623a41d5-e411-4876-bd4a-869896290124"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzIiwiZW1haWwiOiJlbWFpbC0xMkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIwfQ.oGxz4uJ3gzBhbFUzvvXRIig7miIKWFRFiGS6Sjob_nA
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/current_droplet" -d '{
  "droplet_guid": "guid-623a41d5-e411-4876-bd4a-869896290124"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzIiwiZW1haWwiOiJlbWFpbC0xMkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIwfQ.oGxz4uJ3gzBhbFUzvvXRIig7miIKWFRFiGS6Sjob_nA" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2",
  "name": "name1",
  "desired_state": "STOPPED",
  "total_desired_instances": 1,
  "created_at": "2016-02-19T02:03:40Z",
  "updated_at": "2016-02-19T02:03:40Z",
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "name-96",
      "stack": "name-97"
    }
  },
  "environment_variables": {

  },
  "links": {
    "self": {
      "href": "/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2"
    },
    "space": {
      "href": "/v2/spaces/b45b3e11-75dc-44d0-875b-8b2e025a44ff"
    },
    "processes": {
      "href": "/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/processes"
    },
    "route_mappings": {
      "href": "/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/route_mappings"
    },
    "packages": {
      "href": "/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/packages"
    },
    "droplet": {
      "href": "/v3/droplets/guid-623a41d5-e411-4876-bd4a-869896290124"
    },
    "droplets": {
      "href": "/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/droplets"
    },
    "tasks": {
      "href": "/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/tasks"
    },
    "start": {
      "href": "/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-4e195d59-cd90-4f04-82a7-9c08bfe27fe2/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.037776
Content-Length: 1553