Skip to content

Commit

Permalink
Merge pull request #158 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
Develop v1.0.1-beta
  • Loading branch information
fmunozmiranda authored Apr 27, 2023
2 parents 4e4b9ac + 84165f6 commit 7871db6
Show file tree
Hide file tree
Showing 186 changed files with 289 additions and 629 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 1.1.1-beta (April 27, 2023)
BUGFIXES:
* Adding to `provider.go` file following resources:
- `dnacenter_sensor_test_delete`
- `dnacenter_sensor_test_create`
- `dnacenter_golden_image`
- `dnacenter_deploy_template_v1`
- `dnacenter_global_credential_snmpv3`
- `dnacenter_global_credential_snmpv2_write_community`
- `dnacenter_global_credential_snmpv2_read_community`
- `dnacenter_global_credential_netconf`
- `dnacenter_global_credential_http_write`
- `dnacenter_global_credential_http_read`
- `dnacenter_global_credential_cli`
- `dnacenter_tag_membership`
* Adding to `provider.go` file following data sources:
- `dnacenter_license_smart_account_details`
- `dnacenter_golden_tag_image_details`
* `dnacenter_site` documentation issues fixed.
## 1.1.0-beta (April 12, 2023)
`dnacenter-go-sdk` version changes from `github.com/cisco-en-programmability/dnacenter-go-sdk/v4/sdk` to `github.com/cisco-en-programmability/dnacenter-go-sdk/v5/sdk`.(Cisco DNA Center's v2.3.5.3 API)
FEATURES:
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.0-beta
VERSION=1.1.1-beta
OS_ARCH=darwin_amd64
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
WEBSITE_REPO=github.com/hashicorp/terraform-website
Expand Down
2 changes: 1 addition & 1 deletion 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.0-beta |
| 2.3.5.3 | 1.1.1-beta |

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

Expand Down
63 changes: 57 additions & 6 deletions dnacenter/data_source_site.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,21 @@ func dataSourceSite() *schema.Resource {
Schema: map[string]*schema.Schema{

"additional_info": &schema.Schema{
Description: `Additional Info`,
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{

"attributes": &schema.Schema{
Type: schema.TypeMap,
Computed: true,
},

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

Expand Down Expand Up @@ -177,7 +187,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 @@ -186,3 +196,44 @@ func flattenSitesGetSiteItems(items *[]dnacentersdkgo.ResponseSitesGetSiteRespon
}
return respItems
}

func flattenSitesGetSiteItem(item *dnacentersdkgo.ResponseSitesGetSiteResponse) []map[string]interface{} {
if item == nil {
return nil
}
var respItems []map[string]interface{}

respItem := make(map[string]interface{})
respItem["parent_id"] = item.ParentID
respItem["name"] = item.Name
respItem["additional_info"] = flattenSitesGetSiteItemsAdditionalInfo(item.AdditionalInfo)
respItem["site_hierarchy"] = item.SiteHierarchy
respItem["site_name_hierarchy"] = item.SiteNameHierarchy
respItem["instance_tenant_id"] = item.InstanceTenantID
respItem["id"] = item.ID
respItems = append(respItems, respItem)

return respItems
}

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

func flattenSitesGetSiteItemsAdditionalInfoAtributes(item *dnacentersdkgo.ResponseSitesGetSiteResponseAdditionalInfoAttributes) map[string]interface{} {
if item == nil {
return nil
}
respItem := make(map[string]interface{})
for key, value := range *item {
respItem[key] = value
}
return respItem
}
14 changes: 14 additions & 0 deletions dnacenter/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ func Provider() *schema.Provider {
"dnacenter_wireless_accespoint_configuration": resourceWirelessAccespointConfiguration(),
"dnacenter_credential_to_site_by_siteid_create_v2": resourceCredentialToSiteBySiteidCreateV2(),
"dnacenter_sp_profile_delete_v2": resourceSpProfileDeleteV2(),
"dnacenter_sensor_test_delete": resourceSensorTestDelete(),
"dnacenter_sensor_test_create": resourceSensorTestCreate(),
"dnacenter_golden_image": resourceGoldenImage(),
"dnacenter_deploy_template_v1": resourceDeployTemplateV1(),
"dnacenter_global_credential_snmpv3": resourceGlobalCredentialSNMPv3(),
"dnacenter_global_credential_snmpv2_write_community": resourceGlobalCredentialSNMPv2WriteCommunity(),
"dnacenter_global_credential_snmpv2_read_community": resourceGlobalCredentialSNMPv2ReadCommunity(),
"dnacenter_global_credential_netconf": resourceGlobalCredentialNetconf(),
"dnacenter_global_credential_http_write": resourceGlobalCredentialHTTPWrite(),
"dnacenter_global_credential_http_read": resourceGlobalCredentialHTTPRead(),
"dnacenter_global_credential_cli": resourceGlobalCredentialCli(),
"dnacenter_tag_membership": resourceTagMembership(),
},
DataSourcesMap: map[string]*schema.Resource{
"dnacenter_reserve_ip_subpool": dataSourceReserveIPSubpool(),
Expand Down Expand Up @@ -399,6 +411,8 @@ func Provider() *schema.Provider {
"dnacenter_roles": dataSourceRoles(),
"dnacenter_user": dataSourceUser(),
"dnacenter_users_external_servers": dataSourceUsersExternalServers(),
"dnacenter_license_smart_account_details": dataSourceLicenseSmartAccountDetails(),
"dnacenter_golden_tag_image_details": dataSourceGoldenTagImageDetails(),
},
ConfigureContextFunc: providerConfigure,
}
Expand Down
3 changes: 2 additions & 1 deletion dnacenter/resource_site.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ func resourceSite() *schema.Resource {
Description: `siteId path parameter. Site id to which site details to be updated.
`,
Type: schema.TypeString,
Required: true,
Optional: true,
Default: "",
},
"type": &schema.Schema{
Description: `Type of site to create (eg: area, building, floor)
Expand Down
2 changes: 1 addition & 1 deletion examples/samples/data-sources/dnacenter_app_policy/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
dnacenter = {
version = "1.1.0-beta"
version = "1.1.1-beta"
source = "hashicorp.com/edu/dnacenter"
# "hashicorp.com/edu/dnacenter" is the local built source, change to "cisco-en-programmability/dnacenter" to use downloaded version from registry
}
Expand Down
Loading

0 comments on commit 7871db6

Please sign in to comment.