-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLVHD.gen.go
85 lines (67 loc) · 2.11 KB
/
LVHD.gen.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
// This is a generated file. DO NOT EDIT manually.
//go:generate goimports -w LVHD.gen.go
package go_xen_client
import (
"reflect"
"github.com/nilshell/xmlrpc"
)
//LVHD: LVHD SR specific operations
type LVHD struct {
Uuid string // Unique identifier/object reference
}
func FromLVHDToXml(LVHD *LVHD) (result xmlrpc.Struct) {
result = make(xmlrpc.Struct)
result["uuid"] = LVHD.Uuid
return result
}
func ToLVHD(obj interface{}) (resultObj *LVHD) {
objValue := reflect.ValueOf(obj)
resultObj = &LVHD{}
for _, oKey := range objValue.MapKeys() {
keyName := oKey.String()
keyValue := objValue.MapIndex(oKey).Interface()
switch keyName {
case "uuid":
if v, ok := keyValue.(string); ok {
resultObj.Uuid = v
}
}
}
return resultObj
}
/* EnableThinProvisioning: Upgrades an LVHD SR to enable thin-provisioning. Future VDIs created in this SR will be thinly-provisioned, although existing VDIs will be left alone. Note that the SR must be attached to the SRmaster for upgrade to work. */
func (client *XenClient) LVHDEnableThinProvisioning(host string, SR string, initial_allocation int, allocation_quantum int) (result string, err error) {
obj, err := client.APICall("LVHD.enable_thin_provisioning", host, SR, initial_allocation, allocation_quantum)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetUuid: Get the uuid field of the given LVHD. */
func (client *XenClient) LVHDGetUuid(self string) (result string, err error) {
obj, err := client.APICall("LVHD.get_uuid", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetByUuid: Get a reference to the LVHD instance with the specified UUID. */
func (client *XenClient) LVHDGetByUuid(uuid string) (result string, err error) {
obj, err := client.APICall("LVHD.get_by_uuid", uuid)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetRecord: Get a record containing the current state of the given LVHD. */
func (client *XenClient) LVHDGetRecord(self string) (result LVHD, err error) {
obj, err := client.APICall("LVHD.get_record", self)
if err != nil {
return
}
result = *ToLVHD(obj.(interface{}))
return
}