Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-22e5b652-ac6b-43de-b17e-a1e74ddfd8fd

Body

Name Description Default Valid Values Example Values
name Name of the App
environment_variables Environment variables to be used for the App when running
buildpack Default buildpack to use when staging the application packages. Note: a null value will use autodetection
  • null
  • buildpack name
  • git url
  • ruby_buildpack
  • https://github.com/cloudfoundry/ruby-buildpack
{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "buildpack": "http://gitwheel.org/my-app"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-22e5b652-ac6b-43de-b17e-a1e74ddfd8fd" -d '{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "buildpack": "http://gitwheel.org/my-app"
}' -X PATCH \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTc3IiwiZW1haWwiOiJlbWFpbC00OEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM2ODI5Nzc2fQ.CWcOrmc_c2lML7h2_xowkba1Zb1dhSWBw8Dq4svVRCc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-22e5b652-ac6b-43de-b17e-a1e74ddfd8fd",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "buildpack": "http://gitwheel.org/my-app",
  "created_at": "2015-07-06T23:22:56Z",
  "updated_at": "2015-07-06T23:22:56Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-22e5b652-ac6b-43de-b17e-a1e74ddfd8fd"
    },
    "processes": {
      "href": "/v3/apps/guid-22e5b652-ac6b-43de-b17e-a1e74ddfd8fd/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-22e5b652-ac6b-43de-b17e-a1e74ddfd8fd/packages"
    },
    "space": {
      "href": "/v2/spaces/e172d4dd-108e-47b5-bf95-421a72b4ec1a"
    },
    "start": {
      "href": "/v3/apps/guid-22e5b652-ac6b-43de-b17e-a1e74ddfd8fd/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-22e5b652-ac6b-43de-b17e-a1e74ddfd8fd/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-22e5b652-ac6b-43de-b17e-a1e74ddfd8fd/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 8c99e8c8-9ee0-4729-a34a-c4075343541e
Content-Length: 1130
X-Content-Type-Options: nosniff