From ac4d6e872df4b37ebdd317f4bb83ff1caed2703a Mon Sep 17 00:00:00 2001 From: Shreyas Date: Tue, 18 Jul 2023 18:28:48 -0400 Subject: [PATCH] [minor_change] Add DNs of port, pcPort, associated groups and associated sub groups attributes to infraPortConfig and fabricPortConfig (#275) --- models/fabric_port_config.go | 42 ++++++++++++++----------- models/infra_port_config.go | 60 +++++++++++++++++++++--------------- 2 files changed, 60 insertions(+), 42 deletions(-) diff --git a/models/fabric_port_config.go b/models/fabric_port_config.go index eae025a..f93701c 100644 --- a/models/fabric_port_config.go +++ b/models/fabric_port_config.go @@ -20,15 +20,17 @@ type FabricPortConfiguration struct { } type FabricPortConfigurationAttributes struct { - Annotation string `json:",omitempty"` - AssocGrp string `json:",omitempty"` - Card string `json:",omitempty"` - Descr string `json:",omitempty"` - Node string `json:",omitempty"` - Port string `json:",omitempty"` - Role string `json:",omitempty"` - Shutdown string `json:",omitempty"` - SubPort string `json:",omitempty"` + Annotation string `json:",omitempty"` + AssocGrp string `json:",omitempty"` + Card string `json:",omitempty"` + Descr string `json:",omitempty"` + Node string `json:",omitempty"` + Port string `json:",omitempty"` + Role string `json:",omitempty"` + Shutdown string `json:",omitempty"` + SubPort string `json:",omitempty"` + OperationalAssocGrp string `json:",omitempty"` + PortDn string `json:",omitempty"` } func NewFabricPortConfiguration(fabricPortConfigRn, parentDn, description string, fabricPortConfigAttr FabricPortConfigurationAttributes) *FabricPortConfiguration { @@ -59,6 +61,8 @@ func (fabricPortConfig *FabricPortConfiguration) ToMap() (map[string]string, err A(fabricPortConfigMap, "role", fabricPortConfig.Role) A(fabricPortConfigMap, "shutdown", fabricPortConfig.Shutdown) A(fabricPortConfigMap, "subPort", fabricPortConfig.SubPort) + A(fabricPortConfigMap, "operationalAssocGrp", fabricPortConfig.OperationalAssocGrp) + A(fabricPortConfigMap, "portDn", fabricPortConfig.PortDn) return fabricPortConfigMap, err } @@ -72,15 +76,17 @@ func FabricPortConfigurationFromContainerList(cont *container.Container, index i Rn: G(FabricPortConfigurationCont, "rn"), }, FabricPortConfigurationAttributes{ - Annotation: G(FabricPortConfigurationCont, "annotation"), - AssocGrp: G(FabricPortConfigurationCont, "assocGrp"), - Card: G(FabricPortConfigurationCont, "card"), - Descr: G(FabricPortConfigurationCont, "description"), - Node: G(FabricPortConfigurationCont, "node"), - Port: G(FabricPortConfigurationCont, "port"), - Role: G(FabricPortConfigurationCont, "role"), - Shutdown: G(FabricPortConfigurationCont, "shutdown"), - SubPort: G(FabricPortConfigurationCont, "subPort"), + Annotation: G(FabricPortConfigurationCont, "annotation"), + AssocGrp: G(FabricPortConfigurationCont, "assocGrp"), + Card: G(FabricPortConfigurationCont, "card"), + Descr: G(FabricPortConfigurationCont, "description"), + Node: G(FabricPortConfigurationCont, "node"), + Port: G(FabricPortConfigurationCont, "port"), + Role: G(FabricPortConfigurationCont, "role"), + Shutdown: G(FabricPortConfigurationCont, "shutdown"), + SubPort: G(FabricPortConfigurationCont, "subPort"), + OperationalAssocGrp: G(FabricPortConfigurationCont, "operationalAssocGrp"), + PortDn: G(FabricPortConfigurationCont, "portDn"), }, } } diff --git a/models/infra_port_config.go b/models/infra_port_config.go index f285f85..4bb6e97 100644 --- a/models/infra_port_config.go +++ b/models/infra_port_config.go @@ -20,18 +20,22 @@ type InfraPortConfiguration struct { } type InfraPortConfigurationAttributes struct { - Annotation string `json:",omitempty"` - AssocGrp string `json:",omitempty"` - BrkoutMap string `json:",omitempty"` - Card string `json:",omitempty"` - ConnectedFex string `json:",omitempty"` - Descr string `json:",omitempty"` - Node string `json:",omitempty"` - PcMember string `json:",omitempty"` - Port string `json:",omitempty"` - Role string `json:",omitempty"` - Shutdown string `json:",omitempty"` - SubPort string `json:",omitempty"` + Annotation string `json:",omitempty"` + AssocGrp string `json:",omitempty"` + BrkoutMap string `json:",omitempty"` + Card string `json:",omitempty"` + ConnectedFex string `json:",omitempty"` + Descr string `json:",omitempty"` + Node string `json:",omitempty"` + PcMember string `json:",omitempty"` + Port string `json:",omitempty"` + Role string `json:",omitempty"` + Shutdown string `json:",omitempty"` + SubPort string `json:",omitempty"` + OperationalAssocGrp string `json:",omitempty"` + OperationalAssocSubGrp string `json:",omitempty"` + PortDn string `json:",omitempty"` + PcPortDn string `json:",omitempty"` } func NewInfraPortConfiguration(infraPortConfigRn, parentDn, description string, infraPortConfigAttr InfraPortConfigurationAttributes) *InfraPortConfiguration { @@ -65,6 +69,10 @@ func (infraPortConfig *InfraPortConfiguration) ToMap() (map[string]string, error A(infraPortConfigMap, "role", infraPortConfig.Role) A(infraPortConfigMap, "shutdown", infraPortConfig.Shutdown) A(infraPortConfigMap, "subPort", infraPortConfig.SubPort) + A(infraPortConfigMap, "operationalAssocGrp", infraPortConfig.OperationalAssocGrp) + A(infraPortConfigMap, "operationalAssocSubGrp", infraPortConfig.OperationalAssocSubGrp) + A(infraPortConfigMap, "portDn", infraPortConfig.PortDn) + A(infraPortConfigMap, "pcPortDn", infraPortConfig.PcPortDn) if infraPortConfig.BrkoutMap != "" && infraPortConfig.BrkoutMap != "none" { infraPortConfigMap["assocGrp"] = "" @@ -83,18 +91,22 @@ func InfraPortConfigurationFromContainerList(cont *container.Container, index in Rn: G(InfraPortConfigurationCont, "rn"), }, InfraPortConfigurationAttributes{ - Annotation: G(InfraPortConfigurationCont, "annotation"), - AssocGrp: G(InfraPortConfigurationCont, "assocGrp"), - BrkoutMap: G(InfraPortConfigurationCont, "brkoutMap"), - Card: G(InfraPortConfigurationCont, "card"), - ConnectedFex: G(InfraPortConfigurationCont, "connectedFex"), - Descr: G(InfraPortConfigurationCont, "description"), - Node: G(InfraPortConfigurationCont, "node"), - PcMember: G(InfraPortConfigurationCont, "pcMember"), - Port: G(InfraPortConfigurationCont, "port"), - Role: G(InfraPortConfigurationCont, "role"), - Shutdown: G(InfraPortConfigurationCont, "shutdown"), - SubPort: G(InfraPortConfigurationCont, "subPort"), + Annotation: G(InfraPortConfigurationCont, "annotation"), + AssocGrp: G(InfraPortConfigurationCont, "assocGrp"), + BrkoutMap: G(InfraPortConfigurationCont, "brkoutMap"), + Card: G(InfraPortConfigurationCont, "card"), + ConnectedFex: G(InfraPortConfigurationCont, "connectedFex"), + Descr: G(InfraPortConfigurationCont, "description"), + Node: G(InfraPortConfigurationCont, "node"), + PcMember: G(InfraPortConfigurationCont, "pcMember"), + Port: G(InfraPortConfigurationCont, "port"), + Role: G(InfraPortConfigurationCont, "role"), + Shutdown: G(InfraPortConfigurationCont, "shutdown"), + SubPort: G(InfraPortConfigurationCont, "subPort"), + OperationalAssocGrp: G(InfraPortConfigurationCont, "operationalAssocGrp"), + OperationalAssocSubGrp: G(InfraPortConfigurationCont, "operationalAssocSubGrp"), + PortDn: G(InfraPortConfigurationCont, "portDn"), + PcPortDn: G(InfraPortConfigurationCont, "pcPortDn"), }, } }