forked from CiscoDevNet/ydk-go
/
routing_policy.go
4388 lines (3579 loc) · 241 KB
/
routing_policy.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 module describes a YANG model for routing policy
// configuration. It is a limited subset of all of the policy
// configuration parameters available in the variety of vendor
// implementations, but supports widely used constructs for managing
// how routes are imported, exported, and modified across different
// routing protocols. This module is intended to be used in
// conjunction with routing protocol configuration models (e.g.,
// BGP) defined in other modules.
//
// Route policy expression:
//
// Policies are expressed as a set of top-level policy definitions,
// each of which consists of a sequence of policy statements. Policy
// statements consist of simple condition-action tuples. Conditions
// may include mutiple match or comparison operations, and similarly
// actions may be multitude of changes to route attributes or a
// final disposition of accepting or rejecting the route.
//
// Route policy evaluation:
//
// Policy definitions are referenced in routing protocol
// configurations using import and export configuration statements.
// The arguments are members of an ordered list of named policy
// definitions which comprise a policy chain, and optionally, an
// explicit default policy action (i.e., reject or accept).
//
// Evaluation of each policy definition proceeds by evaluating its
// corresponding individual policy statements in order. When a
// condition statement in a policy statement is satisfied, the
// corresponding action statement is executed. If the action
// statement has either accept-route or reject-route actions, policy
// evaluation of the current policy definition stops, and no further
// policy definitions in the chain are evaluated.
//
// If the condition is not satisfied, then evaluation proceeds to
// the next policy statement. If none of the policy statement
// conditions are satisfied, then evaluation of the current policy
// definition stops, and the next policy definition in the chain is
// evaluated. When the end of the policy chain is reached, the
// default route disposition action is performed (i.e., reject-route
// unless an an alternate default action is specified for the
// chain).
//
// Policy 'subroutines' (or nested policies) are supported by
// allowing policy statement conditions to reference another policy
// definition which applies conditions and actions from the
// referenced policy before returning to the calling policy
// statement and resuming evaluation. If the called policy
// results in an accept-route (either explicit or by default), then
// the subroutine returns an effective true value to the calling
// policy. Similarly, a reject-route action returns false. If the
// subroutine returns true, the calling policy continues to evaluate
// the remaining conditions (using a modified route if the
// subroutine performed any changes to the route).
package routing_policy
import (
"fmt"
"github.com/CiscoDevNet/ydk-go/ydk"
"github.com/CiscoDevNet/ydk-go/ydk/types"
"github.com/CiscoDevNet/ydk-go/ydk/types/yfilter"
"github.com/CiscoDevNet/ydk-go/ydk/models/openconfig"
"reflect"
)
func init() {
ydk.YLogDebug(fmt.Sprintf("Registering top level entities for package routing_policy"))
ydk.RegisterEntity("{http://openconfig.net/yang/routing-policy routing-policy}", reflect.TypeOf(RoutingPolicy{}))
ydk.RegisterEntity("openconfig-routing-policy:routing-policy", reflect.TypeOf(RoutingPolicy{}))
}
// DefaultPolicyType represents a policy chain
type DefaultPolicyType string
const (
// default policy to accept the route
DefaultPolicyType_ACCEPT_ROUTE DefaultPolicyType = "ACCEPT_ROUTE"
// default policy to reject the route
DefaultPolicyType_REJECT_ROUTE DefaultPolicyType = "REJECT_ROUTE"
)
// RoutingPolicy
// Top-level container for all routing policy configuration
type RoutingPolicy struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// Predefined sets of attributes used in policy match statements.
DefinedSets RoutingPolicy_DefinedSets
// Enclosing container for the list of top-level policy definitions.
PolicyDefinitions RoutingPolicy_PolicyDefinitions
}
func (routingPolicy *RoutingPolicy) GetEntityData() *types.CommonEntityData {
routingPolicy.EntityData.YFilter = routingPolicy.YFilter
routingPolicy.EntityData.YangName = "routing-policy"
routingPolicy.EntityData.BundleName = "openconfig"
routingPolicy.EntityData.ParentYangName = "openconfig-routing-policy"
routingPolicy.EntityData.SegmentPath = "openconfig-routing-policy:routing-policy"
routingPolicy.EntityData.AbsolutePath = routingPolicy.EntityData.SegmentPath
routingPolicy.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
routingPolicy.EntityData.NamespaceTable = openconfig.GetNamespaces()
routingPolicy.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
routingPolicy.EntityData.Children = types.NewOrderedMap()
routingPolicy.EntityData.Children.Append("defined-sets", types.YChild{"DefinedSets", &routingPolicy.DefinedSets})
routingPolicy.EntityData.Children.Append("policy-definitions", types.YChild{"PolicyDefinitions", &routingPolicy.PolicyDefinitions})
routingPolicy.EntityData.Leafs = types.NewOrderedMap()
routingPolicy.EntityData.YListKeys = []string {}
return &(routingPolicy.EntityData)
}
// RoutingPolicy_DefinedSets
// Predefined sets of attributes used in policy match
// statements
type RoutingPolicy_DefinedSets struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// Enclosing container .
PrefixSets RoutingPolicy_DefinedSets_PrefixSets
// Enclosing container for the list of neighbor set definitions.
NeighborSets RoutingPolicy_DefinedSets_NeighborSets
// Enclosing container for the list of tag sets.
TagSets RoutingPolicy_DefinedSets_TagSets
// BGP-related set definitions for policy match conditions.
BgpDefinedSets RoutingPolicy_DefinedSets_BgpDefinedSets
}
func (definedSets *RoutingPolicy_DefinedSets) GetEntityData() *types.CommonEntityData {
definedSets.EntityData.YFilter = definedSets.YFilter
definedSets.EntityData.YangName = "defined-sets"
definedSets.EntityData.BundleName = "openconfig"
definedSets.EntityData.ParentYangName = "routing-policy"
definedSets.EntityData.SegmentPath = "defined-sets"
definedSets.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/" + definedSets.EntityData.SegmentPath
definedSets.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
definedSets.EntityData.NamespaceTable = openconfig.GetNamespaces()
definedSets.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
definedSets.EntityData.Children = types.NewOrderedMap()
definedSets.EntityData.Children.Append("prefix-sets", types.YChild{"PrefixSets", &definedSets.PrefixSets})
definedSets.EntityData.Children.Append("neighbor-sets", types.YChild{"NeighborSets", &definedSets.NeighborSets})
definedSets.EntityData.Children.Append("tag-sets", types.YChild{"TagSets", &definedSets.TagSets})
definedSets.EntityData.Children.Append("openconfig-bgp-policy:bgp-defined-sets", types.YChild{"BgpDefinedSets", &definedSets.BgpDefinedSets})
definedSets.EntityData.Leafs = types.NewOrderedMap()
definedSets.EntityData.YListKeys = []string {}
return &(definedSets.EntityData)
}
// RoutingPolicy_DefinedSets_PrefixSets
// Enclosing container
type RoutingPolicy_DefinedSets_PrefixSets struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// List of the defined prefix sets. The type is slice of
// RoutingPolicy_DefinedSets_PrefixSets_PrefixSet.
PrefixSet []*RoutingPolicy_DefinedSets_PrefixSets_PrefixSet
}
func (prefixSets *RoutingPolicy_DefinedSets_PrefixSets) GetEntityData() *types.CommonEntityData {
prefixSets.EntityData.YFilter = prefixSets.YFilter
prefixSets.EntityData.YangName = "prefix-sets"
prefixSets.EntityData.BundleName = "openconfig"
prefixSets.EntityData.ParentYangName = "defined-sets"
prefixSets.EntityData.SegmentPath = "prefix-sets"
prefixSets.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/" + prefixSets.EntityData.SegmentPath
prefixSets.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
prefixSets.EntityData.NamespaceTable = openconfig.GetNamespaces()
prefixSets.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
prefixSets.EntityData.Children = types.NewOrderedMap()
prefixSets.EntityData.Children.Append("prefix-set", types.YChild{"PrefixSet", nil})
for i := range prefixSets.PrefixSet {
prefixSets.EntityData.Children.Append(types.GetSegmentPath(prefixSets.PrefixSet[i]), types.YChild{"PrefixSet", prefixSets.PrefixSet[i]})
}
prefixSets.EntityData.Leafs = types.NewOrderedMap()
prefixSets.EntityData.YListKeys = []string {}
return &(prefixSets.EntityData)
}
// RoutingPolicy_DefinedSets_PrefixSets_PrefixSet
// List of the defined prefix sets
type RoutingPolicy_DefinedSets_PrefixSets_PrefixSet struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
YListKey string
// This attribute is a key. Reference to prefix name list key. The type is
// string. Refers to
// routing_policy.RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Config_PrefixSetName
PrefixSetName interface{}
// Configuration data for prefix sets.
Config RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Config
// Operational state data .
State RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_State
// Enclosing container for the list of prefixes in a policy prefix list.
Prefixes RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes
}
func (prefixSet *RoutingPolicy_DefinedSets_PrefixSets_PrefixSet) GetEntityData() *types.CommonEntityData {
prefixSet.EntityData.YFilter = prefixSet.YFilter
prefixSet.EntityData.YangName = "prefix-set"
prefixSet.EntityData.BundleName = "openconfig"
prefixSet.EntityData.ParentYangName = "prefix-sets"
prefixSet.EntityData.SegmentPath = "prefix-set" + types.AddKeyToken(prefixSet.PrefixSetName, "prefix-set-name")
prefixSet.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/prefix-sets/" + prefixSet.EntityData.SegmentPath
prefixSet.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
prefixSet.EntityData.NamespaceTable = openconfig.GetNamespaces()
prefixSet.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
prefixSet.EntityData.Children = types.NewOrderedMap()
prefixSet.EntityData.Children.Append("config", types.YChild{"Config", &prefixSet.Config})
prefixSet.EntityData.Children.Append("state", types.YChild{"State", &prefixSet.State})
prefixSet.EntityData.Children.Append("prefixes", types.YChild{"Prefixes", &prefixSet.Prefixes})
prefixSet.EntityData.Leafs = types.NewOrderedMap()
prefixSet.EntityData.Leafs.Append("prefix-set-name", types.YLeaf{"PrefixSetName", prefixSet.PrefixSetName})
prefixSet.EntityData.YListKeys = []string {"PrefixSetName"}
return &(prefixSet.EntityData)
}
// RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Config
// Configuration data for prefix sets
type RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Config struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// name / label of the prefix set -- this is used to reference the set in
// match conditions. The type is string.
PrefixSetName interface{}
}
func (config *RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Config) GetEntityData() *types.CommonEntityData {
config.EntityData.YFilter = config.YFilter
config.EntityData.YangName = "config"
config.EntityData.BundleName = "openconfig"
config.EntityData.ParentYangName = "prefix-set"
config.EntityData.SegmentPath = "config"
config.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/prefix-sets/prefix-set/" + config.EntityData.SegmentPath
config.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
config.EntityData.NamespaceTable = openconfig.GetNamespaces()
config.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
config.EntityData.Children = types.NewOrderedMap()
config.EntityData.Leafs = types.NewOrderedMap()
config.EntityData.Leafs.Append("prefix-set-name", types.YLeaf{"PrefixSetName", config.PrefixSetName})
config.EntityData.YListKeys = []string {}
return &(config.EntityData)
}
// RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_State
// Operational state data
type RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_State struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// name / label of the prefix set -- this is used to reference the set in
// match conditions. The type is string.
PrefixSetName interface{}
}
func (state *RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_State) GetEntityData() *types.CommonEntityData {
state.EntityData.YFilter = state.YFilter
state.EntityData.YangName = "state"
state.EntityData.BundleName = "openconfig"
state.EntityData.ParentYangName = "prefix-set"
state.EntityData.SegmentPath = "state"
state.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/prefix-sets/prefix-set/" + state.EntityData.SegmentPath
state.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
state.EntityData.NamespaceTable = openconfig.GetNamespaces()
state.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
state.EntityData.Children = types.NewOrderedMap()
state.EntityData.Leafs = types.NewOrderedMap()
state.EntityData.Leafs.Append("prefix-set-name", types.YLeaf{"PrefixSetName", state.PrefixSetName})
state.EntityData.YListKeys = []string {}
return &(state.EntityData)
}
// RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes
// Enclosing container for the list of prefixes in a policy
// prefix list
type RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// List of prefixes in the prefix set. The type is slice of
// RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix.
Prefix []*RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix
}
func (prefixes *RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes) GetEntityData() *types.CommonEntityData {
prefixes.EntityData.YFilter = prefixes.YFilter
prefixes.EntityData.YangName = "prefixes"
prefixes.EntityData.BundleName = "openconfig"
prefixes.EntityData.ParentYangName = "prefix-set"
prefixes.EntityData.SegmentPath = "prefixes"
prefixes.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/prefix-sets/prefix-set/" + prefixes.EntityData.SegmentPath
prefixes.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
prefixes.EntityData.NamespaceTable = openconfig.GetNamespaces()
prefixes.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
prefixes.EntityData.Children = types.NewOrderedMap()
prefixes.EntityData.Children.Append("prefix", types.YChild{"Prefix", nil})
for i := range prefixes.Prefix {
prefixes.EntityData.Children.Append(types.GetSegmentPath(prefixes.Prefix[i]), types.YChild{"Prefix", prefixes.Prefix[i]})
}
prefixes.EntityData.Leafs = types.NewOrderedMap()
prefixes.EntityData.YListKeys = []string {}
return &(prefixes.EntityData)
}
// RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix
// List of prefixes in the prefix set
type RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
YListKey string
// This attribute is a key. Reference to the ip-prefix list key. The type is
// one of the following types: string with pattern:
// (([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2])),
// or string with pattern:
// ((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8]))).
IpPrefix interface{}
// This attribute is a key. Reference to the masklength-range list key. The
// type is string with pattern: ^([0-9]+\.\.[0-9]+)|exact$. Refers to
// routing_policy.RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix_Config_MasklengthRange
MasklengthRange interface{}
// Configuration data for prefix definition.
Config RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix_Config
// Operational state data for prefix definition.
State RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix_State
}
func (prefix *RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix) GetEntityData() *types.CommonEntityData {
prefix.EntityData.YFilter = prefix.YFilter
prefix.EntityData.YangName = "prefix"
prefix.EntityData.BundleName = "openconfig"
prefix.EntityData.ParentYangName = "prefixes"
prefix.EntityData.SegmentPath = "prefix" + types.AddKeyToken(prefix.IpPrefix, "ip-prefix") + types.AddKeyToken(prefix.MasklengthRange, "masklength-range")
prefix.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/" + prefix.EntityData.SegmentPath
prefix.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
prefix.EntityData.NamespaceTable = openconfig.GetNamespaces()
prefix.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
prefix.EntityData.Children = types.NewOrderedMap()
prefix.EntityData.Children.Append("config", types.YChild{"Config", &prefix.Config})
prefix.EntityData.Children.Append("state", types.YChild{"State", &prefix.State})
prefix.EntityData.Leafs = types.NewOrderedMap()
prefix.EntityData.Leafs.Append("ip-prefix", types.YLeaf{"IpPrefix", prefix.IpPrefix})
prefix.EntityData.Leafs.Append("masklength-range", types.YLeaf{"MasklengthRange", prefix.MasklengthRange})
prefix.EntityData.YListKeys = []string {"IpPrefix", "MasklengthRange"}
return &(prefix.EntityData)
}
// RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix_Config
// Configuration data for prefix definition
type RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix_Config struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// The prefix member in CIDR notation -- while the prefix may be either IPv4
// or IPv6, most implementations require all members of the prefix set to be
// the same address family. Mixing address types in the same prefix set is
// likely to cause an error. The type is one of the following types: string
// with pattern:
// (([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))
// This attribute is mandatory., or string with pattern:
// ((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))
// This attribute is mandatory..
IpPrefix interface{}
// Defines a range for the masklength, or 'exact' if the prefix has an exact
// length. Example: 10.3.192.0/21 through 10.3.192.0/24 would be expressed as
// prefix: 10.3.192.0/21, masklength-range: 21..24. Example: 10.3.192.0/21
// would be expressed as prefix: 10.3.192.0/21, masklength-range: exact. The
// type is string with pattern: ^([0-9]+\.\.[0-9]+)|exact$.
MasklengthRange interface{}
}
func (config *RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix_Config) GetEntityData() *types.CommonEntityData {
config.EntityData.YFilter = config.YFilter
config.EntityData.YangName = "config"
config.EntityData.BundleName = "openconfig"
config.EntityData.ParentYangName = "prefix"
config.EntityData.SegmentPath = "config"
config.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/" + config.EntityData.SegmentPath
config.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
config.EntityData.NamespaceTable = openconfig.GetNamespaces()
config.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
config.EntityData.Children = types.NewOrderedMap()
config.EntityData.Leafs = types.NewOrderedMap()
config.EntityData.Leafs.Append("ip-prefix", types.YLeaf{"IpPrefix", config.IpPrefix})
config.EntityData.Leafs.Append("masklength-range", types.YLeaf{"MasklengthRange", config.MasklengthRange})
config.EntityData.YListKeys = []string {}
return &(config.EntityData)
}
// RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix_State
// Operational state data for prefix definition
type RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix_State struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// The prefix member in CIDR notation -- while the prefix may be either IPv4
// or IPv6, most implementations require all members of the prefix set to be
// the same address family. Mixing address types in the same prefix set is
// likely to cause an error. The type is one of the following types: string
// with pattern:
// (([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))
// This attribute is mandatory., or string with pattern:
// ((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))
// This attribute is mandatory..
IpPrefix interface{}
// Defines a range for the masklength, or 'exact' if the prefix has an exact
// length. Example: 10.3.192.0/21 through 10.3.192.0/24 would be expressed as
// prefix: 10.3.192.0/21, masklength-range: 21..24. Example: 10.3.192.0/21
// would be expressed as prefix: 10.3.192.0/21, masklength-range: exact. The
// type is string with pattern: ^([0-9]+\.\.[0-9]+)|exact$.
MasklengthRange interface{}
}
func (state *RoutingPolicy_DefinedSets_PrefixSets_PrefixSet_Prefixes_Prefix_State) GetEntityData() *types.CommonEntityData {
state.EntityData.YFilter = state.YFilter
state.EntityData.YangName = "state"
state.EntityData.BundleName = "openconfig"
state.EntityData.ParentYangName = "prefix"
state.EntityData.SegmentPath = "state"
state.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/" + state.EntityData.SegmentPath
state.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
state.EntityData.NamespaceTable = openconfig.GetNamespaces()
state.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
state.EntityData.Children = types.NewOrderedMap()
state.EntityData.Leafs = types.NewOrderedMap()
state.EntityData.Leafs.Append("ip-prefix", types.YLeaf{"IpPrefix", state.IpPrefix})
state.EntityData.Leafs.Append("masklength-range", types.YLeaf{"MasklengthRange", state.MasklengthRange})
state.EntityData.YListKeys = []string {}
return &(state.EntityData)
}
// RoutingPolicy_DefinedSets_NeighborSets
// Enclosing container for the list of neighbor set
// definitions
type RoutingPolicy_DefinedSets_NeighborSets struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// List of defined neighbor sets for use in policies. The type is slice of
// RoutingPolicy_DefinedSets_NeighborSets_NeighborSet.
NeighborSet []*RoutingPolicy_DefinedSets_NeighborSets_NeighborSet
}
func (neighborSets *RoutingPolicy_DefinedSets_NeighborSets) GetEntityData() *types.CommonEntityData {
neighborSets.EntityData.YFilter = neighborSets.YFilter
neighborSets.EntityData.YangName = "neighbor-sets"
neighborSets.EntityData.BundleName = "openconfig"
neighborSets.EntityData.ParentYangName = "defined-sets"
neighborSets.EntityData.SegmentPath = "neighbor-sets"
neighborSets.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/" + neighborSets.EntityData.SegmentPath
neighborSets.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
neighborSets.EntityData.NamespaceTable = openconfig.GetNamespaces()
neighborSets.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
neighborSets.EntityData.Children = types.NewOrderedMap()
neighborSets.EntityData.Children.Append("neighbor-set", types.YChild{"NeighborSet", nil})
for i := range neighborSets.NeighborSet {
neighborSets.EntityData.Children.Append(types.GetSegmentPath(neighborSets.NeighborSet[i]), types.YChild{"NeighborSet", neighborSets.NeighborSet[i]})
}
neighborSets.EntityData.Leafs = types.NewOrderedMap()
neighborSets.EntityData.YListKeys = []string {}
return &(neighborSets.EntityData)
}
// RoutingPolicy_DefinedSets_NeighborSets_NeighborSet
// List of defined neighbor sets for use in policies.
type RoutingPolicy_DefinedSets_NeighborSets_NeighborSet struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
YListKey string
// This attribute is a key. Reference to the neighbor set name list key. The
// type is string. Refers to
// routing_policy.RoutingPolicy_DefinedSets_NeighborSets_NeighborSet_Config_NeighborSetName
NeighborSetName interface{}
// Configuration data for neighbor sets.
Config RoutingPolicy_DefinedSets_NeighborSets_NeighborSet_Config
// Operational state data for neighbor sets.
State RoutingPolicy_DefinedSets_NeighborSets_NeighborSet_State
}
func (neighborSet *RoutingPolicy_DefinedSets_NeighborSets_NeighborSet) GetEntityData() *types.CommonEntityData {
neighborSet.EntityData.YFilter = neighborSet.YFilter
neighborSet.EntityData.YangName = "neighbor-set"
neighborSet.EntityData.BundleName = "openconfig"
neighborSet.EntityData.ParentYangName = "neighbor-sets"
neighborSet.EntityData.SegmentPath = "neighbor-set" + types.AddKeyToken(neighborSet.NeighborSetName, "neighbor-set-name")
neighborSet.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/neighbor-sets/" + neighborSet.EntityData.SegmentPath
neighborSet.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
neighborSet.EntityData.NamespaceTable = openconfig.GetNamespaces()
neighborSet.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
neighborSet.EntityData.Children = types.NewOrderedMap()
neighborSet.EntityData.Children.Append("config", types.YChild{"Config", &neighborSet.Config})
neighborSet.EntityData.Children.Append("state", types.YChild{"State", &neighborSet.State})
neighborSet.EntityData.Leafs = types.NewOrderedMap()
neighborSet.EntityData.Leafs.Append("neighbor-set-name", types.YLeaf{"NeighborSetName", neighborSet.NeighborSetName})
neighborSet.EntityData.YListKeys = []string {"NeighborSetName"}
return &(neighborSet.EntityData)
}
// RoutingPolicy_DefinedSets_NeighborSets_NeighborSet_Config
// Configuration data for neighbor sets.
type RoutingPolicy_DefinedSets_NeighborSets_NeighborSet_Config struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// name / label of the neighbor set -- this is used to reference the set in
// match conditions. The type is string.
NeighborSetName interface{}
// List of IP addresses in the neighbor set. The type is one of the following
// types: slice of string with pattern:
// (([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?,
// or slice of string with pattern:
// ((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\p{N}\p{L}]+)?.
Address []interface{}
}
func (config *RoutingPolicy_DefinedSets_NeighborSets_NeighborSet_Config) GetEntityData() *types.CommonEntityData {
config.EntityData.YFilter = config.YFilter
config.EntityData.YangName = "config"
config.EntityData.BundleName = "openconfig"
config.EntityData.ParentYangName = "neighbor-set"
config.EntityData.SegmentPath = "config"
config.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/neighbor-sets/neighbor-set/" + config.EntityData.SegmentPath
config.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
config.EntityData.NamespaceTable = openconfig.GetNamespaces()
config.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
config.EntityData.Children = types.NewOrderedMap()
config.EntityData.Leafs = types.NewOrderedMap()
config.EntityData.Leafs.Append("neighbor-set-name", types.YLeaf{"NeighborSetName", config.NeighborSetName})
config.EntityData.Leafs.Append("address", types.YLeaf{"Address", config.Address})
config.EntityData.YListKeys = []string {}
return &(config.EntityData)
}
// RoutingPolicy_DefinedSets_NeighborSets_NeighborSet_State
// Operational state data for neighbor sets.
type RoutingPolicy_DefinedSets_NeighborSets_NeighborSet_State struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// name / label of the neighbor set -- this is used to reference the set in
// match conditions. The type is string.
NeighborSetName interface{}
// List of IP addresses in the neighbor set. The type is one of the following
// types: slice of string with pattern:
// (([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?,
// or slice of string with pattern:
// ((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\p{N}\p{L}]+)?.
Address []interface{}
}
func (state *RoutingPolicy_DefinedSets_NeighborSets_NeighborSet_State) GetEntityData() *types.CommonEntityData {
state.EntityData.YFilter = state.YFilter
state.EntityData.YangName = "state"
state.EntityData.BundleName = "openconfig"
state.EntityData.ParentYangName = "neighbor-set"
state.EntityData.SegmentPath = "state"
state.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/neighbor-sets/neighbor-set/" + state.EntityData.SegmentPath
state.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
state.EntityData.NamespaceTable = openconfig.GetNamespaces()
state.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
state.EntityData.Children = types.NewOrderedMap()
state.EntityData.Leafs = types.NewOrderedMap()
state.EntityData.Leafs.Append("neighbor-set-name", types.YLeaf{"NeighborSetName", state.NeighborSetName})
state.EntityData.Leafs.Append("address", types.YLeaf{"Address", state.Address})
state.EntityData.YListKeys = []string {}
return &(state.EntityData)
}
// RoutingPolicy_DefinedSets_TagSets
// Enclosing container for the list of tag sets.
type RoutingPolicy_DefinedSets_TagSets struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// List of tag set definitions. The type is slice of
// RoutingPolicy_DefinedSets_TagSets_TagSet.
TagSet []*RoutingPolicy_DefinedSets_TagSets_TagSet
}
func (tagSets *RoutingPolicy_DefinedSets_TagSets) GetEntityData() *types.CommonEntityData {
tagSets.EntityData.YFilter = tagSets.YFilter
tagSets.EntityData.YangName = "tag-sets"
tagSets.EntityData.BundleName = "openconfig"
tagSets.EntityData.ParentYangName = "defined-sets"
tagSets.EntityData.SegmentPath = "tag-sets"
tagSets.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/" + tagSets.EntityData.SegmentPath
tagSets.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
tagSets.EntityData.NamespaceTable = openconfig.GetNamespaces()
tagSets.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
tagSets.EntityData.Children = types.NewOrderedMap()
tagSets.EntityData.Children.Append("tag-set", types.YChild{"TagSet", nil})
for i := range tagSets.TagSet {
tagSets.EntityData.Children.Append(types.GetSegmentPath(tagSets.TagSet[i]), types.YChild{"TagSet", tagSets.TagSet[i]})
}
tagSets.EntityData.Leafs = types.NewOrderedMap()
tagSets.EntityData.YListKeys = []string {}
return &(tagSets.EntityData)
}
// RoutingPolicy_DefinedSets_TagSets_TagSet
// List of tag set definitions.
type RoutingPolicy_DefinedSets_TagSets_TagSet struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
YListKey string
// This attribute is a key. Reference to the tag set name list key. The type
// is string. Refers to
// routing_policy.RoutingPolicy_DefinedSets_TagSets_TagSet_Config_TagSetName
TagSetName interface{}
// Configuration data for tag sets.
Config RoutingPolicy_DefinedSets_TagSets_TagSet_Config
// Operational state data for tag sets.
State RoutingPolicy_DefinedSets_TagSets_TagSet_State
}
func (tagSet *RoutingPolicy_DefinedSets_TagSets_TagSet) GetEntityData() *types.CommonEntityData {
tagSet.EntityData.YFilter = tagSet.YFilter
tagSet.EntityData.YangName = "tag-set"
tagSet.EntityData.BundleName = "openconfig"
tagSet.EntityData.ParentYangName = "tag-sets"
tagSet.EntityData.SegmentPath = "tag-set" + types.AddKeyToken(tagSet.TagSetName, "tag-set-name")
tagSet.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/tag-sets/" + tagSet.EntityData.SegmentPath
tagSet.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
tagSet.EntityData.NamespaceTable = openconfig.GetNamespaces()
tagSet.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
tagSet.EntityData.Children = types.NewOrderedMap()
tagSet.EntityData.Children.Append("config", types.YChild{"Config", &tagSet.Config})
tagSet.EntityData.Children.Append("state", types.YChild{"State", &tagSet.State})
tagSet.EntityData.Leafs = types.NewOrderedMap()
tagSet.EntityData.Leafs.Append("tag-set-name", types.YLeaf{"TagSetName", tagSet.TagSetName})
tagSet.EntityData.YListKeys = []string {"TagSetName"}
return &(tagSet.EntityData)
}
// RoutingPolicy_DefinedSets_TagSets_TagSet_Config
// Configuration data for tag sets
type RoutingPolicy_DefinedSets_TagSets_TagSet_Config struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// name / label of the tag set -- this is used to reference the set in match
// conditions. The type is string.
TagSetName interface{}
// Value of the tag set member. The type is one of the following types: slice
// of int with range: 0..4294967295, or slice of string with pattern:
// ([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?.
TagValue []interface{}
}
func (config *RoutingPolicy_DefinedSets_TagSets_TagSet_Config) GetEntityData() *types.CommonEntityData {
config.EntityData.YFilter = config.YFilter
config.EntityData.YangName = "config"
config.EntityData.BundleName = "openconfig"
config.EntityData.ParentYangName = "tag-set"
config.EntityData.SegmentPath = "config"
config.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/tag-sets/tag-set/" + config.EntityData.SegmentPath
config.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
config.EntityData.NamespaceTable = openconfig.GetNamespaces()
config.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
config.EntityData.Children = types.NewOrderedMap()
config.EntityData.Leafs = types.NewOrderedMap()
config.EntityData.Leafs.Append("tag-set-name", types.YLeaf{"TagSetName", config.TagSetName})
config.EntityData.Leafs.Append("tag-value", types.YLeaf{"TagValue", config.TagValue})
config.EntityData.YListKeys = []string {}
return &(config.EntityData)
}
// RoutingPolicy_DefinedSets_TagSets_TagSet_State
// Operational state data for tag sets
type RoutingPolicy_DefinedSets_TagSets_TagSet_State struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// name / label of the tag set -- this is used to reference the set in match
// conditions. The type is string.
TagSetName interface{}
// Value of the tag set member. The type is one of the following types: slice
// of int with range: 0..4294967295, or slice of string with pattern:
// ([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?.
TagValue []interface{}
}
func (state *RoutingPolicy_DefinedSets_TagSets_TagSet_State) GetEntityData() *types.CommonEntityData {
state.EntityData.YFilter = state.YFilter
state.EntityData.YangName = "state"
state.EntityData.BundleName = "openconfig"
state.EntityData.ParentYangName = "tag-set"
state.EntityData.SegmentPath = "state"
state.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/tag-sets/tag-set/" + state.EntityData.SegmentPath
state.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
state.EntityData.NamespaceTable = openconfig.GetNamespaces()
state.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
state.EntityData.Children = types.NewOrderedMap()
state.EntityData.Leafs = types.NewOrderedMap()
state.EntityData.Leafs.Append("tag-set-name", types.YLeaf{"TagSetName", state.TagSetName})
state.EntityData.Leafs.Append("tag-value", types.YLeaf{"TagValue", state.TagValue})
state.EntityData.YListKeys = []string {}
return &(state.EntityData)
}
// RoutingPolicy_DefinedSets_BgpDefinedSets
// BGP-related set definitions for policy match conditions
type RoutingPolicy_DefinedSets_BgpDefinedSets struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// Enclosing container for list of defined BGP community sets.
CommunitySets RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets
// Enclosing container for list of extended BGP community sets.
ExtCommunitySets RoutingPolicy_DefinedSets_BgpDefinedSets_ExtCommunitySets
// Enclosing container for list of define AS path sets.
AsPathSets RoutingPolicy_DefinedSets_BgpDefinedSets_AsPathSets
}
func (bgpDefinedSets *RoutingPolicy_DefinedSets_BgpDefinedSets) GetEntityData() *types.CommonEntityData {
bgpDefinedSets.EntityData.YFilter = bgpDefinedSets.YFilter
bgpDefinedSets.EntityData.YangName = "bgp-defined-sets"
bgpDefinedSets.EntityData.BundleName = "openconfig"
bgpDefinedSets.EntityData.ParentYangName = "defined-sets"
bgpDefinedSets.EntityData.SegmentPath = "openconfig-bgp-policy:bgp-defined-sets"
bgpDefinedSets.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/" + bgpDefinedSets.EntityData.SegmentPath
bgpDefinedSets.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
bgpDefinedSets.EntityData.NamespaceTable = openconfig.GetNamespaces()
bgpDefinedSets.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
bgpDefinedSets.EntityData.Children = types.NewOrderedMap()
bgpDefinedSets.EntityData.Children.Append("community-sets", types.YChild{"CommunitySets", &bgpDefinedSets.CommunitySets})
bgpDefinedSets.EntityData.Children.Append("ext-community-sets", types.YChild{"ExtCommunitySets", &bgpDefinedSets.ExtCommunitySets})
bgpDefinedSets.EntityData.Children.Append("as-path-sets", types.YChild{"AsPathSets", &bgpDefinedSets.AsPathSets})
bgpDefinedSets.EntityData.Leafs = types.NewOrderedMap()
bgpDefinedSets.EntityData.YListKeys = []string {}
return &(bgpDefinedSets.EntityData)
}
// RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets
// Enclosing container for list of defined BGP community sets
type RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// List of defined BGP community sets. The type is slice of
// RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet.
CommunitySet []*RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet
}
func (communitySets *RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets) GetEntityData() *types.CommonEntityData {
communitySets.EntityData.YFilter = communitySets.YFilter
communitySets.EntityData.YangName = "community-sets"
communitySets.EntityData.BundleName = "openconfig"
communitySets.EntityData.ParentYangName = "bgp-defined-sets"
communitySets.EntityData.SegmentPath = "community-sets"
communitySets.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/openconfig-bgp-policy:bgp-defined-sets/" + communitySets.EntityData.SegmentPath
communitySets.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
communitySets.EntityData.NamespaceTable = openconfig.GetNamespaces()
communitySets.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
communitySets.EntityData.Children = types.NewOrderedMap()
communitySets.EntityData.Children.Append("community-set", types.YChild{"CommunitySet", nil})
for i := range communitySets.CommunitySet {
communitySets.EntityData.Children.Append(types.GetSegmentPath(communitySets.CommunitySet[i]), types.YChild{"CommunitySet", communitySets.CommunitySet[i]})
}
communitySets.EntityData.Leafs = types.NewOrderedMap()
communitySets.EntityData.YListKeys = []string {}
return &(communitySets.EntityData)
}
// RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet
// List of defined BGP community sets
type RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
YListKey string
// This attribute is a key. Reference to list key. The type is string. Refers
// to
// routing_policy.RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet_Config_CommunitySetName
CommunitySetName interface{}
// Configuration data for BGP community sets.
Config RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet_Config
// Operational state data for BGP community sets.
State RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet_State
}
func (communitySet *RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet) GetEntityData() *types.CommonEntityData {
communitySet.EntityData.YFilter = communitySet.YFilter
communitySet.EntityData.YangName = "community-set"
communitySet.EntityData.BundleName = "openconfig"
communitySet.EntityData.ParentYangName = "community-sets"
communitySet.EntityData.SegmentPath = "community-set" + types.AddKeyToken(communitySet.CommunitySetName, "community-set-name")
communitySet.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/openconfig-bgp-policy:bgp-defined-sets/community-sets/" + communitySet.EntityData.SegmentPath
communitySet.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
communitySet.EntityData.NamespaceTable = openconfig.GetNamespaces()
communitySet.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
communitySet.EntityData.Children = types.NewOrderedMap()
communitySet.EntityData.Children.Append("config", types.YChild{"Config", &communitySet.Config})
communitySet.EntityData.Children.Append("state", types.YChild{"State", &communitySet.State})
communitySet.EntityData.Leafs = types.NewOrderedMap()
communitySet.EntityData.Leafs.Append("community-set-name", types.YLeaf{"CommunitySetName", communitySet.CommunitySetName})
communitySet.EntityData.YListKeys = []string {"CommunitySetName"}
return &(communitySet.EntityData)
}
// RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet_Config
// Configuration data for BGP community sets
type RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet_Config struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// name / label of the community set -- this is used to reference the set in
// match conditions. The type is string. This attribute is mandatory.
CommunitySetName interface{}
// members of the community set. The type is one of the following types: slice
// of int with range: 65536..4294901759, or slice of string with pattern:
// ^(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$.,
// or slice of string, or slice of :go:struct:`BGPWELLKNOWNSTDCOMMUNITY
// <ydk/models/bgp_types/BGPWELLKNOWNSTDCOMMUNITY>`.
CommunityMember []interface{}
}
func (config *RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet_Config) GetEntityData() *types.CommonEntityData {
config.EntityData.YFilter = config.YFilter
config.EntityData.YangName = "config"
config.EntityData.BundleName = "openconfig"
config.EntityData.ParentYangName = "community-set"
config.EntityData.SegmentPath = "config"
config.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/openconfig-bgp-policy:bgp-defined-sets/community-sets/community-set/" + config.EntityData.SegmentPath
config.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
config.EntityData.NamespaceTable = openconfig.GetNamespaces()
config.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
config.EntityData.Children = types.NewOrderedMap()
config.EntityData.Leafs = types.NewOrderedMap()
config.EntityData.Leafs.Append("community-set-name", types.YLeaf{"CommunitySetName", config.CommunitySetName})
config.EntityData.Leafs.Append("community-member", types.YLeaf{"CommunityMember", config.CommunityMember})
config.EntityData.YListKeys = []string {}
return &(config.EntityData)
}
// RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet_State
// Operational state data for BGP community sets
type RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet_State struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// name / label of the community set -- this is used to reference the set in
// match conditions. The type is string. This attribute is mandatory.
CommunitySetName interface{}
// members of the community set. The type is one of the following types: slice
// of int with range: 65536..4294901759, or slice of string with pattern:
// ^(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$.,
// or slice of string, or slice of :go:struct:`BGPWELLKNOWNSTDCOMMUNITY
// <ydk/models/bgp_types/BGPWELLKNOWNSTDCOMMUNITY>`.
CommunityMember []interface{}
}
func (state *RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySets_CommunitySet_State) GetEntityData() *types.CommonEntityData {
state.EntityData.YFilter = state.YFilter
state.EntityData.YangName = "state"
state.EntityData.BundleName = "openconfig"
state.EntityData.ParentYangName = "community-set"
state.EntityData.SegmentPath = "state"
state.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/openconfig-bgp-policy:bgp-defined-sets/community-sets/community-set/" + state.EntityData.SegmentPath
state.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
state.EntityData.NamespaceTable = openconfig.GetNamespaces()
state.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
state.EntityData.Children = types.NewOrderedMap()
state.EntityData.Leafs = types.NewOrderedMap()
state.EntityData.Leafs.Append("community-set-name", types.YLeaf{"CommunitySetName", state.CommunitySetName})
state.EntityData.Leafs.Append("community-member", types.YLeaf{"CommunityMember", state.CommunityMember})
state.EntityData.YListKeys = []string {}
return &(state.EntityData)
}
// RoutingPolicy_DefinedSets_BgpDefinedSets_ExtCommunitySets
// Enclosing container for list of extended BGP community
// sets
type RoutingPolicy_DefinedSets_BgpDefinedSets_ExtCommunitySets struct {
EntityData types.CommonEntityData
YFilter yfilter.YFilter
// List of defined extended BGP community sets. The type is slice of
// RoutingPolicy_DefinedSets_BgpDefinedSets_ExtCommunitySets_ExtCommunitySet.
ExtCommunitySet []*RoutingPolicy_DefinedSets_BgpDefinedSets_ExtCommunitySets_ExtCommunitySet
}
func (extCommunitySets *RoutingPolicy_DefinedSets_BgpDefinedSets_ExtCommunitySets) GetEntityData() *types.CommonEntityData {
extCommunitySets.EntityData.YFilter = extCommunitySets.YFilter
extCommunitySets.EntityData.YangName = "ext-community-sets"
extCommunitySets.EntityData.BundleName = "openconfig"
extCommunitySets.EntityData.ParentYangName = "bgp-defined-sets"
extCommunitySets.EntityData.SegmentPath = "ext-community-sets"
extCommunitySets.EntityData.AbsolutePath = "openconfig-routing-policy:routing-policy/defined-sets/openconfig-bgp-policy:bgp-defined-sets/" + extCommunitySets.EntityData.SegmentPath
extCommunitySets.EntityData.CapabilitiesTable = openconfig.GetCapabilities()
extCommunitySets.EntityData.NamespaceTable = openconfig.GetNamespaces()
extCommunitySets.EntityData.BundleYangModelsLocation = openconfig.GetModelsPath()
extCommunitySets.EntityData.Children = types.NewOrderedMap()
extCommunitySets.EntityData.Children.Append("ext-community-set", types.YChild{"ExtCommunitySet", nil})
for i := range extCommunitySets.ExtCommunitySet {
extCommunitySets.EntityData.Children.Append(types.GetSegmentPath(extCommunitySets.ExtCommunitySet[i]), types.YChild{"ExtCommunitySet", extCommunitySets.ExtCommunitySet[i]})
}
extCommunitySets.EntityData.Leafs = types.NewOrderedMap()