Skip to content

Commit

Permalink
Merge pull request #31 from cisco-en-programmability/develop_2.2.3.3
Browse files Browse the repository at this point in the history
Develop 2.2.3.3 v0.2.0-beta
  • Loading branch information
fmunozmiranda authored Mar 2, 2022
2 parents a2c5866 + 5b488de commit 8551cb3
Show file tree
Hide file tree
Showing 228 changed files with 18,904 additions and 516 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
FEATURES:
## 0.2.0-beta (March 01, 2022)

* **New Resource:** `resource_tag_membership`
* **New Resource:** `resource_path_trace`
* **New Resource:** `resource_golden_image`
* **New Resource:** `resource_swim_image_file`
* **New Resource:** `resource_global_credential_cli`
* **New Resource:** `resource_global_credential_http_read`
* **New Resource:** `resource_global_credential_http_write`
* **New Resource:** `resource_global_credential_netconf`
* **New Resource:** `resource_global_credential_snmpv2_read`
* **New Resource:** `resource_global_credential_snmpv2_write`
* **New Resource:** `resource_global_credential_snmpv3`
* **New Resource:** `resource_site`
* **New Resource:** `resource_service_provider`

IMPROVEMENTS:
* dnacenter/resource_wireless_enterprise_ssid: Add trigger for update passphrase
* dnacenter/resource_network_device: Add trigger for update role of a device
* dnacenter/resource_configuration_template: Add trigger for new versio released

BUG FIXES:
* Remove `use_api_gateway` and `use_csrf_token` configuration parameters from `provider`

## 0.1.0-beta.2 (February 08, 2022)

NOTES:
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=0.1.0-beta.2
VERSION=0.2.0-beta
OS_ARCH=darwin_arm64
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
WEBSITE_REPO=github.com/hashicorp/terraform-website
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Other versions of this collection have support for previous Cisco DNA Center ver
| Cisco DNA Center version | Terraform "dnacenter" provider version |
|--------------------------|----------------------------------------|
| 2.1.1 | 0.0.4 |
| 2.2.3.3 | 0.1.0-beta.2 |
| 2.2.3.3 | 0.2.0-beta |

## Using the provider

Expand All @@ -38,7 +38,7 @@ terraform {
required_providers {
dnacenter = {
source = "cisco-en-programmability/dnacenter"
version = "0.1.0-beta.2"
version = "0.2.0-beta"
}
}
}
Expand Down Expand Up @@ -76,7 +76,7 @@ terraform {
required_providers {
dnacenter = {
source = "hashicorp.com/edu/dnacenter"
version = "0.1.0-beta.2"
version = "0.2.0-beta"
}
}
}
Expand Down
68 changes: 68 additions & 0 deletions dnacenter/data_source_global_credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,43 @@ func dataSourceGlobalCredential() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},

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

"password": &schema.Schema{
Type: schema.TypeString,
Sensitive: true,
Computed: true,
},

"port": &schema.Schema{
Type: schema.TypeInt,
Computed: true,
},

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

"secure": &schema.Schema{
// Type: schema.TypeBool,
Type: schema.TypeString,
Computed: true,
},

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

"write_community": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},
},
},
},
Expand Down Expand Up @@ -205,11 +242,42 @@ func flattenDiscoveryGetGlobalCredentialsItems(items *[]dnacentersdkgo.ResponseD
respItem["id"] = item.ID
respItem["instance_tenant_id"] = item.InstanceTenantID
respItem["instance_uuid"] = item.InstanceUUID
respItem["password"] = item.Password
respItem["port"] = item.Port
respItem["secure"] = boolPtrToString(item.Secure)
respItem["username"] = item.Username
respItem["netconf_port"] = item.NetconfPort
respItem["read_community"] = item.ReadCommunity
respItem["write_community"] = item.WriteCommunity
respItems = append(respItems, respItem)
}
return respItems
}

