Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-44b634ea-d9fd-492d-902d-0f02f01c4cb3

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-44b634ea-d9fd-492d-902d-0f02f01c4cb3" -d '{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  }
}' -X PATCH \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzNSIsImVtYWlsIjoiZW1haWwtODRAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMTY0NjYzMn0.Gif0tKRoQMxhdbWy9AHmqa72AikUCWdggvdbh0ltWD4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-44b634ea-d9fd-492d-902d-0f02f01c4cb3",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2015-05-07T23:37:12Z",
  "updated_at": "2015-05-07T23:37:12Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-44b634ea-d9fd-492d-902d-0f02f01c4cb3"
    },
    "processes": {
      "href": "/v3/apps/guid-44b634ea-d9fd-492d-902d-0f02f01c4cb3/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-44b634ea-d9fd-492d-902d-0f02f01c4cb3/packages"
    },
    "space": {
      "href": "/v2/spaces/9338e597-0778-4864-9c3a-6ab62bc40cb4"
    },
    "start": {
      "href": "/v3/apps/guid-44b634ea-d9fd-492d-902d-0f02f01c4cb3/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-44b634ea-d9fd-492d-902d-0f02f01c4cb3/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-44b634ea-d9fd-492d-902d-0f02f01c4cb3/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 9d4f4dbb-1051-4e6a-8875-1cf03c27eff0
Content-Length: 1085
X-Content-Type-Options: nosniff