Creating a Docker App (experimental)
POST /v2/apps/
Request
Route
POST /v2/apps
Body
Name |
Description |
Default |
Valid Values |
Example Values |
name
|
The name of the app.
|
|
|
|
memory
|
The amount of memory each instance should have. In megabytes.
|
|
|
|
instances
|
The number of instances of the app to run. To ensure optimal availability, ensure there are at least 2 instances.
|
|
|
|
disk_quota
|
The maximum amount of disk available to an instance of an app. In megabytes.
|
|
|
|
space_guid
|
The guid of the associated space.
|
|
|
- guid-5f0c756b-e127-43fa-92a4-5505899efec2
|
stack_guid
|
The guid of the associated stack.
|
Uses the default system stack.
|
|
- guid-f9f5b7e5-c509-4eeb-9aed-dace6b4fe9b1
|
state
|
The current desired state of the app. One of STOPPED or STARTED.
|
STOPPED
|
|
|
detected_start_command
|
The command detected by the buildpack during staging.
|
|
|
|
command
|
The command to start an app after it is staged, maximum length: 4096 (e.g. 'rails s -p $PORT' or 'java com.org.Server $PORT').
|
|
|
|
buildpack
|
Buildpack to build the app. 3 options: a) Blank means autodetection; b) A Git Url pointing to a buildpack; c) Name of an installed buildpack.
|
|
|
- https://github.com/virtualstaticvoid/heroku-buildpack-r.git
- an_example_installed_buildpack
|
health_check_type
|
Type of health check to perform.
|
port
|
|
|
health_check_timeout
|
Timeout for health checking of an staged app when starting up
|
|
|
|
diego
|
Use diego to stage and to run when available
|
false
|
|
|
docker_image
|
Name of the Docker image containing the app
|
|
|
- cloudfoundry/helloworld
- registry.example.com:5000/user/repository/tag
|
environment_json
|
Key/value pairs of all the environment variables to run in your app. Does not include any system or service variables.
|
|
|
|
production
|
Deprecated.
|
true
|
|
|
console
|
Open the console port for the app (at $CONSOLE_PORT).
|
false
|
|
|
debug
|
Open the debug port for the app (at $DEBUG_PORT).
|
false
|
|
|
name
|
The name of the app.
|
|
|
|
memory
|
The amount of memory each instance should have. In megabytes.
|
|
|
|
instances
|
The number of instances of the app to run. To ensure optimal availability, ensure there are at least 2 instances.
|
|
|
|
disk_quota
|
The maximum amount of disk available to an instance of an app. In megabytes.
|
|
|
|
space_guid
|
The guid of the associated space.
|
|
|
- guid-dee29571-be4e-4925-afff-57f7c8fdab23
|
stack_guid
|
The guid of the associated stack.
|
Uses the default system stack.
|
|
- guid-18c58cee-375e-4356-a420-90f8a2de0061
|
state
|
The current desired state of the app. One of STOPPED or STARTED.
|
STOPPED
|
|
|
detected_start_command
|
The command detected by the buildpack during staging.
|
|
|
|
command
|
The command to start an app after it is staged, maximum length: 4096 (e.g. 'rails s -p $PORT' or 'java com.org.Server $PORT').
|
|
|
|
buildpack
|
Buildpack to build the app. 3 options: a) Blank means autodetection; b) A Git Url pointing to a buildpack; c) Name of an installed buildpack.
|
|
|
- https://github.com/virtualstaticvoid/heroku-buildpack-r.git
- an_example_installed_buildpack
|
health_check_type
|
Type of health check to perform.
|
port
|
|
|
health_check_timeout
|
Timeout for health checking of an staged app when starting up
|
|
|
|
diego
|
Use diego to stage and to run when available
|
false
|
|
|
docker_image
|
Name of the Docker image containing the app
|
|
|
- cloudfoundry/helloworld
- registry.example.com:5000/user/repository/tag
|
environment_json
|
Key/value pairs of all the environment variables to run in your app. Does not include any system or service variables.
|
|
|
|
production
|
Deprecated.
|
true
|
|
|
console
|
Open the console port for the app (at $CONSOLE_PORT).
|
false
|
|
|
debug
|
Open the debug port for the app (at $DEBUG_PORT).
|
false
|
|
|
{
"name": "docker_app",
"space_guid": "3b6be8ac-084c-43d9-b6f8-9f5c541b6094",
"docker_image": "cloudfoundry/hello",
"diego": true
}
Headers
cURL
curl "https://api.[your-domain.com]/v2/apps" -d '{
"name": "docker_app",
"space_guid": "3b6be8ac-084c-43d9-b6f8-9f5c541b6094",
"docker_image": "cloudfoundry/hello",
"diego": true
}' -X POST \
-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTk1IiwiZW1haWwiOiJlbWFpbC05NEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDMyMzEzNjExfQ.n5VKyh4NJFn8M5tQ5GGQlaKPUq_g-Dz111lb6kAc38k" \
-H "Host: example.org" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Cookie: "
Response
Status
201 Created
Body
{
"metadata": {
"guid": "2c0bc512-6e3e-4f25-a9dd-10da253bc292",
"url": "/v2/apps/2c0bc512-6e3e-4f25-a9dd-10da253bc292",
"created_at": "2015-05-15T16:53:30Z",
"updated_at": null
},
"entity": {
"name": "docker_app",
"production": false,
"space_guid": "3b6be8ac-084c-43d9-b6f8-9f5c541b6094",
"stack_guid": "bf7ce60b-12d4-4c80-9b00-c34ea7045369",
"buildpack": null,
"detected_buildpack": null,
"environment_json": {
},
"memory": 1024,
"instances": 1,
"disk_quota": 1024,
"state": "STOPPED",
"version": "84e38575-1a11-4400-8774-79ff6f411905",
"command": null,
"console": false,
"debug": null,
"staging_task_id": null,
"package_state": "PENDING",
"health_check_type": "port",
"health_check_timeout": null,
"staging_failed_reason": null,
"diego": true,
"docker_image": "cloudfoundry/hello:latest",
"package_updated_at": "2015-05-15T16:53:31Z",
"detected_start_command": "",
"enable_ssh": true,
"space_url": "/v2/spaces/3b6be8ac-084c-43d9-b6f8-9f5c541b6094",
"stack_url": "/v2/stacks/bf7ce60b-12d4-4c80-9b00-c34ea7045369",
"events_url": "/v2/apps/2c0bc512-6e3e-4f25-a9dd-10da253bc292/events",
"service_bindings_url": "/v2/apps/2c0bc512-6e3e-4f25-a9dd-10da253bc292/service_bindings",
"routes_url": "/v2/apps/2c0bc512-6e3e-4f25-a9dd-10da253bc292/routes"
}
}
Headers
Audit Records Created By The Request
Audit Record: audit.app.create
Attribute Name |
Value |
id
|
21
|
guid
|
f57e3a0a-0c2d-4bb0-a4ce-1bc6b1cd2247
|
created_at
|
2015-05-15 16:53:30 UTC
|
updated_at
|
|
timestamp
|
2015-05-15 16:53:30 UTC
|
type
|
audit.app.create
|
actor
|
uaa-id-95
|
actor_type
|
user
|
actee
|
2c0bc512-6e3e-4f25-a9dd-10da253bc292
|
actee_type
|
app
|
metadata
|
{
"request": {
"name": "docker_app",
"space_guid": "3b6be8ac-084c-43d9-b6f8-9f5c541b6094",
"docker_image": "cloudfoundry/hello",
"diego": true,
"console": false,
"environment_json": "PRIVATE DATA HIDDEN",
"health_check_type": "port",
"instances": 1,
"production": false,
"state": "STOPPED"
}
}
|
space_id
|
93
|
organization_guid
|
f3d2c1e2-8a52-49d0-b9c7-4461aebb8075
|
space_guid
|
3b6be8ac-084c-43d9-b6f8-9f5c541b6094
|
actor_name
|
email-94@somedomain.com
|
actee_name
|
docker_app
|