-
Notifications
You must be signed in to change notification settings - Fork 131
/
types_vps.go
56 lines (49 loc) · 1.53 KB
/
types_vps.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
package ovh
import (
"fmt"
)
type VPSModel struct {
Name string `json:"name"`
Offer string `json:"offer"`
Memory int `json:"memory"`
Vcore int `json:"vcore"`
Version string `json:"version"`
Disk int `json:"disk"`
}
type VPS struct {
Name string `json:"name"`
Cluster string `json:"cluster"`
Memory int `json:"memoryLimit"`
NetbootMode string `json:"netbootMode"`
Keymap string `json:"keymap"`
Zone string `json:"zone"`
State string `json:"state"`
Vcore int `json:"vcore"`
OfferType string `json:"offerType"`
SlaMonitorting bool `json:"slaMonitoring"`
DisplayName string `json:"displayName"`
Model VPSModel `json:"model"`
}
type VPSDatacenter struct {
Name string `json:"name"`
Longname string `json:"longname"`
}
type VPSProperties struct {
NetbootMode *string `json:"netbootMode"`
Keymap *string `json:"keymap"`
SlaMonitorting bool `json:"slaMonitoring"`
DisplayName *string `json:"displayName"`
}
func ovhvps_getType(offertype string, model_name string, model_version string) string {
var offertypeToOfferPrefix = make(map[string]string)
offertypeToOfferPrefix["cloud"] = "ceph-nvme"
offertypeToOfferPrefix["cloud-ram"] = "ceph-nvme-ram"
offertypeToOfferPrefix["ssd"] = "ssd"
offertypeToOfferPrefix["classic"] = "classic"
return (fmt.Sprintf("vps_%s_%s_%s", offertypeToOfferPrefix[offertype],
model_name,
model_version))
}
func strPtr(s string) *string {
return &s
}