github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/dli/v3/elasticresourcepool/results.go (about) 1 package elasticresourcepool 2 3 import ( 4 "github.com/chnsz/golangsdk/pagination" 5 ) 6 7 // AssociateQueueResp is the structure that represents response of the AssociateElasticResourcePool or UpdateElasticResourcePoolQueuePolicy method. 8 type AssociateQueueResp struct { 9 // Whether the request is successfully sent. Value true indicates that the request is successfully sent. 10 IsSuccess bool `json:"is_success"` 11 // System prompt. If execution succeeds, the parameter setting may be left blank. 12 Message string `json:"message"` 13 } 14 15 // QueuePage is a page structure that represents each page information. 16 type QueuePage struct { 17 pagination.OffsetPageBase 18 } 19 20 // QueuesResp is the structure that represents response of the ListElasticResourcePoolQueues method. 21 type QueuesResp struct { 22 // Whether the request is successfully sent. Value true indicates that the request is successfully sent. 23 IsSuccess bool `json:"is_success"` 24 // System prompt. If execution succeeds, the parameter setting may be left blank. 25 Message string `json:"message"` 26 // The list of the queues associated with the specified elastic resource pool. 27 Queues []Queue `json:"queues"` 28 // The number of queues bound to the elastic resource pool. 29 Count int `json:"count"` 30 } 31 32 // QueuesResp is the structure that represents the queue detail associated with the specified elastic resource pool. 33 type Queue struct { 34 // The queue name. 35 QueueName string `json:"queue_name"` 36 // The enterprise project ID of the queue. 37 EnterpriseProjectId string `json:"enterprise_project_id"` 38 // The queue type. 39 QueueType string `json:"queue_type"` 40 // The list of scaling policies of the queue. 41 QueueScalingPolicies []QueueScalingPolicy `json:"queue_scaling_policies"` 42 // The owner of the queue. 43 Owner string `json:"owner"` 44 // Tht creation time of the queue. 45 CreatedAt int `json:"create_time"` 46 // The engine type ot the queue. 47 Engine string `json:"engine"` 48 } 49 50 // ExtractQueues is a method to extract the list of queues associated with elastic resource pool. 51 func ExtractQueues(r pagination.Page) ([]Queue, error) { 52 var s []Queue 53 err := r.(QueuePage).Result.ExtractIntoSlicePtr(&s, "queues") 54 return s, err 55 }