Skip to content

Commit

Permalink
Merge pull request #239 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
## 1.1.26-beta (November 14, 2023)
  • Loading branch information
fmunozmiranda authored Nov 14, 2023
2 parents 0f7a67a + 6beafcc commit af0f410
Show file tree
Hide file tree
Showing 201 changed files with 574 additions and 240 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.1.26-beta (November 14, 2023)
BUGFIXES:
* Resource `dnacenter_reserve_ip_subpool` does not detect changes made outside terraform #217
* `dnacenter_wireless_enterprise_ssid` WPA3 SSIDs fail to provision due to missing parameter #232
* `dnacenter_wireless_profiles` does not properly read or synchronizes to state #233
* Unable to create `dnacenter_tag` with multiple rules. #238


## 1.1.25-beta (October 26, 2023)
BUGFIXES:
* Hardcoded sleep in dnacenter_floor, dnacenter_area resources #227 - 1 minute sleep removed.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOSTNAME=hashicorp.com
NAMESPACE=edu
NAME=dnacenter
BINARY=terraform-provider-${NAME}
VERSION=1.1.24-beta
VERSION=1.1.26-beta
OS_ARCH=darwin_amd64
# Change to OS_ARCH=darwin_arm64 or your current architecture
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The following table shows the supported versions.
| 2.2.3.3 | 0.3.0-beta |
| 2.2.3.3 | 0.3.0 |
| 2.3.3.0 | 1.0.19-beta |
| 2.3.5.3 | 1.1.24-beta |
| 2.3.5.3 | 1.1.26-beta |

If your SDK, Terraform provider is older please consider updating it first.

Expand Down Expand Up @@ -66,7 +66,7 @@ terraform {
required_providers {
dnacenter = {
source = "cisco-en-programmability/dnacenter"
version = "1.1.24-beta"
version = "1.1.26-beta"
}
}
}
Expand Down
31 changes: 31 additions & 0 deletions dnacenter/data_source_reserve_ip_subpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,37 @@ func flattenNetworkSettingsGetReserveIPSubpoolItems(items *[]dnacentersdkgo.Resp
return respItems
}

func flattenNetworkSettingsGetReserveIPSubpoolParameters(items *dnacentersdkgo.RequestNetworkSettingsReserveIPSubpool) []map[string]interface{} {
if items == nil {
return nil
}
var respItems []map[string]interface{}
respItem := make(map[string]interface{})
respItem["name"] = items.Name
respItem["type"] = items.Type
respItem["ipv6_address_space"] = boolPtrToString(items.IPv6AddressSpace)
respItem["ipv4_global_pool"] = items.IPv4GlobalPool
respItem["ipv4_prefix"] = boolPtrToString(items.IPv4Prefix)
respItem["ipv4_prefix_length"] = interfaceToIntPtr(items.IPv4PrefixLength)
respItem["ipv4_subnet"] = items.IPv4Subnet
respItem["ipv4_gate_way"] = items.IPv4GateWay
respItem["ipv4_dhcp_servers"] = items.IPv4DhcpServers
respItem["ipv4_dns_servers"] = items.IPv4DNSServers
respItem["ipv6_global_pool"] = items.IPv6GlobalPool
respItem["ipv6_prefix"] = boolPtrToString(items.IPv6Prefix)
respItem["ipv6_prefix_length"] = items.IPv6PrefixLength
respItem["ipv6_subnet"] = items.IPv6Subnet
respItem["ipv6_gate_way"] = items.IPv6GateWay
respItem["ipv6_dhcp_servers"] = items.IPv6DhcpServers
respItem["ipv6_dns_servers"] = items.IPv6DNSServers
respItem["ipv4_total_host"] = interfaceToIntPtr(items.IPv4TotalHost)
respItem["ipv6_total_host"] = interfaceToIntPtr(items.IPv6TotalHost)
respItem["slaac_support"] = boolPtrToString(items.SLAacSupport)

respItems = append(respItems, respItem)
return respItems
}

