github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dis/v2/dump/GetTransferTask.go (about) 1 package dump 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 6 ) 7 8 type GetTransferTaskOpts struct { 9 // Name of the stream. 10 StreamName string 11 // Name of the dump task to be deleted. 12 TaskName string 13 } 14 15 func GetTransferTask(client *golangsdk.ServiceClient, opts GetTransferTaskOpts) (*GetTransferTaskResponse, error) { 16 // GET /v2/{project_id}/streams/{stream_name}/transfer-tasks/{task_name} 17 raw, err := client.Get(client.ServiceURL("streams", opts.StreamName, "transfer-tasks", opts.TaskName), nil, nil) 18 if err != nil { 19 return nil, err 20 } 21 22 var res GetTransferTaskResponse 23 err = extract.Into(raw.Body, &res) 24 return &res, err 25 } 26 27 type GetTransferTaskResponse struct { 28 // Name of the stream to which the dump task belongs. 29 StreamName string `json:"stream_name,omitempty"` 30 // Name of the dump task. 31 TaskName string `json:"task_name,omitempty"` 32 // Id of the dump task 33 TaskId string `json:"task_id,omitempty"` 34 // Dump task status. 35 // Possible values: 36 // - ERROR: An error occurs. 37 // - STARTING: The dump task is being started. 38 // - PAUSED: The dump task has been stopped. 39 // - RUNNING: The dump task is running. 40 // - DELETE: The dump task has been deleted. 41 // - ABNORMAL: The dump task is abnormal. 42 // Enumeration values: 43 // ERROR 44 // STARTING 45 // PAUSED 46 // RUNNING 47 // DELETE 48 // ABNORMAL 49 State string `json:"state,omitempty"` 50 // Dump destination. 51 // Possible values: 52 // - OBS: Data is dumped to OBS. 53 // - MRS: Data is dumped to MRS. 54 // - DLI: Data is dumped to DLI. 55 // - CLOUDTABLE: Data is dumped to CloudTable. 56 // - DWS: Data is dumped to DWS. 57 // Enumeration values: 58 // OBS 59 // MRS 60 // DLI 61 // CLOUDTABLE 62 // DWS 63 DestinationType string `json:"destination_type,omitempty"` 64 // Time when the dump task is created. 65 CreatedAt *int64 `json:"create_time,omitempty"` 66 // Latest dump time of the dump task. 67 LastTransferTimestamp *int64 `json:"last_transfer_timestamp,omitempty"` 68 // List of partition dump details. 69 Partitions []PartitionResult `json:"partitions,omitempty"` 70 // Parameter list of OBS to which data in the DIS stream will be dumped. 71 OBSDestinationDescription OBSDestinationDescriptorOpts `json:"obs_destination_description,omitempty"` 72 // Parameter list of the DWS to which data in the DIS stream will be dumped. 73 DWSDestinationDescription DWSDestinationDescriptorOpts `json:"dws_destination_description,omitempty"` 74 // Parameter list of the MRS to which data in the DIS stream will be dumped. 75 MRSDestinationDescription MRSDestinationDescriptorOpts `json:"mrs_destination_description,omitempty"` 76 // Parameter list of the DLI to which data in the DIS stream will be dumped. 77 DLIDestinationDescription DLIDestinationDescriptorOpts `json:"dli_destination_description,omitempty"` 78 // Parameter list of the CloudTable to which data in the DIS stream will be dumped. 79 CloudTableDestinationDescription CloudTableDestinationDescriptorOpts `json:"cloud_table_destination_description,omitempty"` 80 } 81 82 type PartitionResult struct { 83 // Current status of the partition. 84 // Possible values: 85 // - CREATING: The stream is being created. 86 // - ACTIVE: The stream is available. 87 // - DELETED: The stream is being deleted. 88 // - EXPIRED: The stream has expired. 89 // Enumeration values: 90 // CREATING 91 // ACTIVE 92 // DELETED 93 // EXPIRED 94 Status string `json:"status,omitempty"` 95 // Unique identifier of the partition. 96 PartitionId string `json:"partition_id,omitempty"` 97 // Possible value range of the hash key used by the partition. 98 HashRange string `json:"hash_range,omitempty"` 99 // Sequence number range of the partition. 100 SequenceNumberRange string `json:"sequence_number_range,omitempty"` 101 // Parent partition. 102 ParentPartitions string `json:"parent_partitions,omitempty"` 103 }