Home
Version 3
Processes (Experimental) API

Processes (Experimental) API

Create a Docker Process

POST /v3/processes

Request

Route

POST /v3/processes

Parameters

Name Description Valid Values Example Values
name Name of process
memory Amount of memory (MB) allocated to each instance
instances Number of instances
disk_quota Amount of disk space (MB) allocated to each instance
space_guid Guid of associated Space
stack_guid Guid of associated Stack
state Desired state of process
command Start command for process
buildpack Buildpack used to stage process
health_check_timeout Health check timeout for process
docker_image Name of docker image containing process
environment_json JSON key-value pairs for ENV variables
type Type of the process

Body

Name Description Default Valid Values Example Values
{
  "name": "process",
  "memory": 256,
  "instances": 2,
  "disk_quota": 1024,
  "space_guid": "763a993b-05cb-4382-b218-80008efa41dc",
  "stack_guid": "9c996fd2-92ba-4502-abd8-0ee3f3eff373",
  "state": "STOPPED",
  "command": "run me",
  "buildpack": null,
  "health_check_timeout": 70,
  "docker_image": "cloudfoundry/hello",
  "environment_json": {
    "foo": "bar"
  },
  "type": "worker"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5MSIsImVtYWlsIjoiZW1haWwtMjIyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjczMjM5NzJ9.Cp_aXWBmVxyeZBGF7QhhUxTb5p3_Roiza1Cc0pTu6sY
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/processes" -d '{
  "name": "process",
  "memory": 256,
  "instances": 2,
  "disk_quota": 1024,
  "space_guid": "763a993b-05cb-4382-b218-80008efa41dc",
  "stack_guid": "9c996fd2-92ba-4502-abd8-0ee3f3eff373",
  "state": "STOPPED",
  "command": "run me",
  "buildpack": null,
  "health_check_timeout": 70,
  "docker_image": "cloudfoundry/hello",
  "environment_json": {
    "foo": "bar"
  },
  "type": "worker"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5MSIsImVtYWlsIjoiZW1haWwtMjIyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjczMjM5NzJ9.Cp_aXWBmVxyeZBGF7QhhUxTb5p3_Roiza1Cc0pTu6sY" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "2c0cadbc-9ca7-4356-a2bc-a2eadbb82df0",
  "type": "worker",
  "command": "run me"
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 614d1c0f-2efb-4c50-8b62-7faa4ce09bdc
Content-Length: 95
X-Content-Type-Options: nosniff