Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-56bf45bb-47c7-4642-a08d-b0dec3a071df

Parameters

Name Description Valid Values Example Values
name Name of the App
environment_variables Environment variables to be used for the App when running

Body

Name Description Default Valid Values Example Values
{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  }
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-56bf45bb-47c7-4642-a08d-b0dec3a071df" -d '{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  }
}' -X PATCH \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwNCIsImVtYWlsIjoiZW1haWwtMTI1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNDB9.J6bZn3H0EQKZzP1qJC68lJJwRy4cAeVvdJIH868bvmo" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-56bf45bb-47c7-4642-a08d-b0dec3a071df",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2015-04-15T00:55:40Z",
  "updated_at": "2015-04-15T00:55:40Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-56bf45bb-47c7-4642-a08d-b0dec3a071df"
    },
    "processes": {
      "href": "/v3/apps/guid-56bf45bb-47c7-4642-a08d-b0dec3a071df/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-56bf45bb-47c7-4642-a08d-b0dec3a071df/packages"
    },
    "space": {
      "href": "/v2/spaces/3d16fddd-adea-415d-adf6-356cae68e3e1"
    },
    "start": {
      "href": "/v3/apps/guid-56bf45bb-47c7-4642-a08d-b0dec3a071df/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-56bf45bb-47c7-4642-a08d-b0dec3a071df/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-56bf45bb-47c7-4642-a08d-b0dec3a071df/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 59ec99f0-a101-47f5-b530-386239e35b92
Content-Length: 1085
X-Content-Type-Options: nosniff