-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfiguration.go
85 lines (73 loc) · 2.3 KB
/
configuration.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
83
84
85
package vscale_api_go
import (
"net/http"
)
type ConfigurationService struct {
client Client
}
type Rplan struct {
Addresses int64 `json:"addresses,omitempty"`
CPUs int64 `json:"cpus,omitempty"`
Locations []string `json:"locations,omitempty"`
ID string `json:"id,omitempty"`
Memory int64 `json:"memory,omitempty"`
Templates []string `json:"templates,omitempty"`
Network int64 `json:"network,omitempty"`
Disk int64 `json:"disk,omitempty"`
}
type Prices struct {
Default struct {
Huge struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"huge,omitempty"`
Large struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"large,omitempty"`
Medium struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"medium,omitempty"`
Monster struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"monster,omitempty"`
Network int64 `json:"network,omitempty"`
Small struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"small,omitempty"`
Backup20 struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"backup_20,omitempty"`
Backup30 struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"backup_30,omitempty"`
Backup40 struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"backup_40,omitempty"`
Backup60 struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"backup_60,omitempty"`
Backup80 struct {
Hour int64 `json:"hour,omitempty"`
Month int64 `json:"month,omitempty"`
} `json:"backup_80,omitempty"`
} `json:"default,omitempty"`
Period string `json:"period,omitempty"`
}
func (c *ConfigurationService) ListRplans() (*[]Rplan, *http.Response, error) {
rplans := new([]Rplan)
res, err := c.client.ExecuteRequest("GET", "rplans", []byte{}, rplans)
return rplans, res, err
}
func (c *ConfigurationService) ListPrices() (*Prices, *http.Response, error) {
prices := new(Prices)
res, err := c.client.ExecuteRequest("GET", "billing/prices", []byte{}, prices)
return prices, res, err
}