Skip to content

Commit 68aa007

Browse files
committed
Add network resource
1 parent c96e6e0 commit 68aa007

File tree

12 files changed

+1357
-0
lines changed

12 files changed

+1357
-0
lines changed

docs/data-sources/network.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "catalystcenter_network Data Source - terraform-provider-catalystcenter"
4+
subcategory: "Network Settings"
5+
description: |-
6+
This data source can read the Network.
7+
---
8+
9+
# catalystcenter_network (Data Source)
10+
11+
This data source can read the Network.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "catalystcenter_network" "example" {
17+
id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
18+
}
19+
```
20+
21+
<!-- schema generated by tfplugindocs -->
22+
## Schema
23+
24+
### Required
25+
26+
- `id` (String) The id of the object
27+
- `site_id` (String) The site ID
28+
29+
### Read-Only
30+
31+
- `catalyst_center_as_snmp_server` (Boolean) Use Catalyst Center as SNMP server
32+
- `catalyst_center_as_syslog_server` (Boolean) Use Catalyst Center as Syslog server
33+
- `dhcp_servers` (List of String) List of DHCP server IPs
34+
- `domain_name` (String) Domain name
35+
- `endpoint_aaa_server_primary_ip` (String) In case of `ISE` server type, this is the PAN IP address, in case of `AAA` this is the primary IP address
36+
- `endpoint_aaa_server_protocol` (String) Server protocol
37+
- `endpoint_aaa_server_secondary_ip` (String) In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
38+
- `endpoint_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
39+
- `endpoint_aaa_server_type` (String) Type of network AAA server
40+
- `netflow_collector` (String) Netflow collector IP
41+
- `netflow_collector_port` (Number) Netflow collector port
42+
- `network_aaa_server_primary_ip` (String) In case of `ISE` server type, this is the PAN IP address, in case of `AAA` this is the primary IP address
43+
- `network_aaa_server_protocol` (String) Server protocol
44+
- `network_aaa_server_secondary_ip` (String) In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
45+
- `network_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
46+
- `network_aaa_server_type` (String) Type of network AAA server
47+
- `ntp_servers` (List of String) List of NTP server IPs
48+
- `primary_dns_server` (String) Primary DNS server IP
49+
- `secondary_dns_server` (String) Secondary DNS server IP
50+
- `snmp_servers` (List of String) List of SNMP server IPs
51+
- `syslog_servers` (List of String) List of Syslog server IPs
52+
- `timezone` (String) Timezone, e.g. `Africa/Abidjan`

docs/resources/network.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "catalystcenter_network Resource - terraform-provider-catalystcenter"
4+
subcategory: "Network Settings"
5+
description: |-
6+
This resource can manage a Network.
7+
---
8+
9+
# catalystcenter_network (Resource)
10+
11+
This resource can manage a Network.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "catalystcenter_network" "example" {
17+
site_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
18+
dhcp_servers = ["1.2.3.4"]
19+
domain_name = "cisco.com"
20+
primary_dns_server = "1.2.3.4"
21+
secondary_dns_server = "1.2.3.5"
22+
syslog_servers = ["1.2.3.4"]
23+
catalyst_center_as_syslog_server = false
24+
snmp_servers = ["1.2.3.4"]
25+
catalyst_center_as_snmp_server = false
26+
netflow_collector = "1.2.3.4"
27+
netflow_collector_port = 1234
28+
ntp_servers = ["1.2.3.4"]
29+
timezone = "Europe/Vienna"
30+
}
31+
```
32+
33+
<!-- schema generated by tfplugindocs -->
34+
## Schema
35+
36+
### Required
37+
38+
- `site_id` (String) The site ID
39+
- `timezone` (String) Timezone, e.g. `Africa/Abidjan`
40+
41+
### Optional
42+
43+
- `catalyst_center_as_snmp_server` (Boolean) Use Catalyst Center as SNMP server
44+
- `catalyst_center_as_syslog_server` (Boolean) Use Catalyst Center as Syslog server
45+
- `dhcp_servers` (List of String) List of DHCP server IPs
46+
- `domain_name` (String) Domain name
47+
- `endpoint_aaa_server_primary_ip` (String) In case of `ISE` server type, this is the PAN IP address, in case of `AAA` this is the primary IP address
48+
- `endpoint_aaa_server_protocol` (String) Server protocol
49+
- Choices: `RADIUS`, `TACACS`
50+
- `endpoint_aaa_server_secondary_ip` (String) In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
51+
- `endpoint_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
52+
- `endpoint_aaa_server_type` (String) Type of network AAA server
53+
- `netflow_collector` (String) Netflow collector IP
54+
- `netflow_collector_port` (Number) Netflow collector port
55+
- `network_aaa_server_primary_ip` (String) In case of `ISE` server type, this is the PAN IP address, in case of `AAA` this is the primary IP address
56+
- `network_aaa_server_protocol` (String) Server protocol
57+
- Choices: `RADIUS`, `TACACS`
58+
- `network_aaa_server_secondary_ip` (String) In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
59+
- `network_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
60+
- `network_aaa_server_type` (String) Type of network AAA server
61+
- `ntp_servers` (List of String) List of NTP server IPs
62+
- `primary_dns_server` (String) Primary DNS server IP
63+
- `secondary_dns_server` (String) Secondary DNS server IP
64+
- `snmp_servers` (List of String) List of SNMP server IPs
65+
- `syslog_servers` (List of String) List of Syslog server IPs
66+
67+
### Read-Only
68+
69+
- `id` (String) The id of the object
70+
71+
## Import
72+
73+
Import is supported using the following syntax:
74+
75+
```shell
76+
terraform import catalystcenter_network.example "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
77+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "catalystcenter_network" "example" {
2+
id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import catalystcenter_network.example "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
resource "catalystcenter_network" "example" {
2+
site_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
3+
dhcp_servers = ["1.2.3.4"]
4+
domain_name = "cisco.com"
5+
primary_dns_server = "1.2.3.4"
6+
secondary_dns_server = "1.2.3.5"
7+
syslog_servers = ["1.2.3.4"]
8+
catalyst_center_as_syslog_server = false
9+
snmp_servers = ["1.2.3.4"]
10+
catalyst_center_as_snmp_server = false
11+
netflow_collector = "1.2.3.4"
12+
netflow_collector_port = 1234
13+
ntp_servers = ["1.2.3.4"]
14+
timezone = "Europe/Vienna"
15+
}

gen/definitions/network.yaml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
---
2+
name: Network
3+
rest_endpoint: /dna/intent/api/v2/network
4+
get_rest_endpoint: /api/v1/commonsetting/global
5+
get_requires_id: true
6+
no_delete: true
7+
doc_category: Network Settings
8+
attributes:
9+
- model_name: siteId
10+
type: String
11+
query_param: true
12+
id: true
13+
description: The site ID
14+
example: 5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1
15+
test_value: catalystcenter_area.test.id
16+
- model_name: dhcpServer
17+
data_path: settings
18+
response_data_path: 'response.#(key=\"dhcp.server\").value'
19+
tf_name: dhcp_servers
20+
type: StringList
21+
description: List of DHCP server IPs
22+
example: 1.2.3.4
23+
- model_name: domainName
24+
data_path: settings.dnsServer
25+
response_data_path: 'response.#(key=\"dns.server\").value.0.domainName'
26+
type: String
27+
description: Domain name
28+
example: cisco.com
29+
- model_name: primaryIpAddress
30+
data_path: settings.dnsServer
31+
response_data_path: 'response.#(key=\"dns.server\").value.0.primaryIpAddress'
32+
tf_name: primary_dns_server
33+
type: String
34+
description: Primary DNS server IP
35+
example: 1.2.3.4
36+
- model_name: secondaryIpAddress
37+
data_path: settings.dnsServer
38+
response_data_path: 'response.#(key=\"dns.server\").value.0.secondaryIpAddress'
39+
tf_name: secondary_dns_server
40+
type: String
41+
description: Secondary DNS server IP
42+
example: 1.2.3.5
43+
- model_name: ipAddresses
44+
data_path: settings.syslogServer
45+
response_data_path: 'response.#(key=\"syslog.server\").value.0.ipAddresses'
46+
tf_name: syslog_servers
47+
type: StringList
48+
description: List of Syslog server IPs
49+
example: 1.2.3.4
50+
- model_name: configureDnacIP
51+
data_path: settings.syslogServer
52+
response_data_path: 'response.#(key=\"syslog.server\").value.0.configureDnacIP'
53+
tf_name: catalyst_center_as_syslog_server
54+
type: Bool
55+
description: Use Catalyst Center as Syslog server
56+
example: false
57+
- model_name: ipAddresses
58+
data_path: settings.snmpServer
59+
response_data_path: 'response.#(key=\"snmp.trap.receiver\").value.0.ipAddresses'
60+
tf_name: snmp_servers
61+
type: StringList
62+
description: List of SNMP server IPs
63+
example: 1.2.3.4
64+
- model_name: configureDnacIP
65+
data_path: settings.snmpServer
66+
response_data_path: 'response.#(key=\"snmp.trap.receiver\").value.0.configureDnacIP'
67+
tf_name: catalyst_center_as_snmp_server
68+
type: Bool
69+
description: Use Catalyst Center as SNMP server
70+
example: false
71+
- model_name: ipAddress
72+
data_path: settings.netflowcollector
73+
response_data_path: 'response.#(key=\"netflow.collector\").value.0.ipAddress'
74+
tf_name: netflow_collector
75+
type: String
76+
description: Netflow collector IP
77+
example: 1.2.3.4
78+
- model_name: port
79+
data_path: settings.netflowcollector
80+
response_data_path: 'response.#(key=\"netflow.collector\").value.0.port'
81+
tf_name: netflow_collector_port
82+
type: Int64
83+
description: Netflow collector port
84+
example: 1234
85+
- model_name: ntpServer
86+
data_path: settings
87+
response_data_path: 'response.#(key=\"ntp.server\").value'
88+
tf_name: ntp_servers
89+
type: StringList
90+
description: List of NTP server IPs
91+
example: 1.2.3.4
92+
- model_name: timezone
93+
data_path: settings
94+
response_data_path: 'response.#(key=\"timezone.site\").value.0'
95+
type: String
96+
mandatory: true
97+
description: Timezone, e.g. `Africa/Abidjan`
98+
example: Europe/Vienna
99+
- model_name: servers
100+
data_path: settings.network_aaa
101+
tf_name: network_aaa_server_type
102+
type: String
103+
write_only: true
104+
enum_value: [AAA, ISE]
105+
description: Type of network AAA server
106+
example: AAA
107+
exclude_test: true
108+
- model_name: network
109+
data_path: settings.network_aaa
110+
tf_name: network_aaa_server_primary_ip
111+
type: String
112+
write_only: true
113+
description: In case of `ISE` server type, this is the PAN IP address, in case of `AAA` this is the primary IP address
114+
example: 1.2.3.4
115+
exclude_test: true
116+
- model_name: ipAddress
117+
data_path: settings.network_aaa
118+
tf_name: network_aaa_server_secondary_ip
119+
type: String
120+
write_only: true
121+
description: In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
122+
example: 1.2.3.5
123+
exclude_test: true
124+
- model_name: protocol
125+
data_path: settings.network_aaa
126+
tf_name: network_aaa_server_protocol
127+
type: String
128+
write_only: true
129+
enum_values: [RADIUS, TACACS]
130+
description: Server protocol
131+
example: RADIUS
132+
exclude_test: true
133+
- model_name: sharedSecret
134+
data_path: settings.network_aaa
135+
tf_name: network_aaa_server_shared_secret
136+
type: String
137+
write_only: true
138+
description: Only relevant for type `ISE`, shared secret
139+
example: Secret123
140+
exclude_test: true
141+
- model_name: servers
142+
data_path: settings.clientAndEndpoint_aaa
143+
tf_name: endpoint_aaa_server_type
144+
type: String
145+
write_only: true
146+
enum_value: [AAA, ISE]
147+
description: Type of network AAA server
148+
example: AAA
149+
exclude_test: true
150+
- model_name: network
151+
data_path: settings.clientAndEndpoint_aaa
152+
tf_name: endpoint_aaa_server_primary_ip
153+
type: String
154+
write_only: true
155+
description: In case of `ISE` server type, this is the PAN IP address, in case of `AAA` this is the primary IP address
156+
example: 1.2.3.4
157+
exclude_test: true
158+
- model_name: ipAddress
159+
data_path: settings.clientAndEndpoint_aaa
160+
tf_name: endpoint_aaa_server_secondary_ip
161+
type: String
162+
write_only: true
163+
description: In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
164+
example: 1.2.3.5
165+
exclude_test: true
166+
- model_name: protocol
167+
data_path: settings.clientAndEndpoint_aaa
168+
tf_name: endpoint_aaa_server_protocol
169+
type: String
170+
write_only: true
171+
enum_values: [RADIUS, TACACS]
172+
description: Server protocol
173+
example: RADIUS
174+
exclude_test: true
175+
- model_name: sharedSecret
176+
data_path: settings.clientAndEndpoint_aaa
177+
tf_name: endpoint_aaa_server_shared_secret
178+
type: String
179+
write_only: true
180+
description: Only relevant for type `ISE`, shared secret
181+
example: Secret123
182+
exclude_test: true
183+
184+
test_prerequisites: |
185+
resource "catalystcenter_area" "test" {
186+
name = "Area1"
187+
parent_name = "Global"
188+
}
189+

0 commit comments

Comments
 (0)