func flattenDiscoveryGetGlobalCredentialsItem(item *dnacentersdkgo.ResponseDiscoveryGetGlobalCredentialsResponse) []map[string]interface{} {
if item == nil {
return nil
}

respItem := make(map[string]interface{})
respItem["comments"] = item.Comments
respItem["credential_type"] = item.CredentialType
respItem["description"] = item.Description
respItem["id"] = item.ID
respItem["instance_tenant_id"] = item.InstanceTenantID
respItem["instance_uuid"] = item.InstanceUUID
respItem["password"] = item.Password
respItem["port"] = item.Port
respItem["secure"] = boolPtrToString(item.Secure)
respItem["username"] = item.Username
respItem["netconf_port"] = item.NetconfPort
respItem["read_community"] = item.ReadCommunity
respItem["write_community"] = item.WriteCommunity
return []map[string]interface{}{
respItem,
}
}

func flattenDiscoveryGetCredentialSubTypeByCredentialIDItem(item *dnacentersdkgo.ResponseDiscoveryGetCredentialSubTypeByCredentialID) []map[string]interface{} {
if item == nil {
return nil
Expand Down
16 changes: 16 additions & 0 deletions dnacenter/data_source_license_smart_account_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,19 @@ func flattenLicensesSmartAccountDetailsItems(items *[]dnacentersdkgo.ResponseLic
}
return respItems
}

func flattenLicensesSmartAccountDetailsItem(item *dnacentersdkgo.ResponseLicensesSmartAccountDetailsResponse) []map[string]interface{} {
if item == nil {
return nil
}

respItem := make(map[string]interface{})
respItem["name"] = item.Name
respItem["id"] = item.ID
respItem["domain"] = item.Domain
respItem["is_active_smart_account"] = boolPtrToString(item.IsActiveSmartAccount)

return []map[string]interface{}{
respItem,
}
}
24 changes: 24 additions & 0 deletions dnacenter/data_source_sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,30 @@ func flattenSensorsSensorsItems(items *[]dnacentersdkgo.ResponseSensorsSensorsRe
return respItems
}

func flattenSensorsSensorsItem(item *dnacentersdkgo.ResponseSensorsSensorsResponse) []map[string]interface{} {
if item == nil {
return nil
}

respItem := make(map[string]interface{})
respItem["name"] = item.Name
respItem["status"] = item.Status
respItem["radio_mac_address"] = item.RadioMacAddress
respItem["ethernet_mac_address"] = item.EthernetMacAddress
respItem["location"] = item.Location
respItem["backhaul_type"] = item.BackhaulType
respItem["serial_number"] = item.SerialNumber
respItem["ip_address"] = item.IPAddress
respItem["version"] = item.Version
respItem["last_seen"] = item.LastSeen
respItem["type"] = item.Type
respItem["ssh_config"] = flattenSensorsSensorsItemsSSHConfig(item.SSHConfig)
respItem["is_led_enabled"] = boolPtrToString(item.IsLEDEnabled)
return []map[string]interface{}{
respItem,
}
}

func flattenSensorsSensorsItemsSSHConfig(item *dnacentersdkgo.ResponseSensorsSensorsResponseSSHConfig) []map[string]interface{} {
if item == nil {
return nil
Expand Down
24 changes: 23 additions & 1 deletion dnacenter/data_source_service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func dataSourceServiceProvider() *schema.Resource {

"version": &schema.Schema{
Description: `Version`,
Type: schema.TypeString,
Type: schema.TypeInt,
Computed: true,
},
},
Expand Down Expand Up @@ -173,6 +173,28 @@ func flattenNetworkSettingsGetServiceProviderDetailsItems(items *[]dnacentersdkg
return respItems
}

func flattenNetworkSettingsGetServiceProviderDetailsItem(item *dnacentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsResponse) []map[string]interface{} {
if item == nil {
return nil
}

respItem := make(map[string]interface{})
respItem["instance_type"] = item.InstanceType
respItem["instance_uuid"] = item.InstanceUUID
respItem["namespace"] = item.Namespace
respItem["type"] = item.Type
respItem["key"] = item.Key
respItem["version"] = item.Version
respItem["value"] = flattenNetworkSettingsGetServiceProviderDetailsItemsValue(item.Value)
respItem["group_uuid"] = item.GroupUUID
respItem["inherited_group_uuid"] = item.InheritedGroupUUID
respItem["inherited_group_name"] = item.InheritedGroupName

return []map[string]interface{}{
respItem,
}
}

func flattenNetworkSettingsGetServiceProviderDetailsItemsValue(items *[]dnacentersdkgo.ResponseNetworkSettingsGetServiceProviderDetailsResponseValue) []map[string]interface{} {
if items == nil {
return nil
Expand Down
139 changes: 136 additions & 3 deletions dnacenter/data_source_site.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,102 @@ func dataSourceSite() *schema.Resource {
Description: `Additional Info`,
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{

"attributes": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{

"address": &schema.Schema{
Description: `address`,
Type: schema.TypeString,
Computed: true,
},

"address_inherited_from": &schema.Schema{
Description: `addressInheritedFrom`,
Type: schema.TypeString,
Computed: true,
},

"country": &schema.Schema{
Description: `country`,
Type: schema.TypeString,
Computed: true,
},

"floor_index": &schema.Schema{
Description: `floorIndex`,
Type: schema.TypeString,
Computed: true,
},

"height": &schema.Schema{
Description: `height`,
Type: schema.TypeString,
Computed: true,
},

"latitude": &schema.Schema{
Description: `latitude`,
Type: schema.TypeString,
Computed: true,
},

"length": &schema.Schema{
Description: `length`,
Type: schema.TypeString,
Computed: true,
},

"longitude": &schema.Schema{
Description: `longitude`,
Type: schema.TypeString,
Computed: true,
},

"offset_x": &schema.Schema{
Description: `offsetX`,
Type: schema.TypeString,
Computed: true,
},

"offset_y": &schema.Schema{
Description: `offsetY`,
Type: schema.TypeString,
Computed: true,
},

"rf_model": &schema.Schema{
Description: `rfModel`,
Type: schema.TypeString,
Computed: true,
},

"type": &schema.Schema{
Description: `type`,
Type: schema.TypeString,
Computed: true,
},

"width": &schema.Schema{
Description: `width`,
Type: schema.TypeString,
Computed: true,
},
},
},
},

"namespace": &schema.Schema{
Description: `namespace`,
Type: schema.TypeString,
Computed: true,
},
},
},
},

Expand Down Expand Up @@ -176,7 +270,7 @@ func flattenSitesGetSiteItems(items *[]dnacentersdkgo.ResponseSitesGetSiteRespon
respItem := make(map[string]interface{})
respItem["parent_id"] = item.ParentID
respItem["name"] = item.Name
respItem["additional_info"] = item.AdditionalInfo
respItem["additional_info"] = flattenSitesGetSiteItemsAdditionalInfo(&item.AdditionalInfo)
respItem["site_hierarchy"] = item.SiteHierarchy
respItem["site_name_hierarchy"] = item.SiteNameHierarchy
respItem["instance_tenant_id"] = item.InstanceTenantID
Expand All @@ -185,3 +279,42 @@ func flattenSitesGetSiteItems(items *[]dnacentersdkgo.ResponseSitesGetSiteRespon
}
return respItems
}

func flattenSitesGetSiteItemsAdditionalInfo(items *[]dnacentersdkgo.ResponseSitesGetSiteResponseAdditionalInfo) []map[string]interface{} {
if items == nil {
return nil
}
var respItems []map[string]interface{}
for _, item := range *items {
respItem := make(map[string]interface{})
respItem["namespace"] = item.Namespace
respItem["attributes"] = flattenSitesGetSiteItemsAdditionalInfoAttributes(&item.Attributes)
respItems = append(respItems, respItem)
}
return respItems
}

func flattenSitesGetSiteItemsAdditionalInfoAttributes(item *dnacentersdkgo.ResponseSitesGetSiteResponseAdditionalInfoAttributes) []map[string]interface{} {
if item == nil {
return nil
}
respItem := make(map[string]interface{})
respItem["country"] = item.Country
respItem["address"] = item.Address
respItem["latitude"] = item.Latitude
respItem["address_inherited_from"] = item.AddressInheritedFrom
respItem["type"] = item.Type
respItem["longitude"] = item.Longitude
respItem["offset_x"] = item.OffsetX
respItem["offset_y"] = item.OffsetY
respItem["length"] = item.Length
respItem["width"] = item.Width
respItem["height"] = item.Height
respItem["rf_model"] = item.RfModel
respItem["floor_index"] = item.FloorIndex

return []map[string]interface{}{
respItem,
}

}
Loading

0 comments on commit 8551cb3

Please sign in to comment.