Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-e9092ee1-c078-49ae-9b61-8ac95bf41519

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.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MiIsImVtYWlsIjoiZW1haWwtMjc1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyODN9.hoATI_j5_OjSdcJu14rLD-X85NGlUyhujSJold-Uutk
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-e9092ee1-c078-49ae-9b61-8ac95bf41519" -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.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MiIsImVtYWlsIjoiZW1haWwtMjc1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyODN9.hoATI_j5_OjSdcJu14rLD-X85NGlUyhujSJold-Uutk" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-e9092ee1-c078-49ae-9b61-8ac95bf41519",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2016-01-19T19:41:23Z",
  "updated_at": "2016-01-19T19:41:23Z",
  "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-e9092ee1-c078-49ae-9b61-8ac95bf41519"
    },
    "space": {
      "href": "/v2/spaces/f3210b69-aeb8-433b-85a6-cbcb8ef39e2c"
    },
    "processes": {
      "href": "/v3/apps/guid-e9092ee1-c078-49ae-9b61-8ac95bf41519/processes"
    },
    "routes": {
      "href": "/v3/apps/guid-e9092ee1-c078-49ae-9b61-8ac95bf41519/routes"
    },
    "packages": {
      "href": "/v3/apps/guid-e9092ee1-c078-49ae-9b61-8ac95bf41519/packages"
    },
    "droplets": {
      "href": "/v3/apps/guid-e9092ee1-c078-49ae-9b61-8ac95bf41519/droplets"
    },
    "start": {
      "href": "/v3/apps/guid-e9092ee1-c078-49ae-9b61-8ac95bf41519/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-e9092ee1-c078-49ae-9b61-8ac95bf41519/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-e9092ee1-c078-49ae-9b61-8ac95bf41519/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.040030
Content-Length: 1422