-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVDI.gen.go
1153 lines (1001 loc) · 35.3 KB
/
VDI.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This is a generated file. DO NOT EDIT manually.
//go:generate goimports -w VDI.gen.go
package go_xen_client
import (
"reflect"
"strconv"
"time"
"github.com/nilshell/xmlrpc"
)
//VDI: A virtual disk image
type VDI struct {
Uuid string // Unique identifier/object reference
NameLabel string // a human-readable name
NameDescription string // a notes field containing human-readable description
AllowedOperations []VdiOperations // list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
CurrentOperations map[string]VdiOperations // links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
SR string // storage repository in which the VDI resides
VBDs []string // list of vbds that refer to this disk
CrashDumps []string // list of crash dumps that refer to this disk
VirtualSize int // size of disk as presented to the guest (in bytes). Note that, depending on storage backend type, requested size may not be respected exactly
PhysicalUtilisation int // amount of physical space that the disk image is currently taking up on the storage repository (in bytes)
Type VdiType // type of the VDI
Sharable bool // true if this disk may be shared
ReadOnly bool // true if this disk may ONLY be mounted read-only
OtherConfig map[string]string // additional configuration
StorageLock bool // true if this disk is locked at the storage level
Location string // location information
Managed bool //
Missing bool // true if SR scan operation reported this VDI as not present on disk
Parent string // This field is always null. Deprecated
XenstoreData map[string]string // data to be inserted into the xenstore tree (/local/domain/0/backend/vbd/<domid>/<device-id>/sm-data) after the VDI is attached. This is generally set by the SM backends on vdi_attach.
SmConfig map[string]string // SM dependent data
IsASnapshot bool // true if this is a snapshot.
SnapshotOf string // Ref pointing to the VDI this snapshot is of.
Snapshots []string // List pointing to all the VDIs snapshots.
SnapshotTime time.Time // Date/time when this snapshot was created.
Tags []string // user-specified tags for categorization purposes
AllowCaching bool // true if this VDI is to be cached in the local cache SR
OnBoot OnBoot // The behaviour of this VDI on a VM boot
MetadataOfPool string // The pool whose metadata is contained in this VDI
MetadataLatest bool // Whether this VDI contains the latest known accessible metadata for the pool
IsToolsIso bool // Whether this VDI is a Tools ISO
CbtEnabled bool // True if changed blocks are tracked for this VDI
}
func FromVDIToXml(VDI *VDI) (result xmlrpc.Struct) {
result = make(xmlrpc.Struct)
result["uuid"] = VDI.Uuid
result["name_label"] = VDI.NameLabel
result["name_description"] = VDI.NameDescription
result["allowed_operations"] = VDI.AllowedOperations
current_operations := make(xmlrpc.Struct)
for key, value := range VDI.CurrentOperations {
current_operations[key] = value
}
result["current_operations"] = current_operations
result["SR"] = VDI.SR
result["VBDs"] = VDI.VBDs
result["crash_dumps"] = VDI.CrashDumps
result["virtual_size"] = strconv.Itoa(VDI.VirtualSize)
result["physical_utilisation"] = strconv.Itoa(VDI.PhysicalUtilisation)
result["type"] = VDI.Type.String()
result["sharable"] = VDI.Sharable
result["read_only"] = VDI.ReadOnly
other_config := make(xmlrpc.Struct)
for key, value := range VDI.OtherConfig {
other_config[key] = value
}
result["other_config"] = other_config
result["storage_lock"] = VDI.StorageLock
result["location"] = VDI.Location
result["managed"] = VDI.Managed
result["missing"] = VDI.Missing
result["parent"] = VDI.Parent
xenstore_data := make(xmlrpc.Struct)
for key, value := range VDI.XenstoreData {
xenstore_data[key] = value
}
result["xenstore_data"] = xenstore_data
sm_config := make(xmlrpc.Struct)
for key, value := range VDI.SmConfig {
sm_config[key] = value
}
result["sm_config"] = sm_config
result["is_a_snapshot"] = VDI.IsASnapshot
result["snapshot_of"] = VDI.SnapshotOf
result["snapshots"] = VDI.Snapshots
result["snapshot_time"] = VDI.SnapshotTime
result["tags"] = VDI.Tags
result["allow_caching"] = VDI.AllowCaching
result["on_boot"] = VDI.OnBoot.String()
result["metadata_of_pool"] = VDI.MetadataOfPool
result["metadata_latest"] = VDI.MetadataLatest
result["is_tools_iso"] = VDI.IsToolsIso
result["cbt_enabled"] = VDI.CbtEnabled
return result
}
func ToVDI(obj interface{}) (resultObj *VDI) {
objValue := reflect.ValueOf(obj)
resultObj = &VDI{}
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
}
case "name_label":
if v, ok := keyValue.(string); ok {
resultObj.NameLabel = v
}
case "name_description":
if v, ok := keyValue.(string); ok {
resultObj.NameDescription = v
}
case "allowed_operations":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.AllowedOperations = make([]VdiOperations, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(VdiOperations); ok {
resultObj.AllowedOperations[i] = v
}
}
}
case "current_operations":
resultObj.CurrentOperations = map[string]VdiOperations{}
interimMap := reflect.ValueOf(keyValue).MapKeys()
for _, mapKey := range interimMap {
mapKeyName := mapKey.String()
mapKeyValue := reflect.ValueOf(keyValue).MapIndex(mapKey).Interface()
if v, ok := mapKeyValue.(string); ok {
resultObj.CurrentOperations[mapKeyName] = ToVdiOperations(v)
} else {
resultObj.CurrentOperations[mapKeyName] = 0
}
}
case "SR":
if v, ok := keyValue.(string); ok {
resultObj.SR = v
}
case "VBDs":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.VBDs = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.VBDs[i] = v
}
}
}
case "crash_dumps":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.CrashDumps = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.CrashDumps[i] = v
}
}
}
case "virtual_size":
if v, ok := keyValue.(int); ok {
resultObj.VirtualSize = v
}
case "physical_utilisation":
if v, ok := keyValue.(int); ok {
resultObj.PhysicalUtilisation = v
}
case "type":
if v, ok := keyValue.(VdiType); ok {
resultObj.Type = v
}
case "sharable":
if v, ok := keyValue.(bool); ok {
resultObj.Sharable = v
}
case "read_only":
if v, ok := keyValue.(bool); ok {
resultObj.ReadOnly = v
}
case "other_config":
resultObj.OtherConfig = map[string]string{}
interimMap := reflect.ValueOf(keyValue).MapKeys()
for _, mapKey := range interimMap {
mapKeyName := mapKey.String()
mapKeyValue := reflect.ValueOf(keyValue).MapIndex(mapKey).Interface()
if v, ok := mapKeyValue.(string); ok {
resultObj.OtherConfig[mapKeyName] = v
} else {
resultObj.OtherConfig[mapKeyName] = ""
}
}
case "storage_lock":
if v, ok := keyValue.(bool); ok {
resultObj.StorageLock = v
}
case "location":
if v, ok := keyValue.(string); ok {
resultObj.Location = v
}
case "managed":
if v, ok := keyValue.(bool); ok {
resultObj.Managed = v
}
case "missing":
if v, ok := keyValue.(bool); ok {
resultObj.Missing = v
}
case "parent":
if v, ok := keyValue.(string); ok {
resultObj.Parent = v
}
case "xenstore_data":
resultObj.XenstoreData = map[string]string{}
interimMap := reflect.ValueOf(keyValue).MapKeys()
for _, mapKey := range interimMap {
mapKeyName := mapKey.String()
mapKeyValue := reflect.ValueOf(keyValue).MapIndex(mapKey).Interface()
if v, ok := mapKeyValue.(string); ok {
resultObj.XenstoreData[mapKeyName] = v
} else {
resultObj.XenstoreData[mapKeyName] = ""
}
}
case "sm_config":
resultObj.SmConfig = map[string]string{}
interimMap := reflect.ValueOf(keyValue).MapKeys()
for _, mapKey := range interimMap {
mapKeyName := mapKey.String()
mapKeyValue := reflect.ValueOf(keyValue).MapIndex(mapKey).Interface()
if v, ok := mapKeyValue.(string); ok {
resultObj.SmConfig[mapKeyName] = v
} else {
resultObj.SmConfig[mapKeyName] = ""
}
}
case "is_a_snapshot":
if v, ok := keyValue.(bool); ok {
resultObj.IsASnapshot = v
}
case "snapshot_of":
if v, ok := keyValue.(string); ok {
resultObj.SnapshotOf = v
}
case "snapshots":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.Snapshots = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.Snapshots[i] = v
}
}
}
case "snapshot_time":
if v, ok := keyValue.(time.Time); ok {
resultObj.SnapshotTime = v
}
case "tags":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.Tags = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.Tags[i] = v
}
}
}
case "allow_caching":
if v, ok := keyValue.(bool); ok {
resultObj.AllowCaching = v
}
case "on_boot":
if v, ok := keyValue.(OnBoot); ok {
resultObj.OnBoot = v
}
case "metadata_of_pool":
if v, ok := keyValue.(string); ok {
resultObj.MetadataOfPool = v
}
case "metadata_latest":
if v, ok := keyValue.(bool); ok {
resultObj.MetadataLatest = v
}
case "is_tools_iso":
if v, ok := keyValue.(bool); ok {
resultObj.IsToolsIso = v
}
case "cbt_enabled":
if v, ok := keyValue.(bool); ok {
resultObj.CbtEnabled = v
}
}
}
return resultObj
}
/* GetAllRecords: Return a map of VDI references to VDI records for all VDIs known to the system. */
func (client *XenClient) VDIGetAllRecords() (result map[string]VDI, err error) {
obj, err := client.APICall("VDI.get_all_records")
if err != nil {
return
}
interim := reflect.ValueOf(obj)
result = map[string]VDI{}
for _, key := range interim.MapKeys() {
obj := interim.MapIndex(key)
mapObj := ToVDI(obj.Interface())
result[key.String()] = *mapObj
}
return
}
/* GetAll: Return a list of all the VDIs known to the system. */
func (client *XenClient) VDIGetAll() (result []string, err error) {
obj, err := client.APICall("VDI.get_all")
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetNbdInfo: Get details specifying how to access this VDI via a Network Block Device server. For each of a set of NBD server addresses on which the VDI is available, the return value set contains a vdi_nbd_server_info object that contains an exportname to request once the NBD connection is established, and connection details for the address. An empty list is returned if there is no network that has a PIF on a host with access to the relevant SR, or if no such network has been assigned an NBD-related purpose in its purpose field. To access the given VDI, any of the vdi_nbd_server_info objects can be used to make a connection to a server, and then the VDI will be available by requesting the exportname. */
func (client *XenClient) VDIGetNbdInfo(self string) (result []VdiNbdServerInfo, err error) {
obj, err := client.APICall("VDI.get_nbd_info", self)
if err != nil {
return
}
result = make([]VdiNbdServerInfo, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = *ToVdiNbdServerInfo(value)
}
return
}
/* ListChangedBlocks: Compare two VDIs in 64k block increments and report which blocks differ. This operation is not allowed when vdi_to is attached to a VM. */
func (client *XenClient) VDIListChangedBlocks(vdi_from string, vdi_to string) (result string, err error) {
obj, err := client.APICall("VDI.list_changed_blocks", vdi_from, vdi_to)
if err != nil {
return
}
result = obj.(string)
return
}
/* DataDestroy: Delete the data of the snapshot VDI, but keep its changed block tracking metadata. When successful, this call changes the type of the VDI to cbt_metadata. This operation is idempotent: calling it on a VDI of type cbt_metadata results in a no-op, and no error will be thrown. */
func (client *XenClient) VDIDataDestroy(self string) (err error) {
_, err = client.APICall("VDI.data_destroy", self)
if err != nil {
return
}
// no return result
return
}
/* DisableCbt: Disable changed block tracking for the VDI. This call is only allowed on VDIs that support enabling CBT. It is an idempotent operation - disabling CBT for a VDI for which CBT is not enabled results in a no-op, and no error will be thrown. */
func (client *XenClient) VDIDisableCbt(self string) (err error) {
_, err = client.APICall("VDI.disable_cbt", self)
if err != nil {
return
}
// no return result
return
}
/* EnableCbt: Enable changed block tracking for the VDI. This call is idempotent - enabling CBT for a VDI for which CBT is already enabled results in a no-op, and no error will be thrown. */
func (client *XenClient) VDIEnableCbt(self string) (err error) {
_, err = client.APICall("VDI.enable_cbt", self)
if err != nil {
return
}
// no return result
return
}
/* PoolMigrate: Migrate a VDI, which may be attached to a running guest, to a different SR. The destination SR must be visible to the guest. */
func (client *XenClient) VDIPoolMigrate(vdi string, sr string, options map[string]string) (result string, err error) {
obj, err := client.APICall("VDI.pool_migrate", vdi, sr, options)
if err != nil {
return
}
result = obj.(string)
return
}
/* ReadDatabasePoolUuid: Check the VDI cache for the pool UUID of the database on this VDI. */
func (client *XenClient) VDIReadDatabasePoolUuid(self string) (result string, err error) {
obj, err := client.APICall("VDI.read_database_pool_uuid", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* OpenDatabase: Load the metadata found on the supplied VDI and return a session reference which can be used in API calls to query its contents. */
func (client *XenClient) VDIOpenDatabase(self string) (result string, err error) {
obj, err := client.APICall("VDI.open_database", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* SetAllowCaching: Set the value of the allow_caching parameter. This value can only be changed when the VDI is not attached to a running VM. The caching behaviour is only affected by this flag for VHD-based VDIs that have one parent and no child VHDs. Moreover, caching only takes place when the host running the VM containing this VDI has a nominated SR for local caching. */
func (client *XenClient) VDISetAllowCaching(self string, value bool) (err error) {
_, err = client.APICall("VDI.set_allow_caching", self, value)
if err != nil {
return
}
// no return result
return
}
/* SetOnBoot: Set the value of the on_boot parameter. This value can only be changed when the VDI is not attached to a running VM. */
func (client *XenClient) VDISetOnBoot(self string, value OnBoot) (err error) {
_, err = client.APICall("VDI.set_on_boot", self, value.String())
if err != nil {
return
}
// no return result
return
}
/* SetNameDescription: Set the name description of the VDI. This can only happen when its SR is currently attached. */
func (client *XenClient) VDISetNameDescription(self string, value string) (err error) {
_, err = client.APICall("VDI.set_name_description", self, value)
if err != nil {
return
}
// no return result
return
}
/* SetNameLabel: Set the name label of the VDI. This can only happen when then its SR is currently attached. */
func (client *XenClient) VDISetNameLabel(self string, value string) (err error) {
_, err = client.APICall("VDI.set_name_label", self, value)
if err != nil {
return
}
// no return result
return
}
/* SetReadOnly: Sets the VDI's read_only field */
func (client *XenClient) VDISetReadOnly(self string, value bool) (err error) {
_, err = client.APICall("VDI.set_read_only", self, value)
if err != nil {
return
}
// no return result
return
}
/* SetSharable: Sets the VDI's sharable field */
func (client *XenClient) VDISetSharable(self string, value bool) (err error) {
_, err = client.APICall("VDI.set_sharable", self, value)
if err != nil {
return
}
// no return result
return
}
/* Forget: Removes a VDI record from the database */
func (client *XenClient) VDIForget(vdi string) (err error) {
_, err = client.APICall("VDI.forget", vdi)
if err != nil {
return
}
// no return result
return
}
/* Copy: Copy either a full VDI or the block differences between two VDIs into either a fresh VDI or an existing VDI. */
func (client *XenClient) VDICopy(vdi string, sr string, base_vdi string, into_vdi string) (result string, err error) {
obj, err := client.APICall("VDI.copy", vdi, sr, base_vdi, into_vdi)
if err != nil {
return
}
result = obj.(string)
return
}
/* Update: Ask the storage backend to refresh the fields in the VDI object */
func (client *XenClient) VDIUpdate(vdi string) (err error) {
_, err = client.APICall("VDI.update", vdi)
if err != nil {
return
}
// no return result
return
}
/* Introduce: Create a new VDI record in the database only */
func (client *XenClient) VDIIntroduce(uuid string, name_label string, name_description string, SR string, xtype VdiType, sharable bool, read_only bool, other_config map[string]string, location string, xenstore_data map[string]string, sm_config map[string]string, managed bool, virtual_size int, physical_utilisation int, metadata_of_pool string, is_a_snapshot bool, snapshot_time time.Time, snapshot_of string) (result string, err error) {
obj, err := client.APICall("VDI.introduce", uuid, name_label, name_description, SR, xtype, sharable, read_only, other_config, location, xenstore_data, sm_config, managed, virtual_size, physical_utilisation, metadata_of_pool, is_a_snapshot, snapshot_time, snapshot_of)
if err != nil {
return
}
result = obj.(string)
return
}
/* ResizeOnline: Resize the VDI which may or may not be attached to running guests. */
func (client *XenClient) VDIResizeOnline(vdi string, size int) (err error) {
_, err = client.APICall("VDI.resize_online", vdi, size)
if err != nil {
return
}
// no return result
return
}
/* Resize: Resize the VDI. */
func (client *XenClient) VDIResize(vdi string, size int) (err error) {
_, err = client.APICall("VDI.resize", vdi, size)
if err != nil {
return
}
// no return result
return
}
/* Clone: Take an exact copy of the VDI and return a reference to the new disk. If any driver_params are specified then these are passed through to the storage-specific substrate driver that implements the clone operation. NB the clone lives in the same Storage Repository as its parent. */
func (client *XenClient) VDIClone(vdi string, driver_params map[string]string) (result string, err error) {
obj, err := client.APICall("VDI.clone", vdi, driver_params)
if err != nil {
return
}
result = obj.(string)
return
}
/* Snapshot: Take a read-only snapshot of the VDI, returning a reference to the snapshot. If any driver_params are specified then these are passed through to the storage-specific substrate driver that takes the snapshot. NB the snapshot lives in the same Storage Repository as its parent. */
func (client *XenClient) VDISnapshot(vdi string, driver_params map[string]string) (result string, err error) {
obj, err := client.APICall("VDI.snapshot", vdi, driver_params)
if err != nil {
return
}
result = obj.(string)
return
}
/* RemoveTags: Remove the given value from the tags field of the given VDI. If the value is not in that Set, then do nothing. */
func (client *XenClient) VDIRemoveTags(self string, value string) (err error) {
_, err = client.APICall("VDI.remove_tags", self, value)
if err != nil {
return
}
// no return result
return
}
/* AddTags: Add the given value to the tags field of the given VDI. If the value is already in that Set, then do nothing. */
func (client *XenClient) VDIAddTags(self string, value string) (err error) {
_, err = client.APICall("VDI.add_tags", self, value)
if err != nil {
return
}
// no return result
return
}
/* SetTags: Set the tags field of the given VDI. */
func (client *XenClient) VDISetTags(self string, value []string) (err error) {
_, err = client.APICall("VDI.set_tags", self, value)
if err != nil {
return
}
// no return result
return
}
/* RemoveFromSmConfig: Remove the given key and its corresponding value from the sm_config field of the given VDI. If the key is not in that Map, then do nothing. */
func (client *XenClient) VDIRemoveFromSmConfig(self string, key string) (err error) {
_, err = client.APICall("VDI.remove_from_sm_config", self, key)
if err != nil {
return
}
// no return result
return
}
/* AddToSmConfig: Add the given key-value pair to the sm_config field of the given VDI. */
func (client *XenClient) VDIAddToSmConfig(self string, key string, value string) (err error) {
_, err = client.APICall("VDI.add_to_sm_config", self, key, value)
if err != nil {
return
}
// no return result
return
}
/* SetSmConfig: Set the sm_config field of the given VDI. */
func (client *XenClient) VDISetSmConfig(self string, value map[string]string) (err error) {
_, err = client.APICall("VDI.set_sm_config", self, value)
if err != nil {
return
}
// no return result
return
}
/* RemoveFromXenstoreData: Remove the given key and its corresponding value from the xenstore_data field of the given VDI. If the key is not in that Map, then do nothing. */
func (client *XenClient) VDIRemoveFromXenstoreData(self string, key string) (err error) {
_, err = client.APICall("VDI.remove_from_xenstore_data", self, key)
if err != nil {
return
}
// no return result
return
}
/* AddToXenstoreData: Add the given key-value pair to the xenstore_data field of the given VDI. */
func (client *XenClient) VDIAddToXenstoreData(self string, key string, value string) (err error) {
_, err = client.APICall("VDI.add_to_xenstore_data", self, key, value)
if err != nil {
return
}
// no return result
return
}
/* SetXenstoreData: Set the xenstore_data field of the given VDI. */
func (client *XenClient) VDISetXenstoreData(self string, value map[string]string) (err error) {
_, err = client.APICall("VDI.set_xenstore_data", self, value)
if err != nil {
return
}
// no return result
return
}
/* RemoveFromOtherConfig: Remove the given key and its corresponding value from the other_config field of the given VDI. If the key is not in that Map, then do nothing. */
func (client *XenClient) VDIRemoveFromOtherConfig(self string, key string) (err error) {
_, err = client.APICall("VDI.remove_from_other_config", self, key)
if err != nil {
return
}
// no return result
return
}
/* AddToOtherConfig: Add the given key-value pair to the other_config field of the given VDI. */
func (client *XenClient) VDIAddToOtherConfig(self string, key string, value string) (err error) {
_, err = client.APICall("VDI.add_to_other_config", self, key, value)
if err != nil {
return
}
// no return result
return
}
/* SetOtherConfig: Set the other_config field of the given VDI. */
func (client *XenClient) VDISetOtherConfig(self string, value map[string]string) (err error) {
_, err = client.APICall("VDI.set_other_config", self, value)
if err != nil {
return
}
// no return result
return
}
/* GetCbtEnabled: Get the cbt_enabled field of the given VDI. */
func (client *XenClient) VDIGetCbtEnabled(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_cbt_enabled", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetIsToolsIso: Get the is_tools_iso field of the given VDI. */
func (client *XenClient) VDIGetIsToolsIso(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_is_tools_iso", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetMetadataLatest: Get the metadata_latest field of the given VDI. */
func (client *XenClient) VDIGetMetadataLatest(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_metadata_latest", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetMetadataOfPool: Get the metadata_of_pool field of the given VDI. */
func (client *XenClient) VDIGetMetadataOfPool(self string) (result string, err error) {
obj, err := client.APICall("VDI.get_metadata_of_pool", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetOnBoot: Get the on_boot field of the given VDI. */
func (client *XenClient) VDIGetOnBoot(self string) (result OnBoot, err error) {
obj, err := client.APICall("VDI.get_on_boot", self)
if err != nil {
return
}
result = ToOnBoot(obj.(string))
return
}
/* GetAllowCaching: Get the allow_caching field of the given VDI. */
func (client *XenClient) VDIGetAllowCaching(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_allow_caching", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetTags: Get the tags field of the given VDI. */
func (client *XenClient) VDIGetTags(self string) (result []string, err error) {
obj, err := client.APICall("VDI.get_tags", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetSnapshotTime: Get the snapshot_time field of the given VDI. */
func (client *XenClient) VDIGetSnapshotTime(self string) (result time.Time, err error) {
obj, err := client.APICall("VDI.get_snapshot_time", self)
if err != nil {
return
}
result = obj.(time.Time)
return
}
/* GetSnapshots: Get the snapshots field of the given VDI. */
func (client *XenClient) VDIGetSnapshots(self string) (result []string, err error) {
obj, err := client.APICall("VDI.get_snapshots", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetSnapshotOf: Get the snapshot_of field of the given VDI. */
func (client *XenClient) VDIGetSnapshotOf(self string) (result string, err error) {
obj, err := client.APICall("VDI.get_snapshot_of", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetIsASnapshot: Get the is_a_snapshot field of the given VDI. */
func (client *XenClient) VDIGetIsASnapshot(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_is_a_snapshot", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetSmConfig: Get the sm_config field of the given VDI. */
func (client *XenClient) VDIGetSmConfig(self string) (result map[string]string, err error) {
obj, err := client.APICall("VDI.get_sm_config", self)
if err != nil {
return
}
interim := reflect.ValueOf(obj)
result = map[string]string{}
for _, key := range interim.MapKeys() {
obj := interim.MapIndex(key)
result[key.String()] = obj.String()
}
return
}
/* GetXenstoreData: Get the xenstore_data field of the given VDI. */
func (client *XenClient) VDIGetXenstoreData(self string) (result map[string]string, err error) {
obj, err := client.APICall("VDI.get_xenstore_data", self)
if err != nil {
return
}
interim := reflect.ValueOf(obj)
result = map[string]string{}
for _, key := range interim.MapKeys() {
obj := interim.MapIndex(key)
result[key.String()] = obj.String()
}
return
}
/* GetParent: Get the parent field of the given VDI. */
func (client *XenClient) VDIGetParent(self string) (result string, err error) {
obj, err := client.APICall("VDI.get_parent", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetMissing: Get the missing field of the given VDI. */
func (client *XenClient) VDIGetMissing(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_missing", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetManaged: Get the managed field of the given VDI. */
func (client *XenClient) VDIGetManaged(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_managed", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetLocation: Get the location field of the given VDI. */
func (client *XenClient) VDIGetLocation(self string) (result string, err error) {
obj, err := client.APICall("VDI.get_location", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetStorageLock: Get the storage_lock field of the given VDI. */
func (client *XenClient) VDIGetStorageLock(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_storage_lock", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetOtherConfig: Get the other_config field of the given VDI. */
func (client *XenClient) VDIGetOtherConfig(self string) (result map[string]string, err error) {
obj, err := client.APICall("VDI.get_other_config", self)
if err != nil {
return
}
interim := reflect.ValueOf(obj)
result = map[string]string{}
for _, key := range interim.MapKeys() {
obj := interim.MapIndex(key)
result[key.String()] = obj.String()
}
return
}
/* GetReadOnly: Get the read_only field of the given VDI. */
func (client *XenClient) VDIGetReadOnly(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_read_only", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetSharable: Get the sharable field of the given VDI. */
func (client *XenClient) VDIGetSharable(self string) (result bool, err error) {
obj, err := client.APICall("VDI.get_sharable", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetType: Get the type field of the given VDI. */
func (client *XenClient) VDIGetType(self string) (result VdiType, err error) {
obj, err := client.APICall("VDI.get_type", self)
if err != nil {
return
}
result = ToVdiType(obj.(string))
return
}
/* GetPhysicalUtilisation: Get the physical_utilisation field of the given VDI. */
func (client *XenClient) VDIGetPhysicalUtilisation(self string) (result int, err error) {
obj, err := client.APICall("VDI.get_physical_utilisation", self)
if err != nil {
return
}
result = obj.(int)
return
}
/* GetVirtualSize: Get the virtual_size field of the given VDI. */
func (client *XenClient) VDIGetVirtualSize(self string) (result int, err error) {
obj, err := client.APICall("VDI.get_virtual_size", self)
if err != nil {
return
}
result = obj.(int)
return
}
/* GetCrashDumps: Get the crash_dumps field of the given VDI. */
func (client *XenClient) VDIGetCrashDumps(self string) (result []string, err error) {
obj, err := client.APICall("VDI.get_crash_dumps", self)
if err != nil {
return
}