Skip to content

Commit

Permalink
Add network resource
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Oct 31, 2023
1 parent c96e6e0 commit 68aa007
Show file tree
Hide file tree
Showing 12 changed files with 1,357 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/data-sources/network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "catalystcenter_network Data Source - terraform-provider-catalystcenter"
subcategory: "Network Settings"
description: |-
This data source can read the Network.
---

# catalystcenter_network (Data Source)

This data source can read the Network.

## Example Usage

```terraform
data "catalystcenter_network" "example" {
id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) The id of the object
- `site_id` (String) The site ID

### Read-Only

- `catalyst_center_as_snmp_server` (Boolean) Use Catalyst Center as SNMP server
- `catalyst_center_as_syslog_server` (Boolean) Use Catalyst Center as Syslog server
- `dhcp_servers` (List of String) List of DHCP server IPs
- `domain_name` (String) Domain name
- `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
- `endpoint_aaa_server_protocol` (String) Server protocol
- `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
- `endpoint_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
- `endpoint_aaa_server_type` (String) Type of network AAA server
- `netflow_collector` (String) Netflow collector IP
- `netflow_collector_port` (Number) Netflow collector port
- `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
- `network_aaa_server_protocol` (String) Server protocol
- `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
- `network_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
- `network_aaa_server_type` (String) Type of network AAA server
- `ntp_servers` (List of String) List of NTP server IPs
- `primary_dns_server` (String) Primary DNS server IP
- `secondary_dns_server` (String) Secondary DNS server IP
- `snmp_servers` (List of String) List of SNMP server IPs
- `syslog_servers` (List of String) List of Syslog server IPs
- `timezone` (String) Timezone, e.g. `Africa/Abidjan`
77 changes: 77 additions & 0 deletions docs/resources/network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "catalystcenter_network Resource - terraform-provider-catalystcenter"
subcategory: "Network Settings"
description: |-
This resource can manage a Network.
---

# catalystcenter_network (Resource)

This resource can manage a Network.

## Example Usage

```terraform
resource "catalystcenter_network" "example" {
site_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
dhcp_servers = ["1.2.3.4"]
domain_name = "cisco.com"
primary_dns_server = "1.2.3.4"
secondary_dns_server = "1.2.3.5"
syslog_servers = ["1.2.3.4"]
catalyst_center_as_syslog_server = false
snmp_servers = ["1.2.3.4"]
catalyst_center_as_snmp_server = false
netflow_collector = "1.2.3.4"
netflow_collector_port = 1234
ntp_servers = ["1.2.3.4"]
timezone = "Europe/Vienna"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `site_id` (String) The site ID
- `timezone` (String) Timezone, e.g. `Africa/Abidjan`

### Optional

- `catalyst_center_as_snmp_server` (Boolean) Use Catalyst Center as SNMP server
- `catalyst_center_as_syslog_server` (Boolean) Use Catalyst Center as Syslog server
- `dhcp_servers` (List of String) List of DHCP server IPs
- `domain_name` (String) Domain name
- `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
- `endpoint_aaa_server_protocol` (String) Server protocol
- Choices: `RADIUS`, `TACACS`
- `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
- `endpoint_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
- `endpoint_aaa_server_type` (String) Type of network AAA server
- `netflow_collector` (String) Netflow collector IP
- `netflow_collector_port` (Number) Netflow collector port
- `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
- `network_aaa_server_protocol` (String) Server protocol
- Choices: `RADIUS`, `TACACS`
- `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
- `network_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
- `network_aaa_server_type` (String) Type of network AAA server
- `ntp_servers` (List of String) List of NTP server IPs
- `primary_dns_server` (String) Primary DNS server IP
- `secondary_dns_server` (String) Secondary DNS server IP
- `snmp_servers` (List of String) List of SNMP server IPs
- `syslog_servers` (List of String) List of Syslog server IPs

### Read-Only

- `id` (String) The id of the object

## Import

Import is supported using the following syntax:

```shell
terraform import catalystcenter_network.example "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
```
3 changes: 3 additions & 0 deletions examples/data-sources/catalystcenter_network/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "catalystcenter_network" "example" {
id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
}
1 change: 1 addition & 0 deletions examples/resources/catalystcenter_network/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import catalystcenter_network.example "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
15 changes: 15 additions & 0 deletions examples/resources/catalystcenter_network/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "catalystcenter_network" "example" {
site_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
dhcp_servers = ["1.2.3.4"]
domain_name = "cisco.com"
primary_dns_server = "1.2.3.4"
secondary_dns_server = "1.2.3.5"
syslog_servers = ["1.2.3.4"]
catalyst_center_as_syslog_server = false
snmp_servers = ["1.2.3.4"]
catalyst_center_as_snmp_server = false
netflow_collector = "1.2.3.4"
netflow_collector_port = 1234
ntp_servers = ["1.2.3.4"]
timezone = "Europe/Vienna"
}
189 changes: 189 additions & 0 deletions gen/definitions/network.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
---
name: Network
rest_endpoint: /dna/intent/api/v2/network
get_rest_endpoint: /api/v1/commonsetting/global
get_requires_id: true
no_delete: true
doc_category: Network Settings
attributes:
- model_name: siteId
type: String
query_param: true
id: true
description: The site ID
example: 5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1
test_value: catalystcenter_area.test.id
- model_name: dhcpServer
data_path: settings
response_data_path: 'response.#(key=\"dhcp.server\").value'
tf_name: dhcp_servers
type: StringList
description: List of DHCP server IPs
example: 1.2.3.4
- model_name: domainName
data_path: settings.dnsServer
response_data_path: 'response.#(key=\"dns.server\").value.0.domainName'
type: String
description: Domain name
example: cisco.com
- model_name: primaryIpAddress
data_path: settings.dnsServer
response_data_path: 'response.#(key=\"dns.server\").value.0.primaryIpAddress'
tf_name: primary_dns_server
type: String
description: Primary DNS server IP
example: 1.2.3.4
- model_name: secondaryIpAddress
data_path: settings.dnsServer
response_data_path: 'response.#(key=\"dns.server\").value.0.secondaryIpAddress'
tf_name: secondary_dns_server
type: String
description: Secondary DNS server IP
example: 1.2.3.5
- model_name: ipAddresses
data_path: settings.syslogServer
response_data_path: 'response.#(key=\"syslog.server\").value.0.ipAddresses'
tf_name: syslog_servers
type: StringList
description: List of Syslog server IPs
example: 1.2.3.4
- model_name: configureDnacIP
data_path: settings.syslogServer
response_data_path: 'response.#(key=\"syslog.server\").value.0.configureDnacIP'
tf_name: catalyst_center_as_syslog_server
type: Bool
description: Use Catalyst Center as Syslog server
example: false
- model_name: ipAddresses
data_path: settings.snmpServer
response_data_path: 'response.#(key=\"snmp.trap.receiver\").value.0.ipAddresses'
tf_name: snmp_servers
type: StringList
description: List of SNMP server IPs
example: 1.2.3.4
- model_name: configureDnacIP
data_path: settings.snmpServer
response_data_path: 'response.#(key=\"snmp.trap.receiver\").value.0.configureDnacIP'
tf_name: catalyst_center_as_snmp_server
type: Bool
description: Use Catalyst Center as SNMP server
example: false
- model_name: ipAddress
data_path: settings.netflowcollector
response_data_path: 'response.#(key=\"netflow.collector\").value.0.ipAddress'
tf_name: netflow_collector
type: String
description: Netflow collector IP
example: 1.2.3.4
- model_name: port
data_path: settings.netflowcollector
response_data_path: 'response.#(key=\"netflow.collector\").value.0.port'
tf_name: netflow_collector_port
type: Int64
description: Netflow collector port
example: 1234
- model_name: ntpServer
data_path: settings
response_data_path: 'response.#(key=\"ntp.server\").value'
tf_name: ntp_servers
type: StringList
description: List of NTP server IPs
example: 1.2.3.4
- model_name: timezone
data_path: settings
response_data_path: 'response.#(key=\"timezone.site\").value.0'
type: String
mandatory: true
description: Timezone, e.g. `Africa/Abidjan`
example: Europe/Vienna
- model_name: servers
data_path: settings.network_aaa
tf_name: network_aaa_server_type
type: String
write_only: true
enum_value: [AAA, ISE]
description: Type of network AAA server
example: AAA
exclude_test: true
- model_name: network
data_path: settings.network_aaa
tf_name: network_aaa_server_primary_ip
type: String
write_only: true
description: In case of `ISE` server type, this is the PAN IP address, in case of `AAA` this is the primary IP address
example: 1.2.3.4
exclude_test: true
- model_name: ipAddress
data_path: settings.network_aaa
tf_name: network_aaa_server_secondary_ip
type: String
write_only: true
description: In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
example: 1.2.3.5
exclude_test: true
- model_name: protocol
data_path: settings.network_aaa
tf_name: network_aaa_server_protocol
type: String
write_only: true
enum_values: [RADIUS, TACACS]
description: Server protocol
example: RADIUS
exclude_test: true
- model_name: sharedSecret
data_path: settings.network_aaa
tf_name: network_aaa_server_shared_secret
type: String
write_only: true
description: Only relevant for type `ISE`, shared secret
example: Secret123
exclude_test: true
- model_name: servers
data_path: settings.clientAndEndpoint_aaa
tf_name: endpoint_aaa_server_type
type: String
write_only: true
enum_value: [AAA, ISE]
description: Type of network AAA server
example: AAA
exclude_test: true
- model_name: network
data_path: settings.clientAndEndpoint_aaa
tf_name: endpoint_aaa_server_primary_ip
type: String
write_only: true
description: In case of `ISE` server type, this is the PAN IP address, in case of `AAA` this is the primary IP address
example: 1.2.3.4
exclude_test: true
- model_name: ipAddress
data_path: settings.clientAndEndpoint_aaa
tf_name: endpoint_aaa_server_secondary_ip
type: String
write_only: true
description: In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
example: 1.2.3.5
exclude_test: true
- model_name: protocol
data_path: settings.clientAndEndpoint_aaa
tf_name: endpoint_aaa_server_protocol
type: String
write_only: true
enum_values: [RADIUS, TACACS]
description: Server protocol
example: RADIUS
exclude_test: true
- model_name: sharedSecret
data_path: settings.clientAndEndpoint_aaa
tf_name: endpoint_aaa_server_shared_secret
type: String
write_only: true
description: Only relevant for type `ISE`, shared secret
example: Secret123
exclude_test: true

test_prerequisites: |
resource "catalystcenter_area" "test" {
name = "Area1"
parent_name = "Global"
}
Loading

0 comments on commit 68aa007

Please sign in to comment.