If you do not need to use a delivery task to deliver data to Object Storage Service (OSS), you can call the DeleteDeliveryTask operation to delete the delivery task.
Usage notes
You cannot restore a deleted delivery task. Proceed with caution.
Prerequisites
The TableStoreClient instance is initialized. For more information, see Initialization.
The delivery task is created. For more information about how to use the console or the SDK, see Quick start or Create delivery tasks.
Parameters
Parameter | Description |
TableName | The name of the data table. |
TaskName | The name of the delivery task. |
Examples
The following sample code provides an example on how to delete a delivery task that is created for a data table:
func DeleteTaskSample(client *tablestore.TableStoreClient, tableName string, taskName string) {
delResp, err := client.DeleteDeliveryTask(&tablestore.DeleteDeliveryTaskRequest{
TableName: tableName,
TaskName: taskName,
})
if err != nil {
log.Fatal("delete delivery task failed ", err)
}
fmt.Println("delete task success", delResp.RequestId)
}