Skip to content

Commit efee990

Browse files
Merge pull request #13 from cisco-en-programmability/develop
Modifying the return values of the Resource interface_update function…
2 parents f3048c5 + 64951d4 commit efee990

File tree

198 files changed

+222
-319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+222
-319
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
## 1.1.0-beta (September 13, 2024)
1+
## 1.1.1-beta (February 25, 2025)
2+
IMPROVEMENTS:
3+
* Modifying the return values of the Resource interface_update functions.
4+
5+
## 1.1.0-beta (February 10, 2025)
26
IMPROVEMENTS:
37
* The provider has been updated with Catalyst Center API version `2.3.7.9`
48
FEATURES:
@@ -939,4 +943,4 @@ FEATURES:
939943
* **New Resource:** `resource_wireless_rf_profile`
940944
* **New Resource:** `resource_wireless_settings_dot11be_profiles`
941945
* **New Resource:** `resource_wireless_settings_interfaces`
942-
* **New Resource:** `resource_wireless_settings_rf_profiles`
946+
* **New Resource:** `resource_wireless_settings_rf_profiles`

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ HOSTNAME=hashicorp.com
33
NAMESPACE=edu
44
NAME=catalystcenter
55
BINARY=terraform-provider-${NAME}
6-
VERSION=1.1.0-beta
6+
VERSION=1.1.1-beta
77
OS_ARCH=darwin_arm64
88
# Change to OS_ARCH=darwin_arm64 or your current architecture
99
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The following table shows the supported versions.
2222
| Cisco Catalyst Center version | Terraform "catalystcenter" provider version |
2323
|--------------------------|----------------------------------------|
2424
| 2.3.7.6 | 1.0.0-beta |
25-
| 2.3.7.9 | 1.1.0-beta |
25+
| 2.3.7.9 | 1.1.1-beta |
2626

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

@@ -63,7 +63,7 @@ terraform {
6363
required_providers {
6464
catalystcenter = {
6565
source = "cisco-en-programmability/catalystcenter"
66-
version = "1.1.0-beta"
66+
version = "1.1.1-beta"
6767
}
6868
}
6969
}
@@ -181,7 +181,7 @@ resource "resource" "default" {
181181
# Explicitly using version 2
182182
resource "resource_v2" "default" {
183183
# This resource will refer to `resource_v2`
184-
}
184+
}
185185
```
186186
### Case 2: Only resource\_v1 exists
187187
If only resource\_v1 is available in your environment, there is no need to specify the version, as the provider will automatically use that version:
@@ -190,7 +190,7 @@ If only resource\_v1 is available in your environment, there is no need to speci
190190
resource "resource" "default" {
191191
192192
# This resource will refer to `resource_v1` since it's the only version available
193-
}
193+
}
194194
```
195195
### Case 3: Only resource\_v2 exists
196196
If only resource\_v2 is available in your environment, the provider will automatically refer to that version, since resource\_v1 is not available:
@@ -199,7 +199,7 @@ If only resource\_v2 is available in your environment, the provider will automat
199199
resource "resource" "default" {
200200
201201
# This resource will refer to `resource_v2` since `resource_v1` is not available
202-
}
202+
}
203203
```
204204
## Example Usage with DataSources
205205
The same version selection logic applies to datasources. Below is how version management works for datasources:
@@ -216,21 +216,21 @@ data "datasource" "default" {
216216
data "datasource_v2" "default" {
217217
218218
# This datasource will refer to `datasource_v2`
219-
}
219+
}
220220
```
221221
### Case 2: Only datasource\_v1 exists
222222
```hcl
223223
data "datasource" "default" {
224224
225225
# This datasource will refer to `datasource_v1` since it's the only version available
226-
}
226+
}
227227
```
228228
### Case 3: Only datasource\_v2 exists
229229
```hcl
230230
data "datasource" "default" {
231231
232232
# This datasource will refer to `datasource_v2` since `datasource_v1` is not available
233-
}
233+
}
234234
```
235235

236236
# Contributing

catalystcenter/resource_interface_update.go

