title | expires_at | tags | ||
---|---|---|---|---|
Tasks API |
never |
|
This reference does not cover the protobuf payload supplied to each endpoint.
For detailed information on the structs and types listed see models documentation
Post a DesireTaskRequest containing a V3 TaskDefinition to "/v1/tasks/desire.r2"
DEPRECATED:
- Post a DesireTaskRequest containing a V0 TaskDefinition to "/v1/tasks/desire"
func (c *client) DesireTask(logger lager.Logger, taskGuid, domain string, taskDef *models.TaskDefinition) error
logger lager.Logger
- The logging sink
taskGuid string
- The task Guid
domain string
- The Domain
taskDef *models.TaskDefinition
- See the Defining Tasks page for how to create a Task
error
- Non-nil if error occurred
See the Defining Tasks page for how to create a Task
Lists all Tasks
Post a TasksRequest to "/v1/tasks/list.r2"
DEPRECATED:
- Post a TasksRequest to "/v1/tasks/list.r1"
- Post a TasksRequest to "/v1/tasks/list"
func (c *client) Tasks(logger lager.Logger) ([]*models.Task, error)
logger lager.Logger
- The logging sink
[]*models.Task
error
- Non-nil if error occurred
client := bbs.NewClient(url)
tasks, err := client.Tasks(logger)
if err != nil {
log.Printf("failed to retrieve tasks: " + err.Error())
}
Lists all Tasks of the given domain
Post a TasksRequest to "/v1/tasks/list.r2"
DEPRECATED:
- Post a TasksRequest to "/v1/tasks/list.r1"
- Post a TasksRequest to "/v1/tasks/list"
func (c *client) TasksByDomain(logger lager.Logger, domain string) ([]*models.Task, error)
logger lager.Logger
- The logging sink
domain string
- The domain
[]*models.Task
error
- Non-nil if error occurred
client := bbs.NewClient(url)
tasks, err := client.TasksByDomain(logger, "the-domain")
if err != nil {
log.Printf("failed to retrieve tasks: " + err.Error())
}
Lists all Tasks on the given cell
Post a TasksRequest to "/v1/tasks/list.r2"
DEPRECATED:
- Post a TasksRequest to "/v1/tasks/list.r1"
- Post a TasksRequest to "/v1/tasks/list"
func (c *client) TasksByCellID(logger lager.Logger, cellId string) ([]*models.Task, error)
logger lager.Logger
- The logging sink
cellId string
- The CellID
[]*models.Task
error
- Non-nil if error occurred
client := bbs.NewClient(url)
tasks, err := client.TasksByCellID(logger, "my-cell")
if err != nil {
log.Printf("failed to retrieve tasks: " + err.Error())
}
Returns the Task with the given guid
Post a TaskByGuidRequest to "/v1/tasks/get_by_task_guid.r3"
DEPRECATED:
- Post a TaskByGuidRequest to "/v1/tasks/get_by_task_guid.r2"
- Post a TaskByGuidRequest to "/v1/tasks/get_by_task_guid.r1"
- Post a TaskByGuidRequest to "/v1/tasks/get_by_task_guid"
func (c *client) TaskByGuid(logger lager.Logger, taskGuid string) (*models.Task, error)
logger lager.Logger
- The logging sink
taskGuid string
- The task Guid
*models.Task
error
- Non-nil if error occurred
client := bbs.NewClient(url)
task, err := client.TaskByGuid(logger, "the-task-guid")
if err != nil {
log.Printf("failed to retrieve task: " + err.Error())
}
Cancels the Task with the given task guid
Post a TaskGuidRequest to "/v1/tasks/cancel"
func (c *client) CancelTask(logger lager.Logger, taskGuid string) error
logger lager.Logger
- The logging sink
taskGuid string
- The task Guid
error
- Non-nil if error occurred
client := bbs.NewClient(url)
err := client.CancelTask(logger, "the-task-guid")
if err != nil {
log.Printf("failed to cancel task: " + err.Error())
}
Resolves a Task with the given guid
Post a TaskGuidRequest to "/v1/tasks/resolving"
func (c *client) ResolvingTask(logger lager.Logger, taskGuid string) error
logger lager.Logger
- The logging sink
taskGuid string
- The task Guid
error
- Non-nil if error occurred
client := bbs.NewClient(url)
err := client.ResolvingTask(logger, "the-task-guid")
if err != nil {
log.Printf("failed to resolving task: " + err.Error())
}
Deletes a completed task with the given guid
Post a TaskGuidRequest to "/v1/tasks/delete"
func (c *client) DeleteTask(logger lager.Logger, taskGuid string) error
logger lager.Logger
- The logging sink
taskGuid string
- The task Guid
error
- Non-nil if error occurred
client := bbs.NewClient(url)
err := client.DeleteTask(logger, "the-task-guid")
if err != nil {
log.Printf("failed to delete task: " + err.Error())
}