-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPIF.gen.go
985 lines (847 loc) · 28.8 KB
/
PIF.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
// This is a generated file. DO NOT EDIT manually.
//go:generate goimports -w PIF.gen.go
package go_xen_client
import (
"reflect"
"strconv"
"github.com/nilshell/xmlrpc"
)
//PIF: A physical network interface (note separate VLANs are represented as several PIFs)
type PIF struct {
Uuid string // Unique identifier/object reference
Device string // machine-readable name of the interface (e.g. eth0)
Network string // virtual network to which this pif is connected
Host string // physical machine to which this pif is connected
MAC string // ethernet MAC address of physical interface
MTU int // MTU in octets
VLAN int // VLAN tag for all traffic passing through this interface
Metrics string // metrics associated with this PIF
Physical bool // true if this represents a physical network interface
CurrentlyAttached bool // true if this interface is online
IpConfigurationMode IpConfigurationMode // Sets if and how this interface gets an IP address
IP string // IP address
Netmask string // IP netmask
Gateway string // IP gateway
DNS string // Comma separated list of the IP addresses of the DNS servers to use
BondSlaveOf string // Indicates which bond this interface is part of
BondMasterOf []string // Indicates this PIF represents the results of a bond
VLANMasterOf string // Indicates wich VLAN this interface receives untagged traffic from
VLANSlaveOf []string // Indicates which VLANs this interface transmits tagged traffic to
Management bool // Indicates whether the control software is listening for connections on this interface
OtherConfig map[string]string // Additional configuration
DisallowUnplug bool // Prevent this PIF from being unplugged; set this to notify the management tool-stack that the PIF has a special use and should not be unplugged under any circumstances (e.g. because you're running storage traffic over it)
TunnelAccessPIFOf []string // Indicates to which tunnel this PIF gives access
TunnelTransportPIFOf []string // Indicates to which tunnel this PIF provides transport
Ipv6ConfigurationMode Ipv6ConfigurationMode // Sets if and how this interface gets an IPv6 address
IPv6 []string // IPv6 address
Ipv6Gateway string // IPv6 gateway
PrimaryAddressType PrimaryAddressType // Which protocol should define the primary address of this interface
Managed bool // Indicates whether the interface is managed by xapi. If it is not, then xapi will not configure the interface, the commands PIF.plug/unplug/reconfigure_ip(v6) cannot be used, nor can the interface be bonded or have VLANs based on top through xapi.
Properties map[string]string // Additional configuration properties for the interface.
Capabilities []string // Additional capabilities on the interface.
IgmpSnoopingStatus PifIgmpStatus // The IGMP snooping status of the corresponding network bridge
SriovPhysicalPIFOf []string // Indicates which network_sriov this interface is physical of
SriovLogicalPIFOf []string // Indicates which network_sriov this interface is logical of
PCI string // Link to underlying PCI device
}
func FromPIFToXml(PIF *PIF) (result xmlrpc.Struct) {
result = make(xmlrpc.Struct)
result["uuid"] = PIF.Uuid
result["device"] = PIF.Device
result["network"] = PIF.Network
result["host"] = PIF.Host
result["MAC"] = PIF.MAC
result["MTU"] = strconv.Itoa(PIF.MTU)
result["VLAN"] = strconv.Itoa(PIF.VLAN)
result["metrics"] = PIF.Metrics
result["physical"] = PIF.Physical
result["currently_attached"] = PIF.CurrentlyAttached
result["ip_configuration_mode"] = PIF.IpConfigurationMode.String()
result["IP"] = PIF.IP
result["netmask"] = PIF.Netmask
result["gateway"] = PIF.Gateway
result["DNS"] = PIF.DNS
result["bond_slave_of"] = PIF.BondSlaveOf
result["bond_master_of"] = PIF.BondMasterOf
result["VLAN_master_of"] = PIF.VLANMasterOf
result["VLAN_slave_of"] = PIF.VLANSlaveOf
result["management"] = PIF.Management
other_config := make(xmlrpc.Struct)
for key, value := range PIF.OtherConfig {
other_config[key] = value
}
result["other_config"] = other_config
result["disallow_unplug"] = PIF.DisallowUnplug
result["tunnel_access_PIF_of"] = PIF.TunnelAccessPIFOf
result["tunnel_transport_PIF_of"] = PIF.TunnelTransportPIFOf
result["ipv6_configuration_mode"] = PIF.Ipv6ConfigurationMode.String()
result["IPv6"] = PIF.IPv6
result["ipv6_gateway"] = PIF.Ipv6Gateway
result["primary_address_type"] = PIF.PrimaryAddressType.String()
result["managed"] = PIF.Managed
properties := make(xmlrpc.Struct)
for key, value := range PIF.Properties {
properties[key] = value
}
result["properties"] = properties
result["capabilities"] = PIF.Capabilities
result["igmp_snooping_status"] = PIF.IgmpSnoopingStatus.String()
result["sriov_physical_PIF_of"] = PIF.SriovPhysicalPIFOf
result["sriov_logical_PIF_of"] = PIF.SriovLogicalPIFOf
result["PCI"] = PIF.PCI
return result
}
func ToPIF(obj interface{}) (resultObj *PIF) {
objValue := reflect.ValueOf(obj)
resultObj = &PIF{}
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 "device":
if v, ok := keyValue.(string); ok {
resultObj.Device = v
}
case "network":
if v, ok := keyValue.(string); ok {
resultObj.Network = v
}
case "host":
if v, ok := keyValue.(string); ok {
resultObj.Host = v
}
case "MAC":
if v, ok := keyValue.(string); ok {
resultObj.MAC = v
}
case "MTU":
if v, ok := keyValue.(int); ok {
resultObj.MTU = v
}
case "VLAN":
if v, ok := keyValue.(int); ok {
resultObj.VLAN = v
}
case "metrics":
if v, ok := keyValue.(string); ok {
resultObj.Metrics = v
}
case "physical":
if v, ok := keyValue.(bool); ok {
resultObj.Physical = v
}
case "currently_attached":
if v, ok := keyValue.(bool); ok {
resultObj.CurrentlyAttached = v
}
case "ip_configuration_mode":
if v, ok := keyValue.(IpConfigurationMode); ok {
resultObj.IpConfigurationMode = v
}
case "IP":
if v, ok := keyValue.(string); ok {
resultObj.IP = v
}
case "netmask":
if v, ok := keyValue.(string); ok {
resultObj.Netmask = v
}
case "gateway":
if v, ok := keyValue.(string); ok {
resultObj.Gateway = v
}
case "DNS":
if v, ok := keyValue.(string); ok {
resultObj.DNS = v
}
case "bond_slave_of":
if v, ok := keyValue.(string); ok {
resultObj.BondSlaveOf = v
}
case "bond_master_of":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.BondMasterOf = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.BondMasterOf[i] = v
}
}
}
case "VLAN_master_of":
if v, ok := keyValue.(string); ok {
resultObj.VLANMasterOf = v
}
case "VLAN_slave_of":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.VLANSlaveOf = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.VLANSlaveOf[i] = v
}
}
}
case "management":
if v, ok := keyValue.(bool); ok {
resultObj.Management = 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 "disallow_unplug":
if v, ok := keyValue.(bool); ok {
resultObj.DisallowUnplug = v
}
case "tunnel_access_PIF_of":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.TunnelAccessPIFOf = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.TunnelAccessPIFOf[i] = v
}
}
}
case "tunnel_transport_PIF_of":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.TunnelTransportPIFOf = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.TunnelTransportPIFOf[i] = v
}
}
}
case "ipv6_configuration_mode":
if v, ok := keyValue.(Ipv6ConfigurationMode); ok {
resultObj.Ipv6ConfigurationMode = v
}
case "IPv6":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.IPv6 = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.IPv6[i] = v
}
}
}
case "ipv6_gateway":
if v, ok := keyValue.(string); ok {
resultObj.Ipv6Gateway = v
}
case "primary_address_type":
if v, ok := keyValue.(PrimaryAddressType); ok {
resultObj.PrimaryAddressType = v
}
case "managed":
if v, ok := keyValue.(bool); ok {
resultObj.Managed = v
}
case "properties":
resultObj.Properties = 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.Properties[mapKeyName] = v
} else {
resultObj.Properties[mapKeyName] = ""
}
}
case "capabilities":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.Capabilities = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.Capabilities[i] = v
}
}
}
case "igmp_snooping_status":
if v, ok := keyValue.(PifIgmpStatus); ok {
resultObj.IgmpSnoopingStatus = v
}
case "sriov_physical_PIF_of":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.SriovPhysicalPIFOf = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.SriovPhysicalPIFOf[i] = v
}
}
}
case "sriov_logical_PIF_of":
if interim, ok := keyValue.([]interface{}); ok {
resultObj.SriovLogicalPIFOf = make([]string, len(interim))
for i, interimValue := range interim {
if v, ok := interimValue.(string); ok {
resultObj.SriovLogicalPIFOf[i] = v
}
}
}
case "PCI":
if v, ok := keyValue.(string); ok {
resultObj.PCI = v
}
}
}
return resultObj
}
/* GetAllRecords: Return a map of PIF references to PIF records for all PIFs known to the system. */
func (client *XenClient) PIFGetAllRecords() (result map[string]PIF, err error) {
obj, err := client.APICall("PIF.get_all_records")
if err != nil {
return
}
interim := reflect.ValueOf(obj)
result = map[string]PIF{}
for _, key := range interim.MapKeys() {
obj := interim.MapIndex(key)
mapObj := ToPIF(obj.Interface())
result[key.String()] = *mapObj
}
return
}
/* GetAll: Return a list of all the PIFs known to the system. */
func (client *XenClient) PIFGetAll() (result []string, err error) {
obj, err := client.APICall("PIF.get_all")
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* SetProperty: Set the value of a property of the PIF */
func (client *XenClient) PIFSetProperty(self string, name string, value string) (err error) {
_, err = client.APICall("PIF.set_property", self, name, value)
if err != nil {
return
}
// no return result
return
}
/* DbForget: Destroy a PIF database record. */
func (client *XenClient) PIFDbForget(self string) (err error) {
_, err = client.APICall("PIF.db_forget", self)
if err != nil {
return
}
// no return result
return
}
/* DbIntroduce: Create a new PIF record in the database only */
func (client *XenClient) PIFDbIntroduce(device string, network string, host string, MAC string, MTU int, VLAN int, physical bool, ip_configuration_mode IpConfigurationMode, IP string, netmask string, gateway string, DNS string, bond_slave_of string, VLAN_master_of string, management bool, other_config map[string]string, disallow_unplug bool, ipv6_configuration_mode Ipv6ConfigurationMode, IPv6 []string, ipv6_gateway string, primary_address_type PrimaryAddressType, managed bool, properties map[string]string) (result string, err error) {
obj, err := client.APICall("PIF.db_introduce", device, network, host, MAC, MTU, VLAN, physical, ip_configuration_mode.String(), IP, netmask, gateway, DNS, bond_slave_of, VLAN_master_of, management, other_config, disallow_unplug, ipv6_configuration_mode.String(), IPv6, ipv6_gateway, primary_address_type.String(), managed, properties)
if err != nil {
return
}
result = obj.(string)
return
}
/* Plug: Attempt to bring up a physical interface */
func (client *XenClient) PIFPlug(self string) (err error) {
_, err = client.APICall("PIF.plug", self)
if err != nil {
return
}
// no return result
return
}
/* SetDisallowUnplug: Set whether unplugging the PIF is allowed */
func (client *XenClient) PIFSetDisallowUnplug(self string, value bool) (err error) {
_, err = client.APICall("PIF.set_disallow_unplug", self, value)
if err != nil {
return
}
// no return result
return
}
/* Unplug: Attempt to bring down a physical interface */
func (client *XenClient) PIFUnplug(self string) (err error) {
_, err = client.APICall("PIF.unplug", self)
if err != nil {
return
}
// no return result
return
}
/* Forget: Destroy the PIF object matching a particular network interface */
func (client *XenClient) PIFForget(self string) (err error) {
_, err = client.APICall("PIF.forget", self)
if err != nil {
return
}
// no return result
return
}
/* Introduce: Create a PIF object matching a particular network interface */
func (client *XenClient) PIFIntroduce(host string, MAC string, device string, managed bool) (result string, err error) {
obj, err := client.APICall("PIF.introduce", host, MAC, device, managed)
if err != nil {
return
}
result = obj.(string)
return
}
/* Scan: Scan for physical interfaces on a host and create PIF objects to represent them */
func (client *XenClient) PIFScan(host string) (err error) {
_, err = client.APICall("PIF.scan", host)
if err != nil {
return
}
// no return result
return
}
/* SetPrimaryAddressType: Change the primary address type used by this PIF */
func (client *XenClient) PIFSetPrimaryAddressType(self string, primary_address_type PrimaryAddressType) (err error) {
_, err = client.APICall("PIF.set_primary_address_type", self, primary_address_type.String())
if err != nil {
return
}
// no return result
return
}
/* ReconfigureIpv6: Reconfigure the IPv6 address settings for this interface */
func (client *XenClient) PIFReconfigureIpv6(self string, mode Ipv6ConfigurationMode, IPv6 string, gateway string, DNS string) (err error) {
_, err = client.APICall("PIF.reconfigure_ipv6", self, mode.String(), IPv6, gateway, DNS)
if err != nil {
return
}
// no return result
return
}
/* ReconfigureIp: Reconfigure the IP address settings for this interface */
func (client *XenClient) PIFReconfigureIp(self string, mode IpConfigurationMode, IP string, netmask string, gateway string, DNS string) (err error) {
_, err = client.APICall("PIF.reconfigure_ip", self, mode.String(), IP, netmask, gateway, DNS)
if err != nil {
return
}
// no return result
return
}
/* Destroy: Destroy the PIF object (provided it is a VLAN interface). This call is deprecated: use VLAN.destroy or Bond.destroy instead */
func (client *XenClient) PIFDestroy(self string) (err error) {
_, err = client.APICall("PIF.destroy", self)
if err != nil {
return
}
// no return result
return
}
/* CreateVLAN: Create a VLAN interface from an existing physical interface. This call is deprecated: use VLAN.create instead */
func (client *XenClient) PIFCreateVLAN(device string, network string, host string, VLAN int) (result string, err error) {
obj, err := client.APICall("PIF.create_VLAN", device, network, host, VLAN)
if err != nil {
return
}
result = obj.(string)
return
}
/* RemoveFromOtherConfig: Remove the given key and its corresponding value from the other_config field of the given PIF. If the key is not in that Map, then do nothing. */
func (client *XenClient) PIFRemoveFromOtherConfig(self string, key string) (err error) {
_, err = client.APICall("PIF.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 PIF. */
func (client *XenClient) PIFAddToOtherConfig(self string, key string, value string) (err error) {
_, err = client.APICall("PIF.add_to_other_config", self, key, value)
if err != nil {
return
}
// no return result
return
}
/* SetOtherConfig: Set the other_config field of the given PIF. */
func (client *XenClient) PIFSetOtherConfig(self string, value map[string]string) (err error) {
_, err = client.APICall("PIF.set_other_config", self, value)
if err != nil {
return
}
// no return result
return
}
/* GetPCI: Get the PCI field of the given PIF. */
func (client *XenClient) PIFGetPCI(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_PCI", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetSriovLogicalPIFOf: Get the sriov_logical_PIF_of field of the given PIF. */
func (client *XenClient) PIFGetSriovLogicalPIFOf(self string) (result []string, err error) {
obj, err := client.APICall("PIF.get_sriov_logical_PIF_of", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetSriovPhysicalPIFOf: Get the sriov_physical_PIF_of field of the given PIF. */
func (client *XenClient) PIFGetSriovPhysicalPIFOf(self string) (result []string, err error) {
obj, err := client.APICall("PIF.get_sriov_physical_PIF_of", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetIgmpSnoopingStatus: Get the igmp_snooping_status field of the given PIF. */
func (client *XenClient) PIFGetIgmpSnoopingStatus(self string) (result PifIgmpStatus, err error) {
obj, err := client.APICall("PIF.get_igmp_snooping_status", self)
if err != nil {
return
}
result = ToPifIgmpStatus(obj.(string))
return
}
/* GetCapabilities: Get the capabilities field of the given PIF. */
func (client *XenClient) PIFGetCapabilities(self string) (result []string, err error) {
obj, err := client.APICall("PIF.get_capabilities", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetProperties: Get the properties field of the given PIF. */
func (client *XenClient) PIFGetProperties(self string) (result map[string]string, err error) {
obj, err := client.APICall("PIF.get_properties", 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
}
/* GetManaged: Get the managed field of the given PIF. */
func (client *XenClient) PIFGetManaged(self string) (result bool, err error) {
obj, err := client.APICall("PIF.get_managed", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetPrimaryAddressType: Get the primary_address_type field of the given PIF. */
func (client *XenClient) PIFGetPrimaryAddressType(self string) (result PrimaryAddressType, err error) {
obj, err := client.APICall("PIF.get_primary_address_type", self)
if err != nil {
return
}
result = ToPrimaryAddressType(obj.(string))
return
}
/* GetIpv6Gateway: Get the ipv6_gateway field of the given PIF. */
func (client *XenClient) PIFGetIpv6Gateway(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_ipv6_gateway", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetIPv6: Get the IPv6 field of the given PIF. */
func (client *XenClient) PIFGetIPv6(self string) (result []string, err error) {
obj, err := client.APICall("PIF.get_IPv6", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetIpv6ConfigurationMode: Get the ipv6_configuration_mode field of the given PIF. */
func (client *XenClient) PIFGetIpv6ConfigurationMode(self string) (result Ipv6ConfigurationMode, err error) {
obj, err := client.APICall("PIF.get_ipv6_configuration_mode", self)
if err != nil {
return
}
result = ToIpv6ConfigurationMode(obj.(string))
return
}
/* GetTunnelTransportPIFOf: Get the tunnel_transport_PIF_of field of the given PIF. */
func (client *XenClient) PIFGetTunnelTransportPIFOf(self string) (result []string, err error) {
obj, err := client.APICall("PIF.get_tunnel_transport_PIF_of", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetTunnelAccessPIFOf: Get the tunnel_access_PIF_of field of the given PIF. */
func (client *XenClient) PIFGetTunnelAccessPIFOf(self string) (result []string, err error) {
obj, err := client.APICall("PIF.get_tunnel_access_PIF_of", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetDisallowUnplug: Get the disallow_unplug field of the given PIF. */
func (client *XenClient) PIFGetDisallowUnplug(self string) (result bool, err error) {
obj, err := client.APICall("PIF.get_disallow_unplug", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetOtherConfig: Get the other_config field of the given PIF. */
func (client *XenClient) PIFGetOtherConfig(self string) (result map[string]string, err error) {
obj, err := client.APICall("PIF.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
}
/* GetManagement: Get the management field of the given PIF. */
func (client *XenClient) PIFGetManagement(self string) (result bool, err error) {
obj, err := client.APICall("PIF.get_management", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetVLANSlaveOf: Get the VLAN_slave_of field of the given PIF. */
func (client *XenClient) PIFGetVLANSlaveOf(self string) (result []string, err error) {
obj, err := client.APICall("PIF.get_VLAN_slave_of", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetVLANMasterOf: Get the VLAN_master_of field of the given PIF. */
func (client *XenClient) PIFGetVLANMasterOf(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_VLAN_master_of", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetBondMasterOf: Get the bond_master_of field of the given PIF. */
func (client *XenClient) PIFGetBondMasterOf(self string) (result []string, err error) {
obj, err := client.APICall("PIF.get_bond_master_of", self)
if err != nil {
return
}
result = make([]string, len(obj.([]interface{})))
for i, value := range obj.([]interface{}) {
result[i] = value.(string)
}
return
}
/* GetBondSlaveOf: Get the bond_slave_of field of the given PIF. */
func (client *XenClient) PIFGetBondSlaveOf(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_bond_slave_of", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetDNS: Get the DNS field of the given PIF. */
func (client *XenClient) PIFGetDNS(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_DNS", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetGateway: Get the gateway field of the given PIF. */
func (client *XenClient) PIFGetGateway(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_gateway", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetNetmask: Get the netmask field of the given PIF. */
func (client *XenClient) PIFGetNetmask(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_netmask", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetIP: Get the IP field of the given PIF. */
func (client *XenClient) PIFGetIP(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_IP", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetIpConfigurationMode: Get the ip_configuration_mode field of the given PIF. */
func (client *XenClient) PIFGetIpConfigurationMode(self string) (result IpConfigurationMode, err error) {
obj, err := client.APICall("PIF.get_ip_configuration_mode", self)
if err != nil {
return
}
result = ToIpConfigurationMode(obj.(string))
return
}
/* GetCurrentlyAttached: Get the currently_attached field of the given PIF. */
func (client *XenClient) PIFGetCurrentlyAttached(self string) (result bool, err error) {
obj, err := client.APICall("PIF.get_currently_attached", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetPhysical: Get the physical field of the given PIF. */
func (client *XenClient) PIFGetPhysical(self string) (result bool, err error) {
obj, err := client.APICall("PIF.get_physical", self)
if err != nil {
return
}
result = obj.(bool)
return
}
/* GetMetrics: Get the metrics field of the given PIF. */
func (client *XenClient) PIFGetMetrics(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_metrics", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetVLAN: Get the VLAN field of the given PIF. */
func (client *XenClient) PIFGetVLAN(self string) (result int, err error) {
obj, err := client.APICall("PIF.get_VLAN", self)
if err != nil {
return
}
result = obj.(int)
return
}
/* GetMTU: Get the MTU field of the given PIF. */
func (client *XenClient) PIFGetMTU(self string) (result int, err error) {
obj, err := client.APICall("PIF.get_MTU", self)
if err != nil {
return
}
result = obj.(int)
return
}
/* GetMAC: Get the MAC field of the given PIF. */
func (client *XenClient) PIFGetMAC(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_MAC", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetHost: Get the host field of the given PIF. */
func (client *XenClient) PIFGetHost(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_host", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetNetwork: Get the network field of the given PIF. */
func (client *XenClient) PIFGetNetwork(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_network", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetDevice: Get the device field of the given PIF. */
func (client *XenClient) PIFGetDevice(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_device", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetUuid: Get the uuid field of the given PIF. */
func (client *XenClient) PIFGetUuid(self string) (result string, err error) {
obj, err := client.APICall("PIF.get_uuid", self)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetByUuid: Get a reference to the PIF instance with the specified UUID. */
func (client *XenClient) PIFGetByUuid(uuid string) (result string, err error) {
obj, err := client.APICall("PIF.get_by_uuid", uuid)
if err != nil {
return
}
result = obj.(string)
return
}
/* GetRecord: Get a record containing the current state of the given PIF. */
func (client *XenClient) PIFGetRecord(self string) (result PIF, err error) {
obj, err := client.APICall("PIF.get_record", self)
if err != nil {
return
}
result = *ToPIF(obj.(interface{}))
return
}