All Products
Search
Document Center

Tablestore:Query the names of delivery tasks

Last Updated:Jun 14, 2024

After you create delivery tasks for a data table, you can call the ListDeliveryTask operation to query information about all delivery tasks for the data table, such as the data table name, delivery task name, and delivery task type.

Prerequisites

Parameters

Request parameters

Parameter

Description

TableName

The name of the data table.

Response parameters

Parameter

Description

TableName

The name of the data table, which is the same as the name of the data table in the request.

TaskName

The name of the delivery task.

TaskType

The type of the delivery task. Valid values:

  • 0: the full delivery type.

  • 1: the incremental delivery type.

  • 2: the differential delivery type.

Examples

The following sample code provides an example on how to query the names of delivery tasks that are created for a data table:

func ListTask(client *tablestore.TableStoreClient, tableName string) {
    resp, err := client.ListDeliveryTask(&tablestore.ListDeliveryTaskRequest{
        TableName: tableName,
    })
    if err != nil {
        log.Fatal("list delivery task failed ", err)
    }
    for _, task := range resp.Tasks {
        fmt.Println("task: ", task.TableName, task.TaskName, task.TaskType)
    }
    fmt.Println("list task finish")
}