forked from sarah-soo/go-xen-api-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
host_gen.go
3293 lines (3117 loc) · 115 KB
/
host_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 HostAllowedOperations string
const (
// Indicates this host is able to provision another VM
HostAllowedOperationsProvision HostAllowedOperations = "provision"
// Indicates this host is evacuating
HostAllowedOperationsEvacuate HostAllowedOperations = "evacuate"
// Indicates this host is in the process of shutting itself down
HostAllowedOperationsShutdown HostAllowedOperations = "shutdown"
// Indicates this host is in the process of rebooting
HostAllowedOperationsReboot HostAllowedOperations = "reboot"
// Indicates this host is in the process of being powered on
HostAllowedOperationsPowerOn HostAllowedOperations = "power_on"
// This host is starting a VM
HostAllowedOperationsVMStart HostAllowedOperations = "vm_start"
// This host is resuming a VM
HostAllowedOperationsVMResume HostAllowedOperations = "vm_resume"
// This host is the migration target of a VM
HostAllowedOperationsVMMigrate HostAllowedOperations = "vm_migrate"
// Indicates this host is being updated
HostAllowedOperationsApplyUpdates HostAllowedOperations = "apply_updates"
)
type HostDisplay string
const (
// This host is outputting its console to a physical display device
HostDisplayEnabled HostDisplay = "enabled"
// The host will stop outputting its console to a physical display device on next boot
HostDisplayDisableOnReboot HostDisplay = "disable_on_reboot"
// This host is not outputting its console to a physical display device
HostDisplayDisabled HostDisplay = "disabled"
// The host will start outputting its console to a physical display device on next boot
HostDisplayEnableOnReboot HostDisplay = "enable_on_reboot"
)
type HostSchedGran string
const (
// core scheduling
HostSchedGranCore HostSchedGran = "core"
// CPU scheduling
HostSchedGranCPU HostSchedGran = "cpu"
// socket scheduling
HostSchedGranSocket HostSchedGran = "socket"
)
type HostRecord struct {
// Unique identifier/object reference
UUID string
// a human-readable name
NameLabel string
// a notes field containing human-readable description
NameDescription string
// Virtualization memory overhead (bytes).
MemoryOverhead int
// 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 []HostAllowedOperations
// 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]HostAllowedOperations
// major version number
APIVersionMajor int
// minor version number
APIVersionMinor int
// identification of vendor
APIVersionVendor string
// details of vendor implementation
APIVersionVendorImplementation map[string]string
// True if the host is currently enabled
Enabled bool
// version strings
SoftwareVersion map[string]string
// additional configuration
OtherConfig map[string]string
// Xen capabilities
Capabilities []string
// The CPU configuration on this host. May contain keys such as "nr_nodes", "sockets_per_node", "cores_per_socket", or "threads_per_core"
CPUConfiguration map[string]string
// Scheduler policy currently in force on this host
SchedPolicy string
// a list of the bootloaders installed on the machine
SupportedBootloaders []string
// list of VMs currently resident on host
ResidentVMs []VMRef
// logging configuration
Logging map[string]string
// physical network interfaces
PIFs []PIFRef
// The SR in which VDIs for suspend images are created
SuspendImageSr SRRef
// The SR in which VDIs for crash dumps are created
CrashDumpSr SRRef
// Set of host crash dumps
Crashdumps []HostCrashdumpRef
// Set of host patches
Patches []HostPatchRef
// Set of updates
Updates []PoolUpdateRef
// physical blockdevices
PBDs []PBDRef
// The physical CPUs on this host
HostCPUs []HostCPURef
// Details about the physical CPUs on this host
CPUInfo map[string]string
// The hostname of this host
Hostname string
// The address by which this host can be contacted from any other host in the pool
Address string
// metrics associated with this host
Metrics HostMetricsRef
// State of the current license
LicenseParams map[string]string
// The set of statefiles accessible from this host
HaStatefiles []string
// The set of hosts visible via the network from this host
HaNetworkPeers []string
// Binary blobs associated with this host
Blobs map[string]BlobRef
// user-specified tags for categorization purposes
Tags []string
// type of external authentication service configured; empty if none configured.
ExternalAuthType string
// name of external authentication service configured; empty if none configured.
ExternalAuthServiceName string
// configuration specific to external authentication service
ExternalAuthConfiguration map[string]string
// Product edition
Edition string
// Contact information of the license server
LicenseServer map[string]string
// BIOS strings
BiosStrings map[string]string
// The power on mode
PowerOnMode string
// The power on config
PowerOnConfig map[string]string
// The SR that is used as a local cache
LocalCacheSr SRRef
// Information about chipset features
ChipsetInfo map[string]string
// List of PCI devices in the host
PCIs []PCIRef
// List of physical GPUs in the host
PGPUs []PGPURef
// List of physical USBs in the host
PUSBs []PUSBRef
// Allow SSLv3 protocol and ciphersuites as used by older server versions. This controls both incoming and outgoing connections. When this is set to a different value, the host immediately restarts its SSL/TLS listening service; typically this takes less than a second but existing connections to it will be broken. API login sessions will remain valid.
SslLegacy bool
// VCPUs params to apply to all resident guests
GuestVCPUsParams map[string]string
// indicates whether the host is configured to output its console to a physical display device
Display HostDisplay
// The set of versions of the virtual hardware platform that the host can offer to its guests
VirtualHardwarePlatformVersions []int
// The control domain (domain 0)
ControlDomain VMRef
// List of updates which require reboot
UpdatesRequiringReboot []PoolUpdateRef
// List of features available on this host
Features []FeatureRef
// The initiator IQN for the host
IscsiIqn string
// Specifies whether multipathing is enabled
Multipathing bool
// The UEFI certificates allowing Secure Boot
UefiCertificates string
// List of certificates installed in the host
Certificates []CertificateRef
// List of all available product editions
Editions []string
// The set of pending guidances after applying updates
PendingGuidances []UpdateGuidances
// True if this host has TLS verifcation enabled
TLSVerificationEnabled bool
// Date and time when the last software update was applied
LastSoftwareUpdate time.Time
// Reflects whether port 80 is open (false) or not (true)
HTTPSOnly bool
}
type HostRef string
// A physical host
type HostClass struct {
client *Client
}
// GetAllRecords Return a map of host references to host records for all hosts known to the system.
func (_class HostClass) GetAllRecords(sessionID SessionRef) (_retval map[HostRef]HostRecord, _err error) {
_method := "host.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 = convertHostRefToHostRecordMapToGo(_method + " -> ", _result.Value)
return
}
// GetAll Return a list of all the hosts known to the system.
func (_class HostClass) GetAll(sessionID SessionRef) (_retval []HostRef, _err error) {
_method := "host.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 = convertHostRefSetToGo(_method + " -> ", _result.Value)
return
}
// SetHTTPSOnly updates the host firewall to open or close port 80 depending on the value
func (_class HostClass) SetHTTPSOnly(sessionID SessionRef, self HostRef, value bool) (_err error) {
_method := "host.set_https_only"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertHostRefToXen(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
}
// ApplyUpdates apply updates from current enabled repository on a host
func (_class HostClass) ApplyUpdates(sessionID SessionRef, self HostRef, hash string) (_retval [][]string, _err error) {
_method := "host.apply_updates"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_hashArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "hash"), hash)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg, _hashArg)
if _err != nil {
return
}
_retval, _err = convertStringSetSetToGo(_method + " -> ", _result.Value)
return
}
// EmergencyReenableTLSVerification Reenable TLS verification for this host only
func (_class HostClass) EmergencyReenableTLSVerification(sessionID SessionRef) (_err error) {
_method := "host.emergency_reenable_tls_verification"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg)
return
}
// EmergencyDisableTLSVerification Disable TLS verification for this host only
func (_class HostClass) EmergencyDisableTLSVerification(sessionID SessionRef) (_err error) {
_method := "host.emergency_disable_tls_verification"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg)
return
}
// GetSchedGran Gets xen's sched-gran on a host
func (_class HostClass) GetSchedGran(sessionID SessionRef, self HostRef) (_retval HostSchedGran, _err error) {
_method := "host.get_sched_gran"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertHostRefToXen(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 = convertEnumHostSchedGranToGo(_method + " -> ", _result.Value)
return
}
// SetSchedGran Sets xen's sched-gran on a host. See: https://xenbits.xen.org/docs/unstable/misc/xen-command-line.html#sched-gran-x86
func (_class HostClass) SetSchedGran(sessionID SessionRef, self HostRef, value HostSchedGran) (_err error) {
_method := "host.set_sched_gran"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_valueArg, _err := convertEnumHostSchedGranToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg, _valueArg)
return
}
// SetUefiCertificates Sets the UEFI certificates on a host
func (_class HostClass) SetUefiCertificates(sessionID SessionRef, host HostRef, value string) (_err error) {
_method := "host.set_uefi_certificates"
_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
}
_valueArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg, _valueArg)
return
}
// SetMultipathing Specifies whether multipathing is enabled
func (_class HostClass) SetMultipathing(sessionID SessionRef, host HostRef, value bool) (_err error) {
_method := "host.set_multipathing"
_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
}
_valueArg, _err := convertBoolToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg, _valueArg)
return
}
// SetIscsiIqn Sets the initiator IQN for the host
func (_class HostClass) SetIscsiIqn(sessionID SessionRef, host HostRef, value string) (_err error) {
_method := "host.set_iscsi_iqn"
_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
}
_valueArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg, _valueArg)
return
}
// SetSslLegacy Enable/disable SSLv3 for interoperability with older server versions. When this is set to a different value, the host immediately restarts its SSL/TLS listening service; typically this takes less than a second but existing connections to it will be broken. API login sessions will remain valid.
func (_class HostClass) SetSslLegacy(sessionID SessionRef, self HostRef, value bool) (_err error) {
_method := "host.set_ssl_legacy"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertHostRefToXen(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
}
// DisableDisplay Disable console output to the physical display device next time this host boots
func (_class HostClass) DisableDisplay(sessionID SessionRef, host HostRef) (_retval HostDisplay, _err error) {
_method := "host.disable_display"
_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
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg)
if _err != nil {
return
}
_retval, _err = convertEnumHostDisplayToGo(_method + " -> ", _result.Value)
return
}
// EnableDisplay Enable console output to the physical display device next time this host boots
func (_class HostClass) EnableDisplay(sessionID SessionRef, host HostRef) (_retval HostDisplay, _err error) {
_method := "host.enable_display"
_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
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg)
if _err != nil {
return
}
_retval, _err = convertEnumHostDisplayToGo(_method + " -> ", _result.Value)
return
}
// DeclareDead Declare that a host is dead. This is a dangerous operation, and should only be called if the administrator is absolutely sure the host is definitely dead
func (_class HostClass) DeclareDead(sessionID SessionRef, host HostRef) (_err error) {
_method := "host.declare_dead"
_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
}
// MigrateReceive Prepare to receive a VM, returning a token which can be passed to VM.migrate.
func (_class HostClass) MigrateReceive(sessionID SessionRef, host HostRef, network NetworkRef, options map[string]string) (_retval map[string]string, _err error) {
_method := "host.migrate_receive"
_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
}
_networkArg, _err := convertNetworkRefToXen(fmt.Sprintf("%s(%s)", _method, "network"), network)
if _err != nil {
return
}
_optionsArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "options"), options)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg, _networkArg, _optionsArg)
if _err != nil {
return
}
_retval, _err = convertStringToStringMapToGo(_method + " -> ", _result.Value)
return
}
// DisableLocalStorageCaching Disable the use of a local SR for caching purposes
func (_class HostClass) DisableLocalStorageCaching(sessionID SessionRef, host HostRef) (_err error) {
_method := "host.disable_local_storage_caching"
_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
}
// EnableLocalStorageCaching Enable the use of a local SR for caching purposes
func (_class HostClass) EnableLocalStorageCaching(sessionID SessionRef, host HostRef, sr SRRef) (_err error) {
_method := "host.enable_local_storage_caching"
_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
}
_srArg, _err := convertSRRefToXen(fmt.Sprintf("%s(%s)", _method, "sr"), sr)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg, _srArg)
return
}
// ResetCPUFeatures Remove the feature mask, such that after a reboot all features of the CPU are enabled.
func (_class HostClass) ResetCPUFeatures(sessionID SessionRef, host HostRef) (_err error) {
_method := "host.reset_cpu_features"
_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
}
// SetCPUFeatures Set the CPU features to be used after a reboot, if the given features string is valid.
func (_class HostClass) SetCPUFeatures(sessionID SessionRef, host HostRef, features string) (_err error) {
_method := "host.set_cpu_features"
_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
}
_featuresArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "features"), features)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg, _featuresArg)
return
}
// SetPowerOnMode Set the power-on-mode, host, user and password
func (_class HostClass) SetPowerOnMode(sessionID SessionRef, self HostRef, powerOnMode string, powerOnConfig map[string]string) (_err error) {
_method := "host.set_power_on_mode"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
if _err != nil {
return
}
_powerOnModeArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "power_on_mode"), powerOnMode)
if _err != nil {
return
}
_powerOnConfigArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "power_on_config"), powerOnConfig)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _selfArg, _powerOnModeArg, _powerOnConfigArg)
return
}
// RefreshPackInfo Refresh the list of installed Supplemental Packs.
func (_class HostClass) RefreshPackInfo(sessionID SessionRef, host HostRef) (_err error) {
_method := "host.refresh_pack_info"
_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
}
// ApplyEdition Change to another edition, or reactivate the current edition after a license has expired. This may be subject to the successful checkout of an appropriate license.
func (_class HostClass) ApplyEdition(sessionID SessionRef, host HostRef, edition string, force bool) (_err error) {
_method := "host.apply_edition"
_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
}
_editionArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "edition"), edition)
if _err != nil {
return
}
_forceArg, _err := convertBoolToXen(fmt.Sprintf("%s(%s)", _method, "force"), force)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg, _editionArg, _forceArg)
return
}
// ResetServerCertificate Delete the current TLS server certificate and replace by a new, self-signed one. This should only be used with extreme care.
func (_class HostClass) ResetServerCertificate(sessionID SessionRef, host HostRef) (_err error) {
_method := "host.reset_server_certificate"
_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
}
// EmergencyResetServerCertificate Delete the current TLS server certificate and replace by a new, self-signed one. This should only be used with extreme care.
func (_class HostClass) EmergencyResetServerCertificate(sessionID SessionRef) (_err error) {
_method := "host.emergency_reset_server_certificate"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg)
return
}
// InstallServerCertificate Install the TLS server certificate.
func (_class HostClass) InstallServerCertificate(sessionID SessionRef, host HostRef, certificate string, privateKey string, certificateChain string) (_err error) {
_method := "host.install_server_certificate"
_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
}
_certificateArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "certificate"), certificate)
if _err != nil {
return
}
_privateKeyArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "private_key"), privateKey)
if _err != nil {
return
}
_certificateChainArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "certificate_chain"), certificateChain)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg, _certificateArg, _privateKeyArg, _certificateChainArg)
return
}
// RefreshServerCertificate Replace the internal self-signed host certficate with a new one.
func (_class HostClass) RefreshServerCertificate(sessionID SessionRef, host HostRef) (_err error) {
_method := "host.refresh_server_certificate"
_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
}
// GetServerCertificate Get the installed server public TLS certificate.
func (_class HostClass) GetServerCertificate(sessionID SessionRef, host HostRef) (_retval string, _err error) {
_method := "host.get_server_certificate"
_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
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg)
if _err != nil {
return
}
_retval, _err = convertStringToGo(_method + " -> ", _result.Value)
return
}
// RetrieveWlbEvacuateRecommendations Retrieves recommended host migrations to perform when evacuating the host from the wlb server. If a VM cannot be migrated from the host the reason is listed instead of a recommendation.
func (_class HostClass) RetrieveWlbEvacuateRecommendations(sessionID SessionRef, self HostRef) (_retval map[VMRef][]string, _err error) {
_method := "host.retrieve_wlb_evacuate_recommendations"
_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
if _err != nil {
return
}
_selfArg, _err := convertHostRefToXen(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 = convertVMRefToStringSetMapToGo(_method + " -> ", _result.Value)
return
}
// DisableExternalAuth This call disables external authentication on the local host
func (_class HostClass) DisableExternalAuth(sessionID SessionRef, host HostRef, config map[string]string) (_err error) {
_method := "host.disable_external_auth"
_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
}
_configArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "config"), config)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg, _configArg)
return
}
// EnableExternalAuth This call enables external authentication on a host
func (_class HostClass) EnableExternalAuth(sessionID SessionRef, host HostRef, config map[string]string, serviceName string, authType string) (_err error) {
_method := "host.enable_external_auth"
_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
}
_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, _hostArg, _configArg, _serviceNameArg, _authTypeArg)
return
}
// GetServerLocaltime This call queries the host's clock for the current time in the host's local timezone
func (_class HostClass) GetServerLocaltime(sessionID SessionRef, host HostRef) (_retval time.Time, _err error) {
_method := "host.get_server_localtime"
_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
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg)
if _err != nil {
return
}
_retval, _err = convertTimeToGo(_method + " -> ", _result.Value)
return
}
// GetServertime This call queries the host's clock for the current time
func (_class HostClass) GetServertime(sessionID SessionRef, host HostRef) (_retval time.Time, _err error) {
_method := "host.get_servertime"
_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
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg)
if _err != nil {
return
}
_retval, _err = convertTimeToGo(_method + " -> ", _result.Value)
return
}
// CallExtension Call an API extension on this host
func (_class HostClass) CallExtension(sessionID SessionRef, host HostRef, call string) (_retval string, _err error) {
_method := "host.call_extension"
_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
}
_callArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "call"), call)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg, _callArg)
if _err != nil {
return
}
_retval, _err = convertStringToGo(_method + " -> ", _result.Value)
return
}
// HasExtension Return true if the extension is available on the host
func (_class HostClass) HasExtension(sessionID SessionRef, host HostRef, name string) (_retval bool, _err error) {
_method := "host.has_extension"
_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
}
_nameArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "name"), name)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg, _nameArg)
if _err != nil {
return
}
_retval, _err = convertBoolToGo(_method + " -> ", _result.Value)
return
}
// CallPlugin Call an API plugin on this host
func (_class HostClass) CallPlugin(sessionID SessionRef, host HostRef, plugin string, fn string, args map[string]string) (_retval string, _err error) {
_method := "host.call_plugin"
_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
}
_pluginArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "plugin"), plugin)
if _err != nil {
return
}
_fnArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "fn"), fn)
if _err != nil {
return
}
_argsArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "args"), args)
if _err != nil {
return
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg, _pluginArg, _fnArg, _argsArg)
if _err != nil {
return
}
_retval, _err = convertStringToGo(_method + " -> ", _result.Value)
return
}
// CreateNewBlob Create a placeholder for a named binary blob of data that is associated with this host
func (_class HostClass) CreateNewBlob(sessionID SessionRef, host HostRef, name string, mimeType string, public bool) (_retval BlobRef, _err error) {
_method := "host.create_new_blob"
_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
}
_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, _hostArg, _nameArg, _mimeTypeArg, _publicArg)
if _err != nil {
return
}
_retval, _err = convertBlobRefToGo(_method + " -> ", _result.Value)
return
}
// BackupRrds This causes the RRDs to be backed up to the master
func (_class HostClass) BackupRrds(sessionID SessionRef, host HostRef, delay float64) (_err error) {
_method := "host.backup_rrds"
_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
}
_delayArg, _err := convertFloatToXen(fmt.Sprintf("%s(%s)", _method, "delay"), delay)
if _err != nil {
return
}
_, _err = _class.client.APICall(_method, _sessionIDArg, _hostArg, _delayArg)
return
}
// SyncData This causes the synchronisation of the non-database data (messages, RRDs and so on) stored on the master to be synchronised with the host
func (_class HostClass) SyncData(sessionID SessionRef, host HostRef) (_err error) {
_method := "host.sync_data"
_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
}
// ComputeMemoryOverhead Computes the virtualization memory overhead of a host.
func (_class HostClass) ComputeMemoryOverhead(sessionID SessionRef, host HostRef) (_retval int, _err error) {
_method := "host.compute_memory_overhead"
_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
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg)
if _err != nil {
return
}
_retval, _err = convertIntToGo(_method + " -> ", _result.Value)
return
}
// ComputeFreeMemory Computes the amount of free memory on the host.
func (_class HostClass) ComputeFreeMemory(sessionID SessionRef, host HostRef) (_retval int, _err error) {
_method := "host.compute_free_memory"
_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
}
_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg)
if _err != nil {
return
}
_retval, _err = convertIntToGo(_method + " -> ", _result.Value)
return
}
// SetHostnameLive Sets the host name to the specified string. Both the API and lower-level system hostname are changed immediately.
//
// Errors:
// HOST_NAME_INVALID - The server name is invalid.