Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-d65b78c7-4a7c-48db-9275-1fd9462f6876

Parameters

Name Description Valid Values Example Values
name Name of the App
desired_droplet_guid GUID of the Droplet to be used for the App
environment_variables Environment variables to be used for the App when running

Body

Name Description Default Valid Values Example Values
{
  "name": "new_name",
  "desired_droplet_guid": "guid-fe24bb90-3705-47bf-932e-ca384c6490b7",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  }
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-d65b78c7-4a7c-48db-9275-1fd9462f6876" -d '{
  "name": "new_name",
  "desired_droplet_guid": "guid-fe24bb90-3705-47bf-932e-ca384c6490b7",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  }
}' -X PATCH \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxOSIsImVtYWlsIjoiZW1haWwtMjIxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjkwMzg3MTR9.lhPf24ZixJ1pSAm1oocC8Y7EGdzBtqHGsDQlaAyez44" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-d65b78c7-4a7c-48db-9275-1fd9462f6876",
  "name": "new_name",
  "desired_state": "STOPPED",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-d65b78c7-4a7c-48db-9275-1fd9462f6876"
    },
    "processes": {
      "href": "/v3/apps/guid-d65b78c7-4a7c-48db-9275-1fd9462f6876/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-d65b78c7-4a7c-48db-9275-1fd9462f6876/packages"
    },
    "space": {
      "href": "/v2/spaces/3fa56589-496c-4ea8-821d-e7d33f92848d"
    },
    "desired_droplet": {
      "href": "/v3/droplets/guid-fe24bb90-3705-47bf-932e-ca384c6490b7"
    },
    "start": {
      "href": "/v3/apps/guid-d65b78c7-4a7c-48db-9275-1fd9462f6876/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-d65b78c7-4a7c-48db-9275-1fd9462f6876/stop",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: e0cffe0d-4e04-43a5-9391-bf506ec01583
Content-Length: 931
X-Content-Type-Options: nosniff