-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add discovery and swim functionality (#18)
- Loading branch information
1 parent
90de3d5
commit f7f125b
Showing
56 changed files
with
4,975 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "catalystcenter_device_detail Data Source - terraform-provider-catalystcenter" | ||
subcategory: "Inventory" | ||
description: |- | ||
This data source fetches device's details, including the assigned physical location. | ||
--- | ||
|
||
# catalystcenter_device_detail (Data Source) | ||
|
||
This data source fetches device's details, including the assigned physical location. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "catalystcenter_device_detail" "example" { | ||
id = "76d24097-41c4-4558-a4d0-a8c07ac08470" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `id` (String) The id of the object | ||
|
||
### Read-Only | ||
|
||
- `collection_status` (String) Collection status in Catalyst Center, such as "SUCCESS". | ||
- `communication_state` (String) Communication state of the device, such as "REACHABLE". | ||
- `cpu` (String) CPU of the device, such as "1.25". | ||
- `device_group_hierarchy_id` (String) Identifier of the group hierarchy where the device is assigned, such as "/360b1804-969f-4eab-a4ba-9832ea3f1731/26d4bbe6-f908-4b83-86f1-49bfbb1d05f6/". | ||
- `device_series` (String) Device series, such as "Cisco Catalyst 9400 Series Switches". | ||
- `ha_status` (String) High availability status. | ||
- `location` (String) Location of the device as a slash-separated path, such as "Global/USA/New York/DC01". | ||
- `mac_address` (String) MAC address. | ||
- `maintenance_mode` (Boolean) Whether the device is in maintenance mode. | ||
- `management_ip_address` (String) IP address for managing the device. | ||
- `memory` (String) Memory in gigabytes, e.g. "39.186811767835785". | ||
- `nw_device_family` (String) Family of the network device, such as "Switches and Hubs". | ||
- `nw_device_id` (String) As of now, same as `id`. | ||
- `nw_device_name` (String) Name of the device. | ||
- `nw_device_role` (String) Network device role, such as CORE. | ||
- `nw_device_type` (String) Type of network device. | ||
- `os_type` (String) Corresponds to the `catalystcenter_network_devices.devices.*.software_type`. | ||
- `overall_health` (Number) Overall numerical health score. | ||
- `platform_id` (String) Platform identifier, such as "C9KV-UADP-8P". | ||
- `policy_tag_name` (String) Policy tag name. | ||
- `serial_number` (String) Serial number of the device. | ||
- `site_hierarchy_graph_id` (String) Identifier of the site hierarchy graph where the device is assigned, such as "/2b0a78ee-482e-4b4d-ae85-df289873cbbb/76b11b6a-d94a-431b-8bab-fd16b09f5d40/adad4a8a-17ec-4be3-a4b5-b6549b840afe/e8ce8788-9b13-46ec-86c8-740f7ea443c1/". | ||
- `software_version` (String) Software version on the device. | ||
- `tag_id_list` (List of String) Tags assigned to the device. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "catalystcenter_discovery Data Source - terraform-provider-catalystcenter" | ||
subcategory: "Discovery" | ||
description: |- | ||
This data source retrieves information about a discovery. It is however not intended to be used to retrieve the devices discovered, so instead please use data source catalystcenter_network_devices that can read all existing network devices, including the discovered ones. | ||
--- | ||
|
||
# catalystcenter_discovery (Data Source) | ||
|
||
This data source retrieves information about a discovery. It is however not intended to be used to retrieve the devices discovered, so instead please use data source `catalystcenter_network_devices` that can read all existing network devices, including the discovered ones. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "catalystcenter_discovery" "example" { | ||
id = "disco42" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `id` (String) The id of the object | ||
|
||
### Read-Only | ||
|
||
- `cdp_level` (Number) CDP level is the number of hops across neighbor devices. | ||
- `discovery_type` (String) Type of Discovery. | ||
- `enable_password_list` (List of String) Enable passwords of the devices to be discovered. | ||
- `global_credential_id_list` (List of String) A list of IDs, which must include SNMP credential and CLI credential. | ||
- `http_read_credential` (String) | ||
- `http_write_credential` (String) | ||
- `ip_address_list` (String) A string of IP address ranges to discover. E.g.: '172.30.0.1' for discovery_type Single, CDP and LLDP; '172.30.0.1-172.30.0.4' for Range; '72.30.0.1-172.30.0.4,172.31.0.1-172.31.0.4' for Multi Range; '172.30.0.1/20' for CIDR. | ||
- `ip_filter_list` (List of String) A list of IP address ranges to exclude from the discovery. | ||
- `lldp_level` (Number) LLDP level to which neighbor devices to be discovered. | ||
- `name` (String) A name of the discovery. | ||
- `netconf_port` (String) Port number for netconf as a string. It requires SSH protocol to work. | ||
- `password_list` (List of String) Passwords of the devices to be discovered. | ||
- `preferred_ip_method` (String) Preferred method for selecting management IP address. | ||
- `protocol_order` (String) A string of comma-separated protocols (SSH/Telnet), in the same order in which the connections to each device are attempted. E.g.: 'Telnet': only telnet; 'SSH,Telnet': ssh first, with telnet fallback. | ||
- `retry` (Number) Number of times to try establishing SSH/Telnet connection to a device. | ||
- `snmp_auth_passphrase` (String) Auth passphrase for SNMP. | ||
- `snmp_auth_protocol` (String) SNMP auth protocol. | ||
- `snmp_mode` (String) Mode of SNMP. The `snmp_auth_protocol` and `snmp_auth_passphrase` are required for "AuthNoPriv" mode. Additionally, `snmp_priv_protocol` and `snmp_priv_passphrase` are required for "AuthPriv" mode. | ||
- `snmp_priv_passphrase` (String) Passphrase for SNMP privacy. | ||
- `snmp_priv_protocol` (String) SNMP privacy protocol. | ||
- `snmp_ro_community` (String) SNMP RO community of the devices to be discovered. | ||
- `snmp_ro_community_desc` (String) Description for snmp_ro_community. | ||
- `snmp_rw_community` (String) SNMP RW community of the devices to be discovered. | ||
- `snmp_rw_community_desc` (String) Description for snmp_rw_community | ||
- `snmp_user_name` (String) SNMP username of the devices to be discovered. | ||
- `snmp_version` (String) SNMP version | ||
- `timeout_seconds` (Number) Number of seconds to wait for each SSH/Telnet connection to a device. | ||
- `user_name_list` (List of String) Usernames for the devices to be discovered. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "catalystcenter_network_devices Data Source - terraform-provider-catalystcenter" | ||
subcategory: "Inventory" | ||
description: |- | ||
This data source fetches all network devices defined on the Catalyst Center. | ||
This data source does not report physical location (site) information. Obtain it instead from the data source | ||
data.catalystcenter_device_detail. To determine physical locations of multiple devices use the same data | ||
source with for_each Terraform meta-argument. | ||
--- | ||
|
||
# catalystcenter_network_devices (Data Source) | ||
|
||
This data source fetches all network devices defined on the Catalyst Center. | ||
|
||
This data source does not report physical location (site) information. Obtain it instead from the data source | ||
`data.catalystcenter_device_detail`. To determine physical locations of multiple devices use the same data | ||
source with `for_each` Terraform meta-argument. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "catalystcenter_network_devices" "example" { | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Read-Only | ||
|
||
- `devices` (Attributes List) (see [below for nested schema](#nestedatt--devices)) | ||
|
||
<a id="nestedatt--devices"></a> | ||
### Nested Schema for `devices` | ||
|
||
Read-Only: | ||
|
||
- `hostname` (String) Hostname of the network device | ||
- `id` (String) UUID of the network device | ||
- `management_ip_address` (String) Management IP address | ||
- `management_state` (String) Management state of a network device. If it is not "Managed" for a device, then the `catalystcenter_network_device_detail` may fail for that device. | ||
- `platform_id` (String) Platform identifier | ||
- `role` (String) Role of the network device, such as `ACCESS` or `DISTRIBUTION`. | ||
- `software_type` (String) Type of software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "catalystcenter_discovery Resource - terraform-provider-catalystcenter" | ||
subcategory: "Discovery" | ||
description: |- | ||
After discovery resource has been created, the Catalyst Center would contain device entries (if discovered). All the device entries can be subsequently obtained from data source catalystcenter_network_devices. Terraform currently is not able to handle for_each from a data source that depends on any managed resource, therefore to work around that limitation the catalystcenter_discovery can be placed in a different tfstate (root module) than catalystcenter_network_devices when the latter is used as a source of for_each. The discovery resource does not support updates, it needs to be destroyed and re-created instead. | ||
--- | ||
|
||
# catalystcenter_discovery (Resource) | ||
|
||
After discovery resource has been created, the Catalyst Center would contain device entries (if discovered). All the device entries can be subsequently obtained from data source `catalystcenter_network_devices`. Terraform currently is not able to handle `for_each` from a data source that depends on any managed resource, therefore to work around that limitation the `catalystcenter_discovery` can be placed in a different tfstate (root module) than `catalystcenter_network_devices` when the latter is used as a source of `for_each`. <p/> The discovery resource does not support updates, it needs to be destroyed and re-created instead. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "catalystcenter_discovery" "example" { | ||
discovery_type = "Range" | ||
ip_address_list = "192.168.0.1-192.168.0.99" | ||
name = "disco42" | ||
netconf_port = "830" | ||
protocol_order = "SSH" | ||
retry = 3 | ||
timeout_seconds = 5 | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `discovery_type` (String) Type of Discovery. | ||
- Choices: `Single`, `Range`, `Multi Range`, `CDP`, `LLDP`, `CIDR` | ||
- `name` (String) A name of the discovery. | ||
- `protocol_order` (String) A string of comma-separated protocols (SSH/Telnet), in the same order in which the connections to each device are attempted. E.g.: 'Telnet': only telnet; 'SSH,Telnet': ssh first, with telnet fallback. | ||
|
||
### Optional | ||
|
||
- `cdp_level` (Number) CDP level is the number of hops across neighbor devices. | ||
- `enable_password_list` (List of String) Enable passwords of the devices to be discovered. | ||
- `global_credential_id_list` (List of String) A list of IDs, which must include SNMP credential and CLI credential. | ||
- `http_read_credential` (String) | ||
- `http_write_credential` (String) | ||
- `ip_address_list` (String) A string of IP address ranges to discover. E.g.: '172.30.0.1' for discovery_type Single, CDP and LLDP; '172.30.0.1-172.30.0.4' for Range; '72.30.0.1-172.30.0.4,172.31.0.1-172.31.0.4' for Multi Range; '172.30.0.1/20' for CIDR. | ||
- `ip_filter_list` (List of String) A list of IP address ranges to exclude from the discovery. | ||
- `lldp_level` (Number) LLDP level to which neighbor devices to be discovered. | ||
- `netconf_port` (String) Port number for netconf as a string. It requires SSH protocol to work. | ||
- `password_list` (List of String) Passwords of the devices to be discovered. | ||
- `preferred_ip_method` (String) Preferred method for selecting management IP address. | ||
- Choices: `None`, `UseLoopBack` | ||
- Default value: `None` | ||
- `retry` (Number) Number of times to try establishing SSH/Telnet connection to a device. | ||
- `snmp_auth_passphrase` (String) Auth passphrase for SNMP. | ||
- `snmp_auth_protocol` (String) SNMP auth protocol. | ||
- Choices: `SHA`, `MD5` | ||
- `snmp_mode` (String) Mode of SNMP. The `snmp_auth_protocol` and `snmp_auth_passphrase` are required for "AuthNoPriv" mode. Additionally, `snmp_priv_protocol` and `snmp_priv_passphrase` are required for "AuthPriv" mode. | ||
- Choices: `AuthPriv`, `AuthNoPriv`, `NoAuthNoPriv` | ||
- `snmp_priv_passphrase` (String) Passphrase for SNMP privacy. | ||
- `snmp_priv_protocol` (String) SNMP privacy protocol. | ||
- Choices: `DES`, `AES128` | ||
- `snmp_ro_community` (String) SNMP RO community of the devices to be discovered. | ||
- `snmp_ro_community_desc` (String) Description for snmp_ro_community. | ||
- `snmp_rw_community` (String) SNMP RW community of the devices to be discovered. | ||
- `snmp_rw_community_desc` (String) Description for snmp_rw_community | ||
- `snmp_user_name` (String) SNMP username of the devices to be discovered. | ||
- `snmp_version` (String) SNMP version | ||
- Choices: `v2`, `v3` | ||
- `timeout_seconds` (Number) Number of seconds to wait for each SSH/Telnet connection to a device. | ||
- `user_name_list` (List of String) Usernames for the devices to be discovered. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The id of the object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "catalystcenter_image Resource - terraform-provider-catalystcenter" | ||
subcategory: "Software Image Management (SWIM)" | ||
description: |- | ||
This resource can fetch a software image from a local file and upload it on the Catalyst Center. It can be further used by catalystcenter_image_distribution, catalystcenter_image_activation, etc. | ||
--- | ||
|
||
# catalystcenter_image (Resource) | ||
|
||
This resource can fetch a software image from a local file and upload it on the Catalyst Center. It can be further used by `catalystcenter_image_distribution`, `catalystcenter_image_activation`, etc. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "catalystcenter_image" "example" { | ||
source_path = "../software.bin" | ||
name = "basename(\"../software.bin\")" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) File name that uniquely identifies the software image. It should not contain any path. Usually this can be specified as `basename(source_path)` | ||
- `source_path` (String) Local path where the software image file resides. Supported file extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz, qcow2. | ||
|
||
### Optional | ||
|
||
- `family` (String) Third party image family | ||
- `is_third_party` (Boolean) Whether the software image is from a third party. | ||
- Default value: `false` | ||
- `third_party_application_type` (String) Third party application type | ||
- `third_party_vendor` (String) Third party Vendor | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The id of the object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "catalystcenter_image_activation Resource - terraform-provider-catalystcenter" | ||
subcategory: "Software Image Management (SWIM)" | ||
description: |- | ||
This resource can activate a software image file on the chosen network device (upgrade the software on the device). Every time this resource is created or re-created, the Catalyst Center considers image activation on the device. (Catalyst Center does not however proceed with activation if the image is already running on the device, assuming the operation has succeeded and noting this fact in its audit log.) When this resource is destroyed or updated or refreshed, no actions are done either on CatalystCenter or on devices. In effect, this resource currently cannot undo an image activation. | ||
--- | ||
|
||
# catalystcenter_image_activation (Resource) | ||
|
||
This resource can activate a software image file on the chosen network device (upgrade the software on the device). Every time this resource is created or re-created, the Catalyst Center considers image activation on the device. (Catalyst Center does not however proceed with activation if the image is already running on the device, assuming the operation has succeeded and noting this fact in its audit log.) <p/> When this resource is destroyed or updated or refreshed, no actions are done either on CatalystCenter or on devices. In effect, this resource currently cannot undo an image activation. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "catalystcenter_image_activation" "example" { | ||
device_uuid = "138b3181-f9c5-4271-9292-cf3152ab4d3e" | ||
image_uuid_list = [""] | ||
activate_lower_image_version = true | ||
distribute_if_needed = true | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `activate_lower_image_version` (Boolean) Allow to activate a lower version of an image. Updating this attribute later does not cause image to be re-activated. | ||
- `device_upgrade_mode` (String) Device upgrade mode. Updating this attribute later does not cause image to be re-activated. | ||
- `device_uuid` (String) The UUID of the network device on which to active the software image. Changing it forces the entire resource to be re-created, so that the activation occurs as newly specified. | ||
- `distribute_if_needed` (Boolean) Whether to distribute the image as needed, thus negating the need for a separate `catalystcenter_image_distribution`. Updating this attribute later does not cause image to be re-activated. | ||
- `image_uuid_list` (List of String) The list of UUIDs of the software images to activate. The UUIDs could be obtained for example from `catalystcenter_image.id`. SMU images shouldn't be specified in this list. Changing/adding/removing any UUID causes the entire resource to be re-created, so that the entire activation occurs as newly specified. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The id of the object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "catalystcenter_image_distribution Resource - terraform-provider-catalystcenter" | ||
subcategory: "Software Image Management (SWIM)" | ||
description: |- | ||
This resource can distribute (copy) a software image file to the chosen network device. Every time this resource is created or re-created, the Catalyst Center considers distributying/copying the image onto the device. (Catalyst Center does not however proceed with copying if the image is already present on the device, assuming the operation has succeeded and noting this fact in its audit log.) When this resource is destroyed or updated or refreshed, no actions are done either on CatalystCenter or on devices. In effect, this resource currently cannot be used to undo a distribution of an image. | ||
--- | ||
|
||
# catalystcenter_image_distribution (Resource) | ||
|
||
This resource can distribute (copy) a software image file to the chosen network device. Every time this resource is created or re-created, the Catalyst Center considers distributying/copying the image onto the device. (Catalyst Center does not however proceed with copying if the image is already present on the device, assuming the operation has succeeded and noting this fact in its audit log.) <p/> When this resource is destroyed or updated or refreshed, no actions are done either on CatalystCenter or on devices. In effect, this resource currently cannot be used to undo a distribution of an image. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "catalystcenter_image_distribution" "example" { | ||
device_uuid = "138b3181-f9c5-4271-9292-cf3152ab4d3e" | ||
image_uuid = "faa9c5f7-d093-459a-8164-cc555bbf3b80" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `device_uuid` (String) The UUID of the network device to which to copy the software image file. | ||
- `image_uuid` (String) The UUID of the software image to copy. It could be obtained for example from `catalystcenter_image.id`. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The id of the object |
Oops, something went wrong.