Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681

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.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2NSIsImVtYWlsIjoiZW1haWwtMzMzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NTV9.XI03_9igwEftzihZdDyO3wH0QblE-FIKtNR1zuwFh6s
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681" -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.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2NSIsImVtYWlsIjoiZW1haWwtMzMzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NTV9.XI03_9igwEftzihZdDyO3wH0QblE-FIKtNR1zuwFh6s" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "buildpack": "http://gitwheel.org/my-app",
  "created_at": "2015-09-11T18:39:15Z",
  "updated_at": "2015-09-11T18:39:15Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681"
    },
    "space": {
      "href": "/v2/spaces/9e6558c6-2bb1-4ca8-b90b-0b85ed84aa02"
    },
    "processes": {
      "href": "/v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681/processes"
    },
    "routes": {
      "href": "/v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681/routes"
    },
    "packages": {
      "href": "/v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681/packages"
    },
    "droplets": {
      "href": "/v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681/droplets"
    },
    "start": {
      "href": "/v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-b0a804a4-44c2-40fe-ab6c-27c7ce404681/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: f183a59f-da3a-496e-8ee8-f7c807b03b9a
Content-Length: 1328
X-Content-Type-Options: nosniff