From dcb8dace7533967636dac8f7fdb1b96072231973 Mon Sep 17 00:00:00 2001 From: Github Actions Bot Date: Mon, 18 Sep 2023 09:54:22 +0000 Subject: [PATCH] Update auto generated go snappi --- gosnappi/common.go | 52 +- gosnappi/go.mod | 2 +- gosnappi/go.sum | 4 +- gosnappi/gosnappi.go | 1456 ++++++++++++++++++++++++++++++++++-------- requirements.txt | 8 +- snappi/snappi.py | 260 ++++++-- 6 files changed, 1405 insertions(+), 377 deletions(-) diff --git a/gosnappi/common.go b/gosnappi/common.go index 8eb9236c..5e3196b8 100644 --- a/gosnappi/common.go +++ b/gosnappi/common.go @@ -254,7 +254,7 @@ type httpClient struct { // All methods that perform validation will add errors here // All api rpcs MUST call Validate type Constraints interface { - ValueOf(name string) interface{} + Warnings() []string } type validation struct { @@ -428,34 +428,32 @@ func (obj *validation) validateHexSlice(hex []string) error { return obj.validateSlice(hex, "hex") } -// TODO: restore behavior -// func (obj *validation) createMap(objName string) { -// if obj.constraints == nil { -// obj.constraints = make(map[string]map[string]Constraints) -// } -// _, ok := obj.constraints[objName] -// if !ok { -// obj.constraints[objName] = make(map[string]Constraints) -// } -// } +func (obj *validation) createMap(objName string) { + if obj.constraints == nil { + obj.constraints = make(map[string]map[string]Constraints) + } + _, ok := obj.constraints[objName] + if !ok { + obj.constraints[objName] = make(map[string]Constraints) + } +} -// TODO: restore behavior -// func (obj *validation) isUnique(objectName, value string, object Constraints) bool { -// if value == "" { -// return true -// } +func (obj *validation) isUnique(objectName, value string, scope string, object Constraints) bool { + if value == "" { + return true + } -// obj.createMap("globals") -// _, ok := obj.constraints["globals"][value] -// unique := false -// if !ok { -// obj.constraints["globals"][value] = object -// obj.createMap(objectName) -// obj.constraints[objectName][value] = object -// unique = true -// } -// return unique -// } + obj.createMap(scope) + _, ok := obj.constraints[scope][value] + unique := false + if !ok { + obj.constraints[scope][value] = object + // obj.createMap(objectName) + // obj.constraints[objectName][value] = object + unique = true + } + return unique +} // TODO: restore behavior // func (obj *validation) validateConstraint(objectName []string, value string) bool { diff --git a/gosnappi/go.mod b/gosnappi/go.mod index 772bb748..788ebd8a 100644 --- a/gosnappi/go.mod +++ b/gosnappi/go.mod @@ -7,6 +7,6 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/gorilla/mux v1.8.0 github.com/stretchr/testify v1.8.4 - google.golang.org/grpc v1.58.0 + google.golang.org/grpc v1.58.1 google.golang.org/protobuf v1.31.0 ) diff --git a/gosnappi/go.sum b/gosnappi/go.sum index 27a150c1..182b2635 100644 --- a/gosnappi/go.sum +++ b/gosnappi/go.sum @@ -1665,8 +1665,8 @@ google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwS google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= -google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= +google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/gosnappi/gosnappi.go b/gosnappi/gosnappi.go index 93a464e5..9036fc9e 100644 --- a/gosnappi/gosnappi.go +++ b/gosnappi/gosnappi.go @@ -1849,7 +1849,10 @@ func (obj *config) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ports().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Lags) != 0 { @@ -1863,7 +1866,10 @@ func (obj *config) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Lags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Layer1) != 0 { @@ -1877,7 +1883,10 @@ func (obj *config) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Layer1().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Captures) != 0 { @@ -1891,7 +1900,10 @@ func (obj *config) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Captures().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Devices) != 0 { @@ -1905,7 +1917,10 @@ func (obj *config) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Devices().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Flows) != 0 { @@ -1919,7 +1934,10 @@ func (obj *config) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Flows().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Events != nil { @@ -1943,7 +1961,10 @@ func (obj *config) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Lldp().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -7447,6 +7468,8 @@ func (obj *port) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface Port") + } else if !vObj.isUnique("port", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -7878,7 +7901,10 @@ func (obj *lag) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ports().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Protocol != nil { @@ -7899,6 +7925,8 @@ func (obj *lag) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface Lag") + } else if !vObj.isUnique("lag", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -8528,6 +8556,8 @@ func (obj *layer1) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface Layer1") + } else if !vObj.isUnique("layer1", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -9047,7 +9077,10 @@ func (obj *capture) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Filters().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.PacketSize != nil { @@ -9063,6 +9096,8 @@ func (obj *capture) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface Capture") + } else if !vObj.isUnique("capture", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -9766,7 +9801,10 @@ func (obj *device) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ethernets().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv4Loopbacks) != 0 { @@ -9780,7 +9818,10 @@ func (obj *device) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv4Loopbacks().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv6Loopbacks) != 0 { @@ -9794,7 +9835,10 @@ func (obj *device) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv6Loopbacks().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Isis != nil { @@ -9815,6 +9859,8 @@ func (obj *device) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface Device") + } else if !vObj.isUnique("device", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } if obj.obj.Rsvp != nil { @@ -10414,7 +10460,10 @@ func (obj *flow) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Packet().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.EgressPacket) != 0 { @@ -10428,7 +10477,10 @@ func (obj *flow) validateObj(vObj *validation, set_default bool) { for _, item := range obj.EgressPacket().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Size != nil { @@ -10454,6 +10506,8 @@ func (obj *flow) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface Flow") + } else if !vObj.isUnique("flow", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -11694,6 +11748,8 @@ func (obj *lldp) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface Lldp") + } else if !vObj.isUnique("lldp", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -12084,7 +12140,10 @@ func (obj *flowsUpdate) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Flows().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -17795,7 +17854,10 @@ func (obj *bgpPrefixStateRequest) validateObj(vObj *validation, set_default bool for _, item := range obj.Ipv4UnicastFilters().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv6UnicastFilters) != 0 { @@ -17809,7 +17871,10 @@ func (obj *bgpPrefixStateRequest) validateObj(vObj *validation, set_default bool for _, item := range obj.Ipv6UnicastFilters().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -20739,7 +20804,10 @@ func (obj *metricsResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.PortMetrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.FlowMetrics) != 0 { @@ -20753,7 +20821,10 @@ func (obj *metricsResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.FlowMetrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Bgpv4Metrics) != 0 { @@ -20767,7 +20838,10 @@ func (obj *metricsResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Bgpv4Metrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Bgpv6Metrics) != 0 { @@ -20781,7 +20855,10 @@ func (obj *metricsResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Bgpv6Metrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.IsisMetrics) != 0 { @@ -20795,7 +20872,10 @@ func (obj *metricsResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.IsisMetrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.LagMetrics) != 0 { @@ -20809,7 +20889,10 @@ func (obj *metricsResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.LagMetrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.LacpMetrics) != 0 { @@ -20823,7 +20906,10 @@ func (obj *metricsResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.LacpMetrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.LldpMetrics) != 0 { @@ -20837,7 +20923,10 @@ func (obj *metricsResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.LldpMetrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.RsvpMetrics) != 0 { @@ -20851,7 +20940,10 @@ func (obj *metricsResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.RsvpMetrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -21739,7 +21831,10 @@ func (obj *statesResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv4Neighbors().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv6Neighbors) != 0 { @@ -21753,7 +21848,10 @@ func (obj *statesResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv6Neighbors().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.BgpPrefixes) != 0 { @@ -21767,7 +21865,10 @@ func (obj *statesResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.BgpPrefixes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.IsisLsps) != 0 { @@ -21781,7 +21882,10 @@ func (obj *statesResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.IsisLsps().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.LldpNeighbors) != 0 { @@ -21795,7 +21899,10 @@ func (obj *statesResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.LldpNeighbors().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.RsvpLsps) != 0 { @@ -21809,7 +21916,10 @@ func (obj *statesResponse) validateObj(vObj *validation, set_default bool) { for _, item := range obj.RsvpLsps().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -24942,7 +25052,10 @@ func (obj *deviceEthernet) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv4Addresses().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv6Addresses) != 0 { @@ -24956,7 +25069,10 @@ func (obj *deviceEthernet) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv6Addresses().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Mac is required @@ -24993,12 +25109,17 @@ func (obj *deviceEthernet) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Vlans().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface DeviceEthernet") + } else if !vObj.isUnique("deviceEthernet", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -25333,6 +25454,8 @@ func (obj *deviceIpv4Loopback) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface DeviceIpv4Loopback") + } else if !vObj.isUnique("deviceIpv4Loopback", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -25669,6 +25792,8 @@ func (obj *deviceIpv6Loopback) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface DeviceIpv6Loopback") + } else if !vObj.isUnique("deviceIpv6Loopback", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -26405,7 +26530,10 @@ func (obj *deviceIsisRouter) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Interfaces().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Basic != nil { @@ -26434,7 +26562,10 @@ func (obj *deviceIsisRouter) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V4Routes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.V6Routes) != 0 { @@ -26448,12 +26579,17 @@ func (obj *deviceIsisRouter) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V6Routes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface DeviceIsisRouter") + } else if !vObj.isUnique("deviceIsisRouter", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -26920,7 +27056,10 @@ func (obj *deviceBgpRouter) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv4Interfaces().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv6Interfaces) != 0 { @@ -26934,7 +27073,10 @@ func (obj *deviceBgpRouter) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv6Interfaces().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -27370,7 +27512,10 @@ func (obj *deviceVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V4Tunnels().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.V6Tunnels) != 0 { @@ -27384,7 +27529,10 @@ func (obj *deviceVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V6Tunnels().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -27848,7 +27996,10 @@ func (obj *deviceRsvp) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv4Interfaces().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.LspIpv4Interfaces) != 0 { @@ -27862,9 +28013,17 @@ func (obj *deviceRsvp) validateObj(vObj *validation, set_default bool) { for _, item := range obj.LspIpv4Interfaces().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } + if obj.HasName() { + if !vObj.isUnique("deviceRsvp", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) + } + } } func (obj *deviceRsvp) setDefault() { @@ -37661,7 +37820,10 @@ func (obj *flowTaggedMetricsFilter) validateObj(vObj *validation, set_default bo for _, item := range obj.Filters().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -40162,7 +40324,10 @@ func (obj *flowMetric) validateObj(vObj *validation, set_default bool) { for _, item := range obj.TaggedMetrics().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -46626,7 +46791,10 @@ func (obj *bgpPrefixesState) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv4UnicastPrefixes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv6UnicastPrefixes) != 0 { @@ -46640,7 +46808,10 @@ func (obj *bgpPrefixesState) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv6UnicastPrefixes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -47013,7 +47184,10 @@ func (obj *isisLspsState) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Lsps().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -47885,7 +48059,10 @@ func (obj *lldpNeighborsState) validateObj(vObj *validation, set_default bool) { for _, item := range obj.CustomTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Capabilities) != 0 { @@ -47899,7 +48076,10 @@ func (obj *lldpNeighborsState) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Capabilities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -48272,7 +48452,10 @@ func (obj *rsvpLspsState) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv4Lsps().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -49149,12 +49332,17 @@ func (obj *deviceEthernetBase) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Vlans().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface DeviceEthernetBase") + } else if !vObj.isUnique("deviceEthernetBase", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -54160,6 +54348,8 @@ func (obj *deviceIpv4) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface DeviceIpv4") + } else if !vObj.isUnique("deviceIpv4", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -54575,6 +54765,8 @@ func (obj *deviceIpv6) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface DeviceIpv6") + } else if !vObj.isUnique("deviceIpv6", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -54956,6 +55148,8 @@ func (obj *deviceVlan) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface DeviceVlan") + } else if !vObj.isUnique("deviceVlan", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -56115,7 +56309,10 @@ func (obj *isisInterface) validateObj(vObj *validation, set_default bool) { for _, item := range obj.MultiTopologyIds().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.TrafficEngineering) != 0 { @@ -56129,7 +56326,10 @@ func (obj *isisInterface) validateObj(vObj *validation, set_default bool) { for _, item := range obj.TrafficEngineering().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Authentication != nil { @@ -56163,6 +56363,8 @@ func (obj *isisInterface) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface IsisInterface") + } else if !vObj.isUnique("isisInterface", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -58108,7 +58310,10 @@ func (obj *isisV4RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Addresses().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.LinkMetric != nil { @@ -58124,6 +58329,8 @@ func (obj *isisV4RouteRange) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface IsisV4RouteRange") + } else if !vObj.isUnique("isisV4RouteRange", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -58742,7 +58949,10 @@ func (obj *isisV6RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Addresses().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.LinkMetric != nil { @@ -58758,6 +58968,8 @@ func (obj *isisV6RouteRange) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface IsisV6RouteRange") + } else if !vObj.isUnique("isisV6RouteRange", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -59166,7 +59378,10 @@ func (obj *bgpV4Interface) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Peers().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -59553,7 +59768,10 @@ func (obj *bgpV6Interface) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Peers().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -59934,6 +60152,8 @@ func (obj *vxlanV4Tunnel) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface VxlanV4Tunnel") + } else if !vObj.isUnique("vxlanV4Tunnel", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -60313,6 +60533,8 @@ func (obj *vxlanV6Tunnel) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface VxlanV6Tunnel") + } else if !vObj.isUnique("vxlanV6Tunnel", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -61383,7 +61605,10 @@ func (obj *rsvpLspIpv4Interface) validateObj(vObj *validation, set_default bool) for _, item := range obj.P2PIngressIpv4Lsps().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -62604,7 +62829,10 @@ func (obj *flowCustom) validateObj(vObj *validation, set_default bool) { for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -69176,7 +69404,10 @@ func (obj *flowGtpv1) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtensionHeaders().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -73418,7 +73649,10 @@ func (obj *flowSizeWeightPairs) validateObj(vObj *validation, set_default bool) for _, item := range obj.Custom().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -77168,7 +77402,10 @@ func (obj *actionProtocolIpv4Ping) validateObj(vObj *validation, set_default boo for _, item := range obj.Requests().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -77513,7 +77750,10 @@ func (obj *actionProtocolIpv6Ping) validateObj(vObj *validation, set_default boo for _, item := range obj.Requests().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -80414,7 +80654,10 @@ func (obj *flowTaggedMetric) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Tags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Timestamps != nil { @@ -81073,7 +81316,10 @@ func (obj *bgpPrefixIpv4UnicastState) validateObj(vObj *validation, set_default for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.AsPath != nil { @@ -81727,7 +81973,10 @@ func (obj *bgpPrefixIpv6UnicastState) validateObj(vObj *validation, set_default for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.AsPath != nil { @@ -83452,7 +83701,10 @@ func (obj *rsvpIPv4LspState) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Rros().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Eros) != 0 { @@ -83466,7 +83718,10 @@ func (obj *rsvpIPv4LspState) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Eros().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -89025,7 +89280,10 @@ func (obj *bgpV4Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.EvpnEthernetSegments().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // AsType is required @@ -89059,7 +89317,10 @@ func (obj *bgpV4Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V4Routes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.V6Routes) != 0 { @@ -89073,7 +89334,10 @@ func (obj *bgpV4Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V6Routes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.V4SrtePolicies) != 0 { @@ -89087,7 +89351,10 @@ func (obj *bgpV4Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V4SrtePolicies().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.V6SrtePolicies) != 0 { @@ -89101,12 +89368,17 @@ func (obj *bgpV4Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V6SrtePolicies().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpV4Peer") + } else if !vObj.isUnique("bgpV4Peer", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } if obj.obj.GracefulRestart != nil { @@ -90176,7 +90448,10 @@ func (obj *bgpV6Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.EvpnEthernetSegments().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // AsType is required @@ -90210,7 +90485,10 @@ func (obj *bgpV6Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V4Routes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.V6Routes) != 0 { @@ -90224,7 +90502,10 @@ func (obj *bgpV6Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V6Routes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.V4SrtePolicies) != 0 { @@ -90238,7 +90519,10 @@ func (obj *bgpV6Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V4SrtePolicies().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.V6SrtePolicies) != 0 { @@ -90252,12 +90536,17 @@ func (obj *bgpV6Peer) validateObj(vObj *validation, set_default bool) { for _, item := range obj.V6SrtePolicies().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpV6Peer") + } else if !vObj.isUnique("bgpV6Peer", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } if obj.obj.GracefulRestart != nil { @@ -91442,6 +91731,8 @@ func (obj *rsvpLspIpv4InterfaceP2PEgressIpv4Lsp) validateObj(vObj *validation, s // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface RsvpLspIpv4InterfaceP2PEgressIpv4Lsp") + } else if !vObj.isUnique("rsvpLspIpv4InterfaceP2PEgressIpv4Lsp", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } if obj.obj.RefreshInterval != nil { @@ -92097,6 +92388,8 @@ func (obj *rsvpLspIpv4InterfaceP2PIngressIpv4Lsp) validateObj(vObj *validation, // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface RsvpLspIpv4InterfaceP2PIngressIpv4Lsp") + } else if !vObj.isUnique("rsvpLspIpv4InterfaceP2PIngressIpv4Lsp", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } // RemoteAddress is required @@ -93160,7 +93453,10 @@ func (obj *patternFlowEthernetDst) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -93738,7 +94034,10 @@ func (obj *patternFlowEthernetSrc) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -94365,7 +94664,10 @@ func (obj *patternFlowEthernetEtherType) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -94948,7 +95250,10 @@ func (obj *patternFlowEthernetPfcQueue) validateObj(vObj *validation, set_defaul for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -95531,7 +95836,10 @@ func (obj *patternFlowVlanPriority) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -96114,7 +96422,10 @@ func (obj *patternFlowVlanCfi) validateObj(vObj *validation, set_default bool) { for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -96697,7 +97008,10 @@ func (obj *patternFlowVlanId) validateObj(vObj *validation, set_default bool) { for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -97280,7 +97594,10 @@ func (obj *patternFlowVlanTpid) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -97863,7 +98180,10 @@ func (obj *patternFlowVxlanFlags) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -98446,7 +98766,10 @@ func (obj *patternFlowVxlanReserved0) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -99073,7 +99396,10 @@ func (obj *patternFlowVxlanVni) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -99656,7 +99982,10 @@ func (obj *patternFlowVxlanReserved1) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -100239,7 +100568,10 @@ func (obj *patternFlowIpv4Version) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -100866,7 +101198,10 @@ func (obj *patternFlowIpv4HeaderLength) validateObj(vObj *validation, set_defaul for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -101926,7 +102261,10 @@ func (obj *patternFlowIpv4TotalLength) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -102509,7 +102847,10 @@ func (obj *patternFlowIpv4Identification) validateObj(vObj *validation, set_defa for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -103092,7 +103433,10 @@ func (obj *patternFlowIpv4Reserved) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -103675,7 +104019,10 @@ func (obj *patternFlowIpv4DontFragment) validateObj(vObj *validation, set_defaul for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -104258,7 +104605,10 @@ func (obj *patternFlowIpv4MoreFragments) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -104841,7 +105191,10 @@ func (obj *patternFlowIpv4FragmentOffset) validateObj(vObj *validation, set_defa for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -105424,7 +105777,10 @@ func (obj *patternFlowIpv4TimeToLive) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -106051,7 +106407,10 @@ func (obj *patternFlowIpv4Protocol) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -106993,7 +107352,10 @@ func (obj *patternFlowIpv4Src) validateObj(vObj *validation, set_default bool) { for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -107571,7 +107933,10 @@ func (obj *patternFlowIpv4Dst) validateObj(vObj *validation, set_default bool) { for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -108154,7 +108519,10 @@ func (obj *patternFlowIpv6Version) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -108737,7 +109105,10 @@ func (obj *patternFlowIpv6TrafficClass) validateObj(vObj *validation, set_defaul for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -109320,7 +109691,10 @@ func (obj *patternFlowIpv6FlowLabel) validateObj(vObj *validation, set_default b for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -109947,7 +110321,10 @@ func (obj *patternFlowIpv6PayloadLength) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -110574,7 +110951,10 @@ func (obj *patternFlowIpv6NextHeader) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -111157,7 +111537,10 @@ func (obj *patternFlowIpv6HopLimit) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -111735,7 +112118,10 @@ func (obj *patternFlowIpv6Src) validateObj(vObj *validation, set_default bool) { for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -112313,7 +112699,10 @@ func (obj *patternFlowIpv6Dst) validateObj(vObj *validation, set_default bool) { for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -112891,7 +113280,10 @@ func (obj *patternFlowPfcPauseDst) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -113469,7 +113861,10 @@ func (obj *patternFlowPfcPauseSrc) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -114052,7 +114447,10 @@ func (obj *patternFlowPfcPauseEtherType) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -114635,7 +115033,10 @@ func (obj *patternFlowPfcPauseControlOpCode) validateObj(vObj *validation, set_d for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -115218,7 +115619,10 @@ func (obj *patternFlowPfcPauseClassEnableVector) validateObj(vObj *validation, s for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -115801,7 +116205,10 @@ func (obj *patternFlowPfcPausePauseClass0) validateObj(vObj *validation, set_def for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -116384,7 +116791,10 @@ func (obj *patternFlowPfcPausePauseClass1) validateObj(vObj *validation, set_def for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -116967,7 +117377,10 @@ func (obj *patternFlowPfcPausePauseClass2) validateObj(vObj *validation, set_def for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -117550,7 +117963,10 @@ func (obj *patternFlowPfcPausePauseClass3) validateObj(vObj *validation, set_def for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -118133,7 +118549,10 @@ func (obj *patternFlowPfcPausePauseClass4) validateObj(vObj *validation, set_def for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -118716,7 +119135,10 @@ func (obj *patternFlowPfcPausePauseClass5) validateObj(vObj *validation, set_def for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -119299,7 +119721,10 @@ func (obj *patternFlowPfcPausePauseClass6) validateObj(vObj *validation, set_def for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -119882,7 +120307,10 @@ func (obj *patternFlowPfcPausePauseClass7) validateObj(vObj *validation, set_def for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -120460,7 +120888,10 @@ func (obj *patternFlowEthernetPauseDst) validateObj(vObj *validation, set_defaul for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -121038,7 +121469,10 @@ func (obj *patternFlowEthernetPauseSrc) validateObj(vObj *validation, set_defaul for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -121621,7 +122055,10 @@ func (obj *patternFlowEthernetPauseEtherType) validateObj(vObj *validation, set_ for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -122204,7 +122641,10 @@ func (obj *patternFlowEthernetPauseControlOpCode) validateObj(vObj *validation, for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -122787,7 +123227,10 @@ func (obj *patternFlowEthernetPauseTime) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -123370,7 +123813,10 @@ func (obj *patternFlowTcpSrcPort) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -123953,7 +124399,10 @@ func (obj *patternFlowTcpDstPort) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -124513,7 +124962,10 @@ func (obj *patternFlowTcpSeqNum) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -125073,7 +125525,10 @@ func (obj *patternFlowTcpAckNum) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -125656,7 +126111,10 @@ func (obj *patternFlowTcpDataOffset) validateObj(vObj *validation, set_default b for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -126239,7 +126697,10 @@ func (obj *patternFlowTcpEcnNs) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -126822,7 +127283,10 @@ func (obj *patternFlowTcpEcnCwr) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -127405,7 +127869,10 @@ func (obj *patternFlowTcpEcnEcho) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -127988,7 +128455,10 @@ func (obj *patternFlowTcpCtlUrg) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -128571,7 +129041,10 @@ func (obj *patternFlowTcpCtlAck) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -129154,7 +129627,10 @@ func (obj *patternFlowTcpCtlPsh) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -129737,7 +130213,10 @@ func (obj *patternFlowTcpCtlRst) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -130320,7 +130799,10 @@ func (obj *patternFlowTcpCtlSyn) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -130903,7 +131385,10 @@ func (obj *patternFlowTcpCtlFin) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -131486,7 +131971,10 @@ func (obj *patternFlowTcpWindow) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -132069,7 +132557,10 @@ func (obj *patternFlowUdpSrcPort) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -132652,7 +133143,10 @@ func (obj *patternFlowUdpDstPort) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -133235,7 +133729,10 @@ func (obj *patternFlowUdpLength) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -134182,7 +134679,10 @@ func (obj *patternFlowGreChecksumPresent) validateObj(vObj *validation, set_defa for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -134765,7 +135265,10 @@ func (obj *patternFlowGreReserved0) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -135348,7 +135851,10 @@ func (obj *patternFlowGreVersion) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -135931,7 +136437,10 @@ func (obj *patternFlowGreProtocol) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -136878,7 +137387,10 @@ func (obj *patternFlowGreReserved1) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -137461,7 +137973,10 @@ func (obj *patternFlowGtpv1Version) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -138044,7 +138559,10 @@ func (obj *patternFlowGtpv1ProtocolType) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -138627,7 +139145,10 @@ func (obj *patternFlowGtpv1Reserved) validateObj(vObj *validation, set_default b for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -139210,7 +139731,10 @@ func (obj *patternFlowGtpv1EFlag) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -139793,7 +140317,10 @@ func (obj *patternFlowGtpv1SFlag) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -140376,7 +140903,10 @@ func (obj *patternFlowGtpv1PnFlag) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -140959,7 +141489,10 @@ func (obj *patternFlowGtpv1MessageType) validateObj(vObj *validation, set_defaul for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -141542,7 +142075,10 @@ func (obj *patternFlowGtpv1MessageLength) validateObj(vObj *validation, set_defa for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -142102,7 +142638,10 @@ func (obj *patternFlowGtpv1Teid) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -142685,7 +143224,10 @@ func (obj *patternFlowGtpv1SquenceNumber) validateObj(vObj *validation, set_defa for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -143268,7 +143810,10 @@ func (obj *patternFlowGtpv1NPduNumber) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -143851,7 +144396,10 @@ func (obj *patternFlowGtpv1NextExtensionHeaderType) validateObj(vObj *validation for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -144803,7 +145351,10 @@ func (obj *patternFlowGtpv2Version) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -145386,7 +145937,10 @@ func (obj *patternFlowGtpv2PiggybackingFlag) validateObj(vObj *validation, set_d for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -145969,7 +146523,10 @@ func (obj *patternFlowGtpv2TeidFlag) validateObj(vObj *validation, set_default b for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -146552,7 +147109,10 @@ func (obj *patternFlowGtpv2Spare1) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -147135,7 +147695,10 @@ func (obj *patternFlowGtpv2MessageType) validateObj(vObj *validation, set_defaul for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -147718,7 +148281,10 @@ func (obj *patternFlowGtpv2MessageLength) validateObj(vObj *validation, set_defa for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -148278,7 +148844,10 @@ func (obj *patternFlowGtpv2Teid) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -148861,7 +149430,10 @@ func (obj *patternFlowGtpv2SequenceNumber) validateObj(vObj *validation, set_def for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -149444,7 +150016,10 @@ func (obj *patternFlowGtpv2Spare2) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -150027,7 +150602,10 @@ func (obj *patternFlowArpHardwareType) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -150610,7 +151188,10 @@ func (obj *patternFlowArpProtocolType) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -151193,7 +151774,10 @@ func (obj *patternFlowArpHardwareLength) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -151776,7 +152360,10 @@ func (obj *patternFlowArpProtocolLength) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -152359,7 +152946,10 @@ func (obj *patternFlowArpOperation) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -152937,7 +153527,10 @@ func (obj *patternFlowArpSenderHardwareAddr) validateObj(vObj *validation, set_d for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -153515,7 +154108,10 @@ func (obj *patternFlowArpSenderProtocolAddr) validateObj(vObj *validation, set_d for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -154093,7 +154689,10 @@ func (obj *patternFlowArpTargetHardwareAddr) validateObj(vObj *validation, set_d for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -154671,7 +155270,10 @@ func (obj *patternFlowArpTargetProtocolAddr) validateObj(vObj *validation, set_d for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -156164,7 +156766,10 @@ func (obj *patternFlowPppAddress) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -156747,7 +157352,10 @@ func (obj *patternFlowPppControl) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -157374,7 +157982,10 @@ func (obj *patternFlowPppProtocolType) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -157957,7 +158568,10 @@ func (obj *patternFlowIgmpv1Version) validateObj(vObj *validation, set_default b for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -158540,7 +159154,10 @@ func (obj *patternFlowIgmpv1Type) validateObj(vObj *validation, set_default bool for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -159123,7 +159740,10 @@ func (obj *patternFlowIgmpv1Unused) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -160065,7 +160685,10 @@ func (obj *patternFlowIgmpv1GroupAddress) validateObj(vObj *validation, set_defa for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -160692,7 +161315,10 @@ func (obj *patternFlowMplsLabel) validateObj(vObj *validation, set_default bool) for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -161275,7 +161901,10 @@ func (obj *patternFlowMplsTrafficClass) validateObj(vObj *validation, set_defaul for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -161902,7 +162531,10 @@ func (obj *patternFlowMplsBottomOfStack) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -162485,7 +163117,10 @@ func (obj *patternFlowMplsTimeToLive) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -168114,7 +168749,10 @@ func (obj *resultBgpAsPath) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Segments().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -169418,7 +170056,10 @@ func (obj *isisLspTlvs) validateObj(vObj *validation, set_default bool) { for _, item := range obj.HostnameTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.IsReachabilityTlvs) != 0 { @@ -169432,7 +170073,10 @@ func (obj *isisLspTlvs) validateObj(vObj *validation, set_default bool) { for _, item := range obj.IsReachabilityTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtendedIsReachabilityTlvs) != 0 { @@ -169446,7 +170090,10 @@ func (obj *isisLspTlvs) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtendedIsReachabilityTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv4InternalReachabilityTlvs) != 0 { @@ -169460,7 +170107,10 @@ func (obj *isisLspTlvs) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv4InternalReachabilityTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv4ExternalReachabilityTlvs) != 0 { @@ -169474,7 +170124,10 @@ func (obj *isisLspTlvs) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv4ExternalReachabilityTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtendedIpv4ReachabilityTlvs) != 0 { @@ -169488,7 +170141,10 @@ func (obj *isisLspTlvs) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtendedIpv4ReachabilityTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Ipv6ReachabilityTlvs) != 0 { @@ -169502,7 +170158,10 @@ func (obj *isisLspTlvs) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Ipv6ReachabilityTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -171856,7 +172515,10 @@ func (obj *bgpV4EthernetSegment) validateObj(vObj *validation, set_default bool) for _, item := range obj.Evis().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Esi != nil { @@ -171894,7 +172556,10 @@ func (obj *bgpV4EthernetSegment) validateObj(vObj *validation, set_default bool) for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtCommunities) != 0 { @@ -171908,7 +172573,10 @@ func (obj *bgpV4EthernetSegment) validateObj(vObj *validation, set_default bool) for _, item := range obj.ExtCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.AsPath != nil { @@ -174528,7 +175196,10 @@ func (obj *bgpV4RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Addresses().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.NextHopIpv4Address != nil { @@ -174565,7 +175236,10 @@ func (obj *bgpV4RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.AsPath != nil { @@ -174581,6 +175255,8 @@ func (obj *bgpV4RouteRange) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpV4RouteRange") + } else if !vObj.isUnique("bgpV4RouteRange", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } if len(obj.obj.ExtCommunities) != 0 { @@ -174595,7 +175271,10 @@ func (obj *bgpV4RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtendedCommunities) != 0 { @@ -174609,7 +175288,10 @@ func (obj *bgpV4RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtendedCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -175518,7 +176200,10 @@ func (obj *bgpV6RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Addresses().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.NextHopIpv4Address != nil { @@ -175555,7 +176240,10 @@ func (obj *bgpV6RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.AsPath != nil { @@ -175571,6 +176259,8 @@ func (obj *bgpV6RouteRange) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpV6RouteRange") + } else if !vObj.isUnique("bgpV6RouteRange", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } if len(obj.obj.ExtCommunities) != 0 { @@ -175585,7 +176275,10 @@ func (obj *bgpV6RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtendedCommunities) != 0 { @@ -175599,7 +176292,10 @@ func (obj *bgpV6RouteRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtendedCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -176560,7 +177256,10 @@ func (obj *bgpSrteV4Policy) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtCommunities) != 0 { @@ -176574,7 +177273,10 @@ func (obj *bgpSrteV4Policy) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.TunnelTlvs) != 0 { @@ -176588,12 +177290,17 @@ func (obj *bgpSrteV4Policy) validateObj(vObj *validation, set_default bool) { for _, item := range obj.TunnelTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpSrteV4Policy") + } else if !vObj.isUnique("bgpSrteV4Policy", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -177555,7 +178262,10 @@ func (obj *bgpSrteV6Policy) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.Extcommunities) != 0 { @@ -177569,7 +178279,10 @@ func (obj *bgpSrteV6Policy) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Extcommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.TunnelTlvs) != 0 { @@ -177583,12 +178296,17 @@ func (obj *bgpSrteV6Policy) validateObj(vObj *validation, set_default bool) { for _, item := range obj.TunnelTlvs().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpSrteV6Policy") + } else if !vObj.isUnique("bgpSrteV6Policy", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -179237,7 +179955,10 @@ func (obj *bgpV6EthernetSegment) validateObj(vObj *validation, set_default bool) for _, item := range obj.Evis().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Esi != nil { @@ -179275,7 +179996,10 @@ func (obj *bgpV6EthernetSegment) validateObj(vObj *validation, set_default bool) for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtCommunities) != 0 { @@ -179289,7 +180013,10 @@ func (obj *bgpV6EthernetSegment) validateObj(vObj *validation, set_default bool) for _, item := range obj.ExtCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.AsPath != nil { @@ -179649,7 +180376,10 @@ func (obj *vxlanV4TunnelDestinationIPModeUnicast) validateObj(vObj *validation, for _, item := range obj.Vteps().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -180264,7 +180994,10 @@ func (obj *vxlanV6TunnelDestinationIPModeUnicast) validateObj(vObj *validation, for _, item := range obj.Vteps().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -182546,7 +183279,10 @@ func (obj *rsvpEro) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Subobjects().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -192838,7 +193574,10 @@ func (obj *patternFlowIpv4PriorityRaw) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -243404,7 +244143,10 @@ func (obj *patternFlowGtpExtensionExtensionLength) validateObj(vObj *validation, for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -243987,7 +244729,10 @@ func (obj *patternFlowGtpExtensionContents) validateObj(vObj *validation, set_de for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -244570,7 +245315,10 @@ func (obj *patternFlowGtpExtensionNextExtensionHeader) validateObj(vObj *validat for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -257585,7 +258333,10 @@ func (obj *patternFlowIcmpEchoType) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -258168,7 +258919,10 @@ func (obj *patternFlowIcmpEchoCode) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -259115,7 +259869,10 @@ func (obj *patternFlowIcmpEchoIdentifier) validateObj(vObj *validation, set_defa for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -259698,7 +260455,10 @@ func (obj *patternFlowIcmpEchoSequenceNumber) validateObj(vObj *validation, set_ for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -260281,7 +261041,10 @@ func (obj *patternFlowIcmpv6EchoType) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -260864,7 +261627,10 @@ func (obj *patternFlowIcmpv6EchoCode) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -261447,7 +262213,10 @@ func (obj *patternFlowIcmpv6EchoIdentifier) validateObj(vObj *validation, set_de for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -262030,7 +262799,10 @@ func (obj *patternFlowIcmpv6EchoSequenceNumber) validateObj(vObj *validation, se for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -270376,7 +271148,10 @@ func (obj *actionResponseProtocolIpv4Ping) validateObj(vObj *validation, set_def for _, item := range obj.Responses().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -270721,7 +271496,10 @@ func (obj *actionResponseProtocolIpv6Ping) validateObj(vObj *validation, set_def for _, item := range obj.Responses().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -271981,7 +272759,10 @@ func (obj *isisLspIsReachabilityTlv) validateObj(vObj *validation, set_default b for _, item := range obj.Neighbors().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -272326,7 +273107,10 @@ func (obj *isisLspExtendedIsReachabilityTlv) validateObj(vObj *validation, set_d for _, item := range obj.Neighbors().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -272672,7 +273456,10 @@ func (obj *isisLspIpv4InternalReachabilityTlv) validateObj(vObj *validation, set for _, item := range obj.Prefixes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -273018,7 +273805,10 @@ func (obj *isisLspIpv4ExternalReachabilityTlv) validateObj(vObj *validation, set for _, item := range obj.Prefixes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -273364,7 +274154,10 @@ func (obj *isisLspExtendedIpv4ReachabilityTlv) validateObj(vObj *validation, set for _, item := range obj.Prefixes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -273709,7 +274502,10 @@ func (obj *isisLspIpv6ReachabilityTlv) validateObj(vObj *validation, set_default for _, item := range obj.Prefixes().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -275893,7 +276689,10 @@ func (obj *bgpAsPath) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Segments().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -277491,12 +278290,17 @@ func (obj *bgpSrteV4TunnelTlv) validateObj(vObj *validation, set_default bool) { for _, item := range obj.SegmentLists().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpSrteV4TunnelTlv") + } else if !vObj.isUnique("bgpSrteV4TunnelTlv", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -278191,12 +278995,17 @@ func (obj *bgpSrteV6TunnelTlv) validateObj(vObj *validation, set_default bool) { for _, item := range obj.SegmentLists().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpSrteV6TunnelTlv") + } else if !vObj.isUnique("bgpSrteV6TunnelTlv", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -278925,7 +279734,10 @@ func (obj *vxlanV4TunnelDestinationIPModeUnicastVtep) validateObj(vObj *validati for _, item := range obj.ArpSuppressionCache().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -279307,7 +280119,10 @@ func (obj *vxlanV6TunnelDestinationIPModeUnicastVtep) validateObj(vObj *validati for _, item := range obj.ArpSuppressionCache().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -281388,7 +282203,10 @@ func (obj *patternFlowIpv4TosPrecedence) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -281971,7 +282789,10 @@ func (obj *patternFlowIpv4TosDelay) validateObj(vObj *validation, set_default bo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -282554,7 +283375,10 @@ func (obj *patternFlowIpv4TosThroughput) validateObj(vObj *validation, set_defau for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -283137,7 +283961,10 @@ func (obj *patternFlowIpv4TosReliability) validateObj(vObj *validation, set_defa for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -283720,7 +284547,10 @@ func (obj *patternFlowIpv4TosMonetary) validateObj(vObj *validation, set_default for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -284303,7 +285133,10 @@ func (obj *patternFlowIpv4TosUnused) validateObj(vObj *validation, set_default b for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -284886,7 +285719,10 @@ func (obj *patternFlowIpv4DscpPhb) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -285469,7 +286305,10 @@ func (obj *patternFlowIpv4DscpEcn) validateObj(vObj *validation, set_default boo for _, item := range obj.MetricTags().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -296258,7 +297097,10 @@ func (obj *bgpV4EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.BroadcastDomains().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.PmsiLabel != nil { @@ -296297,7 +297139,10 @@ func (obj *bgpV4EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.RouteTargetExport().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.RouteTargetImport) != 0 { @@ -296311,7 +297156,10 @@ func (obj *bgpV4EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.RouteTargetImport().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.L3RouteTargetExport) != 0 { @@ -296325,7 +297173,10 @@ func (obj *bgpV4EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.L3RouteTargetExport().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.L3RouteTargetImport) != 0 { @@ -296339,7 +297190,10 @@ func (obj *bgpV4EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.L3RouteTargetImport().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Advanced != nil { @@ -296358,7 +297212,10 @@ func (obj *bgpV4EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtCommunities) != 0 { @@ -296372,7 +297229,10 @@ func (obj *bgpV4EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.AsPath != nil { @@ -301821,12 +302681,17 @@ func (obj *bgpSrteSegmentList) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Segments().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpSrteSegmentList") + } else if !vObj.isUnique("bgpSrteSegmentList", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -302711,7 +303576,10 @@ func (obj *bgpV6EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.BroadcastDomains().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.PmsiLabel != nil { @@ -302750,7 +303618,10 @@ func (obj *bgpV6EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.RouteTargetExport().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.RouteTargetImport) != 0 { @@ -302764,7 +303635,10 @@ func (obj *bgpV6EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.RouteTargetImport().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.L3RouteTargetExport) != 0 { @@ -302778,7 +303652,10 @@ func (obj *bgpV6EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.L3RouteTargetExport().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.L3RouteTargetImport) != 0 { @@ -302792,7 +303669,10 @@ func (obj *bgpV6EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.L3RouteTargetImport().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.Advanced != nil { @@ -302811,7 +303691,10 @@ func (obj *bgpV6EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtCommunities) != 0 { @@ -302825,7 +303708,10 @@ func (obj *bgpV6EviVxlan) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.AsPath != nil { @@ -309428,7 +310314,10 @@ func (obj *bgpV4EviVxlanBroadcastDomain) validateObj(vObj *validation, set_defau for _, item := range obj.CmacIpRange().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -313958,6 +314847,8 @@ func (obj *bgpSrteSegment) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpSrteSegment") + } else if !vObj.isUnique("bgpSrteSegment", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } @@ -314363,7 +315254,10 @@ func (obj *bgpV6EviVxlanBroadcastDomain) validateObj(vObj *validation, set_defau for _, item := range obj.CmacIpRange().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } } @@ -315142,7 +316036,10 @@ func (obj *bgpCMacIpRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.Communities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if len(obj.obj.ExtCommunities) != 0 { @@ -315156,7 +316053,10 @@ func (obj *bgpCMacIpRange) validateObj(vObj *validation, set_default bool) { for _, item := range obj.ExtCommunities().Items() { item.validateObj(vObj, set_default) } - + _, ok := obj.constraints["local"] + if ok { + delete(obj.constraints, "local") + } } if obj.obj.AsPath != nil { @@ -315167,6 +316067,8 @@ func (obj *bgpCMacIpRange) validateObj(vObj *validation, set_default bool) { // Name is required if obj.obj.Name == "" { vObj.validationErrors = append(vObj.validationErrors, "Name is required field on interface BgpCMacIpRange") + } else if !vObj.isUnique("bgpCMacIpRange", obj.Name(), "global", obj) { + vObj.validationErrors = append(vObj.validationErrors, fmt.Sprintf("Name with %s already exists", obj.Name())) } } diff --git a/requirements.txt b/requirements.txt index 6d09d46b..dc969203 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ --prefer-binary +requests +protobuf~=4.23.3 ; python_version > '3.6' +protobuf~=3.15.0 ; python_version <= '3.6' grpcio-tools~=1.35.0 ; python_version <= '3.6' grpcio-tools~=1.54.2 ; python_version > '3.6' grpcio~=1.54.2 ; python_version > '3.6' grpcio~=1.35.0 ; python_version <= '3.6' -requests PyYAML -protobuf~=3.15.0 ; python_version <= '3.6' -protobuf~=4.23.3 ; python_version > '3.6' -urllib3 semantic_version +urllib3 diff --git a/snappi/snappi.py b/snappi/snappi.py index 78dfca25..72577cd9 100644 --- a/snappi/snappi.py +++ b/snappi/snappi.py @@ -282,8 +282,7 @@ def serialize(self, encoding=JSON): encoding. The json and yaml encodings will return a str object and the dict encoding will return a python dict object. """ - # TODO: restore behavior - # self._clear_globals() + self._clear_globals() if encoding == OpenApiBase.JSON: data = json.dumps(self._encode(), indent=2, sort_keys=True) elif encoding == OpenApiBase.YAML: @@ -292,8 +291,7 @@ def serialize(self, encoding=JSON): data = self._encode() else: raise NotImplementedError("Encoding %s not supported" % encoding) - # TODO: restore behavior - # self._validate_coded() + self._validate_coded() return data def _encode(self): @@ -316,13 +314,11 @@ def deserialize(self, serialized_object): - obj(OpenApiObject): This object with all the serialized_object deserialized within. """ - # TODO: restore behavior - # self._clear_globals() + self._clear_globals() if isinstance(serialized_object, (str, unicode)): serialized_object = yaml.safe_load(serialized_object) self._decode(serialized_object) - # TODO: restore behavior - # self._validate_coded() + self._validate_coded() return self def _decode(self, dict_object): @@ -545,21 +541,34 @@ def types_validation( raise TypeError(err_msg) def _validate_unique_and_name(self, name, value, latter=False): + if self._TYPES[name].get("unique") is None or value is None: return + + unique_type = self._TYPES[name]["unique"] + if latter is True: - self.__validate_latter__["unique"].append( + if unique_type == "local" and "local_unique" in self.__validate_latter__: + key = "local_unique" + else: + key = "unique" + self.__validate_latter__[key].append( (self._validate_unique_and_name, name, value) ) return - class_name = type(self).__name__ - unique_type = self._TYPES[name]["unique"] - if class_name not in self.__constraints__: - self.__constraints__[class_name] = dict() + + # class_name = type(self).__name__ + + # if class_name not in self.__constraints__: + # self.__constraints__[class_name] = dict() + + values = None if unique_type == "global": values = self.__constraints__["global"] - else: - values = self.__constraints__[class_name] + elif "local" in self.__constraints__: + values = self.__constraints__["local"] + # else: + # values = self.__constraints__["class_name"] if value in values: self._validation_errors.append( "{} with {} already exists".format(name, value) @@ -567,7 +576,7 @@ def _validate_unique_and_name(self, name, value, latter=False): return if isinstance(values, list): values.append(value) - self.__constraints__[class_name].update({value: self}) + # self.__constraints__[class_name].update({value: self}) def _validate_constraint(self, name, value, latter=False): cons = self._TYPES[name].get("constraint") @@ -592,12 +601,21 @@ def _validate_constraint(self, name, value, latter=False): ) return - def _validate_coded(self): - for item in self.__validate_latter__["unique"]: - item[0](item[1], item[2]) - for item in self.__validate_latter__["constraint"]: - item[0](item[1], item[2]) - self._clear_vars() + def _validate_coded(self, check_local_unique=False): + if check_local_unique: + for item in self.__validate_latter__["local_unique"]: + item[0](item[1], item[2]) + if "local" in self.__constraints__: + del self.__constraints__["local"] + elif "local_unique" in self.__validate_latter__: + del self.__validate_latter__["local_unique"] + return + else: + for item in self.__validate_latter__["unique"]: + item[0](item[1], item[2]) + for item in self.__validate_latter__["constraint"]: + item[0](item[1], item[2]) + self._clear_vars() if len(self._validation_errors) > 0: errors = "\n".join(self._validation_errors) self._clear_errors() @@ -724,8 +742,8 @@ def _encode(self): self._validate_required() for key, value in self._properties.items(): self._validate_types(key, value) + self._validate_unique_and_name(key, value, True) # TODO: restore behavior - # self._validate_unique_and_name(key, value, True) # self._validate_constraint(key, value, True) if isinstance(value, (OpenApiObject, OpenApiIter)): output[key] = value._encode() @@ -768,10 +786,19 @@ def _decode(self, obj): and self._TYPES[property_name]["type"] not in dtypes ): child = self._get_child_class(property_name, True) + + # placeholders added for checking local unique + self.__constraints__["local"] = [] + self.__validate_latter__["local_unique"] = [] + openapi_list = child[0]() for item in property_value: item = child[1]()._decode(item) openapi_list._items.append(item) + + # checking local unique + self._validate_coded(check_local_unique=True) + property_value = openapi_list ignore_warnings = True elif property_name in self._DEFAULTS and property_value is None: @@ -790,15 +817,11 @@ def _decode(self, obj): ): property_value = [int(v) for v in property_value] self._properties[property_name] = property_value - # TODO: restore behavior - # OpenApiStatus.warn( - # "{}.{}".format(type(self).__name__, property_name), self - # ) if not ignore_warnings: self._raise_status_warnings(property_name, property_value) self._validate_types(property_name, property_value) + self._validate_unique_and_name(property_name, property_value, True) # TODO: restore behavior - # self._validate_unique_and_name(property_name, property_value, True) # self._validate_constraint(property_name, property_value, True) self._validate_required() return self @@ -929,8 +952,7 @@ def validate(self): self._validate_required() for key, value in self._properties.items(): self._validate_types(key, value) - # TODO: restore behavior - # self._validate_coded() + self._validate_coded() def get(self, name, with_default=False): """ @@ -966,7 +988,7 @@ def _raise_status_warnings(self, property_name, property_value): print("[WARNING]: %s" % self._STATUS[enum_key]) -class OpenApiIter(OpenApiBase): +class OpenApiIter(OpenApiBase, OpenApiValidator): """Container class for OpenApiObject Inheriting classes contain 0..n instances of an OpenAPI components/schemas @@ -1058,7 +1080,11 @@ def set(self, index, item): return self def _encode(self): - return [item._encode() for item in self._items] + self.__constraints__["local"] = [] + self.__validate_latter__["local_unique"] = [] + items = [item._encode() for item in self._items] + self._validate_coded(check_local_unique=True) + return items def _decode(self, encoded_list): item_class_name = self.__class__.__name__.replace("Iter", "") @@ -1216,7 +1242,10 @@ class Port(OpenApiObject): _TYPES = { "location": {"type": str}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("name",) # type: tuple(str) @@ -1347,7 +1376,10 @@ class Lag(OpenApiObject): "format": "uint32", "maximum": 32, }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("name",) # type: tuple(str) @@ -1714,7 +1746,10 @@ class DeviceEthernetBase(OpenApiObject): "maximum": 65535, }, "vlans": {"type": "DeviceVlanIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("mac", "name") # type: tuple(str) @@ -1840,7 +1875,10 @@ class DeviceVlan(OpenApiObject): "format": "uint32", "maximum": 4095, }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("name",) # type: tuple(str) @@ -2417,7 +2455,10 @@ class Layer1(OpenApiObject): "auto_negotiate": {"type": bool}, "auto_negotiation": {"type": "Layer1AutoNegotiation"}, "flow_control": {"type": "Layer1FlowControl"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("port_names", "name") # type: tuple(str) @@ -3437,7 +3478,10 @@ class Capture(OpenApiObject): "pcapng", ], }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("port_names", "name") # type: tuple(str) @@ -4634,7 +4678,10 @@ class Device(OpenApiObject): "isis": {"type": "DeviceIsisRouter"}, "bgp": {"type": "DeviceBgpRouter"}, "vxlan": {"type": "DeviceVxlan"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "rsvp": {"type": "DeviceRsvp"}, } # type: Dict[str, str] @@ -4778,7 +4825,10 @@ class DeviceEthernet(OpenApiObject): "maximum": 65535, }, "vlans": {"type": "DeviceVlanIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("mac", "name") # type: tuple(str) @@ -5070,7 +5120,10 @@ class DeviceIpv4(OpenApiObject): "minimum": 1, "maximum": 32, }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("gateway", "address", "name") # type: tuple(str) @@ -5395,7 +5448,10 @@ class DeviceIpv6(OpenApiObject): "minimum": 1, "maximum": 128, }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("gateway", "address", "name") # type: tuple(str) @@ -5765,7 +5821,10 @@ class DeviceIpv4Loopback(OpenApiObject): "type": str, "format": "ipv4", }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("eth_name", "name") # type: tuple(str) @@ -5924,7 +5983,10 @@ class DeviceIpv6Loopback(OpenApiObject): "type": str, "format": "ipv6", }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("eth_name", "name") # type: tuple(str) @@ -6089,7 +6151,10 @@ class DeviceIsisRouter(OpenApiObject): "router_auth": {"type": "IsisAuthentication"}, "v4_routes": {"type": "IsisV4RouteRangeIter"}, "v6_routes": {"type": "IsisV6RouteRangeIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("system_id", "interfaces", "name") # type: tuple(str) @@ -6356,7 +6421,10 @@ class IsisInterface(OpenApiObject): "itemformat": "uint32", "maximum": 16777215, }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("eth_name", "name") # type: tuple(str) @@ -8609,7 +8677,10 @@ class IsisV4RouteRange(OpenApiObject): "down", ], }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "prefix_attr_enabled": {"type": bool}, "x_flag": {"type": bool}, "r_flag": {"type": bool}, @@ -9172,7 +9243,10 @@ class IsisV6RouteRange(OpenApiObject): "down", ], }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "prefix_attr_enabled": {"type": bool}, "x_flag": {"type": bool}, "r_flag": {"type": bool}, @@ -9881,7 +9955,10 @@ class BgpV4Peer(OpenApiObject): "v6_routes": {"type": "BgpV6RouteRangeIter"}, "v4_srte_policies": {"type": "BgpSrteV4PolicyIter"}, "v6_srte_policies": {"type": "BgpSrteV6PolicyIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "graceful_restart": {"type": "BgpGracefulRestart"}, } # type: Dict[str, str] @@ -10831,7 +10908,10 @@ class BgpCMacIpRange(OpenApiObject): "communities": {"type": "BgpCommunityIter"}, "ext_communities": {"type": "BgpExtCommunityIter"}, "as_path": {"type": "BgpAsPath"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("name",) # type: tuple(str) @@ -13411,7 +13491,10 @@ class BgpV4RouteRange(OpenApiObject): "communities": {"type": "BgpCommunityIter"}, "as_path": {"type": "BgpAsPath"}, "add_path": {"type": "BgpAddPath"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "ext_communities": {"type": "BgpExtCommunityIter"}, "extended_communities": {"type": "BgpExtendedCommunityIter"}, } # type: Dict[str, str] @@ -15565,7 +15648,10 @@ class BgpV6RouteRange(OpenApiObject): "communities": {"type": "BgpCommunityIter"}, "as_path": {"type": "BgpAsPath"}, "add_path": {"type": "BgpAddPath"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "ext_communities": {"type": "BgpExtCommunityIter"}, "extended_communities": {"type": "BgpExtendedCommunityIter"}, } # type: Dict[str, str] @@ -15938,7 +16024,10 @@ class BgpSrteV4Policy(OpenApiObject): "communities": {"type": "BgpCommunityIter"}, "ext_communities": {"type": "BgpExtCommunityIter"}, "tunnel_tlvs": {"type": "BgpSrteV4TunnelTlvIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "active": {"type": bool}, } # type: Dict[str, str] @@ -16281,7 +16370,10 @@ class BgpSrteV4TunnelTlv(OpenApiObject): "type": "BgpSrteExplicitNullLabelPolicySubTlv" }, "segment_lists": {"type": "BgpSrteSegmentListIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "active": {"type": bool}, } # type: Dict[str, str] @@ -17031,7 +17123,10 @@ class BgpSrteSegmentList(OpenApiObject): "format": "uint32", }, "segments": {"type": "BgpSrteSegmentIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "active": {"type": bool}, } # type: Dict[str, str] @@ -17166,7 +17261,10 @@ class BgpSrteSegment(OpenApiObject): "type_i": {"type": "BgpSrteSegmentITypeSubTlv"}, "type_j": {"type": "BgpSrteSegmentJTypeSubTlv"}, "type_k": {"type": "BgpSrteSegmentKTypeSubTlv"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "active": {"type": bool}, } # type: Dict[str, str] @@ -19558,7 +19656,10 @@ class BgpSrteV6Policy(OpenApiObject): "communities": {"type": "BgpCommunityIter"}, "extcommunities": {"type": "BgpExtCommunityIter"}, "tunnel_tlvs": {"type": "BgpSrteV6TunnelTlvIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "active": {"type": bool}, } # type: Dict[str, str] @@ -19903,7 +20004,10 @@ class BgpSrteV6TunnelTlv(OpenApiObject): "type": "BgpSrteExplicitNullLabelPolicySubTlv" }, "segment_lists": {"type": "BgpSrteSegmentListIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "active": {"type": bool}, } # type: Dict[str, str] @@ -20587,7 +20691,10 @@ class BgpV6Peer(OpenApiObject): "v6_routes": {"type": "BgpV6RouteRangeIter"}, "v4_srte_policies": {"type": "BgpSrteV4PolicyIter"}, "v6_srte_policies": {"type": "BgpSrteV6PolicyIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "graceful_restart": {"type": "BgpGracefulRestart"}, } # type: Dict[str, str] @@ -22113,7 +22220,10 @@ class VxlanV4Tunnel(OpenApiObject): "minimum": 1, "maximum": 16777215, }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("source_interface", "vni", "name") # type: tuple(str) @@ -22723,7 +22833,10 @@ class VxlanV6Tunnel(OpenApiObject): "minimum": 1, "maximum": 16777215, }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("source_interface", "vni", "name") # type: tuple(str) @@ -23186,7 +23299,10 @@ class DeviceRsvp(OpenApiObject): _TYPES = { "ipv4_interfaces": {"type": "RsvpIpv4InterfaceIter"}, "lsp_ipv4_interfaces": {"type": "RsvpLspIpv4InterfaceIter"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = () # type: tuple(str) @@ -23785,7 +23901,10 @@ class RsvpLspIpv4InterfaceP2PEgressIpv4Lsp(OpenApiObject): __slots__ = "_parent" _TYPES = { - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "refresh_interval": { "type": int, "format": "uint32", @@ -23993,7 +24112,10 @@ class RsvpLspIpv4InterfaceP2PIngressIpv4Lsp(OpenApiObject): __slots__ = "_parent" _TYPES = { - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, "remote_address": { "type": str, "format": "ipv4", @@ -25760,7 +25882,10 @@ class Flow(OpenApiObject): "rate": {"type": "FlowRate"}, "duration": {"type": "FlowDuration"}, "metrics": {"type": "FlowMetrics"}, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("tx_rx", "name") # type: tuple(str) @@ -92070,7 +92195,10 @@ class Lldp(OpenApiObject): "minimum": 5, "maximum": 65534, }, - "name": {"type": str}, + "name": { + "type": str, + "unique": "global", + }, } # type: Dict[str, str] _REQUIRED = ("connection", "name") # type: tuple(str)