github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/iec/v1/deployments/results.go (about) 1 package deployments 2 3 import ( 4 "github.com/huaweicloud/golangsdk" 5 ) 6 7 // Location struct 8 type Location struct { 9 //SiteID site id 10 SiteID string `json:"site_id"` 11 12 // Area title 13 Area string `json:"area"` 14 15 // Province title 16 Province string `json:"province"` 17 18 // City title 19 City string `json:"city"` 20 21 // Operator title 22 Operator string `json:"operator"` 23 24 //Region region info 25 Region string `json:"-"` 26 27 // AvailabilityZone title 28 AvailabilityZone string `json:"-"` 29 30 // Count title 31 Count int `json:"stack_count"` 32 } 33 34 type CreateResp struct { 35 ID string `json:"id"` 36 Locations []Location `json:"locations"` 37 } 38 39 type commonResult struct { 40 golangsdk.Result 41 } 42 43 type CreateResult struct { 44 commonResult 45 } 46 47 func (r CreateResult) ExtractCreateResult() (*CreateResp, error) { 48 var entity CreateResp 49 err := r.ExtractIntoStructPtr(&entity, "") 50 return &entity, err 51 } 52 53 type DeployResult struct { 54 commonResult 55 } 56 57 type DeployResp struct { 58 ID string `json:"id"` 59 Name string `json:"name"` 60 DeploymentID string `json:"deployment_id"` 61 Status string `orm:"column(STATUS)" json:"status"` 62 } 63 64 func (r DeployResult) ExtractDeployOrExpandResult() (*DeployResp, error) { 65 var entity DeployResp 66 err := r.ExtractIntoStructPtr(&entity, "") 67 return &entity, err 68 } 69 70 type ExpandResult struct { 71 commonResult 72 } 73 74 func (r ExpandResult) ExtractExpandResult() (*DeployResp, error) { 75 var entity DeployResp 76 err := r.ExtractIntoStructPtr(&entity, "") 77 return &entity, err 78 } 79 80 type DeleteResult struct { 81 golangsdk.ErrResult 82 }