Skip to content

Commit

Permalink
Staging (#145)
Browse files Browse the repository at this point in the history
* CACIT-71 inline block added

* CACIT-72 attribute renamed

* CACIT-72 docs updated

* CACIT-74 resource ds added

* CACIT-75 logic added

* CACIT-74 test file added

* CACIT-76 parent_dn logic added

* CACIT-77 logic added for ctrl

* CACIT-77 docs and test file updated

* CACIT-79 resource aaaDomain added

* CACIT-78 index.html updated

* removed relation

* CACIT-83 made scope attr as list

* Cacit 82 83 84 85 (#143)

* CACIT-85 TGW in ctxProfile

* CACIT-85 TGW in ctxProfile

* CACIT-84 cloudSubnet zone update

* CACIT-85 done

* CACIT-85 fomatting Done

* CACIT-71 inline block added

* CACIT-72 attribute renamed

* CACIT-72 docs updated

* CACIT-74 resource ds added

* CACIT-75 logic added

* CACIT-74 test file added

* CACIT-76 parent_dn logic added

* CACIT-77 logic added for ctrl

* CACIT-77 docs and test file updated

* CACIT-79 resource aaaDomain added

* CACIT-78 index.html updated

* removed relation

* CACIT-83 made scope attr as list

* Cacit 82 83 84 85 (#143)

* CACIT-85 TGW in ctxProfile

* CACIT-85 TGW in ctxProfile

* CACIT-84 cloudSubnet zone update

* CACIT-85 done

* CACIT-85 fomatting Done

* Done
  • Loading branch information
nkatarmal-crest authored Oct 23, 2020
1 parent 8f18d89 commit 355a01f
Show file tree
Hide file tree
Showing 167 changed files with 2,638 additions and 269 deletions.
49 changes: 49 additions & 0 deletions aci/data_source_aci_aaadomain.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package aci

import (
"fmt"

"github.com/ciscoecosystem/aci-go-client/client"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

func dataSourceAciSecurityDomain() *schema.Resource {
return &schema.Resource{

Read: dataSourceAciSecurityDomainRead,

SchemaVersion: 1,

Schema: AppendBaseAttrSchema(map[string]*schema.Schema{

"name": &schema.Schema{
Type: schema.TypeString,
Required: true,
},

"name_alias": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
}),
}
}

func dataSourceAciSecurityDomainRead(d *schema.ResourceData, m interface{}) error {
aciClient := m.(*client.Client)

name := d.Get("name").(string)

rn := fmt.Sprintf("userext/domain-%s", name)

dn := fmt.Sprintf("uni/%s", rn)

aaaDomain, err := getRemoteSecurityDomain(aciClient, dn)

if err != nil {
return err
}
setSecurityDomainAttributes(aaaDomain, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_aaausercert.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func dataSourceAciX509CertificateRead(d *schema.ResourceData, m interface{}) err
if err != nil {
return err
}
d.SetId(dn)
setX509CertificateAttributes(aaaUserCert, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func dataSourceAciCloudApplicationcontainerRead(d *schema.ResourceData, m interf
if err != nil {
return err
}
d.SetId(dn)
setCloudApplicationcontainerAttributes(cloudApp, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudawsprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func dataSourceAciCloudAWSProviderRead(d *schema.ResourceData, m interface{}) er
if err != nil {
return err
}
d.SetId(dn)
setCloudAWSProviderAttributes(cloudAwsProvider, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudcidr.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func dataSourceAciCloudCIDRPoolRead(d *schema.ResourceData, m interface{}) error
if err != nil {
return err
}
d.SetId(dn)
setCloudCIDRPoolAttributes(cloudCidr, d)
return nil
}
2 changes: 2 additions & 0 deletions aci/data_source_aci_cloudctxprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package aci

import (
"fmt"

"github.com/ciscoecosystem/aci-go-client/client"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
Expand Down Expand Up @@ -42,6 +43,7 @@ func dataSourceAciCloudContextProfileRead(d *schema.ResourceData, m interface{})
if err != nil {
return err
}
d.SetId(dn)
setCloudContextProfileAttributes(cloudCtxProfile, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudepg.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func dataSourceAciCloudEPgRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setCloudEPgAttributes(cloudEPg, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudepselector.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func dataSourceAciCloudEndpointSelectorRead(d *schema.ResourceData, m interface{
if err != nil {
return err
}
d.SetId(dn)
setCloudEndpointSelectorAttributes(cloudEPSelector, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudextepg.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func dataSourceAciCloudExternalEPgRead(d *schema.ResourceData, m interface{}) er
if err != nil {
return err
}
d.SetId(dn)
setCloudExternalEPgAttributes(cloudExtEPg, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudextepselector.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func dataSourceAciCloudEndpointSelectorforExternalEPgsRead(d *schema.ResourceDat
if err != nil {
return err
}
d.SetId(dn)
setCloudEndpointSelectorforExternalEPgsAttributes(cloudExtEPSelector, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudregion.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func dataSourceAciCloudProvidersRegionRead(d *schema.ResourceData, m interface{}
if err != nil {
return err
}
d.SetId(dn)
setCloudProvidersRegionAttributes(cloudRegion, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudsubnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func dataSourceAciCloudSubnetRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setCloudSubnetAttributes(cloudSubnet, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_cloudzone.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func dataSourceAciCloudAvailabilityZoneRead(d *schema.ResourceData, m interface{
if err != nil {
return err
}
d.SetId(dn)
setCloudAvailabilityZoneAttributes(cloudZone, d)
return nil
}
73 changes: 73 additions & 0 deletions aci/data_source_aci_fabrichifpol.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package aci

import (
"fmt"

"github.com/ciscoecosystem/aci-go-client/client"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

func dataSourceAciLinkLevelPolicy() *schema.Resource {
return &schema.Resource{

Read: dataSourceAciLinkLevelPolicyRead,

SchemaVersion: 1,

Schema: AppendBaseAttrSchema(map[string]*schema.Schema{

"name": &schema.Schema{
Type: schema.TypeString,
Required: true,
},

"auto_neg": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},

"fec_mode": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},

"link_debounce": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},

"name_alias": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},

"speed": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
}),
}
}

func dataSourceAciLinkLevelPolicyRead(d *schema.ResourceData, m interface{}) error {
aciClient := m.(*client.Client)

name := d.Get("name").(string)

rn := fmt.Sprintf("infra/hintfpol-%s", name)

dn := fmt.Sprintf("uni/%s", rn)

fabricHIfPol, err := getRemoteLinkLevelPolicy(aciClient, dn)

if err != nil {
return err
}
setLinkLevelPolicyAttributes(fabricHIfPol, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_fabricnodeblk_FirmWare.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func dataSourceAciNodeBlockReadFW(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setNodeBlockAttributesFW(fabricNodeBlk, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_fabricnodeblk_MaintGrp.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func dataSourceAciNodeBlockReadMG(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setNodeBlockAttributesMG(fabricNodeBlk, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_fvaepg.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func dataSourceAciApplicationEPGRead(d *schema.ResourceData, m interface{}) erro
if err != nil {
return err
}
d.SetId(dn)
setApplicationEPGAttributes(fvAEPg, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_fvap.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func dataSourceAciApplicationProfileRead(d *schema.ResourceData, m interface{})
if err != nil {
return err
}
d.SetId(dn)
setApplicationProfileAttributes(fvAp, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_fvbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func dataSourceAciBridgeDomainRead(d *schema.ResourceData, m interface{}) error
if err != nil {
return err
}
d.SetId(dn)
setBridgeDomainAttributes(fvBD, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_fvctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func dataSourceAciVRFRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setVRFAttributes(fvCtx, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_fvepretpol.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func dataSourceAciEndPointRetentionPolicyRead(d *schema.ResourceData, m interfac
if err != nil {
return err
}
d.SetId(dn)
setEndPointRetentionPolicyAttributes(fvEpRetPol, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_fvnsencapblk.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func dataSourceAciRangesRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setRangesAttributes(fvnsEncapBlk, d)
return nil
}
5 changes: 3 additions & 2 deletions aci/data_source_aci_fvrsdomatt.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func dataSourceAciDomain() *schema.Resource {
Computed: true,
},

"class_pref": &schema.Schema{
Type: schema.TypeString,
"allow_micro_seg": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Computed: true,
},
Expand Down Expand Up @@ -151,6 +151,7 @@ func dataSourceAciDomainRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setDomainAttributes(fvRsDomAtt, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_fvrspathatt.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func dataSourceAciStaticPathRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setStaticPathAttributes(fvRsPathAtt, d)
return nil
}
4 changes: 2 additions & 2 deletions aci/data_source_aci_fvrsprovcons.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func dataSourceAciContractProviderRead(d *schema.ResourceData, m interface{}) er
if err != nil {
return nil
}

d.SetId(dn)
setContractProviderDataAttributes(fvRsProv, d)

} else if contractType == "consumer" {
Expand All @@ -75,7 +75,7 @@ func dataSourceAciContractProviderRead(d *schema.ResourceData, m interface{}) er
if err != nil {
return nil
}

d.SetId(dn)
setContractConsumerDataAttributes(fvRsCons, d)

} else {
Expand Down
6 changes: 5 additions & 1 deletion aci/data_source_aci_fvsubnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ func dataSourceAciSubnet() *schema.Resource {
},

"scope": &schema.Schema{
Type: schema.TypeString,
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},

"virtual": &schema.Schema{
Expand All @@ -73,6 +76,7 @@ func dataSourceAciSubnetRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setSubnetAttributes(fvSubnet, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_infrafexbndlgrp.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func dataSourceAciFexBundleGroupRead(d *schema.ResourceData, m interface{}) erro
if err != nil {
return err
}
d.SetId(dn)
setFexBundleGroupAttributes(infraFexBndlGrp, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_infrageneric.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func dataSourceAciAccessGenericRead(d *schema.ResourceData, m interface{}) error
if err != nil {
return err
}
d.SetId(dn)
setAccessGenericAttributes(infraGeneric, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_infrahports.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func dataSourceAciAccessPortSelectorRead(d *schema.ResourceData, m interface{})
if err != nil {
return err
}
d.SetId(dn)
setAccessPortSelectorAttributes(infraHPortS, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_infraleafs.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func dataSourceAciSwitchAssociationRead(d *schema.ResourceData, m interface{}) e
if err != nil {
return err
}
d.SetId(dn)
setSwitchAssociationAttributes(infraLeafS, d)
return nil
}
1 change: 1 addition & 0 deletions aci/data_source_aci_infranodeblk.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func dataSourceAciNodeBlockRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
d.SetId(dn)
setNodeBlockAttributes(infraNodeBlk, d)
return nil
}
Loading

0 comments on commit 355a01f

Please sign in to comment.