Skip to content

Commit 0b0d291

Browse files
add catalystcenter_provision_access_points resource (#302)
* update basic getting started guide * add catalystcenter_provision_access_points resource to provision multiple access points within single resource
1 parent 2bf1a30 commit 0b0d291

File tree

13 files changed

+807
-81
lines changed

13 files changed

+807
-81
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 0.4.1 (unreleased)
22

3+
- Add `catalystcenter_provision_access_points` resource to provision multiple access points within single resource
34
- Fix issue with `catalystcenter_ip_pool_reservation` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/300)
45

56
## 0.4.0

docs/guides/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ description: |-
99

1010
## 0.4.1 (unreleased)
1111

12+
- Add `catalystcenter_provision_access_points` resource to provision multiple access points within single resource
1213
- Fix issue with `catalystcenter_ip_pool_reservation` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/300)
1314

1415
## 0.4.0

docs/guides/getting_started.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,49 +30,54 @@ provider "catalystcenter" {
3030
Next we add the configuration for a few sites, where we make use of implicit dependencies to ensure the sites are being configured in the right sequence.
3131

3232
```hcl
33+
data "catalystcenter_site" "global" {
34+
name_hierarchy = "Global"
35+
}
36+
3337
resource "catalystcenter_area" "san_jose" {
34-
name = "San Jose"
35-
parent_name = "Global"
38+
name = "San Jose"
39+
parent_id = data.catalystcenter_site.global.id
3640
}
3741
3842
resource "catalystcenter_building" "main_building" {
39-
name = "Main Building"
40-
parent_name = "Global/${catalystcenter_area.san_jose.name}"
41-
latitude = 37.338
42-
longitude = -121.832
43+
name = "Main Building"
44+
parent_id = catalystcenter_area.san_jose.id
45+
country = "United States"
46+
latitude = 37.338
47+
longitude = -121.832
4348
}
4449
4550
resource "catalystcenter_floor" "ground_floor" {
46-
name = "Ground Floor"
47-
parent_name = "${catalystcenter_building.main_building.parent_name}/${catalystcenter_building.main_building.name}"
48-
rf_model = "Drywall Office Only"
49-
width = 30.5
50-
length = 50.5
51-
height = 3.5
51+
name = "Ground Floor"
52+
parent_id = catalystcenter_building.main_building.id
53+
rf_model = "Drywall Office Only"
54+
floor_number = 1
55+
width = 30.5
56+
length = 50.5
57+
height = 3.5
58+
units_of_measure = "feet"
5259
}
5360
```
5461

5562
Now we can add a new IP pool, which does not have any dependencies and can therefore be provisioned in parallel by Terraform. Once we have the global pool, we can add a reservation for the building with created previously. With implicit dependencies we ensure that the reservation is only provisioned after the site and the global pool have been added.
5663

5764
```hcl
5865
resource "catalystcenter_ip_pool" "mgmt_pool_1" {
59-
name = "MgmtPool1"
60-
ip_address_space = "IPv4"
61-
type = "Generic"
62-
ip_subnet = "10.100.0.0/16"
63-
dhcp_server_ips = ["10.101.1.1"]
64-
dns_server_ips = ["10.101.1.101", "10.101.1.102"]
66+
name = "MgmtPool1"
67+
pool_type = "Generic"
68+
address_space_subnet = "10.100.0.0"
69+
address_space_prefix_length = 16
70+
address_space_dhcp_servers = ["10.101.1.1"]
71+
address_space_dns_servers = ["10.101.1.101", "10.101.1.102"]
6572
}
6673
6774
resource "catalystcenter_ip_pool_reservation" "san_jose_main_building_mgmt_1" {
68-
site_id = catalystcenter_building.main_building.id
69-
name = "SanJoseMainBuildingMgmt1"
70-
type = "Generic"
71-
ipv6_address_space = false
72-
ipv4_global_pool = catalystcenter_ip_pool.mgmt_pool_1.ip_subnet
73-
ipv4_prefix = true
74-
ipv4_prefix_length = 24
75-
ipv4_subnet = "10.100.0.0"
76-
ipv4_gateway = "10.100.0.1"
75+
site_id = catalystcenter_building.main_building.id
76+
name = "SanJoseMainBuildingMgmt1"
77+
pool_type = "Generic"
78+
ipv4_global_pool_id = catalystcenter_ip_pool.mgmt_pool_1.id
79+
ipv4_prefix_length = 24
80+
ipv4_subnet = "10.100.0.0"
81+
ipv4_gateway = "10.100.0.1"
7782
}
7883
```
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "catalystcenter_provision_access_points Resource - terraform-provider-catalystcenter"
4+
subcategory: "Inventory"
5+
description: |-
6+
Manages the provisioning of Access Points within a single resource, specifying a list of access points to be provisioned in selected site.
7+
---
8+
9+
# catalystcenter_provision_access_points (Resource)
10+
11+
Manages the provisioning of Access Points within a single resource, specifying a list of access points to be provisioned in selected site.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "catalystcenter_provision_access_points" "example" {
17+
network_devices = [
18+
{
19+
}
20+
]
21+
rf_profile_name = "TYPICAL"
22+
site_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
23+
}
24+
```
25+
26+
<!-- schema generated by tfplugindocs -->
27+
## Schema
28+
29+
### Required
30+
31+
- `network_devices` (Attributes Set) List of access points to be provisioned (see [below for nested schema](#nestedatt--network_devices))
32+
- `rf_profile_name` (String) RF Profile Name. RF Profile is not allowed for custom AP Zones.
33+
- Choices: `LOW`, `TYPICAL`, `HIGH`
34+
- `site_id` (String) ID of the site this network device needs to be provisioned
35+
36+
### Optional
37+
38+
- `ap_zone_name` (String) AP Zone Name. A custom AP Zone should be passed if no rfProfileName is provided.
39+
40+
### Read-Only
41+
42+
- `id` (String) The id of the object
43+
44+
<a id="nestedatt--network_devices"></a>
45+
### Nested Schema for `network_devices`
46+
47+
Required:
48+
49+
- `device_id` (String) ID of the Access Point to be provisioned
50+
51+
Optional:
52+
53+
- `id` (String) ID of the provisioned AP device
54+
- `mesh_role` (String) Mesh Role (Applicable only when AP is in Bridge Mode)
55+
- `reprovision` (Boolean) Flag to indicate whether the device should be reprovisioned. If set to `true`, reprovisioning will be triggered on every Terraform apply
Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,46 @@
1+
data "catalystcenter_site" "global" {
2+
name_hierarchy = "Global"
3+
}
4+
15
resource "catalystcenter_area" "san_jose" {
2-
name = "San Jose"
3-
parent_name = "Global"
6+
name = "San Jose"
7+
parent_id = data.catalystcenter_site.global.id
48
}
59

610
resource "catalystcenter_building" "main_building" {
7-
name = "Main Building"
8-
parent_name = "Global/${catalystcenter_area.san_jose.name}"
9-
latitude = 37.338
10-
longitude = -121.832
11+
name = "Main Building"
12+
parent_id = catalystcenter_area.san_jose.id
13+
country = "United States"
14+
latitude = 37.338
15+
longitude = -121.832
1116
}
1217

1318
resource "catalystcenter_floor" "ground_floor" {
14-
name = "Ground Floor"
15-
parent_name = "${catalystcenter_building.main_building.parent_name}/${catalystcenter_building.main_building.name}"
16-
rf_model = "Drywall Office Only"
17-
width = 30.5
18-
length = 50.5
19-
height = 3.5
19+
name = "Ground Floor"
20+
parent_id = catalystcenter_building.main_building.id
21+
rf_model = "Drywall Office Only"
22+
floor_number = 1
23+
width = 30.5
24+
length = 50.5
25+
height = 3.5
26+
units_of_measure = "feet"
2027
}
2128

2229
resource "catalystcenter_ip_pool" "mgmt_pool_1" {
23-
name = "MgmtPool1"
24-
ip_address_space = "IPv4"
25-
type = "Generic"
26-
ip_subnet = "10.100.0.0/16"
27-
dhcp_server_ips = ["10.101.1.1"]
28-
dns_server_ips = ["10.101.1.101", "10.101.1.102"]
30+
name = "MgmtPool1"
31+
pool_type = "Generic"
32+
address_space_subnet = "10.100.0.0"
33+
address_space_prefix_length = 16
34+
address_space_dhcp_servers = ["10.101.1.1"]
35+
address_space_dns_servers = ["10.101.1.101", "10.101.1.102"]
2936
}
3037

3138
resource "catalystcenter_ip_pool_reservation" "san_jose_main_building_mgmt_1" {
32-
site_id = catalystcenter_building.main_building.id
33-
name = "SanJoseMainBuildingMgmt1"
34-
type = "Generic"
35-
ipv6_address_space = false
36-
ipv4_global_pool = catalystcenter_ip_pool.mgmt_pool_1.ip_subnet
37-
ipv4_prefix = true
38-
ipv4_prefix_length = 24
39-
ipv4_subnet = "10.100.0.0"
40-
ipv4_gateway = "10.100.0.1"
39+
site_id = catalystcenter_building.main_building.id
40+
name = "SanJoseMainBuildingMgmt1"
41+
pool_type = "Generic"
42+
ipv4_global_pool_id = catalystcenter_ip_pool.mgmt_pool_1.id
43+
ipv4_prefix_length = 24
44+
ipv4_subnet = "10.100.0.0"
45+
ipv4_gateway = "10.100.0.1"
4146
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "catalystcenter_provision_access_points" "example" {
2+
network_devices = [
3+
{
4+
}
5+
]
6+
rf_profile_name = "TYPICAL"
7+
site_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
8+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
name: Provision Access Points
3+
# manual updates to Read function in resource file
4+
rest_endpoint: /dna/intent/api/v1/wirelessAccessPoints/provision
5+
res_description: Manages the provisioning of Access Points within a single resource, specifying a list of access points to be provisioned in selected site.
6+
no_delete: true
7+
no_import: true
8+
no_update: true
9+
no_read: true
10+
no_data_source: true
11+
doc_category: Inventory
12+
mutex: true
13+
test_tags: [INVENTORY]
14+
attributes:
15+
- model_name: networkDevices
16+
type: Set
17+
mandatory: true
18+
description: List of access points to be provisioned
19+
attributes:
20+
- model_name: id
21+
type: String
22+
description: ID of the provisioned AP device
23+
exclude_test: true
24+
- model_name: deviceId
25+
type: String
26+
description: ID of the Access Point to be provisioned
27+
mandatory: true
28+
exclude_test: true
29+
- model_name: meshRole
30+
type: String
31+
description: Mesh Role (Applicable only when AP is in Bridge Mode)
32+
mandatory: false
33+
exclude_test: true
34+
- tf_name: reprovision
35+
description: Flag to indicate whether the device should be reprovisioned. If set to `true`, reprovisioning will be triggered on every Terraform apply
36+
type: Bool
37+
example: false
38+
requires_replace: true
39+
exclude_test: true
40+
- model_name: rfProfileName
41+
requires_replace: true
42+
mandatory: true
43+
description: RF Profile Name. RF Profile is not allowed for custom AP Zones.
44+
type: String
45+
enum_values: [LOW, TYPICAL, HIGH]
46+
example: TYPICAL
47+
- model_name: apZoneName
48+
requires_replace: true
49+
mandatory: false
50+
description: AP Zone Name. A custom AP Zone should be passed if no rfProfileName is provided.
51+
type: String
52+
exclude_test: true
53+
- model_name: siteId
54+
id: true
55+
description: ID of the site this network device needs to be provisioned
56+
type: String
57+
example: 5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1
58+
test_value: catalystcenter_area.test.id
59+
test_prerequisites: |
60+
data "catalystcenter_site" "test" {
61+
name_hierarchy = "Global"
62+
}
63+
resource "catalystcenter_area" "test" {
64+
name = "Area1"
65+
parent_id = data.catalystcenter_site.test.id
66+
}

0 commit comments

Comments
 (0)