Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4

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.eyJ1c2VyX2lkIjoidWFhLWlkLTM1NiIsImVtYWlsIjoiZW1haWwtMjQ2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTF9.pzxKNAL8_yCLxOg8cTQk-rXM0DGyhkNQqqW-tJ8GIPs
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4" -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.eyJ1c2VyX2lkIjoidWFhLWlkLTM1NiIsImVtYWlsIjoiZW1haWwtMjQ2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTF9.pzxKNAL8_yCLxOg8cTQk-rXM0DGyhkNQqqW-tJ8GIPs" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "buildpack": "http://gitwheel.org/my-app",
  "created_at": "2015-08-06T00:36:51Z",
  "updated_at": "2015-08-06T00:36:51Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4"
    },
    "space": {
      "href": "/v2/spaces/7452d52a-9342-4b2a-8ada-81ceafc22b61"
    },
    "processes": {
      "href": "/v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4/processes"
    },
    "routes": {
      "href": "/v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4/routes"
    },
    "packages": {
      "href": "/v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4/packages"
    },
    "droplets": {
      "href": "/v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4/droplets"
    },
    "start": {
      "href": "/v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-71ddd65d-5a50-4bd6-9f6b-3ac2cb18bcb4/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 4f857f32-02e7-4fd1-addf-000e98c409ab
Content-Length: 1328
X-Content-Type-Options: nosniff