Updating an App
PATCH /v3/apps/:guid
Request
Route
PATCH /v3/apps/guid-a7b667e9-2358-4f51-9b1d-92a74beaa30a
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
|
|
|
|
buildpack
|
Default buildpack to use when staging the application packages.
Note: a null value will use autodetection
|
|
- null
- buildpack name
- git url
|
- ruby_buildpack
- https://github.com/cloudfoundry/ruby-buildpack
|
{
"name": "new_name",
"environment_variables": {
"MY_ENV_VAR": "foobar",
"FOOBAR": "MY_ENV_VAR"
},
"buildpack": "http://gitwheel.org/my-app"
}
Headers
cURL
curl "https://api.[your-domain.com]/v3/apps/guid-a7b667e9-2358-4f51-9b1d-92a74beaa30a" -d '{
"name": "new_name",
"environment_variables": {
"MY_ENV_VAR": "foobar",
"FOOBAR": "MY_ENV_VAR"
},
"buildpack": "http://gitwheel.org/my-app"
}' -X PATCH \
-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE0OCIsImVtYWlsIjoiZW1haWwtMTAyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE3OTR9.ZU_BHz6MX0sfsW_Vb3ivmgfmoPHYgSRd7bndC7yascs" \
-H "Host: example.org" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Cookie: "
Response
Status
200 OK
Body
{
"guid": "guid-a7b667e9-2358-4f51-9b1d-92a74beaa30a",
"name": "new_name",
"desired_state": "STOPPED",
"total_desired_instances": 0,
"buildpack": "http://gitwheel.org/my-app",
"created_at": "2015-07-27T22:43:14Z",
"updated_at": "2015-07-27T22:43:14Z",
"environment_variables": {
"MY_ENV_VAR": "foobar",
"FOOBAR": "MY_ENV_VAR"
},
"_links": {
"self": {
"href": "/v3/apps/guid-a7b667e9-2358-4f51-9b1d-92a74beaa30a"
},
"processes": {
"href": "/v3/apps/guid-a7b667e9-2358-4f51-9b1d-92a74beaa30a/processes"
},
"packages": {
"href": "/v3/apps/guid-a7b667e9-2358-4f51-9b1d-92a74beaa30a/packages"
},
"space": {
"href": "/v2/spaces/68040a7b-e84d-4461-960d-36bf8c9873d8"
},
"start": {
"href": "/v3/apps/guid-a7b667e9-2358-4f51-9b1d-92a74beaa30a/start",
"method": "PUT"
},
"stop": {
"href": "/v3/apps/guid-a7b667e9-2358-4f51-9b1d-92a74beaa30a/stop",
"method": "PUT"
},
"assign_current_droplet": {
"href": "/v3/apps/guid-a7b667e9-2358-4f51-9b1d-92a74beaa30a/current_droplet",
"method": "PUT"
}
}
}
Headers