Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-161bce2f-299d-4900-85f0-9b91d0cbea29

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-161bce2f-299d-4900-85f0-9b91d0cbea29" -d '{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  }
}' -X PATCH \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2MyIsImVtYWlsIjoiZW1haWwtMjA5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzI3NzQ5OTR9.Zk2gD0VjmAgkyG7dOowbcK-nDuNfS56lPvgzsY6dcF0" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-161bce2f-299d-4900-85f0-9b91d0cbea29",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2015-05-21T01:03:14Z",
  "updated_at": "2015-05-21T01:03:14Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-161bce2f-299d-4900-85f0-9b91d0cbea29"
    },
    "processes": {
      "href": "/v3/apps/guid-161bce2f-299d-4900-85f0-9b91d0cbea29/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-161bce2f-299d-4900-85f0-9b91d0cbea29/packages"
    },
    "space": {
      "href": "/v2/spaces/edfc6a3f-57e1-4b0d-82b6-bc06b8a7ffec"
    },
    "start": {
      "href": "/v3/apps/guid-161bce2f-299d-4900-85f0-9b91d0cbea29/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-161bce2f-299d-4900-85f0-9b91d0cbea29/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-161bce2f-299d-4900-85f0-9b91d0cbea29/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 7242f0c6-35a7-4f42-a2fb-ec212729aeb9
Content-Length: 1085
X-Content-Type-Options: nosniff