-
Notifications
You must be signed in to change notification settings - Fork 132
/
types_dedicated_ceph.go
71 lines (62 loc) · 2.64 KB
/
types_dedicated_ceph.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
package ovh
import (
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ovh/terraform-provider-ovh/ovh/helpers"
)
type DedicatedCephCrushTunable string
type DedicatedCephState string
type DedicatedCephACLType string
type DedicatedCephStatus string
const (
CrushTunableOptimal DedicatedCephCrushTunable = "OPTIMAL"
CrushTunableDefault DedicatedCephCrushTunable = "DEFAULT"
CrushTunableLegacy DedicatedCephCrushTunable = "LEGACY"
CrushTunableBobtail DedicatedCephCrushTunable = "BOBTAIL"
CrushTunableArgonaut DedicatedCephCrushTunable = "ARGONAUT"
CrushTunableFirefly DedicatedCephCrushTunable = "FIREFLY"
CrushTunableHammer DedicatedCephCrushTunable = "HAMMER"
CrushTunablEjewel DedicatedCephCrushTunable = "JEWEL"
StateActive DedicatedCephState = "ACTIVE"
StateSuspended DedicatedCephState = "SUSPENDED"
ACLTypeIPv4 DedicatedCephACLType = "IPV4"
ACLTypeIPv6 DedicatedCephACLType = "IPV6"
StatusCreating DedicatedCephStatus = "CREATING"
StatusInstalled DedicatedCephStatus = "INSTALLED"
StatusDeleting DedicatedCephStatus = "DELETING"
StatusDeleted DedicatedCephStatus = "DELETED"
StatusTaskInProgress DedicatedCephStatus = "TASK_IN_PROGRESS"
)
type DedicatedCeph struct {
ServiceName string `json:"serviceName"`
CephMonitors []string `json:"cephMons"`
CephVersion string `json:"cephVersion"`
CrushTunables DedicatedCephCrushTunable `json:"crushTunables"`
Label string `json:"label"`
Region string `json:"region"`
Size float32 `json:"size"`
State DedicatedCephState `json:"state"`
Status DedicatedCephStatus `json:"status"`
}
type DedicatedCephACL struct {
Id int `json:"id"`
Family DedicatedCephACLType `json:"family"`
Netmask string `json:"netmask"`
Network string `json:"network"`
}
type DedicatedCephACLCreateOpts struct {
AclList []string `json:"aclList"`
}
type DedicatedCephTask struct {
Name string `json:"name"`
State string `json:"state"`
FinishDate string `json:"finishDate"`
Type string `json:"type"`
CreateDate string `json:"createDate"`
}
func (opts *DedicatedCephACLCreateOpts) FromResource(d *schema.ResourceData) *DedicatedCephACLCreateOpts {
network := helpers.GetNilStringPointerFromData(d, "network")
netmask := helpers.GetNilStringPointerFromData(d, "netmask")
opts.AclList = []string{fmt.Sprintf("%s/%s", *network, *netmask)}
return opts
}