func flattenNetworkSettingsGetReserveIPSubpoolItemsIPPools(items *[]dnacentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponseIPPools) []map[string]interface{} {
if items == nil {
return nil
Expand Down
17 changes: 16 additions & 1 deletion dnacenter/data_source_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ func flattenTagGetTagByIDItemDynamicRulesRules(item *dnacentersdkgo.ResponseTagG
}
respItem := make(map[string]interface{})
respItem["values"] = item.Values
respItem["items"] = item.Items
respItem["items"] = flattenTagGetTagByIDItemDynamicRulesRulesItems(item.Items)
respItem["operation"] = item.Operation
respItem["name"] = item.Name
respItem["value"] = item.Value
Expand All @@ -479,3 +479,18 @@ func flattenTagGetTagByIDItemDynamicRulesRules(item *dnacentersdkgo.ResponseTagG
}

}

func flattenTagGetTagByIDItemDynamicRulesRulesItems(items *[]dnacentersdkgo.ResponseTagGetTagByIDResponseDynamicRulesRulesItems) []map[string]interface{} {
if items == nil {
return nil
}
var respItems []map[string]interface{}
for _, item := range *items {
respItem := make(map[string]interface{})
respItem["name"] = item.Name
respItem["operation"] = item.Operation
respItem["value"] = item.Value
respItems = append(respItems, respItem)
}
return respItems
}
6 changes: 6 additions & 0 deletions dnacenter/diffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ func diffSuppressSgt() schema.SchemaDiffSuppressFunc {
}
}

func diffArray() schema.SchemaDiffSuppressFunc {
return func(k, old, new string, d *schema.ResourceData) bool {
return compareArray(k, new, old, d)
}
}

func diffSupressOptional() schema.SchemaDiffSuppressFunc {
return func(k, old, new string, d *schema.ResourceData) bool {
return compareOptional(new, old)
Expand Down
34 changes: 34 additions & 0 deletions dnacenter/resource_reserve_ip_subpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ func resourceReserveIPSubpoolRead(ctx context.Context, d *schema.ResourceData, m
return diags
}
if response1 == nil {
// log.Print("[DEBUG] Error response")
d.SetId("")
return diags
}
Expand All @@ -536,6 +537,17 @@ func resourceReserveIPSubpoolRead(ctx context.Context, d *schema.ResourceData, m
err))
return diags
}
request1 := expandRequestReserveIPSubpoolReserveIPSubpool(ctx, "parameters.0", d)
updatedParameters := updateReserveIpPoolParameters(request1, response1)

vParameters := flattenNetworkSettingsGetReserveIPSubpoolParameters(updatedParameters)
vParameters[0]["site_id"] = vSiteID
if err := d.Set("parameters", vParameters); err != nil {
diags = append(diags, diagError(
"Failure when setting GetReserveIPSubpool search response",
err))
return diags
}

}
return diags
Expand Down Expand Up @@ -842,6 +854,7 @@ func searchNetworkSettingsGetReserveIPSubpool(m interface{}, queryParams dnacent
// maxPageSize := len(*nResponse.Response)
for nResponse != nil && nResponse.Response != nil && len(*nResponse.Response) > 0 {
for _, item := range *nResponse.Response {
// log.Printf("Vname: %s GroupName: %s", vName, item.GroupName)
if vName == item.GroupName {
return &item, err
}
Expand All @@ -854,3 +867,24 @@ func searchNetworkSettingsGetReserveIPSubpool(m interface{}, queryParams dnacent
}
return foundItem, err
}

func updateReserveIpPoolParameters(request *dnacentersdkgo.RequestNetworkSettingsReserveIPSubpool, response *dnacentersdkgo.ResponseNetworkSettingsGetReserveIPSubpoolResponse) *dnacentersdkgo.RequestNetworkSettingsReserveIPSubpool {
for _, v := range *response.IPPools {
// log.Printf("IPPOOL %s", responseInterfaceToString(v))
if v.IPv6 != nil && *v.IPv6 {
if v.IPPoolName == request.Name {
request.Name = v.IPPoolName
request.IPv6DhcpServers = interfaceToSliceString(v.DhcpServerIPs)
request.IPv6DNSServers = interfaceToSliceString(v.DNSServerIPs)
}
// request.SLAacSupport =
} else {
if v.IPPoolName == request.Name {
request.Name = v.IPPoolName
request.IPv4DhcpServers = interfaceToSliceString(v.DhcpServerIPs)
request.IPv4DNSServers = interfaceToSliceString(v.DNSServerIPs)
}
}
}
return request
}
Loading

0 comments on commit af0f410

Please sign in to comment.