Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90" -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.eyJ1c2VyX2lkIjoidWFhLWlkLTUiLCJlbWFpbCI6ImVtYWlsLTRAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0NzExNjgyNH0.ndYq4FJgm_aom13RVs8UE0CndXw7SJXSbIYUP0GbT3c" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2015-11-03T00:53:44Z",
  "updated_at": "2015-11-03T00:53:44Z",
  "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-6193cece-fd96-46a0-ab74-fc8eab7c9a90"
    },
    "space": {
      "href": "/v2/spaces/168b71ce-a6f2-4986-a208-199c3eed422d"
    },
    "processes": {
      "href": "/v3/apps/guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90/processes"
    },
    "routes": {
      "href": "/v3/apps/guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90/routes"
    },
    "packages": {
      "href": "/v3/apps/guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90/packages"
    },
    "droplets": {
      "href": "/v3/apps/guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90/droplets"
    },
    "start": {
      "href": "/v3/apps/guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-6193cece-fd96-46a0-ab74-fc8eab7c9a90/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: e0295cb8-a9e9-4434-af51-d212b5cca3f7
Content-Length: 1422
X-Content-Type-Options: nosniff