Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03

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.eyJ1c2VyX2lkIjoidWFhLWlkLTIwNiIsImVtYWlsIjoiZW1haWwtMTM4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMDZ9.80XXYa4jLWN5jcNNHKwmOAomfTY3loSBVH3lh0FZib8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03" -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.eyJ1c2VyX2lkIjoidWFhLWlkLTIwNiIsImVtYWlsIjoiZW1haWwtMTM4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMDZ9.80XXYa4jLWN5jcNNHKwmOAomfTY3loSBVH3lh0FZib8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "buildpack": "http://gitwheel.org/my-app",
  "created_at": "2015-10-13T17:31:45Z",
  "updated_at": "2015-10-13T17:31:46Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "links": {
    "self": {
      "href": "/v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03"
    },
    "space": {
      "href": "/v2/spaces/0c5ecf11-5e7b-4749-bb97-894cb23d41f1"
    },
    "processes": {
      "href": "/v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03/processes"
    },
    "routes": {
      "href": "/v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03/routes"
    },
    "packages": {
      "href": "/v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03/packages"
    },
    "droplets": {
      "href": "/v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03/droplets"
    },
    "start": {
      "href": "/v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-3e0f9374-e4e4-43ff-b306-95ba238a0c03/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 8b82cc0c-1e2d-453a-a3d8-d3c5547782b2
Content-Length: 1327
X-Content-Type-Options: nosniff