Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced

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
lifecycle Lifecycle to be used when updating the app. Note: lifecycle type cannot be changed. Buildpack can be set to null to allow the backend to auto-detect the appropriate buildpack. Stack can be updated, but cannot be null. Type and Data are required fields in lifecycle, but lifecycle itself is not required.
{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "http://gitwheel.org/my-app",
      "stack": "redhat"
    }
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEyIiwiZW1haWwiOiJlbWFpbC0xMUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIwfQ.JV1UA1ie4uhOB9ZQ1Bx7UbfXdfS2R5ZMQW59R01FQrg
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced" -d '{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "http://gitwheel.org/my-app",
      "stack": "redhat"
    }
  }
}' -X PATCH \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEyIiwiZW1haWwiOiJlbWFpbC0xMUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIwfQ.JV1UA1ie4uhOB9ZQ1Bx7UbfXdfS2R5ZMQW59R01FQrg" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-5b86cf5e-2151-42ae-ac00-88b950ccdced",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2016-02-19T02:03:40Z",
  "updated_at": "2016-02-19T02:03:40Z",
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "buildpack": "http://gitwheel.org/my-app",
      "stack": "redhat"
    }
  },
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "links": {
    "self": {
      "href": "/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced"
    },
    "space": {
      "href": "/v2/spaces/4056cf96-f031-403e-9ccc-a27e4e647bde"
    },
    "processes": {
      "href": "/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced/processes"
    },
    "route_mappings": {
      "href": "/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced/route_mappings"
    },
    "packages": {
      "href": "/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced/packages"
    },
    "droplets": {
      "href": "/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced/droplets"
    },
    "tasks": {
      "href": "/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced/tasks"
    },
    "start": {
      "href": "/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-5b86cf5e-2151-42ae-ac00-88b950ccdced/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
X-Runtime: 0.029916
Content-Length: 1533