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