From 9ab46da146666f6aed08162565c749f97100deb1 Mon Sep 17 00:00:00 2001 From: Shreyas Date: Fri, 17 Mar 2023 14:46:26 -0400 Subject: [PATCH] [minor_change] Add encap attribute to the relation_l3ext_rs_dyn_path_att attribute of aci_l3out_floating_svi (#1027) --- aci/resource_aci_l3extvirtuallifp.go | 9 +- examples/l3out_floating_svi/main.tf | 1 + go.mod | 2 +- go.sum | 5 +- .../v2/client/fabricPortConfig_service.go | 46 ++++++++ .../v2/client/infraPortConfig_service.go | 46 ++++++++ .../v2/client/l3extVirtualLIfP_service.go | 7 +- .../v2/models/fabric_port_config.go | 101 ++++++++++++++++ .../v2/models/infra_port_config.go | 110 ++++++++++++++++++ vendor/modules.txt | 2 +- .../docs/d/l3out_floating_svi.html.markdown | 12 +- .../docs/r/l3out_floating_svi.html.markdown | 17 ++- 12 files changed, 347 insertions(+), 11 deletions(-) create mode 100644 vendor/github.com/ciscoecosystem/aci-go-client/v2/client/fabricPortConfig_service.go create mode 100644 vendor/github.com/ciscoecosystem/aci-go-client/v2/client/infraPortConfig_service.go create mode 100644 vendor/github.com/ciscoecosystem/aci-go-client/v2/models/fabric_port_config.go create mode 100644 vendor/github.com/ciscoecosystem/aci-go-client/v2/models/infra_port_config.go diff --git a/aci/resource_aci_l3extvirtuallifp.go b/aci/resource_aci_l3extvirtuallifp.go index 4d322d26a..80d1e7a82 100644 --- a/aci/resource_aci_l3extvirtuallifp.go +++ b/aci/resource_aci_l3extvirtuallifp.go @@ -201,6 +201,10 @@ func resourceAciVirtualLogicalInterfaceProfile() *schema.Resource { Optional: true, Default: "", }, + "encap": { + Type: schema.TypeString, + Optional: true, + }, }, }, }, @@ -281,6 +285,7 @@ func getAndSetL3extRsDynPathAttFromLogicalInterfaceProfile(client *client.Client obj["forged_transmit"] = l3extRsDynPathObj["forgedTransmit"] obj["mac_change"] = l3extRsDynPathObj["macChange"] obj["promiscuous_mode"] = l3extRsDynPathObj["promMode"] + obj["encap"] = l3extRsDynPathObj["encap"] obj["enhanced_lag_policy_dn"] = getL3extRsVSwitchEnhancedLagPol(client, dn, l3extRsDynPathObj["tDn"]) l3extRsDynPaths = append(l3extRsDynPaths, obj) } @@ -391,7 +396,7 @@ func resourceAciVirtualLogicalInterfaceProfileCreate(ctx context.Context, d *sch relationParamList := relationTol3extRsDynPathAtt.(*schema.Set).List() for _, relationParam := range relationParamList { paramMap := relationParam.(map[string]interface{}) - err = aciClient.CreateRelationl3extRsDynPathAttFromLogicalInterfaceProfile(l3extVirtualLIfP.DistinguishedName, paramMap["tdn"].(string), paramMap["floating_address"].(string), paramMap["forged_transmit"].(string), paramMap["mac_change"].(string), paramMap["promiscuous_mode"].(string)) + err = aciClient.CreateRelationl3extRsDynPathAttFromLogicalInterfaceProfile(l3extVirtualLIfP.DistinguishedName, paramMap["tdn"].(string), paramMap["floating_address"].(string), paramMap["forged_transmit"].(string), paramMap["mac_change"].(string), paramMap["promiscuous_mode"].(string), paramMap["encap"].(string)) if err != nil { return diag.FromErr(err) } @@ -501,7 +506,7 @@ func resourceAciVirtualLogicalInterfaceProfileUpdate(ctx context.Context, d *sch } for _, relationParam := range newRelList { paramMap := relationParam.(map[string]interface{}) - err = aciClient.CreateRelationl3extRsDynPathAttFromLogicalInterfaceProfile(l3extVirtualLIfP.DistinguishedName, paramMap["tdn"].(string), paramMap["floating_address"].(string), paramMap["forged_transmit"].(string), paramMap["mac_change"].(string), paramMap["promiscuous_mode"].(string)) + err = aciClient.CreateRelationl3extRsDynPathAttFromLogicalInterfaceProfile(l3extVirtualLIfP.DistinguishedName, paramMap["tdn"].(string), paramMap["floating_address"].(string), paramMap["forged_transmit"].(string), paramMap["mac_change"].(string), paramMap["promiscuous_mode"].(string), paramMap["encap"].(string)) if err != nil { return diag.FromErr(err) } diff --git a/examples/l3out_floating_svi/main.tf b/examples/l3out_floating_svi/main.tf index 6ab0a6796..f0805bfb8 100644 --- a/examples/l3out_floating_svi/main.tf +++ b/examples/l3out_floating_svi/main.tf @@ -84,5 +84,6 @@ resource "aci_l3out_floating_svi" "example2" { relation_l3ext_rs_dyn_path_att { tdn = aci_physical_domain.example.id floating_address = "10.21.30.254/16" + encap = "vlan-1" } } \ No newline at end of file diff --git a/go.mod b/go.mod index 00c20365a..0eae81988 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-aci go 1.18 require ( - github.com/ciscoecosystem/aci-go-client/v2 v2.7.5 + github.com/ciscoecosystem/aci-go-client/v2 v2.9.0 github.com/ghodss/yaml v1.0.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0 ) diff --git a/go.sum b/go.sum index 8f85c68a9..15edd3efa 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/ciscoecosystem/aci-go-client/v2 v2.7.5 h1:pyl32ECE2W92R6s4dGzG3JZRL8+9bLw674I0JilcM9E= -github.com/ciscoecosystem/aci-go-client/v2 v2.7.5/go.mod h1:ZeJuaKr9gTRn5B1CwA3sVSVqnRjVMEcBc8LUX222wf0= +github.com/ciscoecosystem/aci-go-client/v2 v2.9.0 h1:dbQnWlK+oUc+mF0VX/pM9qmExqtvuL0gAns5TOegeF0= +github.com/ciscoecosystem/aci-go-client/v2 v2.9.0/go.mod h1:0uk5hiHANgXo+0h+Z8dFBriB7hHnI0PSGVUm7/20bt4= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -343,6 +343,7 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/fabricPortConfig_service.go b/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/fabricPortConfig_service.go new file mode 100644 index 000000000..01fb85058 --- /dev/null +++ b/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/fabricPortConfig_service.go @@ -0,0 +1,46 @@ +package client + +import ( + "fmt" + + "github.com/ciscoecosystem/aci-go-client/v2/models" +) + +func (sm *ServiceManager) CreateFabricPortConfiguration(subPort string, port string, card string, node string, description string, fabricPortConfigAttr models.FabricPortConfigurationAttributes) (*models.FabricPortConfiguration, error) { + rn := fmt.Sprintf(models.RnFabricPortConfig, node, card, port, subPort) + fabricPortConfig := models.NewFabricPortConfiguration(rn, models.ParentDnFabricPortConfig, description, fabricPortConfigAttr) + err := sm.Save(fabricPortConfig) + return fabricPortConfig, err +} + +func (sm *ServiceManager) ReadFabricPortConfiguration(subPort string, port string, card string, node string) (*models.FabricPortConfiguration, error) { + rn := fmt.Sprintf(models.RnFabricPortConfig, node, card, port, subPort) + dn := fmt.Sprintf("%s/%s", models.ParentDnFabricPortConfig, rn) + cont, err := sm.Get(dn) + if err != nil { + return nil, err + } + fabricPortConfig := models.FabricPortConfigurationFromContainer(cont) + return fabricPortConfig, nil +} + +func (sm *ServiceManager) DeleteFabricPortConfiguration(subPort string, port string, card string, node string) error { + rn := fmt.Sprintf(models.RnFabricPortConfig, node, card, port, subPort) + dn := fmt.Sprintf("%s/%s", models.ParentDnFabricPortConfig, rn) + return sm.DeleteByDn(dn, models.FabricPortConfigClassName) +} + +func (sm *ServiceManager) UpdateFabricPortConfiguration(subPort string, port string, card string, node string, description string, fabricPortConfigAttr models.FabricPortConfigurationAttributes) (*models.FabricPortConfiguration, error) { + rn := fmt.Sprintf(models.RnFabricPortConfig, node, card, port, subPort) + fabricPortConfig := models.NewFabricPortConfiguration(rn, models.ParentDnFabricPortConfig, description, fabricPortConfigAttr) + fabricPortConfig.Status = "modified" + err := sm.Save(fabricPortConfig) + return fabricPortConfig, err +} + +func (sm *ServiceManager) ListFabricPortConfiguration() ([]*models.FabricPortConfiguration, error) { + dnUrl := fmt.Sprintf("%s/%s/%s.json", models.BaseurlStr, models.ParentDnFabricPortConfig, models.FabricPortConfigClassName) + cont, err := sm.GetViaURL(dnUrl) + list := models.FabricPortConfigurationListFromContainer(cont) + return list, err +} diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/infraPortConfig_service.go b/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/infraPortConfig_service.go new file mode 100644 index 000000000..7c664f45e --- /dev/null +++ b/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/infraPortConfig_service.go @@ -0,0 +1,46 @@ +package client + +import ( + "fmt" + + "github.com/ciscoecosystem/aci-go-client/v2/models" +) + +func (sm *ServiceManager) CreateInfraPortConfiguration(subPort string, port string, card string, node string, description string, infraPortConfigAttr models.InfraPortConfigurationAttributes) (*models.InfraPortConfiguration, error) { + rn := fmt.Sprintf(models.RnInfraPortConfig, node, card, port, subPort) + infraPortConfig := models.NewInfraPortConfiguration(rn, models.ParentDnInfraPortConfig, description, infraPortConfigAttr) + err := sm.Save(infraPortConfig) + return infraPortConfig, err +} + +func (sm *ServiceManager) ReadInfraPortConfiguration(subPort string, port string, card string, node string) (*models.InfraPortConfiguration, error) { + rn := fmt.Sprintf(models.RnInfraPortConfig, node, card, port, subPort) + dn := fmt.Sprintf("%s/%s", models.ParentDnInfraPortConfig, rn) + cont, err := sm.Get(dn) + if err != nil { + return nil, err + } + infraPortConfig := models.InfraPortConfigurationFromContainer(cont) + return infraPortConfig, nil +} + +func (sm *ServiceManager) DeleteInfraPortConfiguration(subPort string, port string, card string, node string) error { + rn := fmt.Sprintf(models.RnInfraPortConfig, node, card, port, subPort) + dn := fmt.Sprintf("%s/%s", models.ParentDnInfraPortConfig, rn) + return sm.DeleteByDn(dn, models.InfraPortConfigClassName) +} + +func (sm *ServiceManager) UpdateInfraPortConfiguration(subPort string, port string, card string, node string, description string, infraPortConfigAttr models.InfraPortConfigurationAttributes) (*models.InfraPortConfiguration, error) { + rn := fmt.Sprintf(models.RnInfraPortConfig, node, card, port, subPort) + infraPortConfig := models.NewInfraPortConfiguration(rn, models.ParentDnInfraPortConfig, description, infraPortConfigAttr) + infraPortConfig.Status = "modified" + err := sm.Save(infraPortConfig) + return infraPortConfig, err +} + +func (sm *ServiceManager) ListInfraPortConfiguration() ([]*models.InfraPortConfiguration, error) { + dnUrl := fmt.Sprintf("%s/%s/%s.json", models.BaseurlStr, models.ParentDnInfraPortConfig, models.InfraPortConfigClassName) + cont, err := sm.GetViaURL(dnUrl) + list := models.InfraPortConfigurationListFromContainer(cont) + return list, err +} diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/l3extVirtualLIfP_service.go b/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/l3extVirtualLIfP_service.go index c2b6d313c..4575026a5 100644 --- a/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/l3extVirtualLIfP_service.go +++ b/vendor/github.com/ciscoecosystem/aci-go-client/v2/client/l3extVirtualLIfP_service.go @@ -54,7 +54,7 @@ func (sm *ServiceManager) ListVirtualLogicalInterfaceProfile(logical_interface_p return list, err } -func (sm *ServiceManager) CreateRelationl3extRsDynPathAttFromLogicalInterfaceProfile(parentDn, tDn, addr, forgedTransmit, macChange, promMode string) error { +func (sm *ServiceManager) CreateRelationl3extRsDynPathAttFromLogicalInterfaceProfile(parentDn, tDn, addr, forgedTransmit, macChange, promMode, encap string) error { dn := fmt.Sprintf("%s/rsdynPathAtt-[%s]", parentDn, tDn) containerJSON := []byte(fmt.Sprintf(`{ "%s": { @@ -87,6 +87,10 @@ func (sm *ServiceManager) CreateRelationl3extRsDynPathAttFromLogicalInterfacePro jsonPayload.Set(promMode, "l3extRsDynPathAtt", "attributes", "promMode") } + if encap != "" { + jsonPayload.Set(encap, "l3extRsDynPathAtt", "attributes", "encap") + } + req, err := sm.client.MakeRestRequest("POST", fmt.Sprintf("%s.json", sm.MOURL), jsonPayload, true) if err != nil { return err @@ -122,6 +126,7 @@ func (sm *ServiceManager) ReadRelationl3extRsDynPathAttFromLogicalInterfaceProfi paramMap["forgedTransmit"] = models.G(contItem, "forgedTransmit") paramMap["macChange"] = models.G(contItem, "macChange") paramMap["promMode"] = models.G(contItem, "promMode") + paramMap["encap"] = models.G(contItem, "encap") st = append(st, paramMap) } diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/v2/models/fabric_port_config.go b/vendor/github.com/ciscoecosystem/aci-go-client/v2/models/fabric_port_config.go new file mode 100644 index 000000000..eae025ac6 --- /dev/null +++ b/vendor/github.com/ciscoecosystem/aci-go-client/v2/models/fabric_port_config.go @@ -0,0 +1,101 @@ +package models + +import ( + "fmt" + "strconv" + + "github.com/ciscoecosystem/aci-go-client/v2/container" +) + +const ( + RnFabricPortConfig = "portconfnode-%s-card-%s-port-%s-sub-%s" + DnFabricPortConfig = "uni/fabric/portconfnode-%s-card-%s-port-%s-sub-%s" + ParentDnFabricPortConfig = "uni/fabric" + FabricPortConfigClassName = "fabricPortConfig" +) + +type FabricPortConfiguration struct { + BaseAttributes + FabricPortConfigurationAttributes +} + +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"` +} + +func NewFabricPortConfiguration(fabricPortConfigRn, parentDn, description string, fabricPortConfigAttr FabricPortConfigurationAttributes) *FabricPortConfiguration { + dn := fmt.Sprintf("%s/%s", parentDn, fabricPortConfigRn) + return &FabricPortConfiguration{ + BaseAttributes: BaseAttributes{ + DistinguishedName: dn, + Status: "created, modified", + ClassName: FabricPortConfigClassName, + Rn: fabricPortConfigRn, + }, + FabricPortConfigurationAttributes: fabricPortConfigAttr, + } +} + +func (fabricPortConfig *FabricPortConfiguration) ToMap() (map[string]string, error) { + fabricPortConfigMap, err := fabricPortConfig.BaseAttributes.ToMap() + if err != nil { + return nil, err + } + + A(fabricPortConfigMap, "annotation", fabricPortConfig.Annotation) + A(fabricPortConfigMap, "assocGrp", fabricPortConfig.AssocGrp) + A(fabricPortConfigMap, "card", fabricPortConfig.Card) + A(fabricPortConfigMap, "description", fabricPortConfig.Descr) + A(fabricPortConfigMap, "node", fabricPortConfig.Node) + A(fabricPortConfigMap, "port", fabricPortConfig.Port) + A(fabricPortConfigMap, "role", fabricPortConfig.Role) + A(fabricPortConfigMap, "shutdown", fabricPortConfig.Shutdown) + A(fabricPortConfigMap, "subPort", fabricPortConfig.SubPort) + return fabricPortConfigMap, err +} + +func FabricPortConfigurationFromContainerList(cont *container.Container, index int) *FabricPortConfiguration { + FabricPortConfigurationCont := cont.S("imdata").Index(index).S(FabricPortConfigClassName, "attributes") + return &FabricPortConfiguration{ + BaseAttributes{ + DistinguishedName: G(FabricPortConfigurationCont, "dn"), + Status: G(FabricPortConfigurationCont, "status"), + ClassName: FabricPortConfigClassName, + 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"), + }, + } +} + +func FabricPortConfigurationFromContainer(cont *container.Container) *FabricPortConfiguration { + return FabricPortConfigurationFromContainerList(cont, 0) +} + +func FabricPortConfigurationListFromContainer(cont *container.Container) []*FabricPortConfiguration { + length, _ := strconv.Atoi(G(cont, "totalCount")) + arr := make([]*FabricPortConfiguration, length) + + for i := 0; i < length; i++ { + arr[i] = FabricPortConfigurationFromContainerList(cont, i) + } + + return arr +} diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/v2/models/infra_port_config.go b/vendor/github.com/ciscoecosystem/aci-go-client/v2/models/infra_port_config.go new file mode 100644 index 000000000..0a21df488 --- /dev/null +++ b/vendor/github.com/ciscoecosystem/aci-go-client/v2/models/infra_port_config.go @@ -0,0 +1,110 @@ +package models + +import ( + "fmt" + "strconv" + + "github.com/ciscoecosystem/aci-go-client/v2/container" +) + +const ( + RnInfraPortConfig = "portconfnode-%s-card-%s-port-%s-sub-%s" + DnInfraPortConfig = "uni/infra/portconfnode-%s-card-%s-port-%s-sub-%s" + ParentDnInfraPortConfig = "uni/infra" + InfraPortConfigClassName = "infraPortConfig" +) + +type InfraPortConfiguration struct { + BaseAttributes + InfraPortConfigurationAttributes +} + +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"` +} + +func NewInfraPortConfiguration(infraPortConfigRn, parentDn, description string, infraPortConfigAttr InfraPortConfigurationAttributes) *InfraPortConfiguration { + dn := fmt.Sprintf("%s/%s", parentDn, infraPortConfigRn) + return &InfraPortConfiguration{ + BaseAttributes: BaseAttributes{ + DistinguishedName: dn, + Status: "created, modified", + ClassName: InfraPortConfigClassName, + Rn: infraPortConfigRn, + }, + InfraPortConfigurationAttributes: infraPortConfigAttr, + } +} + +func (infraPortConfig *InfraPortConfiguration) ToMap() (map[string]string, error) { + infraPortConfigMap, err := infraPortConfig.BaseAttributes.ToMap() + if err != nil { + return nil, err + } + + A(infraPortConfigMap, "annotation", infraPortConfig.Annotation) + A(infraPortConfigMap, "assocGrp", infraPortConfig.AssocGrp) + A(infraPortConfigMap, "brkoutMap", infraPortConfig.BrkoutMap) + A(infraPortConfigMap, "card", infraPortConfig.Card) + A(infraPortConfigMap, "connectedFex", infraPortConfig.ConnectedFex) + A(infraPortConfigMap, "description", infraPortConfig.Descr) + A(infraPortConfigMap, "node", infraPortConfig.Node) + A(infraPortConfigMap, "pcMember", infraPortConfig.PcMember) + A(infraPortConfigMap, "port", infraPortConfig.Port) + A(infraPortConfigMap, "role", infraPortConfig.Role) + A(infraPortConfigMap, "shutdown", infraPortConfig.Shutdown) + A(infraPortConfigMap, "subPort", infraPortConfig.SubPort) + return infraPortConfigMap, err +} + +func InfraPortConfigurationFromContainerList(cont *container.Container, index int) *InfraPortConfiguration { + InfraPortConfigurationCont := cont.S("imdata").Index(index).S(InfraPortConfigClassName, "attributes") + return &InfraPortConfiguration{ + BaseAttributes{ + DistinguishedName: G(InfraPortConfigurationCont, "dn"), + Status: G(InfraPortConfigurationCont, "status"), + ClassName: InfraPortConfigClassName, + 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"), + }, + } +} + +func InfraPortConfigurationFromContainer(cont *container.Container) *InfraPortConfiguration { + return InfraPortConfigurationFromContainerList(cont, 0) +} + +func InfraPortConfigurationListFromContainer(cont *container.Container) []*InfraPortConfiguration { + length, _ := strconv.Atoi(G(cont, "totalCount")) + arr := make([]*InfraPortConfiguration, length) + + for i := 0; i < length; i++ { + arr[i] = InfraPortConfigurationFromContainerList(cont, i) + } + + return arr +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 09e80504f..db9607d87 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -4,7 +4,7 @@ github.com/agext/levenshtein # github.com/apparentlymart/go-textseg/v13 v13.0.0 ## explicit; go 1.16 github.com/apparentlymart/go-textseg/v13/textseg -# github.com/ciscoecosystem/aci-go-client/v2 v2.7.5 +# github.com/ciscoecosystem/aci-go-client/v2 v2.9.0 ## explicit; go 1.12 github.com/ciscoecosystem/aci-go-client/v2/client github.com/ciscoecosystem/aci-go-client/v2/container diff --git a/website/docs/d/l3out_floating_svi.html.markdown b/website/docs/d/l3out_floating_svi.html.markdown index c3267e8cf..4845b329a 100644 --- a/website/docs/d/l3out_floating_svi.html.markdown +++ b/website/docs/d/l3out_floating_svi.html.markdown @@ -11,6 +11,15 @@ description: |- Data source for ACI L3out Floating SVI +## API Information ## + +* `Class` - l3extVirtualLIfP +* `Distinguished Name` - uni/tn-{tenant}/out-{l3out}/lnodep-{lnodep}/lifp-{lifp}/vlifp-[nodeDn]-[encap] + +## GUI Information ## + +* `Location` - Tenants -> Networking -> L3Outs -> Logical Node Profiles -> Logical Interface Profiles -> Floating SVI + ## Example Usage ```hcl @@ -48,4 +57,5 @@ data "aci_l3out_floating_svi" "check" { * `forged_transmit` - (Optional) A configuration option that allows virtual machines to send frames with a mac address that is different from the one specified in the virtual-nic adapter configuration. * `mac_change` - (Optional) The status of the mac address change support of the port groups in an external VMM controller, such as a vCenter. * `promiscuous_mode` - (Optional) The status of the promiscuous mode support status of the port groups in an external VMM controller, such as a vCenter. This needs to be turned on only for service devices in the cloud, not for Enterprise AVE service deployments. - * `enhanced_lag_policy_dn` - (Optional) The distinguished name of the target enhanced lag policy (class lacpEnhancedLagPol). \ No newline at end of file + * `enhanced_lag_policy_dn` - (Optional) The distinguished name of the target enhanced lag policy (class lacpEnhancedLagPol). + * `encap` - (Optional) Access port encapsulation (VLAN) of the target (format: vlan-101). \ No newline at end of file diff --git a/website/docs/r/l3out_floating_svi.html.markdown b/website/docs/r/l3out_floating_svi.html.markdown index 5041b10fb..7a93bd6a5 100644 --- a/website/docs/r/l3out_floating_svi.html.markdown +++ b/website/docs/r/l3out_floating_svi.html.markdown @@ -11,6 +11,15 @@ description: |- Manages ACI L3out Floating SVI +## API Information ## + +* `Class` - l3extVirtualLIfP +* `Distinguished Name` - uni/tn-{tenant}/out-{l3out}/lnodep-{lnodep}/lifp-{lifp}/vlifp-[nodeDn]-[encap] + +## GUI Information ## + +* `Location` - Tenants -> Networking -> L3Outs -> Logical Node Profiles -> Logical Interface Profiles -> Floating SVI + ## Example Usage ```hcl @@ -31,11 +40,12 @@ resource "aci_l3out_floating_svi" "example" { mtu = "580" target_dscp = "CS1" relation_l3ext_rs_dyn_path_att { - tdn = data.aci_physical_domain.dom.id + tdn = aci_physical_domain.dom.id floating_address = "10.21.0.254/24" - forged_transmit = "Disabled" - mac_change = "Disabled" + forged_transmit = "Disabled" + mac_change = "Disabled" promiscuous_mode = "Disabled" + encap = "vlan-1" } } ``` @@ -64,6 +74,7 @@ resource "aci_l3out_floating_svi" "example" { * `mac_change` - (Optional) The status of the mac address change support of the port groups in an external VMM controller, such as a vCenter. Allowed values are "Disabled" and "Enabled". Default value is "Disabled". * `promiscuous_mode` - (Optional) The status of promiscuous mode support status of the port groups in an external VMM controller, such as a vCenter. This needs to be turned on only for service devices in the cloud, not for Enterprise AVE service deployments. Allowed values are "Disabled" and "Enabled". Default value is "Disabled". * `enhanced_lag_policy_dn` - (Optional) The distinguished name of the target enhanced lag policy (class lacpEnhancedLagPol). + * `encap` - (Optional) Access port encapsulation (VLAN) of the target (format: vlan-101). This feature can only be used when the Floating SVI is associated to a physical domain (tdn points to infraDomP). ## Attribute Reference