github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/maas/v1/task/results.go (about) 1 package task 2 3 import "github.com/huaweicloud/golangsdk" 4 5 type Task struct { 6 ID int64 `json:"id"` 7 TaskName string `json:"task_name"` 8 } 9 10 type TaskResult struct { 11 ID int64 `json:"id"` 12 Name string `json:"name"` 13 SrcNode SrcNode `json:"src_node"` 14 DstNode DstNode `json:"dst_node"` 15 ThreadNum int `json:"thread_num"` 16 Status int `json:"status"` 17 Progress float64 `json:"progress"` 18 MigrateSpeed int64 `json:"migrate_speed"` 19 EnableKMS bool `json:"enableKMS"` 20 Description string `json:"description"` 21 TotalSize int64 `json:"total_size"` 22 CompleteSize int64 `json:"complete_size"` 23 StartTime int64 `json:"start_time"` 24 LeftTime int64 `json:"left_time"` 25 TotalTime int64 `json:"total_time"` 26 SuccessNum int64 `json:"success_num"` 27 FailNum int64 `json:"fail_num"` 28 TotalNum int64 `json:"total_num"` 29 SmnInfo SmnInfo `json:"smnInfo"` 30 } 31 32 type SrcNode struct { 33 Region string `json:"region"` 34 ObjectKey []string `json:"object_key"` 35 Bucket string `json:"bucket"` 36 } 37 38 type DstNode struct { 39 Region string `json:"region"` 40 ObjectKey string `json:"object_key"` 41 Bucket string `json:"bucket"` 42 } 43 44 type SmnInfo struct { 45 NotifyResult string `json:"notifyResult"` 46 NotifyErrorMessage string `json:"notifyErrorMessage"` 47 TopicName string `json:"topicName"` 48 } 49 50 type CreateResult struct { 51 golangsdk.Result 52 } 53 54 func (r CreateResult) Extract() (*Task, error) { 55 var s Task 56 err := r.ExtractInto(&s) 57 return &s, err 58 } 59 60 func (r CreateResult) ExtractInto(v interface{}) error { 61 return r.Result.ExtractIntoStructPtr(v, "") 62 } 63 64 type GetResult struct { 65 golangsdk.Result 66 } 67 68 func (r GetResult) Extract() (*TaskResult, error) { 69 var s TaskResult 70 err := r.ExtractInto(&s) 71 return &s, err 72 } 73 74 func (r GetResult) ExtractInto(v interface{}) error { 75 return r.Result.ExtractIntoStructPtr(v, "") 76 } 77 78 type DeleteResult struct { 79 golangsdk.ErrResult 80 }