Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96

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.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NiIsImVtYWlsIjoiZW1haWwtMTQzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDR9.2ejfOr1ABaYdjN4lC7QUsajSAmg59W2fXQ5p_IF5vvw
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96" -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.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NiIsImVtYWlsIjoiZW1haWwtMTQzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDR9.2ejfOr1ABaYdjN4lC7QUsajSAmg59W2fXQ5p_IF5vvw" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-11233095-be4d-4bf5-9001-fe743d1b7b96",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "buildpack": "http://gitwheel.org/my-app",
  "created_at": "2015-09-30T23:30:44Z",
  "updated_at": "2015-09-30T23:30:44Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "links": {
    "self": {
      "href": "/v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96"
    },
    "space": {
      "href": "/v2/spaces/f1198a6b-be41-49e8-b346-33382c005231"
    },
    "processes": {
      "href": "/v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96/processes"
    },
    "routes": {
      "href": "/v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96/routes"
    },
    "packages": {
      "href": "/v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96/packages"
    },
    "droplets": {
      "href": "/v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96/droplets"
    },
    "start": {
      "href": "/v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-11233095-be4d-4bf5-9001-fe743d1b7b96/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 2bba4f65-32a3-4ae3-b5c3-a23dcbf6408b
Content-Length: 1327
X-Content-Type-Options: nosniff