There's no official CLI release with a UI that supports tasks yet, so I thought I'd confirm that they work.
Find out what my app guid is:
$ cf app --guid myapp
fc2d7a58-343f-47d2-bc24-0d611af11aa6
Submit a task:
$ cf curl -X POST /v3/apps/fc2d7a58-343f-47d2-bc24-0d611af11aa6/tasks -d '{ "name": "curl a URL", "command": "curl http://www.gdb.me/thisismetesting" }
'
{
"guid": "648fc07e-06bd-477a-ae31-dec685fa7526",
"sequence_id": 2,
"name": "curl a URL",
"command": "curl http://www.gdb.me/thisismetesting",
"state": "RUNNING",
"memory_in_mb": 1024,
"result": {
"failure_reason": null
},
"created_at": "2016-11-23T16:12:32Z",
"updated_at": "2016-11-23T16:12:32Z",
"droplet_guid": "1979585e-1936-4844-83d6-60dc60b2422a",
"links": {
"self": {
"href": "https://api.cloud.service.gov.uk/v3/tasks/648fc07e-06bd-477a-ae31-dec685fa7526"
},
"app": {
"href": "https://api.cloud.service.gov.uk/v3/apps/fc2d7a58-343f-47d2-bc24-0d611af11aa6"
},
"droplet": {
"href": "https://api.cloud.service.gov.uk/v3/droplets/1979585e-1936-4844-83d6-60dc60b2422a"
}
}
}
Verifying it happened by checking the access logs of the server:
www.gdb.me:80 52.208.24.161 - - [23/Nov/2016:16:12:33 +0000] "GET /thisismetesting HTTP/1.1" 404 473 "-" "curl/7.35.0"
Verifying that CF thinks it happened (it's the second task):
$ cf curl /v3/tasks?app_guids=fc2d7a58-343f-47d2-bc24-0d611af11aa6
{
"pagination": {
"total_results": 2,
"total_pages": 1,
"first": {
"href": "https://api.cloud.service.gov.uk/v3/tasks?app_guids=fc2d7a58-343f-47d2-bc24-0d611af11aa6&page=1&per_page=50"
},
"last": {
"href": "https://api.cloud.service.gov.uk/v3/tasks?app_guids=fc2d7a58-343f-47d2-bc24-0d611af11aa6&page=1&per_page=50"
},
"next": null,
"previous": null
},
"resources": [
{
"guid": "ccb1087c-eaee-4100-a4a0-097f71b04ba3",
"sequence_id": 1,
"name": "my first task",
"state": "SUCCEEDED",
"memory_in_mb": 1024,
"result": {
"failure_reason": null
},
"created_at": "2016-11-23T16:11:17Z",
"updated_at": "2016-11-23T16:11:19Z",
"droplet_guid": "1979585e-1936-4844-83d6-60dc60b2422a",
"links": {
"self": {
"href": "https://api.cloud.service.gov.uk/v3/tasks/ccb1087c-eaee-4100-a4a0-097f71b04ba3"
},
"app": {
"href": "https://api.cloud.service.gov.uk/v3/apps/fc2d7a58-343f-47d2-bc24-0d611af11aa6"
},
"droplet": {
"href": "https://api.cloud.service.gov.uk/v3/droplets/1979585e-1936-4844-83d6-60dc60b2422a"
}
}
},
{
"guid": "648fc07e-06bd-477a-ae31-dec685fa7526",
"sequence_id": 2,
"name": "curl a URL",
"state": "SUCCEEDED",
"memory_in_mb": 1024,
"result": {
"failure_reason": null
},
"created_at": "2016-11-23T16:12:32Z",
"updated_at": "2016-11-23T16:12:33Z",
"droplet_guid": "1979585e-1936-4844-83d6-60dc60b2422a",
"links": {
"self": {
"href": "https://api.cloud.service.gov.uk/v3/tasks/648fc07e-06bd-477a-ae31-dec685fa7526"
},
"app": {
"href": "https://api.cloud.service.gov.uk/v3/apps/fc2d7a58-343f-47d2-bc24-0d611af11aa6"
},
"droplet": {
"href": "https://api.cloud.service.gov.uk/v3/droplets/1979585e-1936-4844-83d6-60dc60b2422a"
}
}
}
]
}