-
Notifications
You must be signed in to change notification settings - Fork 368
Expand file tree
/
Copy path_create.md.erb
More file actions
67 lines (53 loc) · 3.5 KB
/
_create.md.erb
File metadata and controls
67 lines (53 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
### Create a task
```
Example Request with Command
```
```shell
curl "https://api.example.org/v3/apps/[guid]/tasks" \
-X POST \
-H "Authorization: bearer [token]" \
-H "Content-type: application/json" \
-d '{ "command": "rake db:migrate" }'
```
```
Example Request with Template Process
```
```shell
curl "https://api.example.org/v3/apps/[guid]/tasks" \
-X POST \
-H "Authorization: bearer [token]" \
-H "Content-type: application/json" \
-d '{ "template": { "process": {"guid": "89323d4e-2e84-43e7-83e9-adbf50a20c0e"} } }'
```
```
Example Response
```
```http
HTTP/1.1 202 Accepted
Content-Type: application/json
<%= yield_content :single_task %>
```
#### Definition
`POST /v3/apps/:guid/tasks`
#### Required parameters
Name | Type | Description
---- | ---- | -----------
**command**<sup>[1]</sup> | _string_ | Command that will be executed; **NOTE:** optional if a `template.process.guid` is provided
#### Optional parameters
| Name | Type | Description | Default |
|---------------------------------------------|-------------------------------------|--------------------------------------------------------------|----------------------------------------------------------------------|
| **name** | _string_ | Name of the task | auto-generated |
| **user** | _string_ | OS user used to run the task in the runtime | "vcap" |
| **disk_in_mb**<sup>[1]</sup> | _integer_ | Amount of disk to allocate for the task in MB | operator-configured `default_app_disk_in_mb` |
| **memory_in_mb**<sup>[1]</sup> | _integer_ | Amount of memory to allocate for the task in MB | operator-configured `default_app_memory` |
| **log_rate_limit_per_second**<sup>[1]</sup> | _integer_ | Amount of log rate to allocate for the task in bytes | operator-configured `default_app_log_rate_limit_in_bytes_per_second` |
| **droplet_guid** | _uuid_ | The guid of the droplet that will be used to run the command | the app's current droplet |
| **template.process.guid** | _uuid_ | The guid of the process that will be used as a template | `null` |
| **metadata.labels** | [_label object_](#labels) | Labels applied to the package | |
| **metadata.annotations** | [_annotation object_](#annotations) | Annotations applied to the package | |
<sup>1 If not provided, and a `template.process.guid` is provided, this field will use the value from the process with the given guid.</sup>
#### Permitted roles
|
--- | ---
Admin |
Space Developer |