-
Notifications
You must be signed in to change notification settings - Fork 25
/
pool_gen.go
2209 lines (2089 loc) · 78.3 KB
/
pool_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 file is generated. To change the content of this file, please do not
// apply the change to this file because it will get overwritten. Instead,
// change xenapi.go and execute 'go generate'.
//
package xenapi
import (
"fmt"
"github.com/amfranz/go-xmlrpc-client"
"reflect"
"strconv"
"time"
)
var _ = fmt.Errorf
var _ = xmlrpc.NewClient
var _ = reflect.TypeOf
var _ = strconv.Atoi
var _ = time.UTC
type PoolAllowedOperations string
const (
// Indicates this pool is in the process of enabling HA
PoolAllowedOperationsHaEnable PoolAllowedOperations = "ha_enable"
// Indicates this pool is in the process of disabling HA
PoolAllowedOperationsHaDisable PoolAllowedOperations = "ha_disable"
)
type PoolRecord struct {
// Unique identifier/object reference
UUID string
// Short name
NameLabel string
// Description
NameDescription string
// The host that is pool master
Master HostRef
// Default SR for VDIs
DefaultSR SRRef
// The SR in which VDIs for suspend images are created
SuspendImageSR SRRef
// The SR in which VDIs for crash dumps are created
CrashDumpSR SRRef
// additional configuration
OtherConfig map[string]string
// true if HA is enabled on the pool, false otherwise
HaEnabled bool
// The current HA configuration
HaConfiguration map[string]string
// HA statefile VDIs in use
HaStatefiles []string
// Number of host failures to tolerate before the Pool is declared to be overcommitted
HaHostFailuresToTolerate int
// Number of future host failures we have managed to find a plan for. Once this reaches zero any future host failures will cause the failure of protected VMs.
HaPlanExistsFor int
// If set to false then operations which would cause the Pool to become overcommitted will be blocked.
HaAllowOvercommit bool
// True if the Pool is considered to be overcommitted i.e. if there exist insufficient physical resources to tolerate the configured number of host failures
HaOvercommitted bool
// Binary blobs associated with this pool
Blobs map[string]BlobRef
// user-specified tags for categorization purposes
Tags []string
// gui-specific configuration for pool
GuiConfig map[string]string
// Configuration for the automatic health check feature
HealthCheckConfig map[string]string
// Url for the configured workload balancing host
WlbURL string
// Username for accessing the workload balancing host
WlbUsername string
// true if workload balancing is enabled on the pool, false otherwise
WlbEnabled bool
// true if communication with the WLB server should enforce SSL certificate verification.
WlbVerifyCert bool
// true a redo-log is to be used other than when HA is enabled, false otherwise
RedoLogEnabled bool
// indicates the VDI to use for the redo-log other than when HA is enabled
RedoLogVdi VDIRef
// address of the vswitch controller
VswitchController string
// Pool-wide restrictions currently in effect
Restrictions map[string]string
// The set of currently known metadata VDIs for this pool
MetadataVDIs []VDIRef
// The HA cluster stack that is currently in use. Only valid when HA is enabled.
HaClusterStack string
// 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.
AllowedOperations []PoolAllowedOperations
// links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
CurrentOperations map[string]PoolAllowedOperations
// Pool-wide guest agent configuration information
GuestAgentConfig map[string]string
// Details about the physical CPUs on the pool
CPUInfo map[string]string
// The pool-wide policy for clients on whether to use the vendor device or not on newly created VMs. This field will also be consulted if the 'has_vendor_device' field is not specified in the VM.create call.
PolicyNoVendorDevice bool
// The pool-wide flag to show if the live patching feauture is disabled or not.
LivePatchingDisabled bool
// true if IGMP snooping is enabled in the pool, false otherwise.
IgmpSnoopingEnabled bool
}
type PoolRef string
// Pool-wide information
type PoolClass struct {
client *Client
}
// GetAllRecords Return a map of pool references to pool records for all pools known to the system.
func (_class PoolClass) GetAllRecords(sessionID SessionRef) (_retval map[PoolRef]PoolRecord, _err error) {
_method := "pool.get_all_records"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg)
if _err != nil {
return
}
_retval, _err = convertPoolRefToPoolRecordMapToGo(_method + " -> ", _result.Value)
return
}
// GetAll Return a list of all the pools known to the system.
func (_class PoolClass) GetAll(sessionID SessionRef) (_retval []PoolRef, _err error) {
_method := "pool.get_all"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg)
if _err != nil {
return
}
_retval, _err = convertPoolRefSetToGo(_method + " -> ", _result.Value)
return
}
// RemoveFromGuestAgentConfig Remove a key-value pair from the pool-wide guest agent configuration
func (_class PoolClass) RemoveFromGuestAgentConfig(sessionID SessionRef, self PoolRef, key string) (_err error) {
_method := "pool.remove_from_guest_agent_config"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_keyArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "key"), key)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg, _keyArg)
return
}
// AddToGuestAgentConfig Add a key-value pair to the pool-wide guest agent configuration
func (_class PoolClass) AddToGuestAgentConfig(sessionID SessionRef, self PoolRef, key string, value string) (_err error) {
_method := "pool.add_to_guest_agent_config"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_keyArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "key"), key)
if _err != nil {
return
}
_valueArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg, _keyArg, _valueArg)
return
}
// HasExtension Return true if the extension is available on the pool
func (_class PoolClass) HasExtension(sessionID SessionRef, self PoolRef, name string) (_retval bool, _err error) {
_method := "pool.has_extension"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_nameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name"), name)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg, _nameArg)
if _err != nil {
return
}
_retval, _err = convertBoolToGo(_method + " -> ", _result.Value)
return
}
// SetIgmpSnoopingEnabled Enable or disable IGMP Snooping on the pool.
func (_class PoolClass) SetIgmpSnoopingEnabled(sessionID SessionRef, self PoolRef, value bool) (_err error) {
_method := "pool.set_igmp_snooping_enabled"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_valueArg, _err := convertBoolToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg, _valueArg)
return
}
// DisableSslLegacy Sets ssl_legacy true on each host, pool-master last. See Host.ssl_legacy and Host.set_ssl_legacy.
func (_class PoolClass) DisableSslLegacy(sessionID SessionRef, self PoolRef) (_err error) {
_method := "pool.disable_ssl_legacy"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg)
return
}
// EnableSslLegacy Sets ssl_legacy true on each host, pool-master last. See Host.ssl_legacy and Host.set_ssl_legacy.
func (_class PoolClass) EnableSslLegacy(sessionID SessionRef, self PoolRef) (_err error) {
_method := "pool.enable_ssl_legacy"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg)
return
}
// ApplyEdition Apply an edition to all hosts in the pool
func (_class PoolClass) ApplyEdition(sessionID SessionRef, self PoolRef, edition string) (_err error) {
_method := "pool.apply_edition"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_editionArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "edition"), edition)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg, _editionArg)
return
}
// GetLicenseState This call returns the license state for the pool
func (_class PoolClass) GetLicenseState(sessionID SessionRef, self PoolRef) (_retval map[string]string, _err error) {
_method := "pool.get_license_state"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
if _err != nil {
return
}
_retval, _err = convertStringToStringMapToGo(_method + " -> ", _result.Value)
return
}
// DisableLocalStorageCaching This call disables pool-wide local storage caching
func (_class PoolClass) DisableLocalStorageCaching(sessionID SessionRef, self PoolRef) (_err error) {
_method := "pool.disable_local_storage_caching"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg)
return
}
// EnableLocalStorageCaching This call attempts to enable pool-wide local storage caching
func (_class PoolClass) EnableLocalStorageCaching(sessionID SessionRef, self PoolRef) (_err error) {
_method := "pool.enable_local_storage_caching"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg)
return
}
// TestArchiveTarget This call tests if a location is valid
func (_class PoolClass) TestArchiveTarget(sessionID SessionRef, self PoolRef, config map[string]string) (_retval string, _err error) {
_method := "pool.test_archive_target"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_configArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "config"), config)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg, _configArg)
if _err != nil {
return
}
_retval, _err = convertStringToGo(_method + " -> ", _result.Value)
return
}
// SetVswitchController Set the IP address of the vswitch controller.
func (_class PoolClass) SetVswitchController(sessionID SessionRef, address string) (_err error) {
_method := "pool.set_vswitch_controller"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_addressArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "address"), address)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _addressArg)
return
}
// DisableRedoLog Disable the redo log if in use, unless HA is enabled.
func (_class PoolClass) DisableRedoLog(sessionID SessionRef) (_err error) {
_method := "pool.disable_redo_log"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg)
return
}
// EnableRedoLog Enable the redo log on the given SR and start using it, unless HA is enabled.
func (_class PoolClass) EnableRedoLog(sessionID SessionRef, sr SRRef) (_err error) {
_method := "pool.enable_redo_log"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_srArg, _err := convertSRRefToXen(fmt.Sprintf("%s(%s)", _method, "sr"), sr)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _srArg)
return
}
// CertificateSync Sync SSL certificates from master to slaves.
func (_class PoolClass) CertificateSync(sessionID SessionRef) (_err error) {
_method := "pool.certificate_sync"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg)
return
}
// CrlList List all installed SSL certificate revocation lists.
func (_class PoolClass) CrlList(sessionID SessionRef) (_retval []string, _err error) {
_method := "pool.crl_list"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg)
if _err != nil {
return
}
_retval, _err = convertStringSetToGo(_method + " -> ", _result.Value)
return
}
// CrlUninstall Remove an SSL certificate revocation list.
func (_class PoolClass) CrlUninstall(sessionID SessionRef, name string) (_err error) {
_method := "pool.crl_uninstall"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_nameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name"), name)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _nameArg)
return
}
// CrlInstall Install an SSL certificate revocation list, pool-wide.
func (_class PoolClass) CrlInstall(sessionID SessionRef, name string, cert string) (_err error) {
_method := "pool.crl_install"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_nameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name"), name)
if _err != nil {
return
}
_certArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "cert"), cert)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _nameArg, _certArg)
return
}
// CertificateList List all installed SSL certificates.
func (_class PoolClass) CertificateList(sessionID SessionRef) (_retval []string, _err error) {
_method := "pool.certificate_list"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg)
if _err != nil {
return
}
_retval, _err = convertStringSetToGo(_method + " -> ", _result.Value)
return
}
// CertificateUninstall Remove an SSL certificate.
func (_class PoolClass) CertificateUninstall(sessionID SessionRef, name string) (_err error) {
_method := "pool.certificate_uninstall"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_nameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name"), name)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _nameArg)
return
}
// CertificateInstall Install an SSL certificate pool-wide.
func (_class PoolClass) CertificateInstall(sessionID SessionRef, name string, cert string) (_err error) {
_method := "pool.certificate_install"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_nameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name"), name)
if _err != nil {
return
}
_certArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "cert"), cert)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _nameArg, _certArg)
return
}
// SendTestPost Send the given body to the given host and port, using HTTPS, and print the response. This is used for debugging the SSL layer.
func (_class PoolClass) SendTestPost(sessionID SessionRef, host string, port int, body string) (_retval string, _err error) {
_method := "pool.send_test_post"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_hostArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "host"), host)
if _err != nil {
return
}
_portArg, _err := convertIntToXen(fmt.Sprintf("%s(%s)", _method, "port"), port)
if _err != nil {
return
}
_bodyArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "body"), body)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg, _portArg, _bodyArg)
if _err != nil {
return
}
_retval, _err = convertStringToGo(_method + " -> ", _result.Value)
return
}
// RetrieveWlbRecommendations Retrieves vm migrate recommendations for the pool from the workload balancing server
func (_class PoolClass) RetrieveWlbRecommendations(sessionID SessionRef) (_retval map[VMRef][]string, _err error) {
_method := "pool.retrieve_wlb_recommendations"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg)
if _err != nil {
return
}
_retval, _err = convertVMRefToStringSetMapToGo(_method + " -> ", _result.Value)
return
}
// RetrieveWlbConfiguration Retrieves the pool optimization criteria from the workload balancing server
func (_class PoolClass) RetrieveWlbConfiguration(sessionID SessionRef) (_retval map[string]string, _err error) {
_method := "pool.retrieve_wlb_configuration"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg)
if _err != nil {
return
}
_retval, _err = convertStringToStringMapToGo(_method + " -> ", _result.Value)
return
}
// SendWlbConfiguration Sets the pool optimization criteria for the workload balancing server
func (_class PoolClass) SendWlbConfiguration(sessionID SessionRef, config map[string]string) (_err error) {
_method := "pool.send_wlb_configuration"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_configArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "config"), config)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _configArg)
return
}
// DeconfigureWlb Permanently deconfigures workload balancing monitoring on this pool
func (_class PoolClass) DeconfigureWlb(sessionID SessionRef) (_err error) {
_method := "pool.deconfigure_wlb"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg)
return
}
// InitializeWlb Initializes workload balancing monitoring on this pool with the specified wlb server
func (_class PoolClass) InitializeWlb(sessionID SessionRef, wlbURL string, wlbUsername string, wlbPassword string, xenserverUsername string, xenserverPassword string) (_err error) {
_method := "pool.initialize_wlb"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_wlbURLArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "wlb_url"), wlbURL)
if _err != nil {
return
}
_wlbUsernameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "wlb_username"), wlbUsername)
if _err != nil {
return
}
_wlbPasswordArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "wlb_password"), wlbPassword)
if _err != nil {
return
}
_xenserverUsernameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "xenserver_username"), xenserverUsername)
if _err != nil {
return
}
_xenserverPasswordArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "xenserver_password"), xenserverPassword)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _wlbURLArg, _wlbUsernameArg, _wlbPasswordArg, _xenserverUsernameArg, _xenserverPasswordArg)
return
}
// DetectNonhomogeneousExternalAuth This call asynchronously detects if the external authentication configuration in any slave is different from that in the master and raises appropriate alerts
func (_class PoolClass) DetectNonhomogeneousExternalAuth(sessionID SessionRef, pool PoolRef) (_err error) {
_method := "pool.detect_nonhomogeneous_external_auth"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_poolArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "pool"), pool)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _poolArg)
return
}
// DisableExternalAuth This call disables external authentication on all the hosts of the pool
func (_class PoolClass) DisableExternalAuth(sessionID SessionRef, pool PoolRef, config map[string]string) (_err error) {
_method := "pool.disable_external_auth"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_poolArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "pool"), pool)
if _err != nil {
return
}
_configArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "config"), config)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _poolArg, _configArg)
return
}
// EnableExternalAuth This call enables external authentication on all the hosts of the pool
func (_class PoolClass) EnableExternalAuth(sessionID SessionRef, pool PoolRef, config map[string]string, serviceName string, authType string) (_err error) {
_method := "pool.enable_external_auth"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_poolArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "pool"), pool)
if _err != nil {
return
}
_configArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "config"), config)
if _err != nil {
return
}
_serviceNameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "service_name"), serviceName)
if _err != nil {
return
}
_authTypeArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "auth_type"), authType)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _poolArg, _configArg, _serviceNameArg, _authTypeArg)
return
}
// CreateNewBlob Create a placeholder for a named binary blob of data that is associated with this pool
func (_class PoolClass) CreateNewBlob(sessionID SessionRef, pool PoolRef, name string, mimeType string, public bool) (_retval BlobRef, _err error) {
_method := "pool.create_new_blob"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_poolArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "pool"), pool)
if _err != nil {
return
}
_nameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name"), name)
if _err != nil {
return
}
_mimeTypeArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "mime_type"), mimeType)
if _err != nil {
return
}
_publicArg, _err := convertBoolToXen(fmt.Sprintf("%s(%s)", _method, "public"), public)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _poolArg, _nameArg, _mimeTypeArg, _publicArg)
if _err != nil {
return
}
_retval, _err = convertBlobRefToGo(_method + " -> ", _result.Value)
return
}
// SetHaHostFailuresToTolerate Set the maximum number of host failures to consider in the HA VM restart planner
func (_class PoolClass) SetHaHostFailuresToTolerate(sessionID SessionRef, self PoolRef, value int) (_err error) {
_method := "pool.set_ha_host_failures_to_tolerate"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertPoolRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_valueArg, _err := convertIntToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg, _valueArg)
return
}
// HaComputeVMFailoverPlan Return a VM failover plan assuming a given subset of hosts fail
func (_class PoolClass) HaComputeVMFailoverPlan(sessionID SessionRef, failedHosts []HostRef, failedVms []VMRef) (_retval map[VMRef]map[string]string, _err error) {
_method := "pool.ha_compute_vm_failover_plan"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_failedHostsArg, _err := convertHostRefSetToXen(fmt.Sprintf("%s(%s)", _method, "failed_hosts"), failedHosts)
if _err != nil {
return
}
_failedVmsArg, _err := convertVMRefSetToXen(fmt.Sprintf("%s(%s)", _method, "failed_vms"), failedVms)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _failedHostsArg, _failedVmsArg)
if _err != nil {
return
}
_retval, _err = convertVMRefToStringToStringMapMapToGo(_method + " -> ", _result.Value)
return
}
// HaComputeHypotheticalMaxHostFailuresToTolerate Returns the maximum number of host failures we could tolerate before we would be unable to restart the provided VMs
func (_class PoolClass) HaComputeHypotheticalMaxHostFailuresToTolerate(sessionID SessionRef, configuration map[VMRef]string) (_retval int, _err error) {
_method := "pool.ha_compute_hypothetical_max_host_failures_to_tolerate"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_configurationArg, _err := convertVMRefToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "configuration"), configuration)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _configurationArg)
if _err != nil {
return
}
_retval, _err = convertIntToGo(_method + " -> ", _result.Value)
return
}
// HaComputeMaxHostFailuresToTolerate Returns the maximum number of host failures we could tolerate before we would be unable to restart configured VMs
func (_class PoolClass) HaComputeMaxHostFailuresToTolerate(sessionID SessionRef) (_retval int, _err error) {
_method := "pool.ha_compute_max_host_failures_to_tolerate"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg)
if _err != nil {
return
}
_retval, _err = convertIntToGo(_method + " -> ", _result.Value)
return
}
// HaFailoverPlanExists Returns true if a VM failover plan exists for up to 'n' host failures
func (_class PoolClass) HaFailoverPlanExists(sessionID SessionRef, n int) (_retval bool, _err error) {
_method := "pool.ha_failover_plan_exists"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_nArg, _err := convertIntToXen(fmt.Sprintf("%s(%s)", _method, "n"), n)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _nArg)
if _err != nil {
return
}
_retval, _err = convertBoolToGo(_method + " -> ", _result.Value)
return
}
// HaPreventRestartsFor When this call returns the VM restart logic will not run for the requested number of seconds. If the argument is zero then the restart thread is immediately unblocked
func (_class PoolClass) HaPreventRestartsFor(sessionID SessionRef, seconds int) (_err error) {
_method := "pool.ha_prevent_restarts_for"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_secondsArg, _err := convertIntToXen(fmt.Sprintf("%s(%s)", _method, "seconds"), seconds)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _secondsArg)
return
}
// DesignateNewMaster Perform an orderly handover of the role of master to the referenced host.
func (_class PoolClass) DesignateNewMaster(sessionID SessionRef, host HostRef) (_err error) {
_method := "pool.designate_new_master"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_hostArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "host"), host)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg)
return
}
// SyncDatabase Forcibly synchronise the database now
func (_class PoolClass) SyncDatabase(sessionID SessionRef) (_err error) {
_method := "pool.sync_database"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg)
return
}
// DisableHa Turn off High Availability mode
func (_class PoolClass) DisableHa(sessionID SessionRef) (_err error) {
_method := "pool.disable_ha"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg)
return
}
// EnableHa Turn on High Availability mode
func (_class PoolClass) EnableHa(sessionID SessionRef, heartbeatSrs []SRRef, configuration map[string]string) (_err error) {
_method := "pool.enable_ha"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_heartbeatSrsArg, _err := convertSRRefSetToXen(fmt.Sprintf("%s(%s)", _method, "heartbeat_srs"), heartbeatSrs)
if _err != nil {
return
}
_configurationArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "configuration"), configuration)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _heartbeatSrsArg, _configurationArg)
return
}
// CreateVLANFromPIF Create a pool-wide VLAN by taking the PIF.
//
// Errors:
// VLAN_TAG_INVALID - You tried to create a VLAN, but the tag you gave was invalid -- it must be between 0 and 4094. The parameter echoes the VLAN tag you gave.
func (_class PoolClass) CreateVLANFromPIF(sessionID SessionRef, pif PIFRef, network NetworkRef, vlan int) (_retval []PIFRef, _err error) {
_method := "pool.create_VLAN_from_PIF"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_pifArg, _err := convertPIFRefToXen(fmt.Sprintf("%s(%s)", _method, "pif"), pif)
if _err != nil {
return
}
_networkArg, _err := convertNetworkRefToXen(fmt.Sprintf("%s(%s)", _method, "network"), network)
if _err != nil {
return
}
_vlanArg, _err := convertIntToXen(fmt.Sprintf("%s(%s)", _method, "VLAN"), vlan)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _pifArg, _networkArg, _vlanArg)
if _err != nil {
return
}
_retval, _err = convertPIFRefSetToGo(_method + " -> ", _result.Value)
return
}
// ManagementReconfigure Reconfigure the management network interface for all Hosts in the Pool
//
// Errors:
// HA_IS_ENABLED - The operation could not be performed because HA is enabled on the Pool
// PIF_NOT_PRESENT - This host has no PIF on the given network.
// CANNOT_PLUG_BOND_SLAVE - This PIF is a bond slave and cannot be plugged.
// PIF_INCOMPATIBLE_PRIMARY_ADDRESS_TYPE - The primary address types are not compatible
// PIF_HAS_NO_NETWORK_CONFIGURATION - PIF has no IP configuration (mode currently set to 'none')
// PIF_HAS_NO_V6_NETWORK_CONFIGURATION - PIF has no IPv6 configuration (mode currently set to 'none')
func (_class PoolClass) ManagementReconfigure(sessionID SessionRef, network NetworkRef) (_err error) {
_method := "pool.management_reconfigure"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_networkArg, _err := convertNetworkRefToXen(fmt.Sprintf("%s(%s)", _method, "network"), network)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _networkArg)
return
}
// CreateVLAN Create PIFs, mapping a network to the same physical interface/VLAN on each host. This call is deprecated: use Pool.create_VLAN_from_PIF instead.
//
// Errors:
// VLAN_TAG_INVALID - You tried to create a VLAN, but the tag you gave was invalid -- it must be between 0 and 4094. The parameter echoes the VLAN tag you gave.
func (_class PoolClass) CreateVLAN(sessionID SessionRef, device string, network NetworkRef, vlan int) (_retval []PIFRef, _err error) {
_method := "pool.create_VLAN"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_deviceArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "device"), device)
if _err != nil {
return
}
_networkArg, _err := convertNetworkRefToXen(fmt.Sprintf("%s(%s)", _method, "network"), network)
if _err != nil {
return
}
_vlanArg, _err := convertIntToXen(fmt.Sprintf("%s(%s)", _method, "VLAN"), vlan)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _deviceArg, _networkArg, _vlanArg)
if _err != nil {
return
}
_retval, _err = convertPIFRefSetToGo(_method + " -> ", _result.Value)
return
}
// RecoverSlaves Instruct a pool master, M, to try and contact its slaves and, if slaves are in emergency mode, reset their master address to M.
func (_class PoolClass) RecoverSlaves(sessionID SessionRef) (_retval []HostRef, _err error) {
_method := "pool.recover_slaves"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg)
if _err != nil {
return
}
_retval, _err = convertHostRefSetToGo(_method + " -> ", _result.Value)
return
}
// EmergencyResetMaster Instruct a slave already in a pool that the master has changed
func (_class PoolClass) EmergencyResetMaster(sessionID SessionRef, masterAddress string) (_err error) {
_method := "pool.emergency_reset_master"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_masterAddressArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "master_address"), masterAddress)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _masterAddressArg)
return
}
// EmergencyTransitionToMaster Instruct host that's currently a slave to transition to being master
func (_class PoolClass) EmergencyTransitionToMaster(sessionID SessionRef) (_err error) {
_method := "pool.emergency_transition_to_master"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg)
return
}
// Eject Instruct a pool master to eject a host from the pool
func (_class PoolClass) Eject(sessionID SessionRef, host HostRef) (_err error) {
_method := "pool.eject"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return