Lines changed: 11 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -36,55 +36,17 @@ Request body.
3636
Elem: &schema.Resource{
3737
Schema: map[string]*schema.Schema{
3838

39-
"properties": &schema.Schema{
40-
Type: schema.TypeList,
39+
"task_id": &schema.Schema{
40+
Description: `Task id
41+
`,
42+
Type: schema.TypeString,
4143
Computed: true,
42-
Elem: &schema.Resource{
43-
Schema: map[string]*schema.Schema{
44-
45-
"task_id": &schema.Schema{
46-
Type: schema.TypeList,
47-
Computed: true,
48-
Elem: &schema.Resource{
49-
Schema: map[string]*schema.Schema{
50-
51-
"type": &schema.Schema{
52-
Description: `Type`,
53-
Type: schema.TypeString,
54-
Computed: true,
55-
},
56-
},
57-
},
58-
},
59-
"url": &schema.Schema{
60-
Type: schema.TypeList,
61-
Computed: true,
62-
Elem: &schema.Resource{
63-
Schema: map[string]*schema.Schema{
64-
65-
"type": &schema.Schema{
66-
Description: `Type`,
67-
Type: schema.TypeString,
68-
Computed: true,
69-
},
70-
},
71-
},
72-
},
73-
},
74-
},
75-
},
76-
"required": &schema.Schema{
77-
Description: `Required`,
78-
Type: schema.TypeList,
79-
Computed: true,
80-
Elem: &schema.Schema{
81-
Type: schema.TypeString,
82-
},
8344
},
84-
"type": &schema.Schema{
85-
Description: `Type`,
86-
Type: schema.TypeString,
87-
Computed: true,
45+
"url": &schema.Schema{
46+
Description: `Task url
47+
`,
48+
Type: schema.TypeString,
49+
Computed: true,
8850
},
8951
},
9052
},
@@ -224,50 +186,10 @@ func flattenDevicesUpdateInterfaceDetailsV1Item(item *catalystcentersdkgo.Respon
224186
return nil
225187
}
226188
respItem := make(map[string]interface{})
227-
respItem["type"] = item.Type
228-
respItem["properties"] = flattenDevicesUpdateInterfaceDetailsV1ItemProperties(item.Properties)
229-
respItem["required"] = item.Required
230-
return []map[string]interface{}{
231-
respItem,
232-
}
233-
}
234-
235-
func flattenDevicesUpdateInterfaceDetailsV1ItemProperties(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsV1ResponseProperties) []map[string]interface{} {
236-
if item == nil {
237-
return nil
238-
}
239-
respItem := make(map[string]interface{})
240-
respItem["task_id"] = flattenDevicesUpdateInterfaceDetailsV1ItemPropertiesTaskID(item.TaskID)
241-
respItem["url"] = flattenDevicesUpdateInterfaceDetailsV1ItemPropertiesURL(item.URL)
189+
respItem["task_id"] = item.TaskID
190+
respItem["url"] = item.URL
242191

243192
return []map[string]interface{}{
244193
respItem,
245194
}
246-
247-
}
248-
249-
func flattenDevicesUpdateInterfaceDetailsV1ItemPropertiesTaskID(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsV1ResponsePropertiesTaskID) []map[string]interface{} {
250-
if item == nil {
251-
return nil
252-
}
253-
respItem := make(map[string]interface{})
254-
respItem["type"] = item.Type
255-
256-
return []map[string]interface{}{
257-
respItem,
258-
}
259-
260-
}
261-
262-
func flattenDevicesUpdateInterfaceDetailsV1ItemPropertiesURL(item *catalystcentersdkgo.ResponseDevicesUpdateInterfaceDetailsV1ResponsePropertiesURL) []map[string]interface{} {
263-
if item == nil {
264-
return nil
265-
}
266-
respItem := make(map[string]interface{})
267-
respItem["type"] = item.Type
268-
269-
return []map[string]interface{}{
270-
respItem,
271-
}
272-
273195
}

docs/resources/interface_update.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,29 +73,6 @@ Optional:
7373

7474
Read-Only:
7575

76-
- `properties` (List of Object) (see [below for nested schema](#nestedobjatt--item--properties))
77-
- `required` (List of String)
78-
- `type` (String)
76+
- `task_id` (String)
77+
- `url` (String)
7978

80-
<a id="nestedobjatt--item--properties"></a>
81-
### Nested Schema for `item.properties`
82-
83-
Read-Only:
84-
85-
- `task_id` (List of Object) (see [below for nested schema](#nestedobjatt--item--properties--task_id))
86-
- `url` (List of Object) (see [below for nested schema](#nestedobjatt--item--properties--url))
87-
88-
<a id="nestedobjatt--item--properties--task_id"></a>
89-
### Nested Schema for `item.properties.task_id`
90-
91-
Read-Only:
92-
93-
- `type` (String)
94-
95-
96-
<a id="nestedobjatt--item--properties--url"></a>
97-
### Nested Schema for `item.properties.url`
98-
99-
Read-Only:
100-
101-
- `type` (String)

examples/samples/data-sources/catalystcenter_app_policy/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
catalystcenter = {
4-
version = "1.1.0-beta"
4+
version = "1.1.1-beta"
55
source = "hashicorp.com/edu/catalystcenter"
66
# "hashicorp.com/edu/catalystcenter" is the local built source, change to "cisco-en-programmability/catalystcenter" to use downloaded version from registry
77
}

examples/samples/data-sources/catalystcenter_app_policy_default/data-source.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
catalystcenter = {
4-
version = "1.1.0-beta"
4+
version = "1.1.1-beta"
55
source = "hashicorp.com/edu/catalystcenter"
66
# "hashicorp.com/edu/catalystcenter" is the local built source, change to "cisco-en-programmability/catalystcenter" to use downloaded version from registry
77
}

examples/samples/data-sources/catalystcenter_app_policy_queuing_profile/data-source.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
catalystcenter = {
4-
version = "1.1.0-beta"
4+
version = "1.1.1-beta"
55
source = "hashicorp.com/edu/catalystcenter"
66
# "hashicorp.com/edu/catalystcenter" is the local built source, change to "cisco-en-programmability/catalystcenter" to use downloaded version from registry
77
}

examples/samples/data-sources/catalystcenter_app_policy_queuing_profile_count/data-source.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
catalystcenter = {
4-
version = "1.1.0-beta"
4+
version = "1.1.1-beta"
55
source = "hashicorp.com/edu/catalystcenter"
66
# "hashicorp.com/edu/catalystcenter" is the local built source, change to "cisco-en-programmability/catalystcenter" to use downloaded version from registry
77
}

examples/samples/data-sources/catalystcenter_application_policy_application_set/data-source.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
catalystcenter = {
4-
version = "1.1.0-beta"
4+
version = "1.1.1-beta"
55
source = "hashicorp.com/edu/catalystcenter"
66
# "hashicorp.com/edu/catalystcenter" is the local built source, change to "cisco-en-programmability/catalystcenter" to use downloaded version from registry
77
}

0 commit comments

Comments
 (0)