diff --git a/CHANGELOG.md b/CHANGELOG.md index eb343bf6..98ac9e77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,115 @@ # 2.0.0 () +BREAKING CHANGES: + +Cluster +* **Rename Resource:** `netapp-ontap_cluster_licensing_license_resource` is now renamed to `netapp-ontap_cluster_licensing_license` +* **Rename Resource:** `netapp-ontap_cluster_peers_resource` is now renamed to `netapp-ontap_cluster_peer` +* **Rename Resource:** `netapp-ontap_cluster_schedule_resource` is now renamed to `netapp-ontap_cluster_schedule` +* **Rename Data Source:** `netapp-ontap_cluster_licensing_license_data_source` is now renamed to `netapp-ontap_cluster_licensing_license` +* **Rename Data Source:** `netapp-ontap_cluster_licensing_licenses_data_source` is now renamed to `netapp-ontap_cluster_licensing_licenses` +* **Rename Data Source:** `netapp-ontap_cluster_peer_data_source` is now renamed to `netapp-ontap_cluster_peer` +* **Rename Data Source:** `netapp-ontap_cluster_peers_data_source` is now renamed to `netapp-ontap_cluster_peers` +* **Rename Data Source:** `netapp-ontap_cluster_schedule_data_source` is now renamed to `netapp-ontap_cluster_schedule` +* **Rename Data Source:** `netapp-ontap_cluster_schedules_data_source` is now renamed to `netapp-ontap_cluster_schedules` + +Name Services +* **Rename Resource:** `netapp-ontap_name_services_dns_resource` is now renamed to `netapp-ontap_dns` +* **Rename Resource:** `netapp-ontap_name_services_ldap_resource` is now renamed to `netapp-ontap_name_services_ldap` +* **Rename Data Source:** `netapp-ontap_name_services_dns_data_source` is now renamed to `netapp-ontap_dns` +* **Rename Data Source:** `netapp-ontap_name_services_dnss_data_source` is now renamed to `netapp-ontap_dnss` +* **Rename Data Source:** `netapp-ontap_name_services_ldap_data_source` is now renamed to `netapp-ontap_name_services_ldap` +* **Rename Data Source:** `netapp-ontap_name_services_ldaps_data_source` is now renamed to `netapp-ontap_name_services_ldaps` + +Networking +* **Rename Resource:** `netapp-ontap_networking_ip_interface_resource` is now renamed to `netapp-ontap_network_ip_interface` +* **Rename Resource:** `netapp-ontap_networking_ip_route_resource` is now renamed to `netapp-ontap_network_ip_route` +* **Rename Data Source:** `netapp-ontap_networking_ip_interface_data_source` is now renamed to `netapp-ontap_network_ip_interface` +* **Rename Data Source:** `netapp-ontap_networking_ip_interfaces_data_source` is now renamed to `netapp-ontap_network_ip_interfaces` +* **Rename Data Source:** `netapp-ontap_networking_ip_route_data_source` is now renamed to `netapp-ontap_network_ip_route` +* **Rename Data Source:** `netapp-ontap_networking_ip_routes_data_source` is now renamed to `netapp-ontap_network_ip_routes` + +Protocols +* **Rename Resource:** `netapp-ontap_cifs_local_group_member_resource` is now renamed to `netapp-ontap_cifs_local_group_members` +* **Rename Resource:** `netapp-ontap_cifs_local_group_resource` is now renamed to `netapp-ontap_cifs_local_group` +* **Rename Resource:** `netapp-ontap_cifs_local_user_resource` is now renamed to `netapp-ontap_cifs_local_user` +* **Rename Resource:** `netapp-ontap_cifs_service_resource` is now renamed to `netapp-ontap_cifs_service` +* **Rename Resource:** `netapp-ontap_cifs_share_resource` is now renamed to `netapp-ontap_cifs_share` +* **Rename Resource:** `netapp-ontap_cifs_user_group_privilege_resource` is now renamed to `netapp-ontap_cifs_user_group_privileges` +* **Rename Resource:** `netapp-ontap_nfs_export_policy_resource` is now renamed to `netapp-ontap_nfs_export_policy` +* **Rename Resource:** `netapp-ontap_nfs_export_policy_rule_resource` is now renamed to `netapp-ontap_nfs_export_policy_rule` +* **Rename Resource:** `netapp-ontap_nfs_service_resource` is now renamed to `netapp-ontap_nfs_service` +* **Rename Resource:** `netapp-ontap_san_igroup_resource` is now renamed to `netapp-ontap_san_igroup` +* **Rename Resource:** `netapp-ontap_san_lun-maps_resource` is now renamed to `netapp-ontap_san_lun-map` + +* **Rename Data Source:** `netapp-ontap_cifs_local_group_member_data_source` is now renamed to `netapp-ontap_cifs_local_group_member` +* **Rename Data Source:** `netapp-ontap_cifs_local_group_members_data_source` is now renamed to `netapp-ontap_cifs_local_group_members` +* **Rename Data Source:** `netapp-ontap_cifs_local_group_data_source` is now renamed to `netapp-ontap_cifs_local_group` +* **Rename Data Source:** `netapp-ontap_cifs_local_groups_data_source` is now renamed to `netapp-ontap_cifs_local_groups` +* **Rename Data Source:** `netapp-ontap_cifs_local_user_data_source` is now renamed to `netapp-ontap_cifs_local_user` +* **Rename Data Source:** `netapp-ontap_cifs_local_users_data_source` is now renamed to `netapp-ontap_cifs_local_users` +* **Rename Data Source:** `netapp-ontap_cifs_service_data_source` is now renamed to `netapp-ontap_cifs_service` +* **Rename Data Source:** `netapp-ontap_cifs_services_data_source` is now renamed to `netapp-ontap_cifs_services` +* **Rename Data Source:** `netapp-ontap_cifs_share_data_source` is now renamed to `netapp-ontap_cifs_share` +* **Rename Data Source:** `netapp-ontap_cifs_shares_data_source` is now renamed to `netapp-ontap_cifs_shares` +* **Rename Data Source:** `netapp-ontap_cifs_user_group_privilege_data_source` is now renamed to `netapp-ontap_cifs_user_group_privilege` +* **Rename Data Source:** `netapp-ontap_cifs_user_group_privileges_data_source` is now renamed to `netapp-ontap_cifs_user_group_privileges` +* **Rename Data Source:** `netapp-ontap_nfs_export_policy_data_source` is now renamed to `netapp-ontap_nfs_export_policy` +* **Rename Data Source:** `netapp-ontap_nfs_export_policies_data_source` is now renamed to `netapp-ontap_nfs_export_policies` +* **Rename Data Source:** `netapp-ontap_nfs_export_policy_rule_data_source` is now renamed to `netapp-ontap_nfs_export_policy_rule` +* **Rename Data Source:** `netapp-ontap_nfs_export_policy_rules_data_source` is now renamed to `netapp-ontap_nfs_export_policy_rules` +* **Rename Data Source:** `netapp-ontap_nfs_service_data_source` is now renamed to `netapp-ontap_nfs_service` +* **Rename Data Source:** `netapp-ontap_nfs_services_data_source` is now renamed to `netapp-ontap_nfs_services` +* **Rename Data Source:** `netapp-ontap_san_igroup_data_source` is now renamed to `netapp-ontap_san_igroup` +* **Rename Data Source:** `netapp-ontap_san_igroups_data_source` is now renamed to `netapp-ontap_san_igroups` +* **Rename Data Source:** `netapp-ontap_san_lun-map_data_source` is now renamed to `netapp-ontap_san_lun-map` +* **Rename Data Source:** `netapp-ontap_san_lun-maps_data_source` is now renamed to `netapp-ontap_san_lun-maps` + +Security +* **Rename Resource:** `netapp-ontap_security_accounts_resource` is now renamed to `netapp-ontap_security_account` +* **Rename Data Source:** `netapp-ontap_security_account_data_source` is now renamed to `netapp-ontap_security_account` +* **Rename Data Source:** `netapp-ontap_security_accounts_data_source` is now renamed to `netapp-ontap_security_accounts` + +Snapmirror +* **Rename Resource:** `netapp-ontap_snapmirror_resource` is now renamed to `netapp-ontap_snapmirror` +* **Rename Resource:** `netapp-ontap_snapmirror_policy_resource` is now renamed to `netapp-ontap_snapmirror_policy` +* **Rename Data Source:** `netapp-ontap_snapmirror_data_source` is now renamed to `netapp-ontap_snapmirror` +* **Rename Data Source:** `netapp-ontap_snapmirrors_data_source` is now renamed to `netapp-ontap_snapmirrors` +* **Rename Data Source:** `netapp-ontap_snapmirror_policy_data_source` is now renamed to `netapp-ontap_snapmirror_policy` +* **Rename Data Source:** `netapp-ontap_snapmirror_policies_data_source` is now renamed to `netapp-ontap_snapmirror_policies` + +Storage +* **Rename Resource:** `netapp-ontap_aggregate_resource` is now renamed to `netapp-ontap_aggregate` +* **Rename Resource:** `netapp-ontap_flexcache_resource` is now renamed to `netapp-ontap_flexcache` +* **Rename Resource:** `netapp-ontap_lun_resource` is now renamed to `netapp-ontap_lun` +* **Rename Resource:** `netapp-ontap_snapshot_policy_resource` is now renamed to `netapp-ontap_snapshot_policy` +* **Rename Resource:** `netapp-ontap_volume_resource` is now renamed to `netapp-ontap_volume` +* **Rename Resource:** `netapp-ontap_volume_snapshot_resource` is now renamed to `netapp-ontap_volume_snapshot` + +* **Rename Data Source:** `netapp-ontap_aggregate_data_source` is now renamed to `netapp-ontap_aggregate` +* **Rename Data Source:** `netapp-ontap_aggregates_data_source` is now renamed to `netapp-ontap_aggregates` +* **Rename Data Source:** `netapp-ontap_flexcache_data_source` is now renamed to `netapp-ontap_flexcache` +* **Rename Data Source:** `netapp-ontap_flexcaches_data_source` is now renamed to `netapp-ontap_flexcaches` +* **Rename Data Source:** `netapp-ontap_lun_data_source` is now renamed to `netapp-ontap_lun` +* **Rename Data Source:** `netapp-ontap_luns_data_source` is now renamed to `netapp-ontap_luns` +* **Rename Data Source:** `netapp-ontap_snapshot_policy_data_source` is now renamed to `netapp-ontap_snapshot_policy` +* **Rename Data Source:** `netapp-ontap_snapshot_policies_data_source` is now renamed to `netapp-ontap_snapshot_policies` +* **Rename Data Source:** `netapp-ontap_volume_data_source` is now renamed to `netapp-ontap_volume` +* **Rename Data Source:** `netapp-ontap_volumes_data_source` is now renamed to `netapp-ontap_volumes` +* **Rename Data Source:** `netapp-ontap_volume_snapshot_data_source` is now renamed to `netapp-ontap_volume_snapshot` +* **Rename Data Source:** `netapp-ontap_volume_snapshots_data_source` is now renamed to `netapp-ontap_volume_snapshots` + +Svm +* **Rename Resource:** `netapp-ontap_svm_peers_resource` is now renamed to `netapp-ontap_svm_peer` +* **Rename Resource:** `netapp-ontap_svm_resource` is now renamed to `netapp-ontap_svm` +* **Rename Data Source:** `netapp-ontap_svm_peer_data_source` is now renamed to `netapp-ontap_svm_peer` +* **Rename Data Source:** `netapp-ontap_svm_peers_data_source` is now renamed to `netapp-ontap_svm_peers` +* **Rename Data Source:** `netapp-ontap_svm_data_source` is now renamed to `netapp-ontap_svm` +* **Rename Data Source:** `netapp-ontap_svms_data_source` is now renamed to `netapp-ontap_svms` + FEATURES: * **provider**: add `aws_lambda` option. ([#262](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/262)) -* **New Data Source:** `netapp-ontap_volumes_files` ([#8](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/8)) +* **New Data Source:** `netapp-ontap_volume_file` ([#8](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/8)) * **New Data Source:** `netapp-ontap_qos_policy` ([#77](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/77)) * **New Data Source:** `netapp-ontap_qos_policies` ([#77](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/77)) * **New Data Source:** `netapp-ontap_quota_rules` ([#135](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/135)) @@ -11,22 +118,25 @@ FEATURES: * **New Data Source:** `netapp-ontap_security_roles` ([#139](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/139)) * **New Data Source:** `netapp-ontap_security_login_message` ([#17](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/17)) * **New Data Source:** `netapp-ontap_security_login_messages` ([#17](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/17)) -* **New Data Source:** `netapp-ontap_storage_qtree` ([#83](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/83)) -* **New Data Source:** `netapp-ontap_storage_qtrees` ([#83](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/83)) +* **New Data Source:** `netapp-ontap_qtree` ([#83](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/83)) +* **New Data Source:** `netapp-ontap_qtrees` ([#83](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/83)) * **New Data Source:** `netapp-ontap_volume_efficiency_policy` ([#81](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/81)) * **New Data Source:** `netapp-ontap_volume_efficiency_policies` ([#81](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/81)) -* **New Resource:** `netapp-ontap_volume_efficiency_policies` ([#80](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/80)) -* **New Resource:** `netapp-ontap_quota_rules` ([#136](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/136)) -* **New Resource:** `netapp-ontap_volumes_files` ([#5](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/5)) -* **New Resource:** `netapp-ontap_security_roles` ([#140](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/140)) -* **New Resource:** `netapp-ontap_storage_qtrees` ([#82](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/82)) -* **New Resource:** `netapp-ontap_qos_policies` ([#76](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/76)) -* **New Resource:** `netapp-security_login_messages` ([#18](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/18)) +* **New Data Source:** `netapp-ontap_security_certificate` ([#137](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/137)) +* **New Data Source:** `netapp-ontap_security_certificates` ([#137](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/137)) +* **New Resource:** `netapp-ontap_volume_efficiency_policy` ([#80](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/80)) +* **New Resource:** `netapp-ontap_quota_rule` ([#136](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/136)) +* **New Resource:** `netapp-ontap_volume_file` ([#5](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/5)) +* **New Resource:** `netapp-ontap_security_role` ([#140](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/140)) +* **New Resource:** `netapp-ontap_qtree` ([#82](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/82)) +* **New Resource:** `netapp-ontap_qos_policy` ([#76](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/76)) +* **New Resource:** `netapp-security_login_message` ([#18](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/18)) * **New Resource:** `netapp-ontap_security_certificate` ([#138](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/138)) ENHANCEMENTS: * **netapp-ontap_lun**: added `size_unit` option. ([#227](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/227)) * **netapp-ontap_security_account**: Add support for import and update ([#243](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/243)) +* **netapp-ontap_name_services_dns**: Add `skip_config_validation`([#316](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/316)) ## 1.1.4 (2024-09-05) @@ -36,6 +146,7 @@ DOC FIXES: BUG FIXES: * **netapp-ontap_cluster_data_source: fix on nodes to show multiple elements ([#264](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/264)) +* **netapp-ontap_protocols_nfs_export_policy_resource: fix id error during the creation ([[#290](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/290)]) ## 1.1.3 (2024-08-08) diff --git a/docs/data-sources/cluster.md b/docs/data-sources/cluster.md index 2730bb67..11644de8 100644 --- a/docs/data-sources/cluster.md +++ b/docs/data-sources/cluster.md @@ -13,6 +13,10 @@ Retrieve the details of a cluster data source ### Related ONTAP commands cluster show +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cluster" "cluster" { @@ -21,7 +25,6 @@ data "netapp-ontap_cluster" "cluster" { } ``` - ## Schema diff --git a/docs/data-sources/cluster_licensing_license_data_source.md b/docs/data-sources/cluster_licensing_license_data_source.md index 88baac57..31a8de3d 100644 --- a/docs/data-sources/cluster_licensing_license_data_source.md +++ b/docs/data-sources/cluster_licensing_license_data_source.md @@ -7,6 +7,10 @@ description: |- # Netapp Ontap Cluster Licensing License Data Source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ClusterLicensingLicense data source ## Example Usage ```terraform @@ -17,7 +21,6 @@ data "netapp-ontap_cluster_licensing_license" "cluster_licensing_license" { } ``` - ## Schema diff --git a/docs/data-sources/cluster_licensing_licenses_data_source.md b/docs/data-sources/cluster_licensing_licenses_data_source.md index e5a26281..4a27dedd 100644 --- a/docs/data-sources/cluster_licensing_licenses_data_source.md +++ b/docs/data-sources/cluster_licensing_licenses_data_source.md @@ -7,6 +7,10 @@ description: |- # Netapp Ontap Cluster Licensing Licenses Data Source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ClusterLicensingLicenses data source ## Example Usage ```terraform diff --git a/docs/data-sources/cluster_peer_data_source.md b/docs/data-sources/cluster_peer_data_source.md index f1f645a7..023ca24f 100644 --- a/docs/data-sources/cluster_peer_data_source.md +++ b/docs/data-sources/cluster_peer_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves an existing cluster_peer +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cluster_peer" "cluster_peer" { diff --git a/docs/data-sources/cluster_peers_data_source.md b/docs/data-sources/cluster_peers_data_source.md index 2719bd42..0fc0c549 100644 --- a/docs/data-sources/cluster_peers_data_source.md +++ b/docs/data-sources/cluster_peers_data_source.md @@ -6,10 +6,14 @@ description: |- ClusterPeers data source --- -#Data Source cluster_peers +# Data Source cluster_peers Retrieves existing cluster_peers +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cluster_peers" "cluster_peers" { diff --git a/docs/data-sources/cluster_schedule_data_source.md b/docs/data-sources/cluster_schedule_data_source.md index 4d3219bc..d235d884 100644 --- a/docs/data-sources/cluster_schedule_data_source.md +++ b/docs/data-sources/cluster_schedule_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves Cluster Schedule configuration of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cluster_schedule" "cluster_schedule" { diff --git a/docs/data-sources/cluster_schedules_data_source.md b/docs/data-sources/cluster_schedules_data_source.md index 6356d484..b66d3dbc 100644 --- a/docs/data-sources/cluster_schedules_data_source.md +++ b/docs/data-sources/cluster_schedules_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves list of Cluster Schedules configuration of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cluster_schedules" "cluster_schedules" { diff --git a/docs/data-sources/name_services_dns_data_source.md b/docs/data-sources/name_services_dns_data_source.md index 97ae8d3c..2e37693a 100644 --- a/docs/data-sources/name_services_dns_data_source.md +++ b/docs/data-sources/name_services_dns_data_source.md @@ -1,24 +1,27 @@ --- -page_title: "netapp-ontap_name_services_dns Data Source - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_dns Data Source - terraform-provider-netapp-ontap" subcategory: "Name-Services" description: |- Retrieves the DNS Configuration of an SVM. --- -# Data Source name_services_dns +# Data Source dns Retrieves the DNS Configuration of an SVM. +## Supported Platforms +* On-perm ONTAP system 9.9 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform -data "netapp-ontap_name_services_dns" "name_services_dns" { +data "netapp-ontap_dns" "dns" { # required to know which system to interface with cx_profile_name = "cluster4" svm_name = "svm0" } ``` - ## Schema diff --git a/docs/data-sources/name_services_dnss_data_source.md b/docs/data-sources/name_services_dnss_data_source.md index 83cd8b48..381fce6c 100644 --- a/docs/data-sources/name_services_dnss_data_source.md +++ b/docs/data-sources/name_services_dnss_data_source.md @@ -1,17 +1,21 @@ --- -page_title: "netapp-ontap_name_services_dnss Data Source - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_dnss Data Source - terraform-provider-netapp-ontap" subcategory: "Name-Services" description: |- Retrieves the DNSs Configuration of SVMs. --- -# Data Source name_services_dnss +# Data Source dnss Retrieves the DNSs Configuration of an SVMs. +## Supported Platforms +* On-perm ONTAP system 9.9 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform -data "netapp-ontap_name_services_dnss" "name_services_dnss" { +data "netapp-ontap_dnss" "dnss" { # required to know which system to interface with cx_profile_name = "cluster4" filter = { @@ -22,7 +26,6 @@ data "netapp-ontap_name_services_dnss" "name_services_dnss" { } ``` - ## Schema @@ -48,8 +51,8 @@ Optional: - `svm_name` (String) IPInterface svm name. - -### Nested Schema for `name_services_dnss` + +### Nested Schema for `dnss` Required: diff --git a/docs/data-sources/name_services_ldap_data_source.md b/docs/data-sources/name_services_ldap_data_source.md index d349f7c7..a92d12c8 100644 --- a/docs/data-sources/name_services_ldap_data_source.md +++ b/docs/data-sources/name_services_ldap_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieve LDAP data source of a SVM +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_name_services_ldap" "name_services_ldap" { diff --git a/docs/data-sources/name_services_ldaps_data_source.md b/docs/data-sources/name_services_ldaps_data_source.md index ec1e2d9f..4bd72cda 100644 --- a/docs/data-sources/name_services_ldaps_data_source.md +++ b/docs/data-sources/name_services_ldaps_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieve LDAP data source of SVMs +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_name_services_ldaps" "name_services_ldaps" { diff --git a/docs/data-sources/networking_ip_interface_data_source.md b/docs/data-sources/networking_ip_interface_data_source.md index 4a193f68..d958a66c 100644 --- a/docs/data-sources/networking_ip_interface_data_source.md +++ b/docs/data-sources/networking_ip_interface_data_source.md @@ -1,6 +1,6 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_networking_ip_interface Data Source - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_network_ip_interface Data Source - terraform-provider-netapp-ontap" subcategory: "Networking" description: |- Retrieves the details of IP interface of SVMs. @@ -10,16 +10,19 @@ description: |- Retrieves the details of IP interface of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform -data "netapp-ontap_networking_ip_interface" "ip_interface" { +data "netapp-ontap_network_ip_interface" "ip_interface" { # required to know which system to interface with cx_profile_name = "cluster4" name = "cluster_mgmt" } ``` - ## Schema diff --git a/docs/data-sources/networking_ip_interfaces_data_source.md b/docs/data-sources/networking_ip_interfaces_data_source.md index 36527c85..92826fa2 100644 --- a/docs/data-sources/networking_ip_interfaces_data_source.md +++ b/docs/data-sources/networking_ip_interfaces_data_source.md @@ -1,6 +1,6 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_netapp-ontap_networking_ip_interfaces Data Source - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_netapp-ontap_network_ip_interfaces Data Source - terraform-provider-netapp-ontap" subcategory: "Networking" description: |- Retrieves the details of IP interfaces of SVMs. @@ -10,9 +10,13 @@ description: |- Retrieves the details of IP interfaces of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform -data "netapp-ontap_networking_ip_interfaces" "ip_interfaces" { +data "netapp-ontap_network_ip_interfaces" "ip_interfaces" { # required to know which system to interface with cx_profile_name = "cluster4" filter = { @@ -23,7 +27,6 @@ data "netapp-ontap_networking_ip_interfaces" "ip_interfaces" { } ``` - ## Schema diff --git a/docs/data-sources/networking_ip_route_data_source.md b/docs/data-sources/networking_ip_route_data_source.md index 95fa8b8d..55faf5bc 100644 --- a/docs/data-sources/networking_ip_route_data_source.md +++ b/docs/data-sources/networking_ip_route_data_source.md @@ -1,6 +1,6 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_networking_ip_route Data Source - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_network_ip_route Data Source - terraform-provider-netapp-ontap" subcategory: "Networking" description: |- Retrieves the IP route of SVMs. @@ -10,9 +10,13 @@ description: |- Retrieves the IP route of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform -data "netapp-ontap_networking_ip_route" "networking_ip_route" { +data "netapp-ontap_network_ip_route" "network_ip_route" { # required to know which system to interface with cx_profile_name = "cluster4" destination = { @@ -23,7 +27,6 @@ data "netapp-ontap_networking_ip_route" "networking_ip_route" { } ``` - ## Schema diff --git a/docs/data-sources/networking_ip_routes_data_source.md b/docs/data-sources/networking_ip_routes_data_source.md index b8a14f30..072e1abf 100644 --- a/docs/data-sources/networking_ip_routes_data_source.md +++ b/docs/data-sources/networking_ip_routes_data_source.md @@ -1,6 +1,6 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_networking_ip_routes Data Source - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_network_ip_routes Data Source - terraform-provider-netapp-ontap" subcategory: "Networking" description: |- Retrieves the IP routes of SVMs. @@ -10,9 +10,13 @@ description: |- Retrieves the IP routes of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform -data "netapp-ontap_networking_ip_routes" "networking_ip_routes" { +data "netapp-ontap_network_ip_routes" "network_ip_routes" { # required to know which system to interface with cx_profile_name = "cluster4" gateway = "10.10.10.254" @@ -27,7 +31,6 @@ data "netapp-ontap_networking_ip_routes" "networking_ip_routes" { } ``` - ## Schema diff --git a/docs/data-sources/protocols_cifs_local_group_data_source.md b/docs/data-sources/protocols_cifs_local_group_data_source.md index 7118b59b..feeb7d50 100644 --- a/docs/data-sources/protocols_cifs_local_group_data_source.md +++ b/docs/data-sources/protocols_cifs_local_group_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves protocols cifs local group configuration +## Supported Platforms +* On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_local_group" "local_group" { @@ -20,7 +24,6 @@ data "netapp-ontap_cifs_local_group" "local_group" { } ``` - ## Schema diff --git a/docs/data-sources/protocols_cifs_local_group_member_data_source.md b/docs/data-sources/protocols_cifs_local_group_member_data_source.md index 87e0170e..67db5334 100644 --- a/docs/data-sources/protocols_cifs_local_group_member_data_source.md +++ b/docs/data-sources/protocols_cifs_local_group_member_data_source.md @@ -10,6 +10,10 @@ description: |- Retreives protocols cifs local group member configuration +## Supported Platforms +* On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_local_group_member" "protocols_cifs_local_group_member" { diff --git a/docs/data-sources/protocols_cifs_local_group_members_data_source.md b/docs/data-sources/protocols_cifs_local_group_members_data_source.md index 628dcde7..9e52c013 100644 --- a/docs/data-sources/protocols_cifs_local_group_members_data_source.md +++ b/docs/data-sources/protocols_cifs_local_group_members_data_source.md @@ -10,6 +10,10 @@ description: |- Retreives protocols cifs local group members configuration +## Supported Platforms +* On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_local_group_members" "protocols_cifs_local_group_members" { diff --git a/docs/data-sources/protocols_cifs_local_groups_data_source.md b/docs/data-sources/protocols_cifs_local_groups_data_source.md index 10f93820..975894ee 100644 --- a/docs/data-sources/protocols_cifs_local_groups_data_source.md +++ b/docs/data-sources/protocols_cifs_local_groups_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves list of Cifs Local Groups. +## Supported Platforms +* On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_local_groups" "local_groups" { @@ -22,7 +26,6 @@ data "netapp-ontap_cifs_local_groups" "local_groups" { } ``` - ## Schema diff --git a/docs/data-sources/protocols_cifs_local_user_data_source.md b/docs/data-sources/protocols_cifs_local_user_data_source.md index cd09ec80..b9c2ebf5 100644 --- a/docs/data-sources/protocols_cifs_local_user_data_source.md +++ b/docs/data-sources/protocols_cifs_local_user_data_source.md @@ -10,6 +10,10 @@ description: |- Retreives protocols cifs local user configuration +## Supported Platforms +* On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_local_user" "local_user" { diff --git a/docs/data-sources/protocols_cifs_local_users_data_source.md b/docs/data-sources/protocols_cifs_local_users_data_source.md index fd090a24..d4330390 100644 --- a/docs/data-sources/protocols_cifs_local_users_data_source.md +++ b/docs/data-sources/protocols_cifs_local_users_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves a list of Cifs Local Users. +## Supported Platforms +* On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_local_users" "protocols_cifs_local_users" { diff --git a/docs/data-sources/protocols_cifs_service_data_source.md b/docs/data-sources/protocols_cifs_service_data_source.md index 6bab845d..8c002ae3 100644 --- a/docs/data-sources/protocols_cifs_service_data_source.md +++ b/docs/data-sources/protocols_cifs_service_data_source.md @@ -10,6 +10,17 @@ description: |- Retrieves protocols cifs service data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP +* In security, parameters only can be used in ONTAP 9.8 or higher: + `lm_compatibility_level`, `encrypt_dc_connection` +* In security, parameters only can be used in ONTAP 9.10 or higher + `use_ldaps, use_start_tls`, `aes_netlogon_enabled`, `try_ldap_channel_binding`, `ldap_referral_enabled`, `session_security` +* In security, parameters only can be used in ONTAP 9.12 or higher + `advertised_kdc_encryptions` +* In security, `kdc_encryption` deprecated in 9.12.1 + ## Example Usage ```terraform data "netapp-ontap_cifs_service" "protocols_cifs_service" { diff --git a/docs/data-sources/protocols_cifs_services_data_source.md b/docs/data-sources/protocols_cifs_services_data_source.md index 2b8a091a..c873fa7b 100644 --- a/docs/data-sources/protocols_cifs_services_data_source.md +++ b/docs/data-sources/protocols_cifs_services_data_source.md @@ -10,6 +10,17 @@ description: |- Retrieve Cifs Services data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP +* In security, parameters only can be used in ONTAP 9.8 or higher: + `lm_compatibility_level`, `encrypt_dc_connection` +* In security, parameters only can be used in ONTAP 9.10 or higher + `use_ldaps, use_start_tls`, `aes_netlogon_enabled`, `try_ldap_channel_binding`, `ldap_referral_enabled`, `session_security` +* In security, parameters only can be used in ONTAP 9.12 or higher + `advertised_kdc_encryptions` +* In security, `kdc_encryption` deprecated in 9.12.1 + ## Example Usage ```terraform data "netapp-ontap_cifs_services" "protocols_cifs_services" { diff --git a/docs/data-sources/protocols_cifs_share_data_source.md b/docs/data-sources/protocols_cifs_share_data_source.md index c8501107..4b9e589f 100644 --- a/docs/data-sources/protocols_cifs_share_data_source.md +++ b/docs/data-sources/protocols_cifs_share_data_source.md @@ -14,6 +14,10 @@ Retrieves the details of a cifs share * vserver cifs share show * vserver cifs share properties show +## Supported Platforms +* On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_share" "protocols_cifs_share" { diff --git a/docs/data-sources/protocols_cifs_shares_data_source.md b/docs/data-sources/protocols_cifs_shares_data_source.md index eb26ee1b..436fd134 100644 --- a/docs/data-sources/protocols_cifs_shares_data_source.md +++ b/docs/data-sources/protocols_cifs_shares_data_source.md @@ -14,6 +14,10 @@ Retrieves the details of one or more cifs shares by filter * vserver cifs share show * vserver cifs share properties show +## Supported Platforms +* On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_shares" "protocols_cifs_shares" { diff --git a/docs/data-sources/protocols_cifs_user_group_privilege_data_source.md b/docs/data-sources/protocols_cifs_user_group_privilege_data_source.md index e7e3e435..6a4659ff 100644 --- a/docs/data-sources/protocols_cifs_user_group_privilege_data_source.md +++ b/docs/data-sources/protocols_cifs_user_group_privilege_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieve Protocol Cifs User or Group Privilege data source +## Supported Platforms +* On-perm ONTAP system 9.10.1 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_user_group_privilege" "user_privilege" { diff --git a/docs/data-sources/protocols_cifs_user_group_privileges_data_source.md b/docs/data-sources/protocols_cifs_user_group_privileges_data_source.md index fdfc2ef7..a767d9cc 100644 --- a/docs/data-sources/protocols_cifs_user_group_privileges_data_source.md +++ b/docs/data-sources/protocols_cifs_user_group_privileges_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieve Protocol Cifs User or Group Privileges data source +## Supported Platforms +* On-perm ONTAP system 9.10.1 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_cifs_user_group_privileges" "by_name_privileges" { diff --git a/docs/data-sources/protocols_nfs_export_policies_data_source.md b/docs/data-sources/protocols_nfs_export_policies_data_source.md index 42d2d1d7..be7f1992 100644 --- a/docs/data-sources/protocols_nfs_export_policies_data_source.md +++ b/docs/data-sources/protocols_nfs_export_policies_data_source.md @@ -9,6 +9,10 @@ description: |- ExportPolicies data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_nfs_export_policies" "export_policies" { @@ -20,8 +24,6 @@ data "netapp-ontap_nfs_export_policies" "export_policies" { } ``` - - ## Schema diff --git a/docs/data-sources/protocols_nfs_export_policy_data_source.md b/docs/data-sources/protocols_nfs_export_policy_data_source.md index a1c1d872..1f8abee7 100644 --- a/docs/data-sources/protocols_nfs_export_policy_data_source.md +++ b/docs/data-sources/protocols_nfs_export_policy_data_source.md @@ -8,6 +8,11 @@ description: |- # Data source NFS Export Policy NFS Export Policy Data source + +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_nfs_export_policy" "export_policy" { @@ -17,7 +22,6 @@ data "netapp-ontap_nfs_export_policy" "export_policy" { } ``` - ## Schema diff --git a/docs/data-sources/protocols_nfs_export_policy_rule_data_source.md b/docs/data-sources/protocols_nfs_export_policy_rule_data_source.md index f7b89752..9268a41d 100644 --- a/docs/data-sources/protocols_nfs_export_policy_rule_data_source.md +++ b/docs/data-sources/protocols_nfs_export_policy_rule_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves an export policy rule of SVMs +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_nfs_export_policy_rule" "rule" { @@ -20,8 +24,6 @@ data "netapp-ontap_nfs_export_policy_rule" "rule" { } ``` - - ## Schema diff --git a/docs/data-sources/protocols_nfs_export_policy_rules_data_source.md b/docs/data-sources/protocols_nfs_export_policy_rules_data_source.md index e152dac5..b2eb078e 100644 --- a/docs/data-sources/protocols_nfs_export_policy_rules_data_source.md +++ b/docs/data-sources/protocols_nfs_export_policy_rules_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves an export policy rules of SVMs +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_nfs_export_policy_rules" "rules" { @@ -22,8 +26,6 @@ data "netapp-ontap_nfs_export_policy_rules" "rules" { } ``` - - ## Schema diff --git a/docs/data-sources/protocols_nfs_service_data_source.md b/docs/data-sources/protocols_nfs_service_data_source.md index 6f7bcf4d..0088e171 100644 --- a/docs/data-sources/protocols_nfs_service_data_source.md +++ b/docs/data-sources/protocols_nfs_service_data_source.md @@ -9,6 +9,10 @@ description: |- Retrieves the NFS configuration of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_nfs_service" "protcols_nfs_services" { @@ -18,8 +22,6 @@ data "netapp-ontap_nfs_service" "protcols_nfs_services" { } ``` - - ## Argument Reference diff --git a/docs/data-sources/protocols_nfs_services_data_source.md b/docs/data-sources/protocols_nfs_services_data_source.md index 6790e6c3..fe979b22 100644 --- a/docs/data-sources/protocols_nfs_services_data_source.md +++ b/docs/data-sources/protocols_nfs_services_data_source.md @@ -9,6 +9,10 @@ description: |- Retrieves list of NFSs configuration of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_nfs_services" "protocols_nfs_services" { @@ -20,7 +24,6 @@ data "netapp-ontap_nfs_services" "protocols_nfs_services" { } ``` - ## Schema diff --git a/docs/data-sources/protocols_san_igroup_data_source.md b/docs/data-sources/protocols_san_igroup_data_source.md index 25c3e66c..65714f9e 100644 --- a/docs/data-sources/protocols_san_igroup_data_source.md +++ b/docs/data-sources/protocols_san_igroup_data_source.md @@ -10,6 +10,10 @@ description: |- Igroup data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_san_igroup" "protocols_san_igroup" { diff --git a/docs/data-sources/protocols_san_igroups_data_source.md b/docs/data-sources/protocols_san_igroups_data_source.md index 23bc2108..a77cd467 100644 --- a/docs/data-sources/protocols_san_igroups_data_source.md +++ b/docs/data-sources/protocols_san_igroups_data_source.md @@ -10,6 +10,10 @@ description: |- Igroups data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_san_igroups" "protocols_san_igroups" { diff --git a/docs/data-sources/protocols_san_lun-map_data_source.md b/docs/data-sources/protocols_san_lun-map_data_source.md index 3d99a9af..9df3cdcf 100644 --- a/docs/data-sources/protocols_san_lun-map_data_source.md +++ b/docs/data-sources/protocols_san_lun-map_data_source.md @@ -10,6 +10,11 @@ description: |- ProtocolsSanLunMap data source + +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_san_lun-map" "example" { diff --git a/docs/data-sources/protocols_san_lun-maps_data_source.md b/docs/data-sources/protocols_san_lun-maps_data_source.md index 9577ebaf..76274f99 100644 --- a/docs/data-sources/protocols_san_lun-maps_data_source.md +++ b/docs/data-sources/protocols_san_lun-maps_data_source.md @@ -10,6 +10,11 @@ description: |- ProtocolsSanLunMaps data source + +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_san_lun-maps" "example" { diff --git a/docs/data-sources/security_account_data_source.md b/docs/data-sources/security_account_data_source.md index 619e8956..0e17d171 100644 --- a/docs/data-sources/security_account_data_source.md +++ b/docs/data-sources/security_account_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves a ONTAP User +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_security_account" "security_accounts" { @@ -22,8 +26,6 @@ data "netapp-ontap_security_account" "security_accounts" { } ``` - - ## Schema diff --git a/docs/data-sources/security_accounts_data_source.md b/docs/data-sources/security_accounts_data_source.md index df4a3ac8..9374d3cd 100644 --- a/docs/data-sources/security_accounts_data_source.md +++ b/docs/data-sources/security_accounts_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves the configuration of multiple user accounts +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_security_accounts" "security_accounts" { @@ -22,7 +26,6 @@ data "netapp-ontap_security_accounts" "security_accounts" { } ``` - ## Schema diff --git a/docs/data-sources/security_certificate.md b/docs/data-sources/security_certificate.md new file mode 100644 index 00000000..4dfa78bf --- /dev/null +++ b/docs/data-sources/security_certificate.md @@ -0,0 +1,50 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "netapp-ontap_security_certificate Data Source - terraform-provider-netapp-ontap" +subcategory: "Security" +description: |- + Retrieve Security Certificate data source +--- + +# netapp-ontap_security_certificate (Data Source) + +Retrieve Security Certificate data source + +### Related ONTAP commands +* security certificate show + +## Example Usage + +```terraform +# retrieving a certificate using its unique name +data "netapp-ontap_security_certificate" "security_certificate1" { + # required to know which system to interface with + cx_profile_name = "cluster5" + name = "tfsvm_17B9B4C1696136FC" +} +``` + + +## Schema + +### Required + +- `cx_profile_name` (String) Connection profile name +- `name` (String) The unique name of the security certificate per SVM. + +### Optional + +- `svm_name` (String) SVM name in which the certificate is installed. + +### Read-Only + +- `common_name` (String) Common name of the certificate. +- `type` (String) Type of Certificate. +- `ca` (String) Certificate authority. +- `expiry_time` (String) Certificate expiration time, in ISO 8601 duration format or date and time format. +- `hash_function` (String) Hashing function. +- `id` (String) Certificate uuid. +- `key_size` (Number) Key size of the certificate in bits. +- `public_certificate` (String) Public key Certificate in PEM format. +- `scope` (String) Set to 'svm' for certificates installed in a SVM. Otherwise, set to 'cluster'. +- `serial_number` (String) Serial number of certificate. diff --git a/docs/data-sources/security_certificates.md b/docs/data-sources/security_certificates.md new file mode 100644 index 00000000..eb45e364 --- /dev/null +++ b/docs/data-sources/security_certificates.md @@ -0,0 +1,92 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "netapp-ontap_security_certificates Data Source - terraform-provider-netapp-ontap" +subcategory: "Security" +description: |- + Retrieve Security Certificates data source +--- + +# netapp-ontap_security_certificates (Data Source) + +Retrieve Security Certificates data source + +### Related ONTAP commands +* security certificate show + +## Example Usage + +```terraform +# retrieving certificates installed on a specific SVM +data "netapp-ontap_security_certificates" "security_certificates1" { + # required to know which system to interface with + cx_profile_name = "cluster5" + filter = { + scope = "svm" + svm_name = "tfsvm" + } +} + +# retrieving all certificates installed at cluster-scope +data "netapp-ontap_security_certificates" "security_certificates2" { + # required to know which system to interface with + cx_profile_name = "cluster5" + filter = { + scope = "cluster" + } +} + +# retrieving certificate using its common_name and type +data "netapp-ontap_security_certificates" "security_certificates3" { + # required to know which system to interface with + cx_profile_name = "cluster5" + filter = { + common_name = "tfsvm" + type = "server" + } +} +``` + + +## Schema + +### Required + +- `cx_profile_name` (String) Connection profile name + +### Optional + +- `filter` (Attributes) (see [below for nested schema](#nestedatt--filter)) + +### Read-Only + +- `security_certificates` (Attributes List) (see [below for nested schema](#nestedatt--security_certificates)) + + +### Nested Schema for `filter` + +Optional: + +- `scope` (String) Set to 'svm' for certificates installed in a SVM. Otherwise, set to 'cluster'. +- `svm_name` (String) SVM name in which the certificate is installed. +- `common_name` (String) Common name of the certificate. +- `type` (String) Type of certificate. + + + +### Nested Schema for `security_certificates` + +Read-Only: + +- `cx_profile_name` (String) Connection profile name. +- `name` (String) The unique name of the security certificate per SVM. +- `common_name` (String) Common name of the certificate. +- `type` (String) Type of certificate. +- `scope` (String) Set to 'svm' for certificates installed in a SVM. Otherwise, set to 'cluster'. +- `expiry_time` (String) Certificate expiration time, in ISO 8601 duration format or date and time format. +- `hash_function` (String) Hashing function. +- `key_size` (Number) Key size of the certificate in bits. +- `public_certificate` (String) Public key Certificate in PEM format. +- `ca` (String) Certificate authority. +- `serial_number` (String) Serial number of certificate. +- `svm_name` (String) SVM name in which the certificate is installed. +- `id` (String) Certificate uuid. diff --git a/docs/data-sources/security_login_message.md b/docs/data-sources/security_login_message.md index fd109140..ceb711d4 100644 --- a/docs/data-sources/security_login_message.md +++ b/docs/data-sources/security_login_message.md @@ -10,6 +10,10 @@ description: |- Retrieve Security Login Message data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform diff --git a/docs/data-sources/security_login_messages.md b/docs/data-sources/security_login_messages.md index a38519ad..76281538 100644 --- a/docs/data-sources/security_login_messages.md +++ b/docs/data-sources/security_login_messages.md @@ -10,6 +10,10 @@ description: |- Retrieve Security Login Messages data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform diff --git a/docs/data-sources/security_role.md b/docs/data-sources/security_role.md index 0251f69d..07ff0e61 100644 --- a/docs/data-sources/security_role.md +++ b/docs/data-sources/security_role.md @@ -15,6 +15,10 @@ Retrieve a security role * security login role show ``` +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform diff --git a/docs/data-sources/security_roles.md b/docs/data-sources/security_roles.md index 021175fb..7f469ab0 100644 --- a/docs/data-sources/security_roles.md +++ b/docs/data-sources/security_roles.md @@ -15,6 +15,9 @@ Retreive one or more security roles by filter * security login role show ``` +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage diff --git a/docs/data-sources/snapmirror_data_source.md b/docs/data-sources/snapmirror_data_source.md index 7c005fda..857e2076 100644 --- a/docs/data-sources/snapmirror_data_source.md +++ b/docs/data-sources/snapmirror_data_source.md @@ -9,6 +9,10 @@ description: |- Retrieves the snapmirror details +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_snapmirror" "snapmirror" { diff --git a/docs/data-sources/snapmirror_policies_data_source.md b/docs/data-sources/snapmirror_policies_data_source.md index 28a9e754..7007b427 100644 --- a/docs/data-sources/snapmirror_policies_data_source.md +++ b/docs/data-sources/snapmirror_policies_data_source.md @@ -9,6 +9,10 @@ description: |- Retrieves SnapMirror policies of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_snapmirror_policies" "snapmirror_policies" { @@ -20,7 +24,6 @@ data "netapp-ontap_snapmirror_policies" "snapmirror_policies" { } ``` - ## Schema diff --git a/docs/data-sources/snapmirror_policy_data_source.md b/docs/data-sources/snapmirror_policy_data_source.md index a81b9095..24093177 100644 --- a/docs/data-sources/snapmirror_policy_data_source.md +++ b/docs/data-sources/snapmirror_policy_data_source.md @@ -9,6 +9,10 @@ description: |- Retrieves SnapMirror policy of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_snapmirror_policy" "snapmirror_policy" { diff --git a/docs/data-sources/snapmirrors_data_source.md b/docs/data-sources/snapmirrors_data_source.md index 249ebd7a..b439b6d6 100644 --- a/docs/data-sources/snapmirrors_data_source.md +++ b/docs/data-sources/snapmirrors_data_source.md @@ -9,6 +9,10 @@ description: |- Retrieves list of the snapmirrors +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_snapmirrors" "snapmirrors" { diff --git a/docs/data-sources/storage_aggregate_data_source.md b/docs/data-sources/storage_aggregate_data_source.md index cd738c07..0a486440 100644 --- a/docs/data-sources/storage_aggregate_data_source.md +++ b/docs/data-sources/storage_aggregate_data_source.md @@ -9,6 +9,10 @@ description: |- Retrieves the storage aggregation details of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_aggregate" "storage_aggregate" { @@ -18,8 +22,6 @@ data "netapp-ontap_aggregate" "storage_aggregate" { } ``` - - ## Schema diff --git a/docs/data-sources/storage_aggregates_data_source.md b/docs/data-sources/storage_aggregates_data_source.md index 422ee22b..af6f1bb8 100644 --- a/docs/data-sources/storage_aggregates_data_source.md +++ b/docs/data-sources/storage_aggregates_data_source.md @@ -9,6 +9,10 @@ description: |- Retrieves the storage aggregations details of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_aggregates" "storage_aggregates" { @@ -20,8 +24,6 @@ data "netapp-ontap_aggregates" "storage_aggregates" { } ``` - - ## Schema diff --git a/docs/data-sources/storage_flexcache_data_source.md b/docs/data-sources/storage_flexcache_data_source.md index 6717834c..7c6ff16c 100644 --- a/docs/data-sources/storage_flexcache_data_source.md +++ b/docs/data-sources/storage_flexcache_data_source.md @@ -13,6 +13,10 @@ Retrieves the details of a flexcache. ### Related ONTAP commands * volume flexcache show +## Supported Platforms +* On-perm ONTAP system 9.8 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_flexcache" "storage_flexcache" { @@ -23,7 +27,6 @@ data "netapp-ontap_flexcache" "storage_flexcache" { } ``` - ## Schema diff --git a/docs/data-sources/storage_flexcaches_data_source.md b/docs/data-sources/storage_flexcaches_data_source.md index 52e960dc..ce8d73ce 100644 --- a/docs/data-sources/storage_flexcaches_data_source.md +++ b/docs/data-sources/storage_flexcaches_data_source.md @@ -13,6 +13,10 @@ Retrieves the details of one or more flexcaches by filter. ### Related ONTAP commands * volume flexcache show +## Supported Platforms +* On-perm ONTAP system 9.8 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage data "netapp-ontap_flexcaches" "storage_flexcache" { # required to know which system to interface with @@ -24,8 +28,6 @@ data "netapp-ontap_flexcaches" "storage_flexcache" { } ``` - - ## Schema diff --git a/docs/data-sources/storage_lun_data_source.md b/docs/data-sources/storage_lun_data_source.md index 76c545fc..44f6db71 100644 --- a/docs/data-sources/storage_lun_data_source.md +++ b/docs/data-sources/storage_lun_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves existing single lun data +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_lun" "storage_lun" { @@ -25,8 +29,6 @@ data "netapp-ontap_lun" "storage_lun" { } ``` - - ## Schema diff --git a/docs/data-sources/storage_luns_data_source.md b/docs/data-sources/storage_luns_data_source.md index 622394e8..11d712be 100644 --- a/docs/data-sources/storage_luns_data_source.md +++ b/docs/data-sources/storage_luns_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves existing Luns data +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_luns" "storage_luns" { @@ -21,8 +25,6 @@ data "netapp-ontap_luns" "storage_luns" { } ``` - - ## Schema diff --git a/docs/data-sources/storage_qos_policies_data_source.md b/docs/data-sources/storage_qos_policies_data_source.md index b0985d90..88cb9385 100644 --- a/docs/data-sources/storage_qos_policies_data_source.md +++ b/docs/data-sources/storage_qos_policies_data_source.md @@ -10,6 +10,10 @@ description: |- QOSPolicies data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform diff --git a/docs/data-sources/storage_qos_policy_data_source.md b/docs/data-sources/storage_qos_policy_data_source.md index b7de005a..619e6249 100644 --- a/docs/data-sources/storage_qos_policy_data_source.md +++ b/docs/data-sources/storage_qos_policy_data_source.md @@ -10,6 +10,10 @@ description: |- QOSPolicy data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform diff --git a/docs/data-sources/storage_qtree.md b/docs/data-sources/storage_qtree.md index e9be16d3..437064aa 100644 --- a/docs/data-sources/storage_qtree.md +++ b/docs/data-sources/storage_qtree.md @@ -1,19 +1,23 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_storage_qtree Data Source - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_qtree Data Source - terraform-provider-netapp-ontap" subcategory: "" description: |- StorageQtree data source --- -# netapp-ontap_storage_qtree (Data Source) +# netapp-ontap_qtree (Data Source) Retreive a qtree +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform -data "netapp-ontap_storage_qtree" "storage_qtree" { +data "netapp-ontap_qtree" "storage_qtree" { # required to know which system to interface with cx_profile_name = "cluster3" name = "tree10" diff --git a/docs/data-sources/storage_qtrees.md b/docs/data-sources/storage_qtrees.md index d342ead4..db97e2df 100644 --- a/docs/data-sources/storage_qtrees.md +++ b/docs/data-sources/storage_qtrees.md @@ -1,19 +1,23 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_storage_qtrees Data Source - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_qtrees Data Source - terraform-provider-netapp-ontap" subcategory: "" description: |- StorageQtrees data source --- -# netapp-ontap_storage_qtrees (Data Source) +# netapp-ontap_qtrees (Data Source) Retreive one or more qtrees by filter +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform -data "netapp-ontap_storage_qtrees" "storage_qtrees" { +data "netapp-ontap_qtrees" "storage_qtrees" { # required to know which system to interface with cx_profile_name = "cluster3" filter = { diff --git a/docs/data-sources/storage_quota_rule_data_source.md b/docs/data-sources/storage_quota_rule_data_source.md index 925fed43..93a259b3 100644 --- a/docs/data-sources/storage_quota_rule_data_source.md +++ b/docs/data-sources/storage_quota_rule_data_source.md @@ -10,6 +10,10 @@ description: |- QuotaRule data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_quota_rule" "storage_quota_rule" { diff --git a/docs/data-sources/storage_quota_rules_data_source.md b/docs/data-sources/storage_quota_rules_data_source.md index 46a0ff53..415d9ede 100644 --- a/docs/data-sources/storage_quota_rules_data_source.md +++ b/docs/data-sources/storage_quota_rules_data_source.md @@ -10,6 +10,10 @@ description: |- QuotaRules data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_quota_rules" "storage_quota_rules" { diff --git a/docs/data-sources/storage_snapshot_policies_data_source.md b/docs/data-sources/storage_snapshot_policies_data_source.md index 68b4bbcc..49db919e 100644 --- a/docs/data-sources/storage_snapshot_policies_data_source.md +++ b/docs/data-sources/storage_snapshot_policies_data_source.md @@ -9,6 +9,10 @@ description: |- Snapshot Policies data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_snapshot_policies" "storage_snapshot_policies" { @@ -20,7 +24,6 @@ data "netapp-ontap_snapshot_policies" "storage_snapshot_policies" { } ``` - ## Schema diff --git a/docs/data-sources/storage_snapshot_policy_data_source.md b/docs/data-sources/storage_snapshot_policy_data_source.md index f1d9de13..dcf6067e 100644 --- a/docs/data-sources/storage_snapshot_policy_data_source.md +++ b/docs/data-sources/storage_snapshot_policy_data_source.md @@ -9,6 +9,10 @@ description: |- Snapshot Policy data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_snapshot_policy" "storage_snapshot_policy" { @@ -18,7 +22,6 @@ data "netapp-ontap_snapshot_policy" "storage_snapshot_policy" { } ``` - ## Schema diff --git a/docs/data-sources/storage_volume_data_source.md b/docs/data-sources/storage_volume_data_source.md index 0b32b490..009ef37d 100644 --- a/docs/data-sources/storage_volume_data_source.md +++ b/docs/data-sources/storage_volume_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves an existing storage_volume +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_volume" "storage_volume" { @@ -19,8 +23,6 @@ data "netapp-ontap_volume" "storage_volume" { } ``` - - ## Schema diff --git a/docs/data-sources/storage_volume_efficiency_policies.md b/docs/data-sources/storage_volume_efficiency_policies.md index 55d2bc64..8f5e9bf0 100644 --- a/docs/data-sources/storage_volume_efficiency_policies.md +++ b/docs/data-sources/storage_volume_efficiency_policies.md @@ -10,6 +10,10 @@ description: |- VolumeEfficiencyPolicies data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform diff --git a/docs/data-sources/storage_volume_efficiency_policy.md b/docs/data-sources/storage_volume_efficiency_policy.md index 336e8c66..a9c4fd28 100644 --- a/docs/data-sources/storage_volume_efficiency_policy.md +++ b/docs/data-sources/storage_volume_efficiency_policy.md @@ -10,6 +10,10 @@ description: |- VolumeEfficiencyPolicy data source +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform diff --git a/docs/data-sources/storage_volumes_files_data_source.md b/docs/data-sources/storage_volume_files_data_source.md similarity index 74% rename from docs/data-sources/storage_volumes_files_data_source.md rename to docs/data-sources/storage_volume_files_data_source.md index 0c63b1aa..3fc94ea1 100644 --- a/docs/data-sources/storage_volumes_files_data_source.md +++ b/docs/data-sources/storage_volume_files_data_source.md @@ -1,18 +1,22 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_volumes_files Data Source - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_volume_files Data Source - terraform-provider-netapp-ontap" subcategory: "Storage" description: |- - Storage Volumes Files data source + Storage Volume Files data source --- -# netapp-ontap_volumes_files (Data Source) +# netapp-ontap_volume_files (Data Source) -Retrieves an existing storage volumes files +Retrieves an existing storage volume files + +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage ```terraform -data "netapp-ontap_volumes_files" "storage_volumes_files" { +data "netapp-ontap_volume_files" "storage_volume_files" { cx_profile_name = "cluster4" volume_name = "acc_test_peer_root" path = ".snapshot" @@ -20,7 +24,6 @@ data "netapp-ontap_volumes_files" "storage_volumes_files" { } ``` - ## Schema @@ -39,10 +42,10 @@ data "netapp-ontap_volumes_files" "storage_volumes_files" { ### Read-Only -- `storage_volumes_files` (Attributes List) (see [below for nested schema](#nestedatt--storage_volumes_files)) +- `storage_volume_files` (Attributes List) (see [below for nested schema](#nestedatt--storage_volume_files)) - -### Nested Schema for `storage_volumes_files` + +### Nested Schema for `storage_volume_files` Read-Only: diff --git a/docs/data-sources/storage_volume_snapshot_data_source.md b/docs/data-sources/storage_volume_snapshot_data_source.md index 9f4fe38d..a84c4fce 100644 --- a/docs/data-sources/storage_volume_snapshot_data_source.md +++ b/docs/data-sources/storage_volume_snapshot_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves details of a specific volume Snapshot copy +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_volume_snapshot" "snapshot" { @@ -20,8 +24,6 @@ data "netapp-ontap_volume_snapshot" "snapshot" { } ``` - - ## Schema diff --git a/docs/data-sources/storage_volume_snapshots_data_source.md b/docs/data-sources/storage_volume_snapshots_data_source.md index 8ab28d5a..c4a89577 100644 --- a/docs/data-sources/storage_volume_snapshots_data_source.md +++ b/docs/data-sources/storage_volume_snapshots_data_source.md @@ -9,6 +9,11 @@ description: |- # Data Source snapshots Retrieves a collection of volume Snapshot copies + +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_volume_snapshots" "storage_volume_snapshots" { @@ -22,8 +27,6 @@ data "netapp-ontap_volume_snapshots" "storage_volume_snapshots" { } ``` - - ## Schema diff --git a/docs/data-sources/storage_volumes_data_source.md b/docs/data-sources/storage_volumes_data_source.md index f190a218..975e2212 100644 --- a/docs/data-sources/storage_volumes_data_source.md +++ b/docs/data-sources/storage_volumes_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves existing storage_volumes +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_volumes" "storage_volumes" { @@ -21,7 +25,6 @@ data "netapp-ontap_volumes" "storage_volumes" { } ``` - ## Schema diff --git a/docs/data-sources/svm_data_source.md b/docs/data-sources/svm_data_source.md index 62d54f48..44f79f4c 100644 --- a/docs/data-sources/svm_data_source.md +++ b/docs/data-sources/svm_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves the configuration of SVM. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_svm" "svm" { @@ -19,8 +23,6 @@ data "netapp-ontap_svm" "svm" { } ``` - - ## Schema diff --git a/docs/data-sources/svm_peer_data_source.md b/docs/data-sources/svm_peer_data_source.md index cf5d57c5..1df8330b 100644 --- a/docs/data-sources/svm_peer_data_source.md +++ b/docs/data-sources/svm_peer_data_source.md @@ -10,7 +10,9 @@ description: |- Retrieves the configuration of SVM Peer. - +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage ```terraform diff --git a/docs/data-sources/svm_peers_data_source.md b/docs/data-sources/svm_peers_data_source.md index bebc1262..9c43e487 100644 --- a/docs/data-sources/svm_peers_data_source.md +++ b/docs/data-sources/svm_peers_data_source.md @@ -10,7 +10,9 @@ description: |- Retrieves the configuration of SVM Peers. - +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage ```terraform diff --git a/docs/data-sources/svms_data_source.md b/docs/data-sources/svms_data_source.md index 4bae17b8..8008ce21 100644 --- a/docs/data-sources/svms_data_source.md +++ b/docs/data-sources/svms_data_source.md @@ -10,6 +10,10 @@ description: |- Retrieves the configuration of SVMs. +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform data "netapp-ontap_svms" "svms" { @@ -21,8 +25,6 @@ data "netapp-ontap_svms" "svms" { } ``` - - ## Schema diff --git a/docs/guides/aws-config-for-fsx.md b/docs/guides/aws-config-for-fsx.md new file mode 100644 index 00000000..ad562d64 --- /dev/null +++ b/docs/guides/aws-config-for-fsx.md @@ -0,0 +1,49 @@ +--- +page_title: "Setup to use Amazon FSx for Netapp ONTAP via AWS Lambda" +subcategory: "" +description: |- +--- + +# Setup to use Amazon FSx for Netapp ONTAP via AWS Lambda + +This page is specifically for FSx ONTAP system, please skip this part if you are not the target audience. In this provider, AWS Lambda is used as gateway from the client side to communicate with FSx ONTAP, which resides in AWS EC2 instances. + +# Create a Lambda Link +[Create a link](https://docs.netapp.com/us-en/workload-fsx-ontap/create-link.html) and use the link name in the connection profile. + +# Shared config and credentials files +The shared AWS config and credentials files contain a set of profiles. A profile is a set of configuration settings, in key–value pairs, that is used by the AWS Command Line Interface (AWS CLI), the AWS SDKs, and other tools. Configuration values are attached to a profile in order to configure some aspect of the SDK/tool when that profile is used. These files are "shared" in that the values take affect for any applications, processes, or SDKs on the local environment for a user. +[AWS shared config and credentials file format](https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html) +[AWS shared config and credentials file location](https://docs.aws.amazon.com/sdkref/latest/guide/file-location.html) + +You must setup credentials files to use Fsx ONTAP. +Example of AWS credentials file +[fsx] +aws_access_key_id = +aws_secret_access_key = + +You can either specify `region` in the `connection_profiles` or in the AWS config files. If both palces have region set up, the region in the Terraform config file will be used. The profile name must be the same in both AWS config and credentials files. +Example of region dlecaration in AWS config profile +[profile fsx] +region = us-east-1 + +# Construct connection profiles +``` +provider "netapp-ontap" { + # A connection profile defines how to interface with an ONTAP cluster or svm. + # At least one is required. + connection_profiles = [ + { + name = "fsx" + hostname = "aws.management.endpoint.com" #the management endpoints for the FSxN system. + username = "admin" + password = "Password" + aws = { + function_name = "lambda_link_name" + region = "aws_region" + shared_config_profile = "fsx" + } + } + ] +} +``` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 506a6dd0..42a75813 100644 --- a/docs/index.md +++ b/docs/index.md @@ -97,8 +97,8 @@ Optional: Required: - `shared_config_profile` (String) AWS shared config profile. Region set in the profile will be ignored it it's different from the region set in Terraform. aws_access_key_id and aws_secret_access_key are required to be set in credentials +- `function_name` (String) AWS Lambda function name Optional: -- `function_name` (String) AWS Lambda function name - `region` (String) AWS region. diff --git a/docs/resources/cluster_licensing_license_resource.md b/docs/resources/cluster_licensing_license_resource.md index d9b2e571..f1bc3461 100644 --- a/docs/resources/cluster_licensing_license_resource.md +++ b/docs/resources/cluster_licensing_license_resource.md @@ -18,6 +18,7 @@ Add/Remove License from ONTAP ## Supported Platforms * On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage Example when using a license string diff --git a/docs/resources/cluster_peers_resource.md b/docs/resources/cluster_peer_resource.md similarity index 89% rename from docs/resources/cluster_peers_resource.md rename to docs/resources/cluster_peer_resource.md index da8f333f..db3769c8 100644 --- a/docs/resources/cluster_peers_resource.md +++ b/docs/resources/cluster_peer_resource.md @@ -1,11 +1,11 @@ --- -page_title: "ONTAP: Cluster Peers" +page_title: "ONTAP: Cluster Peer" subcategory: "Cluster" description: |- - Cluster peers resource + Cluster peer resource --- -# Resource Cluster Peers +# Resource Cluster Peer Create/Modify/Delete a cluster peer. @@ -23,7 +23,7 @@ Create/Modify/Delete a cluster peer. ## Example Usage ``` -resource "netapp-ontap_cluster_peers" "cluster_peers" { +resource "netapp-ontap_cluster_peer" "cluster_peer" { # required to know which system to interface with cx_profile_name = "cluster3" name = "testme" @@ -50,7 +50,7 @@ resource "netapp-ontap_cluster_peers" "cluster_peers" { ### Optional - `passphrase` (String) User generated passphrase for use in authentication -- `generate_passphrase` (String) When true, ONTAP automatically generates a passphrase to authenticate cluster peers +- `generate_passphrase` (String) When true, ONTAP automatically generates a passphrase to authenticate cluster peer - `name` (String) Name of the peering relationship or name of the remote peer - `peer_applications` (String) SVM peering applications - `peer_cx_profile_name` (String) Peer connection profile name, to be accepted from peer side to make the status OK @@ -86,7 +86,7 @@ Import require a unique ID composed of the cluster name and cx_profile_name, sep For example ```shell - terraform import netapp-ontap_cluster_peers.example clutername-1,cluster4 + terraform import netapp-ontap_cluster_peer.example clutername-1,cluster4 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -97,7 +97,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_cluster_peers.example.cluster_import + to = netapp-ontap_cluster_peer.example.cluster_import id = "clutername-1,cluster4" } ``` @@ -110,7 +110,7 @@ This will generate a file called generated.tf, which will contain the configurat # __generated__ by Terraform # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "clutername-1,cluster4" -resource "netapp-ontap_cluster_peers.example" "cluster_peers_import" { +resource "netapp-ontap_cluster_peer.example" "cluster_peer_import" { cx_profile_name = "cluster3" name = "test" generate_passphrase = false diff --git a/docs/resources/name_services_dns_resource.md b/docs/resources/name_services_dns_resource.md index 8e3050a1..798c43e4 100644 --- a/docs/resources/name_services_dns_resource.md +++ b/docs/resources/name_services_dns_resource.md @@ -3,7 +3,7 @@ page_title: "ONTAP: DNS" subcategory: "Name-Services" description: |- - NameServicesDNS resource + DNS resource --- # Resource DNS @@ -19,14 +19,12 @@ Create/Modify/Delete and Import a name services DNS resource ``` ## Supported Platforms -* On-perm ONTAP system 9.6 or higher +* On-perm ONTAP system 9.9 or higher * Amazon FSx for NetApp ONTAP -[comment]: <> (TODO: Add support for Amazon FSx for NetApp ONTAP ) - ## Example Usage ```terraform -resource "netapp-ontap_name_services_dns" "name_services_dns" { +resource "netapp-ontap_dns" "dns" { # required to know which system to interface with cx_profile_name = "cluster4" svm_name = "testSVM" @@ -47,6 +45,7 @@ resource "netapp-ontap_name_services_dns" "name_services_dns" { - `dns_domains` (Set of String) List of DNS domains such as 'sales.bar.com'. The first domain is the one that the svm belongs to - `name_servers` (Set of String) List of IPv4 addresses of name servers such as '123.123.123.123'. +- `skip_config_validation` (Bool) Indicates whether or not the validation for the specified DNS configuration is disabled. (9.9) ### Read-Only @@ -58,14 +57,14 @@ Import require a unique ID composed of the svm name and the connection profile n id = svm_name,cx_profile_name ### Terraform import -terraform import netapp-ontap_name_services_dns.`name` `svm_name`,`cx_profile_name` +terraform import netapp-ontap_dns.`name` `svm_name`,`cx_profile_name` * name -- name you want to give the resource in terraform * svm_name -- name of the svm the resource belongs to * cx_profile_name -- name of the connection profile to use For example ```shell - terraform import netapp-ontap_name_services_dns.dns_import ansibleSVM,cluster4 + terraform import netapp-ontap_dns.dns_import ansibleSVM,cluster4 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -76,7 +75,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the import block ```terraform import { - to = netapp-ontap_name_services_dns.dns_import + to = netapp-ontap_dns.dns_import id = "svm1,cluster4" } ``` @@ -90,7 +89,7 @@ The auto generated configuration will look like this # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "svm1,cluster4" -resource "netapp-ontap_name_services_dns" "dns_import" { +resource "netapp-ontap_dns" "dns_import" { cx_profile_name = "cluster4" dns_domains = ["test.com", "test1.com"] name_servers = ["1.2.3.4", "3.4.5.6"] diff --git a/docs/resources/networking_ip_interface_resource.md b/docs/resources/network_ip_interface_resource.md similarity index 91% rename from docs/resources/networking_ip_interface_resource.md rename to docs/resources/network_ip_interface_resource.md index d4a9df72..b81a8864 100644 --- a/docs/resources/networking_ip_interface_resource.md +++ b/docs/resources/network_ip_interface_resource.md @@ -24,7 +24,7 @@ Create/Update/Delete an IPInterface resource ## Example Usage ```terraform -resource "netapp-ontap_networking_ip_interface" "example" { +resource "netapp-ontap_network_ip_interface" "example" { cx_profile_name = "cluster4" name = "test-interface" svm_name = "carchi-test" @@ -80,7 +80,7 @@ Import require a unique ID composed of the interface name, svm_name and cx_profi ### Terraform Import For example ```shell - terraform import netapp-ontap_networking_ip_interface.example if1,svm1,cluster4 + terraform import netapp-ontap_network_ip_interface.example if1,svm1,cluster4 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -91,7 +91,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_networking_ip_interface.if_import + to = netapp-ontap_network_ip_interface.if_import id = "if1,svm1,cluster4" } ``` @@ -104,7 +104,7 @@ This will generate a file called generated.tf, which will contain the configurat # __generated__ by Terraform # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "if1,svm1,cluster4" -resource "netapp-ontap_networking_ip_interface" "if1_import" { +resource "netapp-ontap_network_ip_interface" "if1_import" { cx_profile_name = "cluster4" name = "if1" svm_name = "svm1" diff --git a/docs/resources/networking_ip_route_resource.md b/docs/resources/network_ip_route_resource.md similarity index 95% rename from docs/resources/networking_ip_route_resource.md rename to docs/resources/network_ip_route_resource.md index 711b95f5..0aa83fad 100644 --- a/docs/resources/networking_ip_route_resource.md +++ b/docs/resources/network_ip_route_resource.md @@ -23,7 +23,7 @@ Create/Delete an IP Route resource ## Example Usage ```terraform -resource "netapp-ontap_networking_ip_route" "networking_ip_route" { +resource "netapp-ontap_network_ip_route" "network_ip_route" { # required to know which system to interface with cx_profile_name = "cluster4" svm_name = "ansibleSVM" diff --git a/docs/resources/protocols_cifs_local_group_member_resource.md b/docs/resources/protocols_cifs_local_group_members_resource.md similarity index 59% rename from docs/resources/protocols_cifs_local_group_member_resource.md rename to docs/resources/protocols_cifs_local_group_members_resource.md index 2a1682f0..3d61285a 100644 --- a/docs/resources/protocols_cifs_local_group_member_resource.md +++ b/docs/resources/protocols_cifs_local_group_members_resource.md @@ -1,29 +1,31 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_cifs_local_group_member Resource - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_cifs_local_group_members Resource - terraform-provider-netapp-ontap" subcategory: "NAS" description: |- - CifsLocalGroupMember resource + CifsLocalGroupMembers resource --- -# Resource Protocols Cifs Local Group Mmember +# Resource Protocols Cifs Local Group Mmembers -Create/Read/Delete a member in a local group resource +Create/Read/Delete one or more members in a local group resource -~> **NOTE:** This module does not support member modification +~> **NOTE:** This module does not support members modification ### Related ONTAP commands ```commandline * vserver cifs users-and-groups local-group add-members * vserver cifs users-and-groups local-group remove-members ``` + ## Supported Platforms * On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage ```terraform -resource "netapp-ontap_cifs_local_group_member" "protocols_cifs_local_group_member" { +resource "netapp-ontap_cifs_local_group_members" "protocols_cifs_local_group_members" { # required to know which system to interface with cx_profile_name = "cluster4" group_name = "SVM_SERVER\\testme" @@ -37,12 +39,12 @@ resource "netapp-ontap_cifs_local_group_member" "protocols_cifs_local_group_memb ### Required - `cx_profile_name` (String) Connection profile name -- `svm_name` (String) CifsLocalGroupMember svm name -- `group_name` (String) CifsLocalGroupMember name +- `svm_name` (String) CifsLocalGroupMembers svm name +- `group_name` (String) CifsLocalGroupMembers name - `member` (String) Member name. Local user, Active Directory user, or Active Directory group which is a member of the specified local group. ### Read-Only -- `id` (String) CifsLocalGroupMember ID +- `id` (String) CifsLocalGroupMembers ID diff --git a/docs/resources/protocols_cifs_share_resource.md b/docs/resources/protocols_cifs_share_resource.md index 74f89d8e..cec9044f 100644 --- a/docs/resources/protocols_cifs_share_resource.md +++ b/docs/resources/protocols_cifs_share_resource.md @@ -15,6 +15,10 @@ vserver cifs share create vserver cifs share properties add vserver cifs share access-control create +## Supported Platforms +* On-perm ONTAP system 9.10 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform diff --git a/docs/resources/protocols_cifs_user_group_privilege_resource.md b/docs/resources/protocols_cifs_user_group_privileges_resource.md similarity index 75% rename from docs/resources/protocols_cifs_user_group_privilege_resource.md rename to docs/resources/protocols_cifs_user_group_privileges_resource.md index 1a0791e9..ab82996b 100644 --- a/docs/resources/protocols_cifs_user_group_privilege_resource.md +++ b/docs/resources/protocols_cifs_user_group_privileges_resource.md @@ -1,13 +1,13 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "ONTAP: Protocol Cifs User Group Privilege" +page_title: "ONTAP: Protocol Cifs User Group Privileges" subcategory: "NAS" description: |- - CifsUserGroupPrivilege resource + CifsUserGroupPrivileges resource --- -# Resource Protocol Cifs User Group Privilege -Create, Modify, Delete and Import protocols cifs user local privilege resource +# Resource Protocol Cifs User Group Privileges +Create, Modify, Delete and Import protocols cifs user local privileges resource ### Related ONTAP commands ```commandline @@ -18,11 +18,12 @@ vserver cifs users-and-groups privilege reset-privilege ## Supported Platforms * On-perm ONTAP system 9.10.1 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage ```terraform -# Create Protocols Cifs User Group Privilege -resource "netapp-ontap_cifs_user_group_privilege" "user_group_privilege_exp1" { +# Create Protocols Cifs User Group Privileges +resource "netapp-ontap_cifs_user_group_privileges" "user_group_privileges_exp1" { # required to know which system to interface with cx_profile_name = "cluster4" name = "test" @@ -30,7 +31,7 @@ resource "netapp-ontap_cifs_user_group_privilege" "user_group_privilege_exp1" { privileges = ["setcbprivilege", "sesecurityprivilege"] } -resource "netapp-ontap_cifs_user_group_privilege" "user_group_privilege_exp2" { +resource "netapp-ontap_cifs_user_group_privileges" "user_group_privileges_exp2" { # required to know which system to interface with cx_profile_name = "cluster4" name = "testlower" diff --git a/docs/resources/protocols_san_lun-maps_resource.md b/docs/resources/protocols_san_lun-map_resource.md similarity index 71% rename from docs/resources/protocols_san_lun-maps_resource.md rename to docs/resources/protocols_san_lun-map_resource.md index 65d1791c..71a74684 100644 --- a/docs/resources/protocols_san_lun-maps_resource.md +++ b/docs/resources/protocols_san_lun-map_resource.md @@ -1,14 +1,14 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_san_lun-maps Resource - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_san_lun-map Resource - terraform-provider-netapp-ontap" subcategory: "NAS" description: |- - ProtocolsSanLunMaps resource + ProtocolsSanLunMap resource --- -# netapp-ontap_san_lun-maps (Resource) +# netapp-ontap_san_lun-map (Resource) -Create/Delete a protocols_san_lun-maps resource +Create/Delete a protocols_san_lun-map resource ### Related ONTAP commands ```commandline @@ -23,7 +23,7 @@ Create/Delete a protocols_san_lun-maps resource ## Example Usage ``` # Create a protocols_san_lun -resource "netapp-ontap_san_lun-maps" "protocols_san_lun" { +resource "netapp-ontap_san_lun-map" "protocols_san_lun" { # required to know which system to interface with cx_profile_name = "cluster2" svm = { @@ -45,9 +45,9 @@ resource "netapp-ontap_san_lun-maps" "protocols_san_lun" { ### Required - `cx_profile_name` (String) Connection profile name -- `igroup` (Attributes) SVM details for ProtocolsSanLunMaps (see [below for nested schema](#nestedatt--igroup)) -- `lun` (Attributes) SVM details for ProtocolsSanLunMaps (see [below for nested schema](#nestedatt--lun)) -- `svm` (Attributes) SVM details for ProtocolsSanLunMaps (see [below for nested schema](#nestedatt--svm)) +- `igroup` (Attributes) SVM details for ProtocolsSanLunMap (see [below for nested schema](#nestedatt--igroup)) +- `lun` (Attributes) SVM details for ProtocolsSanLunMap (see [below for nested schema](#nestedatt--lun)) +- `svm` (Attributes) SVM details for ProtocolsSanLunMap (see [below for nested schema](#nestedatt--svm)) ### Optional @@ -55,7 +55,7 @@ resource "netapp-ontap_san_lun-maps" "protocols_san_lun" { ### Read-Only -- `id` (String) ProtocolsSanLunMaps igroup and lun UUID +- `id` (String) ProtocolsSanLunMap igroup and lun UUID ### Nested Schema for `igroup` @@ -81,8 +81,8 @@ Required: - `name` (String) name of the SVM ## Import -This resource supports import, which allows you to import existing protocols_san_lun-maps into the state of this resource. -Import require a unique ID composed of the protocols_san_lun-maps svm_name, igroup_name, lun_name and connection profile, separated by a comma. +This resource supports import, which allows you to import existing protocols_san_lun-map into the state of this resource. +Import require a unique ID composed of the protocols_san_lun-map svm_name, igroup_name, lun_name and connection profile, separated by a comma. id = `svm.name`, `igroup.name`, `lun.name`, `cx_profile_name` @@ -90,7 +90,7 @@ id = `svm.name`, `igroup.name`, `lun.name`, `cx_profile_name` For example ```shell - terraform import netapp-ontap_san_lun-maps.example svm_name,igroup_name,lun_name,cluster5 + terraform import netapp-ontap_san_lun-map.example svm_name,igroup_name,lun_name,cluster5 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -100,7 +100,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_san_lun-maps.protocols_san_lun_import + to = netapp-ontap_san_lun-map.protocols_san_lun_import id = "svm_name,igroup_name,lun_name,cluster5" } ``` @@ -113,7 +113,7 @@ This will generate a file called generated.tf, which will contain the configurat # __generated__ by Terraform # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "svm_name,igroup_name,lun_name,cluster5" -resource "netapp-ontap_san_lun-maps" "protocols_san_lun_import" { +resource "netapp-ontap_san_lun-map" "protocols_san_lun_import" { cx_profile_name = "cluster4" id = "abcd" igroup = { diff --git a/docs/resources/security_account_resource.md b/docs/resources/security_account_resource.md index cce653d0..396c378a 100644 --- a/docs/resources/security_account_resource.md +++ b/docs/resources/security_account_resource.md @@ -1,9 +1,9 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_security_accounts Resource - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_security_account Resource - terraform-provider-netapp-ontap" subcategory: "Security" description: |- - SecurityAccounts resource + SecurityAccount resource --- # Resource Security Account @@ -27,7 +27,7 @@ Create/Modify/Delete a ONTAP user account ## Example Usage ```terraform -resource "netapp-ontap_security_accounts" "security_account" { +resource "netapp-ontap_security_account" "security_account" { # required to know which system to interface with cx_profile_name = "cluster4" name = "carchitest" @@ -103,7 +103,7 @@ id = `name`, `cx_profile_name` For example ```shell - terraform import netapp-ontap_security_accounts.act_import acc_user,cluster4 + terraform import netapp-ontap_security_account.act_import acc_user,cluster4 ``` ### Terraform Import Block @@ -112,7 +112,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_security_accounts.act_import + to = netapp-ontap_security_account.act_import id = "acc_user,cluster4" } ``` @@ -125,7 +125,7 @@ This will generate a file called generated.tf, which will contain the configurat # __generated__ by Terraform # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "acc_user,cluster4" -resource "netapp-ontap_security_accounts" "act_import" { +resource "netapp-ontap_security_account" "act_import" { cx_profile_name = "cluster4" name = "acc_user" applications = [ diff --git a/docs/resources/security_login_message.md b/docs/resources/security_login_message.md index d22d3834..cfd3b47c 100644 --- a/docs/resources/security_login_message.md +++ b/docs/resources/security_login_message.md @@ -1,6 +1,6 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_security_login_messages Resource - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_security_login_message Resource - terraform-provider-netapp-ontap" subcategory: "Security" description: |- SecurityLoginMessage resource @@ -9,7 +9,7 @@ description: |- # Resource security login message Update/Import Security Login Message -The `security_login_messages` resource does not support creation or deletion operations. Users must first import the existing resource and then perform updates as needed. +The `security_login_message` resource does not support creation or deletion operations. Users must first import the existing resource and then perform updates as needed. ### Related ONTAP commands ```commandline @@ -21,11 +21,12 @@ The `security_login_messages` resource does not support creation or deletion ope ## Supported Platforms * On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage ```terraform -resource "netapp-ontap_security_login_messages" "msg_import_cluster" { +resource "netapp-ontap_security_login_message" "msg_import_cluster" { banner = "test banner" cx_profile_name = "cluster4" message = "test message" @@ -33,7 +34,7 @@ resource "netapp-ontap_security_login_messages" "msg_import_cluster" { show_cluster_message = true } -resource "netapp-ontap_security_login_messages" "msg_import_svm" { +resource "netapp-ontap_security_login_message" "msg_import_svm" { banner = "test banner" cx_profile_name = "cluster4" message = "test message" @@ -67,11 +68,11 @@ resource "netapp-ontap_security_login_messages" "msg_import_svm" { For example Import with cluster info only ```shell - terraform import netapp-ontap_security_login_messages.cluster_import cluster4 + terraform import netapp-ontap_security_login_message.cluster_import cluster4 ``` Import with svm and cluster info ```shell - terraform import netapp-ontap_security_login_messages.svm_import svm1,cluster4 + terraform import netapp-ontap_security_login_message.svm_import svm1,cluster4 ``` ### Terraform Import Block @@ -80,7 +81,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block. Use import svm message as an example ```terraform import { - to = netapp-ontap_security_login_messages.svm_import + to = netapp-ontap_security_login_message.svm_import id = "svm1,cluster4" } ``` @@ -93,7 +94,7 @@ This will generate a file called generated.tf, which will contain the configurat # __generated__ by Terraform # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "svm1,cluster4" -resource "netapp-ontap_security_login_messages" "msg_import_svm" { +resource "netapp-ontap_security_login_message" "msg_import_svm" { banner = "test banner" cx_profile_name = "cluster4" message = "test message\n12345" @@ -101,4 +102,4 @@ resource "netapp-ontap_security_login_messages" "msg_import_svm" { show_cluster_message = true svm_name = "svm1" } -``` \ No newline at end of file +``` diff --git a/docs/resources/security_roles.md b/docs/resources/security_roles.md index 94837baa..1d10a450 100644 --- a/docs/resources/security_roles.md +++ b/docs/resources/security_roles.md @@ -12,6 +12,7 @@ Create/Modify/Delete a Security role ## Supported Platforms * On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage diff --git a/docs/resources/storage_aggregate_resource.md b/docs/resources/storage_aggregate_resource.md index d8841374..cb961f1f 100644 --- a/docs/resources/storage_aggregate_resource.md +++ b/docs/resources/storage_aggregate_resource.md @@ -20,8 +20,6 @@ Create/Modify/Delete an aggregate resource * On-perm ONTAP system 9.6 or higher * Amazon FSx for NetApp ONTAP -[comment]: <> (TODO: Add support for Amazon FSx for NetApp ONTAP ) - ## Example Usage ```terraform diff --git a/docs/resources/storage_flexcache_resource.md b/docs/resources/storage_flexcache_resource.md index 29e7008b..02fca32c 100644 --- a/docs/resources/storage_flexcache_resource.md +++ b/docs/resources/storage_flexcache_resource.md @@ -16,6 +16,7 @@ Flexcache resource * volume flexcache prepopulate start * volume flexcache delete ``` + ## Supported Platforms * On-perm ONTAP system 9.8 or higher * Amazon FSx for NetApp ONTAP diff --git a/docs/resources/storage_lun_resource.md b/docs/resources/storage_lun_resource.md index 14c2c5cf..21fb077a 100644 --- a/docs/resources/storage_lun_resource.md +++ b/docs/resources/storage_lun_resource.md @@ -37,7 +37,6 @@ resource "netapp-ontap_lun" "storage_lun" { ``` - ## Schema diff --git a/docs/resources/storage_qos_policies_resource.md b/docs/resources/storage_qos_policy_resource.md similarity index 83% rename from docs/resources/storage_qos_policies_resource.md rename to docs/resources/storage_qos_policy_resource.md index bbaf61f2..831aa42a 100644 --- a/docs/resources/storage_qos_policies_resource.md +++ b/docs/resources/storage_qos_policy_resource.md @@ -1,14 +1,14 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_qos_policies Resource - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_qos_policy Resource - terraform-provider-netapp-ontap" subcategory: "Storage" description: |- - QOSPolicies resource + QOSPolicy resource --- -# netapp-ontap_qos_policies (Resource) +# netapp-ontap_qos_policy (Resource) -Create/Modify/Delete a QOSPolicies resource +Create/Modify/Delete a QOSPolicy resource ### Related ONTAP commands ```commandline @@ -20,10 +20,14 @@ Create/Modify/Delete a QOSPolicies resource * qos adaptive-policy-group delete ``` +## Supported Platforms +* On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP + ## Example Usage ```terraform -resource "netapp-ontap_qos_policies" "qos_policies" { +resource "netapp-ontap_qos_policy" "qos_policy" { # required to know which system to interface with cx_profile_name = "cluster1" name = "terraform2" @@ -40,8 +44,8 @@ resource "netapp-ontap_qos_policies" "qos_policies" { ### Required - `cx_profile_name` (String) Connection profile name -- `name` (String) QOSPolicies name -- `svm_name` (String) QOSPolicies svm name +- `name` (String) QOSPolicy name +- `svm_name` (String) QOSPolicy svm name ### Optional @@ -51,7 +55,7 @@ resource "netapp-ontap_qos_policies" "qos_policies" { ### Read-Only -- `id` (String) QOSPolicies UUID +- `id` (String) QOSPolicy UUID ### Nested Schema for `adaptive` @@ -81,7 +85,7 @@ Optional: - `min_throughput_mbps` (Number) Minimum throughput in MBPS ## Import -This Resource supports import, which allows you to import existing qos policies into the state of this resoruce. +This Resource supports import, which allows you to import existing qos policy into the state of this resoruce. Import require a unique ID composed of the name, svm name and cx_profile_name, separated by a comma. id = `name`, `svm_name`, `cx_profile_name` @@ -90,7 +94,7 @@ id = `name`, `svm_name`, `cx_profile_name` For example ```shell - terraform import netapp-ontap_qos_policies.example name,svm,cluster4 + terraform import netapp-ontap_qos_policy.example name,svm,cluster4 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -101,7 +105,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_qos_policies.qos_policies + to = netapp-ontap_qos_policy.qos_policy id = "name,svm,cluster4" } ``` @@ -115,7 +119,7 @@ This will generate a file called generated.tf, which will contain the configurat # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "vol,svm,tree,test,cluster4" -resource "netapp-ontap_qos_policies" "qos_policies" { +resource "netapp-ontap_qos_policy" "qos_policy" { cx_profile_name = "cluster4" id = "abcd" adaptive = { diff --git a/docs/resources/storage_qtrees.md b/docs/resources/storage_qtree.md similarity index 89% rename from docs/resources/storage_qtrees.md rename to docs/resources/storage_qtree.md index 286e66b3..e0078ccc 100644 --- a/docs/resources/storage_qtrees.md +++ b/docs/resources/storage_qtree.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_storage_qtrees Resource - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_qtree Resource - terraform-provider-netapp-ontap" subcategory: "" description: |- - StorageQtree resource + Qtree resource --- -# netapp-ontap_storage_qtrees (Resource) +# netapp-ontap_qtree (Resource) Create/modify/delete a storage qtree @@ -20,11 +20,12 @@ Create/modify/delete a storage qtree ## Supported Platforms * On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage ```terraform -resource "netapp-ontap_storage_qtrees" "storage_qtree" { +resource "netapp-ontap_qtree" "storage_qtree" { # required to know which system to interface with cx_profile_name = "cluster3" name = "testme5" @@ -103,7 +104,7 @@ Import require a unique ID composed of the qtree name, volume_name, svm_name and ### Terraform Import For example ```shell - terraform import netapp-ontap_storage_qtrees.example qtree1,volume1,svm1,cluster1 + terraform import netapp-ontap_qtree.example qtree1,volume1,svm1,cluster1 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -114,7 +115,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_storage_qtrees.qtree_import + to = netapp-ontap_qtree.qtree_import id = "qtree1,volume1,svm1,cluster1" } ``` @@ -127,7 +128,7 @@ This will generate a file called generated.tf, which will contain the configurat # __generated__ by Terraform # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "qtree1,volume1,svm1,cluster1" -resource "netapp-ontap_storage_qtrees" "qtree1_import" { +resource "netapp-ontap_qtree" "qtree1_import" { cx_profile_name = "cluster1" name = "qtree1" volume_name = "volume1" diff --git a/docs/resources/storage_quota_rules_resource.md b/docs/resources/storage_quota_rule_resource.md similarity index 90% rename from docs/resources/storage_quota_rules_resource.md rename to docs/resources/storage_quota_rule_resource.md index 99eac160..efe4e52c 100644 --- a/docs/resources/storage_quota_rules_resource.md +++ b/docs/resources/storage_quota_rule_resource.md @@ -1,14 +1,14 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_quota_rules Resource - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_quota_rule Resource - terraform-provider-netapp-ontap" subcategory: "Storage" description: |- - StorageQuotaRules resource + StorageQuotaRule resource --- -# Resource Quota Rules +# Resource Quota Rule -Create/Modify/Delete a quota rules resource +Create/Modify/Delete a quota rule resource ### Related ONTAP commands ```commandline @@ -19,11 +19,12 @@ Create/Modify/Delete a quota rules resource ## Supported Platforms * On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage ```terraform -resource "netapp-ontap_quota_rules" "storage_quota_rules" { +resource "netapp-ontap_quota_rule" "storage_quota_rule" { # required to know which system to interface with cx_profile_name = "cluster2" volume = { @@ -123,7 +124,7 @@ id = `name`,`volume_name`, `svm_name`, `cx_profile_name` For example ```shell - terraform import netapp-ontap_quota_rules.example vol,svm,tree,test,cluster4 + terraform import netapp-ontap_quota_rule.example vol,svm,tree,test,cluster4 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -134,7 +135,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_quota_rules.lun_import + to = netapp-ontap_quota_rule.lun_import id = "vol,svm,tree,test,cluster4" } ``` @@ -148,7 +149,7 @@ This will generate a file called generated.tf, which will contain the configurat # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "vol,svm,tree,test,cluster4" -resource "netapp-ontap_quota_rules" "storage_quota_rules" { +resource "netapp-ontap_quota_rule" "storage_quota_rule" { cx_profile_name = "cluster4" files = { hard_limit = 100 diff --git a/docs/resources/storage_volume_efficiency_policies.md b/docs/resources/storage_volume_efficiency_policy.md similarity index 68% rename from docs/resources/storage_volume_efficiency_policies.md rename to docs/resources/storage_volume_efficiency_policy.md index 3f457c84..f005defd 100644 --- a/docs/resources/storage_volume_efficiency_policies.md +++ b/docs/resources/storage_volume_efficiency_policy.md @@ -1,14 +1,14 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_volume_efficiency_policies Resource - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_volume_efficiency_policy Resource - terraform-provider-netapp-ontap" subcategory: "Storage" description: |- - VolumeEfficiencyPolicies resource + VolumeEfficiencyPolicy resource --- -# netapp-ontap_volume_efficiency_policies (Resource) +# netapp-ontap_volume_efficiency_policy (Resource) -Create/Modify/Delete a VolumeEfficiencyPolicies resource +Create/Modify/Delete a VolumeEfficiencyPolicy resource ### Related ONTAP commands ```commandline @@ -24,7 +24,7 @@ Create/Modify/Delete a VolumeEfficiencyPolicies resource ## Example Usage ```terraform -resource "netapp-ontap_volume_efficiency_policies" "storage_volume_efficiency_policy" { +resource "netapp-ontap_volume_efficiency_policy" "storage_volume_efficiency_policy" { # required to know which system to interface with cx_profile_name = "cluster4" name = "ACC-import" @@ -42,22 +42,22 @@ resource "netapp-ontap_volume_efficiency_policies" "storage_volume_efficiency_po ### Required - `cx_profile_name` (String) Connection profile name -- `name` (String) StorageVolumeEfficiencyPolicies name -- `svm` (Attributes) SVM details for StorageVolumeEfficiencyPolicies (see [below for nested schema](#nestedatt--svm)) +- `name` (String) StorageVolumeEfficiencyPolicy name +- `svm` (Attributes) SVM details for StorageVolumeEfficiencyPolicy (see [below for nested schema](#nestedatt--svm)) ### Optional -- `comment` (String) StorageVolumeEfficiencyPolicies duration -- `duration` (Number) StorageVolumeEfficiencyPolicies duration -- `enabled` (Boolean) StorageVolumeEfficiencyPolicies duration -- `qos_policy` (String) StorageVolumeEfficiencyPolicies duration -- `schedule` (Attributes) schedule details for StorageVolumeEfficiencyPolicies (see [below for nested schema](#nestedatt--schedule)) -- `start_threshold_percent` (Number) StorageVolumeEfficiencyPolicies duration -- `type` (String) StorageVolumeEfficiencyPolicies type +- `comment` (String) StorageVolumeEfficiencyPolicy duration +- `duration` (Number) StorageVolumeEfficiencyPolicy duration +- `enabled` (Boolean) StorageVolumeEfficiencyPolicy duration +- `qos_policy` (String) StorageVolumeEfficiencyPolicy duration +- `schedule` (Attributes) schedule details for StorageVolumeEfficiencyPolicy (see [below for nested schema](#nestedatt--schedule)) +- `start_threshold_percent` (Number) StorageVolumeEfficiencyPolicy duration +- `type` (String) StorageVolumeEfficiencyPolicy type ### Read-Only -- `id` (String) StorageVolumeEfficiencyPolicies UUID +- `id` (String) StorageVolumeEfficiencyPolicy UUID ### Nested Schema for `svm` @@ -84,7 +84,7 @@ id = `name`, `svm_name`, `cx_profile_name` For example ```shell - terraform import netapp-ontap_volume_efficiency_policies.example name,svm,cluster4 + terraform import netapp-ontap_volume_efficiency_policy.example name,svm,cluster4 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -95,7 +95,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_volume_efficiency_policies.volume_efficiency_policies_import + to = netapp-ontap_volume_efficiency_policy.volume_efficiency_policy_import id = "name,svm,cluster4" } ``` @@ -109,7 +109,7 @@ This will generate a file called generated.tf, which will contain the configurat # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "ACC-import,test,cluster4" -resource "netapp-ontap_volume_efficiency_policies" "volume_efficiency_policies_import" { +resource "netapp-ontap_volume_efficiency_policy" "volume_efficiency_policy_import" { cx_profile_name = "cluster4" name = "ACC-import" qos_policy = "background" diff --git a/docs/resources/storage_volumes_files_resource.md b/docs/resources/storage_volume_file_resource.md similarity index 83% rename from docs/resources/storage_volumes_files_resource.md rename to docs/resources/storage_volume_file_resource.md index 7efd4a9f..2569004a 100644 --- a/docs/resources/storage_volumes_files_resource.md +++ b/docs/resources/storage_volume_file_resource.md @@ -1,22 +1,23 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "netapp-ontap_volumes_files Resource - terraform-provider-netapp-ontap" +page_title: "netapp-ontap_volume_file Resource - terraform-provider-netapp-ontap" subcategory: "Storage" description: |- - VolumesFiles resource + VolumeFile resource --- -# netapp-ontap_volumes_files (Resource) +# netapp-ontap_volume_file (Resource) -Create/Modify/Delete a VolumesFiles resource +Create/Modify/Delete a VolumeFile resource ## Supported Platforms * On-perm ONTAP system 9.6 or higher +* Amazon FSx for NetApp ONTAP ## Example Usage ```terraform -resource "netapp-ontap_volumes_files" "volumes_files" { +resource "netapp-ontap_volume_file" "volume_files" { # required to know which system to interface with cx_profile_name = "cluster1" path = "vol4" @@ -47,7 +48,7 @@ resource "netapp-ontap_volumes_files" "volumes_files" { ### Read-Only -- `id` (String) VolumesFiles path is used as ID here +- `id` (String) VolumeFile path is used as ID here - `size` (Number) The size of the file or directory ## Import @@ -60,7 +61,7 @@ Import require a unique ID composed of the volume_name, svm_name, path and cx_pr For example ```shell - terraform import netapp-ontap_volumes_files.example vol2,svm1,path,cluster4 + terraform import netapp-ontap_volume_file.example vol2,svm1,path,cluster4 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -71,7 +72,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_volumes_files.files_import + to = netapp-ontap_volume_file.files_import id = "vol1,svm1,path,cluster4" } ``` @@ -84,7 +85,7 @@ This will generate a file called generated.tf, which will contain the configurat # __generated__ by Terraform # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "vol1,svm1,vol3,cluster4" -resource "netapp-ontap_volumes_files" "files_import" { +resource "netapp-ontap_volume_file" "files_import" { cx_profile_name = "cluster4" volume_name = "vol1" svm_name = "svm1" diff --git a/docs/resources/svm_peers_resource.md b/docs/resources/svm_peer_resource.md similarity index 91% rename from docs/resources/svm_peers_resource.md rename to docs/resources/svm_peer_resource.md index 821350ae..dfaa795d 100644 --- a/docs/resources/svm_peers_resource.md +++ b/docs/resources/svm_peer_resource.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "ONTAP: SVM Peers" +page_title: "ONTAP: SVM Peer" subcategory: "SVM" description: |- Svm resource --- -# Resource SVMPeers +# Resource SVMPeer Create/Modify/Delete a SVMPeer @@ -25,7 +25,7 @@ Create/Modify/Delete a SVMPeer ## Example Usage ```terraform -resource "netapp-ontap_svm_peers" "example" { +resource "netapp-ontap_svm_peer" "example" { cx_profile_name = "cluster4" svm = { name = "test" @@ -93,7 +93,7 @@ id = `svm_name`,`peer_svm_name`,`peer_cluster_name`,`cx_profile_name` For example ```shell - terraform import netapp-ontap_svm_peers.example svm1,peer_svm,test-1,cluster4 + terraform import netapp-ontap_svm_peer.example svm1,peer_svm,test-1,cluster4 ``` !> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. @@ -103,7 +103,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo First create the block ```terraform import { - to = netapp-ontap_svm_peers.svm_import + to = netapp-ontap_svm_peer.svm_import id = "svm1,peer_svm,test-1,cluster4" } ``` @@ -116,7 +116,7 @@ This will generate a file called generated.tf, which will contain the configurat # __generated__ by Terraform # Please review these resources and move them into your main configuration files. # __generated__ by Terraform from "svm1_root,svm1,cluster4" -resource "netapp-ontap_svm_peers" "svm_peers_import" { +resource "netapp-ontap_svm_peer" "svm_peer_import" { svm = { name = "svm1" } diff --git a/examples/data-sources/netapp-ontap_aggregate/provider.tf b/examples/data-sources/netapp-ontap_aggregate/provider.tf deleted file mode 100644 index 9abcaafb..00000000 --- a/examples/data-sources/netapp-ontap_aggregate/provider.tf +++ /dev/null @@ -1,44 +0,0 @@ -terraform { - required_providers { - netapp-ontap = { - source = "NetApp/netapp-ontap" - version = "0.0.1" - } - } -} - - -provider "netapp-ontap" { - # A connection profile defines how to interface with an ONTAP cluster or svm. - # At least one is required. - connection_profiles = [ - { - name = "cluster1" - hostname = "********219" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster2" - hostname = "********222" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster3" - hostname = "10.193.176.159" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster4" - hostname = "10.193.180.108" - username = var.username - password = var.password - validate_certs = var.validate_certs - } - ] -} diff --git a/examples/data-sources/netapp-ontap_aggregate/provider.tf b/examples/data-sources/netapp-ontap_aggregate/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/data-sources/netapp-ontap_aggregate/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/data-sources/netapp-ontap_cifs_local_group_members/data-source.tf b/examples/data-sources/netapp-ontap_cifs_local_group_members/data-source.tf index 84e104b8..40fe201d 100644 --- a/examples/data-sources/netapp-ontap_cifs_local_group_members/data-source.tf +++ b/examples/data-sources/netapp-ontap_cifs_local_group_members/data-source.tf @@ -4,3 +4,4 @@ data "netapp-ontap_cifs_local_group_members" "protocols_cifs_local_group_members svm_name = "test3" group_name = "testme" } + diff --git a/examples/data-sources/netapp-ontap_cifs_local_groups/data-source.tf b/examples/data-sources/netapp-ontap_cifs_local_groups/data-source.tf index 54a5e68e..a02af0ca 100644 --- a/examples/data-sources/netapp-ontap_cifs_local_groups/data-source.tf +++ b/examples/data-sources/netapp-ontap_cifs_local_groups/data-source.tf @@ -6,3 +6,4 @@ data "netapp-ontap_cifs_local_groups" "protocols_cifs_local_groups" { name = "Administrators" } } + diff --git a/examples/data-sources/netapp-ontap_cifs_local_groups/terraform.tfvars b/examples/data-sources/netapp-ontap_cifs_local_groups/terraform.tfvars deleted file mode 100644 index d36beb44..00000000 --- a/examples/data-sources/netapp-ontap_cifs_local_groups/terraform.tfvars +++ /dev/null @@ -1,3 +0,0 @@ -username = "admin" -password = "xxxxxxxxx" -validate_certs = true diff --git a/examples/data-sources/netapp-ontap_cifs_local_groups/terraform.tfvars b/examples/data-sources/netapp-ontap_cifs_local_groups/terraform.tfvars new file mode 120000 index 00000000..8d9d1c96 --- /dev/null +++ b/examples/data-sources/netapp-ontap_cifs_local_groups/terraform.tfvars @@ -0,0 +1 @@ +../../provider/terraform.tfvars \ No newline at end of file diff --git a/examples/data-sources/netapp-ontap_cifs_user_group_privileges/data-source.tf b/examples/data-sources/netapp-ontap_cifs_user_group_privileges/data-source.tf index 3b7e1cfb..dbcc8ff1 100644 --- a/examples/data-sources/netapp-ontap_cifs_user_group_privileges/data-source.tf +++ b/examples/data-sources/netapp-ontap_cifs_user_group_privileges/data-source.tf @@ -5,4 +5,4 @@ data "netapp-ontap_cifs_user_group_privileges" "protocols_cifs_user_group_privil # name = "user1" svm_name = "ansibleSVM" } -} +} \ No newline at end of file diff --git a/examples/data-sources/netapp-ontap_cluster/provider.tf b/examples/data-sources/netapp-ontap_cluster/provider.tf deleted file mode 100644 index 9abcaafb..00000000 --- a/examples/data-sources/netapp-ontap_cluster/provider.tf +++ /dev/null @@ -1,44 +0,0 @@ -terraform { - required_providers { - netapp-ontap = { - source = "NetApp/netapp-ontap" - version = "0.0.1" - } - } -} - - -provider "netapp-ontap" { - # A connection profile defines how to interface with an ONTAP cluster or svm. - # At least one is required. - connection_profiles = [ - { - name = "cluster1" - hostname = "********219" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster2" - hostname = "********222" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster3" - hostname = "10.193.176.159" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster4" - hostname = "10.193.180.108" - username = var.username - password = var.password - validate_certs = var.validate_certs - } - ] -} diff --git a/examples/data-sources/netapp-ontap_cluster/provider.tf b/examples/data-sources/netapp-ontap_cluster/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/data-sources/netapp-ontap_cluster/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/data-sources/netapp-ontap_cluster/terraform.tfvars b/examples/data-sources/netapp-ontap_cluster/terraform.tfvars deleted file mode 100644 index d36beb44..00000000 --- a/examples/data-sources/netapp-ontap_cluster/terraform.tfvars +++ /dev/null @@ -1,3 +0,0 @@ -username = "admin" -password = "xxxxxxxxx" -validate_certs = true diff --git a/examples/data-sources/netapp-ontap_cluster/terraform.tfvars b/examples/data-sources/netapp-ontap_cluster/terraform.tfvars new file mode 120000 index 00000000..8d9d1c96 --- /dev/null +++ b/examples/data-sources/netapp-ontap_cluster/terraform.tfvars @@ -0,0 +1 @@ +../../provider/terraform.tfvars \ No newline at end of file diff --git a/examples/data-sources/netapp-ontap_cluster_licensing_licenses/provider.tf b/examples/data-sources/netapp-ontap_cluster_licensing_licenses/provider.tf deleted file mode 100644 index 9abcaafb..00000000 --- a/examples/data-sources/netapp-ontap_cluster_licensing_licenses/provider.tf +++ /dev/null @@ -1,44 +0,0 @@ -terraform { - required_providers { - netapp-ontap = { - source = "NetApp/netapp-ontap" - version = "0.0.1" - } - } -} - - -provider "netapp-ontap" { - # A connection profile defines how to interface with an ONTAP cluster or svm. - # At least one is required. - connection_profiles = [ - { - name = "cluster1" - hostname = "********219" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster2" - hostname = "********222" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster3" - hostname = "10.193.176.159" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster4" - hostname = "10.193.180.108" - username = var.username - password = var.password - validate_certs = var.validate_certs - } - ] -} diff --git a/examples/data-sources/netapp-ontap_cluster_licensing_licenses/provider.tf b/examples/data-sources/netapp-ontap_cluster_licensing_licenses/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/data-sources/netapp-ontap_cluster_licensing_licenses/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/data-sources/netapp-ontap_cluster_schedules/provider.tf b/examples/data-sources/netapp-ontap_cluster_schedules/provider.tf deleted file mode 100644 index 9abcaafb..00000000 --- a/examples/data-sources/netapp-ontap_cluster_schedules/provider.tf +++ /dev/null @@ -1,44 +0,0 @@ -terraform { - required_providers { - netapp-ontap = { - source = "NetApp/netapp-ontap" - version = "0.0.1" - } - } -} - - -provider "netapp-ontap" { - # A connection profile defines how to interface with an ONTAP cluster or svm. - # At least one is required. - connection_profiles = [ - { - name = "cluster1" - hostname = "********219" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster2" - hostname = "********222" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster3" - hostname = "10.193.176.159" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster4" - hostname = "10.193.180.108" - username = var.username - password = var.password - validate_certs = var.validate_certs - } - ] -} diff --git a/examples/data-sources/netapp-ontap_cluster_schedules/provider.tf b/examples/data-sources/netapp-ontap_cluster_schedules/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/data-sources/netapp-ontap_cluster_schedules/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/data-sources/netapp-ontap_name_services_dns/data-source.tf b/examples/data-sources/netapp-ontap_name_services_dns/data-source.tf index a2c06e6e..0474ef34 100644 --- a/examples/data-sources/netapp-ontap_name_services_dns/data-source.tf +++ b/examples/data-sources/netapp-ontap_name_services_dns/data-source.tf @@ -1,4 +1,4 @@ -data "netapp-ontap_name_services_dns" "name_services_dns" { +data "netapp-ontap_dns" "dns" { # required to know which system to interface with cx_profile_name = "cluster4" svm_name = "svm0" diff --git a/examples/data-sources/netapp-ontap_name_services_dnss/data-source.tf b/examples/data-sources/netapp-ontap_name_services_dnss/data-source.tf index ca5935fd..dcb5c75b 100644 --- a/examples/data-sources/netapp-ontap_name_services_dnss/data-source.tf +++ b/examples/data-sources/netapp-ontap_name_services_dnss/data-source.tf @@ -1,4 +1,4 @@ -data "netapp-ontap_name_services_dnss" "name_services_dnss" { +data "netapp-ontap_dnss" "dnss" { # required to know which system to interface with cx_profile_name = "cluster4" filter = { diff --git a/examples/data-sources/netapp-ontap_networking_ip_interface/data-source.tf b/examples/data-sources/netapp-ontap_network_ip_interface/data-source.tf similarity index 64% rename from examples/data-sources/netapp-ontap_networking_ip_interface/data-source.tf rename to examples/data-sources/netapp-ontap_network_ip_interface/data-source.tf index c5ce0bb1..2b00adf1 100644 --- a/examples/data-sources/netapp-ontap_networking_ip_interface/data-source.tf +++ b/examples/data-sources/netapp-ontap_network_ip_interface/data-source.tf @@ -1,4 +1,4 @@ -data "netapp-ontap_networking_ip_interface" "ip_interface" { +data "netapp-ontap_network_ip_interface" "ip_interface" { # required to know which system to interface with cx_profile_name = "cluster4" name = "cluster_mgmt" diff --git a/examples/data-sources/netapp-ontap_networking_ip_interface/provider.tf b/examples/data-sources/netapp-ontap_network_ip_interface/provider.tf similarity index 100% rename from examples/data-sources/netapp-ontap_networking_ip_interface/provider.tf rename to examples/data-sources/netapp-ontap_network_ip_interface/provider.tf diff --git a/examples/data-sources/netapp-ontap_networking_ip_interface/variables.tf b/examples/data-sources/netapp-ontap_network_ip_interface/variables.tf similarity index 100% rename from examples/data-sources/netapp-ontap_networking_ip_interface/variables.tf rename to examples/data-sources/netapp-ontap_network_ip_interface/variables.tf diff --git a/examples/data-sources/netapp-ontap_networking_ip_interfaces/data-source.tf b/examples/data-sources/netapp-ontap_network_ip_interfaces/data-source.tf similarity index 71% rename from examples/data-sources/netapp-ontap_networking_ip_interfaces/data-source.tf rename to examples/data-sources/netapp-ontap_network_ip_interfaces/data-source.tf index 61e263c0..5809ddb0 100644 --- a/examples/data-sources/netapp-ontap_networking_ip_interfaces/data-source.tf +++ b/examples/data-sources/netapp-ontap_network_ip_interfaces/data-source.tf @@ -1,4 +1,4 @@ -data "netapp-ontap_networking_ip_interfaces" "ip_interfaces" { +data "netapp-ontap_network_ip_interfaces" "ip_interfaces" { # required to know which system to interface with cx_profile_name = "cluster4" filter = { diff --git a/examples/data-sources/netapp-ontap_networking_ip_interfaces/provider.tf b/examples/data-sources/netapp-ontap_network_ip_interfaces/provider.tf similarity index 100% rename from examples/data-sources/netapp-ontap_networking_ip_interfaces/provider.tf rename to examples/data-sources/netapp-ontap_network_ip_interfaces/provider.tf diff --git a/examples/data-sources/netapp-ontap_networking_ip_interfaces/variables.tf b/examples/data-sources/netapp-ontap_network_ip_interfaces/variables.tf similarity index 100% rename from examples/data-sources/netapp-ontap_networking_ip_interfaces/variables.tf rename to examples/data-sources/netapp-ontap_network_ip_interfaces/variables.tf diff --git a/examples/data-sources/netapp-ontap_networking_ip_route/data-source.tf b/examples/data-sources/netapp-ontap_network_ip_route/data-source.tf similarity index 74% rename from examples/data-sources/netapp-ontap_networking_ip_route/data-source.tf rename to examples/data-sources/netapp-ontap_network_ip_route/data-source.tf index 45e5df2b..72a57e00 100644 --- a/examples/data-sources/netapp-ontap_networking_ip_route/data-source.tf +++ b/examples/data-sources/netapp-ontap_network_ip_route/data-source.tf @@ -1,4 +1,4 @@ -data "netapp-ontap_networking_ip_route" "networking_ip_route" { +data "netapp-ontap_network_ip_route" "network_ip_route" { # required to know which system to interface with cx_profile_name = "cluster4" destination = { diff --git a/examples/data-sources/netapp-ontap_networking_ip_route/provider.tf b/examples/data-sources/netapp-ontap_network_ip_route/provider.tf similarity index 100% rename from examples/data-sources/netapp-ontap_networking_ip_route/provider.tf rename to examples/data-sources/netapp-ontap_network_ip_route/provider.tf diff --git a/examples/data-sources/netapp-ontap_networking_ip_route/variables.tf b/examples/data-sources/netapp-ontap_network_ip_route/variables.tf similarity index 100% rename from examples/data-sources/netapp-ontap_networking_ip_route/variables.tf rename to examples/data-sources/netapp-ontap_network_ip_route/variables.tf diff --git a/examples/data-sources/netapp-ontap_networking_ip_routes/data-source.tf b/examples/data-sources/netapp-ontap_network_ip_routes/data-source.tf similarity index 78% rename from examples/data-sources/netapp-ontap_networking_ip_routes/data-source.tf rename to examples/data-sources/netapp-ontap_network_ip_routes/data-source.tf index 132a70a4..9b8ca8f4 100644 --- a/examples/data-sources/netapp-ontap_networking_ip_routes/data-source.tf +++ b/examples/data-sources/netapp-ontap_network_ip_routes/data-source.tf @@ -1,4 +1,4 @@ -data "netapp-ontap_networking_ip_routes" "networking_ip_routes" { +data "netapp-ontap_network_ip_routes" "network_ip_routes" { # required to know which system to interface with cx_profile_name = "cluster4" gateway = "10.10.10.254" diff --git a/examples/data-sources/netapp-ontap_networking_ip_routes/provider.tf b/examples/data-sources/netapp-ontap_network_ip_routes/provider.tf similarity index 100% rename from examples/data-sources/netapp-ontap_networking_ip_routes/provider.tf rename to examples/data-sources/netapp-ontap_network_ip_routes/provider.tf diff --git a/examples/data-sources/netapp-ontap_networking_ip_routes/variables.tf b/examples/data-sources/netapp-ontap_network_ip_routes/variables.tf similarity index 100% rename from examples/data-sources/netapp-ontap_networking_ip_routes/variables.tf rename to examples/data-sources/netapp-ontap_network_ip_routes/variables.tf diff --git a/examples/data-sources/netapp-ontap_nfs_export_policies/data-source.tf b/examples/data-sources/netapp-ontap_nfs_export_policies/data-source.tf index 9b36740b..cd650c43 100644 --- a/examples/data-sources/netapp-ontap_nfs_export_policies/data-source.tf +++ b/examples/data-sources/netapp-ontap_nfs_export_policies/data-source.tf @@ -4,4 +4,4 @@ data "netapp-ontap_nfs_export_policies" "export_policies" { #name = "default" svm_name = "svm*" } -} \ No newline at end of file +} diff --git a/examples/data-sources/netapp-ontap_nfs_export_policy_rules/provider.tf b/examples/data-sources/netapp-ontap_nfs_export_policy_rules/provider.tf deleted file mode 100644 index 9abcaafb..00000000 --- a/examples/data-sources/netapp-ontap_nfs_export_policy_rules/provider.tf +++ /dev/null @@ -1,44 +0,0 @@ -terraform { - required_providers { - netapp-ontap = { - source = "NetApp/netapp-ontap" - version = "0.0.1" - } - } -} - - -provider "netapp-ontap" { - # A connection profile defines how to interface with an ONTAP cluster or svm. - # At least one is required. - connection_profiles = [ - { - name = "cluster1" - hostname = "********219" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster2" - hostname = "********222" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster3" - hostname = "10.193.176.159" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster4" - hostname = "10.193.180.108" - username = var.username - password = var.password - validate_certs = var.validate_certs - } - ] -} diff --git a/examples/data-sources/netapp-ontap_nfs_export_policy_rules/provider.tf b/examples/data-sources/netapp-ontap_nfs_export_policy_rules/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/data-sources/netapp-ontap_nfs_export_policy_rules/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/data-sources/netapp-ontap_nfs_services/provider.tf b/examples/data-sources/netapp-ontap_nfs_services/provider.tf deleted file mode 100644 index 9abcaafb..00000000 --- a/examples/data-sources/netapp-ontap_nfs_services/provider.tf +++ /dev/null @@ -1,44 +0,0 @@ -terraform { - required_providers { - netapp-ontap = { - source = "NetApp/netapp-ontap" - version = "0.0.1" - } - } -} - - -provider "netapp-ontap" { - # A connection profile defines how to interface with an ONTAP cluster or svm. - # At least one is required. - connection_profiles = [ - { - name = "cluster1" - hostname = "********219" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster2" - hostname = "********222" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster3" - hostname = "10.193.176.159" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster4" - hostname = "10.193.180.108" - username = var.username - password = var.password - validate_certs = var.validate_certs - } - ] -} diff --git a/examples/data-sources/netapp-ontap_nfs_services/provider.tf b/examples/data-sources/netapp-ontap_nfs_services/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/data-sources/netapp-ontap_nfs_services/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/data-sources/netapp-ontap_security_accounts/data-source.tf b/examples/data-sources/netapp-ontap_security_accounts/data-source.tf index f7f09a2b..526ac547 100644 --- a/examples/data-sources/netapp-ontap_security_accounts/data-source.tf +++ b/examples/data-sources/netapp-ontap_security_accounts/data-source.tf @@ -30,4 +30,3 @@ data "netapp-ontap_security_accounts" "security_accounts4" { svm_name = "carchi-test" } } - diff --git a/examples/data-sources/netapp-ontap_security_certificate/data-source.tf b/examples/data-sources/netapp-ontap_security_certificate/data-source.tf new file mode 100644 index 00000000..38c07eb4 --- /dev/null +++ b/examples/data-sources/netapp-ontap_security_certificate/data-source.tf @@ -0,0 +1,6 @@ +# retrieving a certificate using its unique name +data "netapp-ontap_security_certificate" "security_certificate1" { + # required to know which system to interface with + cx_profile_name = "cluster5" + name = "tfsvm_ca_cert1" +} diff --git a/examples/data-sources/netapp-ontap_storage_volumes_files/provider.tf b/examples/data-sources/netapp-ontap_security_certificate/provider.tf similarity index 100% rename from examples/data-sources/netapp-ontap_storage_volumes_files/provider.tf rename to examples/data-sources/netapp-ontap_security_certificate/provider.tf diff --git a/examples/data-sources/netapp-ontap_storage_volumes_files/variables.tf b/examples/data-sources/netapp-ontap_security_certificate/variables.tf similarity index 100% rename from examples/data-sources/netapp-ontap_storage_volumes_files/variables.tf rename to examples/data-sources/netapp-ontap_security_certificate/variables.tf diff --git a/examples/data-sources/netapp-ontap_security_certificates/data-source.tf b/examples/data-sources/netapp-ontap_security_certificates/data-source.tf new file mode 100644 index 00000000..2b755222 --- /dev/null +++ b/examples/data-sources/netapp-ontap_security_certificates/data-source.tf @@ -0,0 +1,28 @@ +# retrieving certificates installed on a specific SVM +data "netapp-ontap_security_certificates" "security_certificates1" { + # required to know which system to interface with + cx_profile_name = "cluster5" + filter = { + scope = "svm" + svm_name = "tfsvm" + } +} + +# retrieving all certificates installed at cluster-scope +data "netapp-ontap_security_certificates" "security_certificates2" { + # required to know which system to interface with + cx_profile_name = "cluster5" + filter = { + scope = "cluster" + } +} + +# retrieving certificate using its common_name and type +data "netapp-ontap_security_certificates" "security_certificates3" { + # required to know which system to interface with + cx_profile_name = "cluster5" + filter = { + common_name = "tfsvm" + type = "server" + } +} \ No newline at end of file diff --git a/examples/resources/netapp-ontap_cifs_local_group_member/provider.tf b/examples/data-sources/netapp-ontap_security_certificates/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_cifs_local_group_member/provider.tf rename to examples/data-sources/netapp-ontap_security_certificates/provider.tf diff --git a/examples/resources/netapp-ontap_cifs_local_group_member/variables.tf b/examples/data-sources/netapp-ontap_security_certificates/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_cifs_local_group_member/variables.tf rename to examples/data-sources/netapp-ontap_security_certificates/variables.tf diff --git a/examples/data-sources/netapp-ontap_storage_qtree/data-source.tf b/examples/data-sources/netapp-ontap_storage_qtree/data-source.tf index b1d17209..42acd6e7 100644 --- a/examples/data-sources/netapp-ontap_storage_qtree/data-source.tf +++ b/examples/data-sources/netapp-ontap_storage_qtree/data-source.tf @@ -1,4 +1,4 @@ -data "netapp-ontap_storage_qtree" "storage_qtree" { +data "netapp-ontap_qtree" "storage_qtree" { # required to know which system to interface with cx_profile_name = "cluster3" name = "tree10" diff --git a/examples/data-sources/netapp-ontap_storage_qtrees/data-source.tf b/examples/data-sources/netapp-ontap_storage_qtrees/data-source.tf index 575712c2..3dc72a7a 100644 --- a/examples/data-sources/netapp-ontap_storage_qtrees/data-source.tf +++ b/examples/data-sources/netapp-ontap_storage_qtrees/data-source.tf @@ -1,4 +1,4 @@ -data "netapp-ontap_storage_qtrees" "storage_qtrees" { +data "netapp-ontap_qtrees" "storage_qtrees" { # required to know which system to interface with cx_profile_name = "cluster3" filter = { diff --git a/examples/data-sources/netapp-ontap_storage_volumes_files/data-source.tf b/examples/data-sources/netapp-ontap_storage_volume_files/data-source.tf similarity index 74% rename from examples/data-sources/netapp-ontap_storage_volumes_files/data-source.tf rename to examples/data-sources/netapp-ontap_storage_volume_files/data-source.tf index 52d86656..0247496f 100644 --- a/examples/data-sources/netapp-ontap_storage_volumes_files/data-source.tf +++ b/examples/data-sources/netapp-ontap_storage_volume_files/data-source.tf @@ -1,4 +1,4 @@ -data "netapp-ontap_volumes_files" "storage_volumes_files" { +data "netapp-ontap_volume_files" "storage_volume_files" { # required to know which system to interface with cx_profile_name = "cluster4" volume_name = "acc_test_peer_root" diff --git a/examples/resources/netapp-ontap_cluster_peers/provider.tf b/examples/data-sources/netapp-ontap_storage_volume_files/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_cluster_peers/provider.tf rename to examples/data-sources/netapp-ontap_storage_volume_files/provider.tf diff --git a/examples/data-sources/netapp-ontap_storage_volumes_files/terraform.tfvars b/examples/data-sources/netapp-ontap_storage_volume_files/terraform.tfvars similarity index 100% rename from examples/data-sources/netapp-ontap_storage_volumes_files/terraform.tfvars rename to examples/data-sources/netapp-ontap_storage_volume_files/terraform.tfvars diff --git a/examples/resources/netapp-ontap_cluster_peers/variables.tf b/examples/data-sources/netapp-ontap_storage_volume_files/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_cluster_peers/variables.tf rename to examples/data-sources/netapp-ontap_storage_volume_files/variables.tf diff --git a/examples/data-sources/netapp-ontap_svm/provider.tf b/examples/data-sources/netapp-ontap_svm/provider.tf deleted file mode 100644 index 9abcaafb..00000000 --- a/examples/data-sources/netapp-ontap_svm/provider.tf +++ /dev/null @@ -1,44 +0,0 @@ -terraform { - required_providers { - netapp-ontap = { - source = "NetApp/netapp-ontap" - version = "0.0.1" - } - } -} - - -provider "netapp-ontap" { - # A connection profile defines how to interface with an ONTAP cluster or svm. - # At least one is required. - connection_profiles = [ - { - name = "cluster1" - hostname = "********219" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster2" - hostname = "********222" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster3" - hostname = "10.193.176.159" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster4" - hostname = "10.193.180.108" - username = var.username - password = var.password - validate_certs = var.validate_certs - } - ] -} diff --git a/examples/data-sources/netapp-ontap_svm/provider.tf b/examples/data-sources/netapp-ontap_svm/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/data-sources/netapp-ontap_svm/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/resources/netapp-ontap_qos_policies/provider.tf b/examples/resources/netapp-ontap_cifs_local_group_members/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_qos_policies/provider.tf rename to examples/resources/netapp-ontap_cifs_local_group_members/provider.tf diff --git a/examples/resources/netapp-ontap_cifs_local_group_member/resource.tf b/examples/resources/netapp-ontap_cifs_local_group_members/resource.tf similarity index 66% rename from examples/resources/netapp-ontap_cifs_local_group_member/resource.tf rename to examples/resources/netapp-ontap_cifs_local_group_members/resource.tf index 5280ce96..905e09e5 100644 --- a/examples/resources/netapp-ontap_cifs_local_group_member/resource.tf +++ b/examples/resources/netapp-ontap_cifs_local_group_members/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_cifs_local_group_member" "protocols_cifs_local_group_member" { +resource "netapp-ontap_cifs_local_group_members" "protocols_cifs_local_group_member" { # required to know which system to interface with cx_profile_name = "cluster4" group_name = "SVM_SERVER\\testme" diff --git a/examples/resources/netapp-ontap_cifs_local_group_member/terraform.tfvars b/examples/resources/netapp-ontap_cifs_local_group_members/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_cifs_local_group_member/terraform.tfvars rename to examples/resources/netapp-ontap_cifs_local_group_members/terraform.tfvars diff --git a/examples/resources/netapp-ontap_qos_policies/variables.tf b/examples/resources/netapp-ontap_cifs_local_group_members/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_qos_policies/variables.tf rename to examples/resources/netapp-ontap_cifs_local_group_members/variables.tf diff --git a/examples/resources/netapp-ontap_san_lun-maps/provider.tf b/examples/resources/netapp-ontap_cluster_peer/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_san_lun-maps/provider.tf rename to examples/resources/netapp-ontap_cluster_peer/provider.tf diff --git a/examples/resources/netapp-ontap_cluster_peers/resource.tf b/examples/resources/netapp-ontap_cluster_peer/resource.tf similarity index 86% rename from examples/resources/netapp-ontap_cluster_peers/resource.tf rename to examples/resources/netapp-ontap_cluster_peer/resource.tf index 091b606d..be516e4e 100644 --- a/examples/resources/netapp-ontap_cluster_peers/resource.tf +++ b/examples/resources/netapp-ontap_cluster_peer/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_cluster_peers" "cluster_peers" { +resource "netapp-ontap_cluster_peer" "cluster_peer" { # required to know which system to interface with cx_profile_name = "cluster3" # name = "testme" diff --git a/examples/resources/netapp-ontap_cluster_peers/terraform.tfvars b/examples/resources/netapp-ontap_cluster_peer/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_cluster_peers/terraform.tfvars rename to examples/resources/netapp-ontap_cluster_peer/terraform.tfvars diff --git a/examples/resources/netapp-ontap_san_lun-maps/variables.tf b/examples/resources/netapp-ontap_cluster_peer/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_san_lun-maps/variables.tf rename to examples/resources/netapp-ontap_cluster_peer/variables.tf diff --git a/examples/resources/netapp-ontap_name_services_dns/provider.tf b/examples/resources/netapp-ontap_name_services_dns/provider.tf deleted file mode 100644 index 9abcaafb..00000000 --- a/examples/resources/netapp-ontap_name_services_dns/provider.tf +++ /dev/null @@ -1,44 +0,0 @@ -terraform { - required_providers { - netapp-ontap = { - source = "NetApp/netapp-ontap" - version = "0.0.1" - } - } -} - - -provider "netapp-ontap" { - # A connection profile defines how to interface with an ONTAP cluster or svm. - # At least one is required. - connection_profiles = [ - { - name = "cluster1" - hostname = "********219" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster2" - hostname = "********222" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster3" - hostname = "10.193.176.159" - username = var.username - password = var.password - validate_certs = var.validate_certs - }, - { - name = "cluster4" - hostname = "10.193.180.108" - username = var.username - password = var.password - validate_certs = var.validate_certs - } - ] -} diff --git a/examples/resources/netapp-ontap_name_services_dns/provider.tf b/examples/resources/netapp-ontap_name_services_dns/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/resources/netapp-ontap_name_services_dns/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/resources/netapp-ontap_name_services_dns/resource.tf b/examples/resources/netapp-ontap_name_services_dns/resource.tf index cbf00963..5a705310 100644 --- a/examples/resources/netapp-ontap_name_services_dns/resource.tf +++ b/examples/resources/netapp-ontap_name_services_dns/resource.tf @@ -1,7 +1,8 @@ -resource "netapp-ontap_name_services_dns" "name_services_dns" { +resource "netapp-ontap_dns" "dns" { # required to know which system to interface with - cx_profile_name = "cluster2" - svm_name = "ansibleSVM_cifs" + cx_profile_name = "cluster4" + svm_name = "svm5" name_servers = ["1.1.1.1", "2.2.2.2"] dns_domains = ["foo.bar.com", "boo.bar.com"] + skip_config_validation = true } diff --git a/examples/resources/netapp-ontap_ip_interface/provider.tf b/examples/resources/netapp-ontap_network_ip_interface/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_ip_interface/provider.tf rename to examples/resources/netapp-ontap_network_ip_interface/provider.tf diff --git a/examples/resources/netapp-ontap_ip_interface/resource.tf b/examples/resources/netapp-ontap_network_ip_interface/resource.tf similarity index 80% rename from examples/resources/netapp-ontap_ip_interface/resource.tf rename to examples/resources/netapp-ontap_network_ip_interface/resource.tf index c209c0b0..97f2651b 100644 --- a/examples/resources/netapp-ontap_ip_interface/resource.tf +++ b/examples/resources/netapp-ontap_network_ip_interface/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_networking_ip_interface" "ip_interface" { +resource "netapp-ontap_network_ip_interface" "ip_interface" { # required to know which system to interface with cx_profile_name = "cluster4" name = "testme" diff --git a/examples/resources/netapp-ontap_ip_interface/terraform.tfvars b/examples/resources/netapp-ontap_network_ip_interface/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_ip_interface/terraform.tfvars rename to examples/resources/netapp-ontap_network_ip_interface/terraform.tfvars diff --git a/examples/resources/netapp-ontap_ip_interface/variables.tf b/examples/resources/netapp-ontap_network_ip_interface/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_ip_interface/variables.tf rename to examples/resources/netapp-ontap_network_ip_interface/variables.tf diff --git a/examples/resources/netapp-ontap_networking_ip_route/provider.tf b/examples/resources/netapp-ontap_network_ip_route/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_networking_ip_route/provider.tf rename to examples/resources/netapp-ontap_network_ip_route/provider.tf diff --git a/examples/resources/netapp-ontap_networking_ip_route/resource.tf b/examples/resources/netapp-ontap_network_ip_route/resource.tf similarity index 76% rename from examples/resources/netapp-ontap_networking_ip_route/resource.tf rename to examples/resources/netapp-ontap_network_ip_route/resource.tf index 028cbb3c..188c9c42 100644 --- a/examples/resources/netapp-ontap_networking_ip_route/resource.tf +++ b/examples/resources/netapp-ontap_network_ip_route/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_networking_ip_route" "networking_ip_route" { +resource "netapp-ontap_network_ip_route" "network_ip_route" { # required to know which system to interface with cx_profile_name = "cluster4" svm_name = "ansibleSVM" diff --git a/examples/resources/netapp-ontap_networking_ip_route/variables.tf b/examples/resources/netapp-ontap_network_ip_route/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_networking_ip_route/variables.tf rename to examples/resources/netapp-ontap_network_ip_route/variables.tf diff --git a/examples/resources/netapp-ontap_security_accounts/provider.tf b/examples/resources/netapp-ontap_qos_policy/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_security_accounts/provider.tf rename to examples/resources/netapp-ontap_qos_policy/provider.tf diff --git a/examples/resources/netapp-ontap_qos_policies/resource.tf b/examples/resources/netapp-ontap_qos_policy/resource.tf similarity index 76% rename from examples/resources/netapp-ontap_qos_policies/resource.tf rename to examples/resources/netapp-ontap_qos_policy/resource.tf index 7b294cd9..c5bee99b 100644 --- a/examples/resources/netapp-ontap_qos_policies/resource.tf +++ b/examples/resources/netapp-ontap_qos_policy/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_qos_policies" "qos_policies" { +resource "netapp-ontap_qos_policy" "qos_policy" { # required to know which system to interface with cx_profile_name = "cluster1" name = "terraform2" diff --git a/examples/resources/netapp-ontap_qos_policies/terraform.tfvars b/examples/resources/netapp-ontap_qos_policy/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_qos_policies/terraform.tfvars rename to examples/resources/netapp-ontap_qos_policy/terraform.tfvars diff --git a/examples/resources/netapp-ontap_security_accounts/variables.tf b/examples/resources/netapp-ontap_qos_policy/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_security_accounts/variables.tf rename to examples/resources/netapp-ontap_qos_policy/variables.tf diff --git a/examples/resources/netapp-ontap_security_login_messages/provider.tf b/examples/resources/netapp-ontap_san_lun-map/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_security_login_messages/provider.tf rename to examples/resources/netapp-ontap_san_lun-map/provider.tf diff --git a/examples/resources/netapp-ontap_san_lun-maps/resource.tf b/examples/resources/netapp-ontap_san_lun-map/resource.tf similarity index 79% rename from examples/resources/netapp-ontap_san_lun-maps/resource.tf rename to examples/resources/netapp-ontap_san_lun-map/resource.tf index d656bc03..62b6cf71 100644 --- a/examples/resources/netapp-ontap_san_lun-maps/resource.tf +++ b/examples/resources/netapp-ontap_san_lun-map/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_san_lun-maps" "protocols_san_lun-maps" { +resource "netapp-ontap_san_lun-map" "protocols_san_lun-map" { # required to know which system to interface with cx_profile_name = "cluster2" svm = { diff --git a/examples/resources/netapp-ontap_san_lun-maps/terraform.tfvars b/examples/resources/netapp-ontap_san_lun-map/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_san_lun-maps/terraform.tfvars rename to examples/resources/netapp-ontap_san_lun-map/terraform.tfvars diff --git a/examples/resources/netapp-ontap_security_login_messages/variables.tf b/examples/resources/netapp-ontap_san_lun-map/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_security_login_messages/variables.tf rename to examples/resources/netapp-ontap_san_lun-map/variables.tf diff --git a/examples/resources/netapp-ontap_storage_quota_rules/provider.tf b/examples/resources/netapp-ontap_security_account/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_storage_quota_rules/provider.tf rename to examples/resources/netapp-ontap_security_account/provider.tf diff --git a/examples/resources/netapp-ontap_security_accounts/resource.tf b/examples/resources/netapp-ontap_security_account/resource.tf similarity index 77% rename from examples/resources/netapp-ontap_security_accounts/resource.tf rename to examples/resources/netapp-ontap_security_account/resource.tf index 611d7d1e..6b9dffe9 100644 --- a/examples/resources/netapp-ontap_security_accounts/resource.tf +++ b/examples/resources/netapp-ontap_security_account/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_security_accounts" "security_account" { +resource "netapp-ontap_security_account" "security_account" { # required to know which system to interface with cx_profile_name = "cluster4" name = "carchitest" diff --git a/examples/resources/netapp-ontap_storage_quota_rules/variables.tf b/examples/resources/netapp-ontap_security_account/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_storage_quota_rules/variables.tf rename to examples/resources/netapp-ontap_security_account/variables.tf diff --git a/examples/resources/netapp-ontap_storage_volume_efficiency_policies/provider.tf b/examples/resources/netapp-ontap_security_login_message/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_storage_volume_efficiency_policies/provider.tf rename to examples/resources/netapp-ontap_security_login_message/provider.tf diff --git a/examples/resources/netapp-ontap_security_login_messages/resource.tf b/examples/resources/netapp-ontap_security_login_message/resource.tf similarity index 74% rename from examples/resources/netapp-ontap_security_login_messages/resource.tf rename to examples/resources/netapp-ontap_security_login_message/resource.tf index d04d7002..ec8f6dbf 100644 --- a/examples/resources/netapp-ontap_security_login_messages/resource.tf +++ b/examples/resources/netapp-ontap_security_login_message/resource.tf @@ -1,5 +1,5 @@ -resource "netapp-ontap_security_login_messages" "msg_import_cluster" { +resource "netapp-ontap_security_login_message" "msg_import_cluster" { banner = "test banner" cx_profile_name = "cluster4" message = "test message" @@ -7,7 +7,7 @@ resource "netapp-ontap_security_login_messages" "msg_import_cluster" { show_cluster_message = true } -resource "netapp-ontap_security_login_messages" "msg_import_svm" { +resource "netapp-ontap_security_login_message" "msg_import_svm" { banner = "test banner" cx_profile_name = "cluster4" message = "test message" diff --git a/examples/resources/netapp-ontap_security_login_messages/terraform.tfvars b/examples/resources/netapp-ontap_security_login_message/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_security_login_messages/terraform.tfvars rename to examples/resources/netapp-ontap_security_login_message/terraform.tfvars diff --git a/examples/resources/netapp-ontap_storage_volume_efficiency_policies/variables.tf b/examples/resources/netapp-ontap_security_login_message/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_storage_volume_efficiency_policies/variables.tf rename to examples/resources/netapp-ontap_security_login_message/variables.tf diff --git a/examples/resources/netapp-ontap_storage_qtrees/resource.tf b/examples/resources/netapp-ontap_storage_qtrees/resource.tf index 34fc0072..ab4f8476 100644 --- a/examples/resources/netapp-ontap_storage_qtrees/resource.tf +++ b/examples/resources/netapp-ontap_storage_qtrees/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_storage_qtrees" "storage_qtrees" { +resource "netapp-ontap_qtrees" "storage_qtrees" { # required to know which system to interface with cx_profile_name = "cluster3" name = "testme5" diff --git a/examples/resources/netapp-ontap_svm_peers/provider.tf b/examples/resources/netapp-ontap_storage_quota_rule/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_svm_peers/provider.tf rename to examples/resources/netapp-ontap_storage_quota_rule/provider.tf diff --git a/examples/resources/netapp-ontap_storage_quota_rules/resource.tf b/examples/resources/netapp-ontap_storage_quota_rule/resource.tf similarity index 83% rename from examples/resources/netapp-ontap_storage_quota_rules/resource.tf rename to examples/resources/netapp-ontap_storage_quota_rule/resource.tf index 8637b56c..fb3e7415 100644 --- a/examples/resources/netapp-ontap_storage_quota_rules/resource.tf +++ b/examples/resources/netapp-ontap_storage_quota_rule/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_quota_rules" "storage_quota_rules" { +resource "netapp-ontap_quota_rule" "storage_quota_rule" { # required to know which system to interface with cx_profile_name = "cluster2" volume = { diff --git a/examples/resources/netapp-ontap_storage_quota_rules/terraform.tfvars b/examples/resources/netapp-ontap_storage_quota_rule/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_storage_quota_rules/terraform.tfvars rename to examples/resources/netapp-ontap_storage_quota_rule/terraform.tfvars diff --git a/examples/resources/netapp-ontap_svm_peers/variables.tf b/examples/resources/netapp-ontap_storage_quota_rule/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_svm_peers/variables.tf rename to examples/resources/netapp-ontap_storage_quota_rule/variables.tf diff --git a/examples/resources/netapp-ontap_volumes_files/provider.tf b/examples/resources/netapp-ontap_storage_volume_efficiency_policy/provider.tf similarity index 100% rename from examples/resources/netapp-ontap_volumes_files/provider.tf rename to examples/resources/netapp-ontap_storage_volume_efficiency_policy/provider.tf diff --git a/examples/resources/netapp-ontap_storage_volume_efficiency_policies/resource.tf b/examples/resources/netapp-ontap_storage_volume_efficiency_policy/resource.tf similarity index 74% rename from examples/resources/netapp-ontap_storage_volume_efficiency_policies/resource.tf rename to examples/resources/netapp-ontap_storage_volume_efficiency_policy/resource.tf index 43b32e90..75d28a99 100644 --- a/examples/resources/netapp-ontap_storage_volume_efficiency_policies/resource.tf +++ b/examples/resources/netapp-ontap_storage_volume_efficiency_policy/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_volume_efficiency_policies" "storage_volume_efficiency_policies" { +resource "netapp-ontap_volume_efficiency_policy" "storage_volume_efficiency_policy" { # required to know which system to interface with cx_profile_name = "cluster1" name = "testme" diff --git a/examples/resources/netapp-ontap_storage_volume_efficiency_policies/terraform.tfvars b/examples/resources/netapp-ontap_storage_volume_efficiency_policy/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_storage_volume_efficiency_policies/terraform.tfvars rename to examples/resources/netapp-ontap_storage_volume_efficiency_policy/terraform.tfvars diff --git a/examples/resources/netapp-ontap_volumes_files/variables.tf b/examples/resources/netapp-ontap_storage_volume_efficiency_policy/variables.tf similarity index 100% rename from examples/resources/netapp-ontap_volumes_files/variables.tf rename to examples/resources/netapp-ontap_storage_volume_efficiency_policy/variables.tf diff --git a/examples/resources/netapp-ontap_svm_peer/provider.tf b/examples/resources/netapp-ontap_svm_peer/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/resources/netapp-ontap_svm_peer/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/resources/netapp-ontap_svm_peers/resource.tf b/examples/resources/netapp-ontap_svm_peer/resource.tf similarity index 88% rename from examples/resources/netapp-ontap_svm_peers/resource.tf rename to examples/resources/netapp-ontap_svm_peer/resource.tf index 43be19f3..accd46d8 100644 --- a/examples/resources/netapp-ontap_svm_peers/resource.tf +++ b/examples/resources/netapp-ontap_svm_peer/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_svm_peers" "svm_peers" { +resource "netapp-ontap_svm_peer" "svm_peer" { # required to know which system to interface with cx_profile_name = "cluster4" # name = "svm_peers_test" diff --git a/examples/resources/netapp-ontap_svm_peers/terraform.tfvars b/examples/resources/netapp-ontap_svm_peer/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_svm_peers/terraform.tfvars rename to examples/resources/netapp-ontap_svm_peer/terraform.tfvars diff --git a/examples/resources/netapp-ontap_svm_peer/variables.tf b/examples/resources/netapp-ontap_svm_peer/variables.tf new file mode 120000 index 00000000..395ce618 --- /dev/null +++ b/examples/resources/netapp-ontap_svm_peer/variables.tf @@ -0,0 +1 @@ +../../provider/variables.tf \ No newline at end of file diff --git a/examples/resources/netapp-ontap_volume_file/provider.tf b/examples/resources/netapp-ontap_volume_file/provider.tf new file mode 120000 index 00000000..c6b7138f --- /dev/null +++ b/examples/resources/netapp-ontap_volume_file/provider.tf @@ -0,0 +1 @@ +../../provider/provider.tf \ No newline at end of file diff --git a/examples/resources/netapp-ontap_volumes_files/resource.tf b/examples/resources/netapp-ontap_volume_file/resource.tf similarity index 78% rename from examples/resources/netapp-ontap_volumes_files/resource.tf rename to examples/resources/netapp-ontap_volume_file/resource.tf index 09140a9f..664c7288 100644 --- a/examples/resources/netapp-ontap_volumes_files/resource.tf +++ b/examples/resources/netapp-ontap_volume_file/resource.tf @@ -1,4 +1,4 @@ -resource "netapp-ontap_volumes_files" "volumes_files" { +resource "netapp-ontap_volume_file" "volumes_file" { # required to know which system to interface with cx_profile_name = "cluster1" path = "vol3" diff --git a/examples/resources/netapp-ontap_volumes_files/terraform.tfvars b/examples/resources/netapp-ontap_volume_file/terraform.tfvars similarity index 100% rename from examples/resources/netapp-ontap_volumes_files/terraform.tfvars rename to examples/resources/netapp-ontap_volume_file/terraform.tfvars diff --git a/examples/resources/netapp-ontap_volume_file/variables.tf b/examples/resources/netapp-ontap_volume_file/variables.tf new file mode 120000 index 00000000..395ce618 --- /dev/null +++ b/examples/resources/netapp-ontap_volume_file/variables.tf @@ -0,0 +1 @@ +../../provider/variables.tf \ No newline at end of file diff --git a/internal/interfaces/cluster.go b/internal/interfaces/cluster.go index 23d0daf7..a584b0df 100644 --- a/internal/interfaces/cluster.go +++ b/internal/interfaces/cluster.go @@ -105,6 +105,7 @@ func GetCluster(errorHandler *utils.ErrorHandler, r restclient.RestClient) (*Clu statusCode, response, err := r.GetNilOrOneRecord("cluster", nil, nil) query := r.NewQuery() query.Fields([]string{"name", "location", "contact", "dns_domains", "name_servers", "ntp_servers", "management_interfaces", "timezone", "certificate", "uuid"}) + // statusCode, response, err := r.GetNilOrOneRecord("cluster", query, nil) if err == nil && response == nil { err = fmt.Errorf("no response for GET cluster") } diff --git a/internal/interfaces/cluster_peer.go b/internal/interfaces/cluster_peer.go index f2ea842d..e7760f70 100644 --- a/internal/interfaces/cluster_peer.go +++ b/internal/interfaces/cluster_peer.go @@ -169,7 +169,7 @@ func CreateClusterPeers(errorHandler *utils.ErrorHandler, r restclient.RestClien var dataONTAP ClusterPeersGetDataModelONTAP if err := mapstructure.Decode(response.Records[0], &dataONTAP); err != nil { - return nil, errorHandler.MakeAndReportError("error decoding cluster_peers info", fmt.Sprintf("error on decode storage/cluster_peerss info: %s, statusCode %d, response %#v", err, statusCode, response)) + return nil, errorHandler.MakeAndReportError("error decoding cluster_peers info", fmt.Sprintf("error on decode cluster/cluster_peers info: %s, statusCode %d, response %#v", err, statusCode, response)) } tflog.Debug(errorHandler.Ctx, fmt.Sprintf("Create cluster_peers source - udata: %#v", dataONTAP)) return &dataONTAP, nil diff --git a/internal/interfaces/name_services_dns.go b/internal/interfaces/name_services_dns.go index b8fbf0a3..fb8d225a 100644 --- a/internal/interfaces/name_services_dns.go +++ b/internal/interfaces/name_services_dns.go @@ -12,9 +12,10 @@ import ( // NameServicesDNSGetDataModelONTAP describes the GET record data model using go types for mapping. type NameServicesDNSGetDataModelONTAP struct { - Domains []string `mapstructure:"domains"` - Servers []string `mapstructure:"servers"` - SVM SvmDataModelONTAP `mapstructure:"svm"` + Domains []string `mapstructure:"domains"` + Servers []string `mapstructure:"servers"` + SVM SvmDataModelONTAP `mapstructure:"svm"` + SkipConfigValidation bool `mapstructure:"skip_config_validation"` } // NameServicesDNSDataSourceFilterModel describes filter model. @@ -111,7 +112,7 @@ func CreateNameServicesDNS(errorHandler *utils.ErrorHandler, r restclient.RestCl // DeleteNameServicesDNS deletes a DNS func DeleteNameServicesDNS(errorHandler *utils.ErrorHandler, r restclient.RestClient, uuid string) error { - statusCode, _, err := r.CallDeleteMethod("name-services/dns"+uuid, nil, nil) + statusCode, _, err := r.CallDeleteMethod("name-services/dns/"+uuid, nil, nil) if err != nil { return errorHandler.MakeAndReportError("error deleting DNS", fmt.Sprintf("error on DELETE name-services/dns: %s, statusCode %d", err, statusCode)) } diff --git a/internal/interfaces/name_services_ldap.go b/internal/interfaces/name_services_ldap.go index 464fa85f..4d20acba 100644 --- a/internal/interfaces/name_services_ldap.go +++ b/internal/interfaces/name_services_ldap.go @@ -162,7 +162,7 @@ func CreateNameServicesLDAP(errorHandler *utils.ErrorHandler, r restclient.RestC var dataONTAP NameServicesLDAPGetDataModelONTAP if err := mapstructure.Decode(response.Records[0], &dataONTAP); err != nil { - return nil, errorHandler.MakeAndReportError("error decoding name_services_ldap info", fmt.Sprintf("error on decode storage/name_services_ldaps info: %s, statusCode %d, response %#v", err, statusCode, response)) + return nil, errorHandler.MakeAndReportError("error decoding name_services_ldap info", fmt.Sprintf("error on decode name_services_ldaps info: %s, statusCode %d, response %#v", err, statusCode, response)) } tflog.Debug(errorHandler.Ctx, fmt.Sprintf("Create name_services_ldap source - udata: %#v", dataONTAP)) return &dataONTAP, nil diff --git a/internal/interfaces/protocols_nfs_export_policy.go b/internal/interfaces/protocols_nfs_export_policy.go index 4e81daaa..908fe6e9 100644 --- a/internal/interfaces/protocols_nfs_export_policy.go +++ b/internal/interfaces/protocols_nfs_export_policy.go @@ -16,11 +16,18 @@ type ExportpolicyResourceModel struct { ID int `mapstructure:"id"` } +// ExportpolicyResourceBodyDataModelONTAP describes the resource data model. +type ExportpolicyResourceBodyDataModelONTAP struct { + Name string `mapstructure:"name"` + Svm SvmDataModelONTAP `mapstructure:"svm"` +} + // ExportPolicyGetDataModelONTAP describes the GET record data model using go types for mapping. type ExportPolicyGetDataModelONTAP struct { - Name string `mapstructure:"name"` - Svm string `mapstructure:"svm_name"` - ID int `mapstructure:"id"` + Name string `mapstructure:"name"` + Svm string `mapstructure:"svm_name"` + SvmUUID string `mapstructure:"svm_uuid"` + ID int `mapstructure:"id"` } // ExportPolicyGetDataFilterModel describes filter model @@ -30,7 +37,7 @@ type ExportPolicyGetDataFilterModel struct { } // CreateExportPolicy to create export policy -func CreateExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClient, data ExportpolicyResourceModel) (*ExportPolicyGetDataModelONTAP, error) { +func CreateExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClient, data ExportpolicyResourceBodyDataModelONTAP) (*ExportpolicyResourceModel, error) { var body map[string]interface{} if err := mapstructure.Decode(data, &body); err != nil { return nil, errorHandler.MakeAndReportError("error encoding export policy body", fmt.Sprintf("error on encoding export policy body: %s, body: %#v", err, data)) @@ -42,7 +49,7 @@ func CreateExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClien return nil, errorHandler.MakeAndReportError("error creating export policy", fmt.Sprintf("error on POST protocols/nfs/export-policies: %s, statusCode %d", err, statusCode)) } - var dataONTAP ExportPolicyGetDataModelONTAP + var dataONTAP ExportpolicyResourceModel if err := mapstructure.Decode(response.Records[0], &dataONTAP); err != nil { return nil, errorHandler.MakeAndReportError("error decoding export policies info", fmt.Sprintf("error on decode protocols/nfs/export-policies info: %s, statusCode %d, response %#v", err, statusCode, response)) } @@ -51,7 +58,7 @@ func CreateExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClien } // GetExportPolicy to get export policy -func GetExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClient, id string) (*ExportPolicyGetDataModelONTAP, error) { +func GetExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClient, id string) (*ExportpolicyResourceModel, error) { api := "protocols/nfs/export-policies/" + id statusCode, response, err := r.GetNilOrOneRecord(api, nil, nil) if err == nil && response == nil { @@ -61,7 +68,7 @@ func GetExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClient, return nil, errorHandler.MakeAndReportError("error reading export policy info", fmt.Sprintf("error on GET protocols/nfs/export-policies/%s: %s", id, err)) } - var dataONTAP ExportPolicyGetDataModelONTAP + var dataONTAP ExportpolicyResourceModel if err := mapstructure.Decode(response, &dataONTAP); err != nil { return nil, errorHandler.MakeAndReportError("error decoding export policy info", fmt.Sprintf("error on decode protocols/nfs/export-policies/%s: %s, statusCode %d, response %#v", id, err, statusCode, response)) } @@ -70,7 +77,7 @@ func GetExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClient, } // GetNfsExportPolicyByName to get export policy by filter -func GetNfsExportPolicyByName(errorHandler *utils.ErrorHandler, r restclient.RestClient, filter interface{}) (*ExportPolicyGetDataModelONTAP, error) { +func GetNfsExportPolicyByName(errorHandler *utils.ErrorHandler, r restclient.RestClient, filter interface{}) (*ExportpolicyResourceModel, error) { query := r.NewQuery() query.Fields([]string{"name"}) if filter != nil { @@ -85,7 +92,7 @@ func GetNfsExportPolicyByName(errorHandler *utils.ErrorHandler, r restclient.Res return nil, errorHandler.MakeAndReportError("error reading export policy info", fmt.Sprintf("error on GET protocols/nfs/export-policies: %s", err)) } - var dataONTAP ExportPolicyGetDataModelONTAP + var dataONTAP ExportpolicyResourceModel if err := mapstructure.Decode(response, &dataONTAP); err != nil { return nil, errorHandler.MakeAndReportError("error decoding export policy info", fmt.Sprintf("error on decode protocols/nfs/export-policies: %s, statusCode %d, response %#v", err, statusCode, response)) } @@ -94,7 +101,7 @@ func GetNfsExportPolicyByName(errorHandler *utils.ErrorHandler, r restclient.Res } // GetExportPoliciesList to get export policies -func GetExportPoliciesList(errorHandler *utils.ErrorHandler, r restclient.RestClient, filter *ExportPolicyGetDataFilterModel) ([]ExportpolicyResourceModel, error) { +func GetExportPoliciesList(errorHandler *utils.ErrorHandler, r restclient.RestClient, filter *ExportPolicyGetDataFilterModel) ([]ExportPolicyGetDataModelONTAP, error) { api := "protocols/nfs/export-policies" query := r.NewQuery() query.Fields([]string{"name", "id", "svm.name", "svm.uuid"}) @@ -113,9 +120,9 @@ func GetExportPoliciesList(errorHandler *utils.ErrorHandler, r restclient.RestCl return nil, errorHandler.MakeAndReportError("error reading export policies info", fmt.Sprintf("error on GET %s: %s, statusCode %d", api, err, statusCode)) } - var dataONTAP []ExportpolicyResourceModel + var dataONTAP []ExportPolicyGetDataModelONTAP for _, info := range response { - var record ExportpolicyResourceModel + var record ExportPolicyGetDataModelONTAP if err := mapstructure.Decode(info, &record); err != nil { return nil, errorHandler.MakeAndReportError(fmt.Sprintf("failed to decode response from GET %s", api), fmt.Sprintf("error: %s, statusCode %d, info %#v", err, statusCode, info)) @@ -136,7 +143,7 @@ func DeleteExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClien } // UpdateExportPolicy updates export policy -func UpdateExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClient, data ExportpolicyResourceModel, id string) error { +func UpdateExportPolicy(errorHandler *utils.ErrorHandler, r restclient.RestClient, data ExportpolicyResourceBodyDataModelONTAP, id string) error { var body map[string]interface{} if err := mapstructure.Decode(data, &body); err != nil { return errorHandler.MakeAndReportError("error encoding export policy body", fmt.Sprintf("error on encoding export policy body: %s, body: %#v", err, data)) diff --git a/internal/interfaces/protocols_nfs_export_policy_test.go b/internal/interfaces/protocols_nfs_export_policy_test.go index 1aa72da3..db9e571c 100644 --- a/internal/interfaces/protocols_nfs_export_policy_test.go +++ b/internal/interfaces/protocols_nfs_export_policy_test.go @@ -13,49 +13,56 @@ import ( "github.com/netapp/terraform-provider-netapp-ontap/internal/utils" ) +// basic get data records +var oneBasicExportPolicyRecord = ExportPolicyGetDataModelONTAP{ + Name: "string", + Svm: "string", + SvmUUID: "string", + ID: 123, +} + // basic get data record -var basicExportPolicyRecord = ExportPolicyGetDataModelONTAP{ +var basicExportPolicyRecord = ExportpolicyResourceModel{ Name: "string", - Svm: "string", - ID: 122880, + Svm: SvmDataModelONTAP{ + Name: "string", + UUID: "string", + }, } // bad record var badExportPolicyRecord = struct{ Name int }{123} // create export policy with basic request body -var basicExportPolicyBody = ExportpolicyResourceModel{ +var basicExportPolicyBody = ExportpolicyResourceBodyDataModelONTAP{ Name: "string", Svm: SvmDataModelONTAP{ Name: "string", UUID: "string", }, - ID: 122880, } // create export policy with empty comment -var badExportPolicyBody = ExportpolicyResourceModel{ +var badExportPolicyBody = ExportpolicyResourceBodyDataModelONTAP{ Name: "", } // update export policy name -var renameExportPolicyBody = ExportpolicyResourceModel{ +var renameExportPolicyBody = ExportpolicyResourceBodyDataModelONTAP{ Name: "newname", Svm: SvmDataModelONTAP{ Name: "string", UUID: "string", }, - ID: 122880, } // update export policy with basic request body -var updateExportPolicyErrorBody = ExportpolicyResourceModel{ +var updateExportPolicyErrorBody = ExportpolicyResourceBodyDataModelONTAP{ Name: "string", Svm: SvmDataModelONTAP{ Name: "newsvm", UUID: "string", }, - ID: 122880, } func TestGetExportPolicy(t *testing.T) { @@ -93,7 +100,7 @@ func TestGetExportPolicy(t *testing.T) { tests := []struct { name string responses []restclient.MockResponse - want *ExportPolicyGetDataModelONTAP + want *ExportpolicyResourceModel wantErr bool }{ {name: "test_no_records_1", responses: responses["test_no_records_1"], want: nil, wantErr: true}, @@ -148,8 +155,8 @@ func TestCreateExportPolicy(t *testing.T) { tests := []struct { name string responses []restclient.MockResponse - requestbody ExportpolicyResourceModel - want *ExportPolicyGetDataModelONTAP + requestbody ExportpolicyResourceBodyDataModelONTAP + want *ExportpolicyResourceModel wantErr bool }{ {name: "test_create_basic_record_1", responses: responses["test_create_basic_record_1"], requestbody: basicExportPolicyBody, want: &basicExportPolicyRecord, wantErr: false}, @@ -229,7 +236,7 @@ func TestUpdateExportPolicy(t *testing.T) { tests := []struct { name string responses []restclient.MockResponse - requestbody ExportpolicyResourceModel + requestbody ExportpolicyResourceBodyDataModelONTAP wantErr bool }{ {name: "test_update_rename_export_policy", responses: responses["test_update_rename_export_policy"], requestbody: renameExportPolicyBody, wantErr: false}, @@ -257,7 +264,7 @@ func TestGetExportPoliciesList(t *testing.T) { errorHandler := utils.NewErrorHandler(context.Background(), &diag.Diagnostics{}) badRecord := struct{ Name int }{123} var recordInterface map[string]any - err := mapstructure.Decode(basicExportPolicyBody, &recordInterface) + err := mapstructure.Decode(oneBasicExportPolicyRecord, &recordInterface) if err != nil { panic(err) } @@ -272,8 +279,8 @@ func TestGetExportPoliciesList(t *testing.T) { twoRecordsResponse := restclient.RestResponse{NumRecords: 2, Records: []map[string]any{recordInterface, recordInterface}} badRecordResponse := restclient.RestResponse{NumRecords: 1, Records: []map[string]any{badRecordInterface}} - var wantOneRecord = []ExportpolicyResourceModel{basicExportPolicyBody} - var wantTwoRecords = []ExportpolicyResourceModel{basicExportPolicyBody, basicExportPolicyBody} + var wantOneRecord = []ExportPolicyGetDataModelONTAP{oneBasicExportPolicyRecord} + var wantTwoRecords = []ExportPolicyGetDataModelONTAP{oneBasicExportPolicyRecord, oneBasicExportPolicyRecord} responses := map[string][]restclient.MockResponse{ "test_no_records_1": { @@ -294,7 +301,7 @@ func TestGetExportPoliciesList(t *testing.T) { name string responses []restclient.MockResponse // args args - want []ExportpolicyResourceModel + want []ExportPolicyGetDataModelONTAP wantErr bool }{ {name: "test_no_records_1", responses: responses["test_no_records_1"], want: nil, wantErr: false}, diff --git a/internal/interfaces/protocols_nfs_service.go b/internal/interfaces/protocols_nfs_service.go index 07f9a0d5..c157809a 100644 --- a/internal/interfaces/protocols_nfs_service.go +++ b/internal/interfaces/protocols_nfs_service.go @@ -2,6 +2,7 @@ package interfaces import ( "fmt" + "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/mitchellh/mapstructure" "github.com/netapp/terraform-provider-netapp-ontap/internal/restclient" @@ -21,6 +22,19 @@ type ProtocolsNfsServiceGetDataModelONTAP struct { SVM SvmDataModelONTAP `mapstructure:"svm"` } +// ProtocolsNfsServiceResourceDataModelONTAP describes the GET record data model using go types for mapping. +type ProtocolsNfsServiceResourceDataModelONTAP struct { + Enabled bool `mapstructure:"enabled"` + Protocol Protocol `mapstructure:"protocol"` + Root Root `mapstructure:"root"` + Security Security `mapstructure:"security"` + ShowmountEnabled bool `mapstructure:"showmount_enabled"` + Transport Transport `mapstructure:"transport"` + VstorageEnabled bool `mapstructure:"vstorage_enabled"` + Windows Windows `mapstructure:"windows"` + SVM SvmDataModelONTAP `mapstructure:"svm"` +} + // Protocol describes the GET record data model using go types for mapping. type Protocol struct { V3Enabled bool `mapstructure:"v3_enabled"` @@ -159,7 +173,7 @@ func GetProtocolsNfsServices(errorHandler *utils.ErrorHandler, r restclient.Rest } // CreateProtocolsNfsService Create a NFS Service -func CreateProtocolsNfsService(errorHandler *utils.ErrorHandler, r restclient.RestClient, data ProtocolsNfsServiceGetDataModelONTAP, svnUUID string) (*ProtocolsNfsServiceGetDataModelONTAP, error) { +func CreateProtocolsNfsService(errorHandler *utils.ErrorHandler, r restclient.RestClient, data ProtocolsNfsServiceResourceDataModelONTAP) (*ProtocolsNfsServiceGetDataModelONTAP, error) { var body map[string]interface{} if err := mapstructure.Decode(data, &body); err != nil { return nil, errorHandler.MakeAndReportError("error encoding NFS Service body", fmt.Sprintf("error on encoding protocols/nfs/services body: %s, body: %#v", err, data)) @@ -188,7 +202,7 @@ func DeleteProtocolsNfsService(errorHandler *utils.ErrorHandler, r restclient.Re } // UpdateProtocolsNfsService Update a NFS service -func UpdateProtocolsNfsService(errorHandler *utils.ErrorHandler, r restclient.RestClient, request ProtocolsNfsServiceGetDataModelONTAP, uuid string) error { +func UpdateProtocolsNfsService(errorHandler *utils.ErrorHandler, r restclient.RestClient, request ProtocolsNfsServiceResourceDataModelONTAP, uuid string) error { var body map[string]interface{} if err := mapstructure.Decode(request, &body); err != nil { return errorHandler.MakeAndReportError("error encoding NFS Services body", fmt.Sprintf("error on encoding NFS Services body: %s, body: %#v", err, request)) diff --git a/internal/interfaces/protocols_nfs_service_test.go b/internal/interfaces/protocols_nfs_service_test.go index 6b0d137c..3cb78b50 100644 --- a/internal/interfaces/protocols_nfs_service_test.go +++ b/internal/interfaces/protocols_nfs_service_test.go @@ -201,8 +201,9 @@ func TestCreateProtocolsNfsService(t *testing.T) { name string responses []restclient.MockResponse // args args - want *ProtocolsNfsServiceGetDataModelONTAP - wantErr bool + requestBody ProtocolsNfsServiceResourceDataModelONTAP + want *ProtocolsNfsServiceGetDataModelONTAP + wantErr bool }{ {name: "test_one_record_1", responses: responses["test_one_record_1"], want: &nfsServiceRecord, wantErr: false}, {name: "test_one_910_record_1", responses: responses["test_one_910_record_1"], want: &record910, wantErr: false}, @@ -215,7 +216,7 @@ func TestCreateProtocolsNfsService(t *testing.T) { if err != nil { panic(err) } - got, err := CreateProtocolsNfsService(errorHandler, *r, nfsServiceRecord, "svmname") + got, err := CreateProtocolsNfsService(errorHandler, *r, tt.requestBody) if err != nil { fmt.Printf("err: %s\n", err) } diff --git a/internal/interfaces/protocols_san_lun-maps.go b/internal/interfaces/protocols_san_lun-map.go similarity index 100% rename from internal/interfaces/protocols_san_lun-maps.go rename to internal/interfaces/protocols_san_lun-map.go diff --git a/internal/interfaces/qos_policies.go b/internal/interfaces/qos_policy.go similarity index 100% rename from internal/interfaces/qos_policies.go rename to internal/interfaces/qos_policy.go diff --git a/internal/interfaces/security_certificate.go b/internal/interfaces/security_certificate.go index d4970474..e69de29b 100644 --- a/internal/interfaces/security_certificate.go +++ b/internal/interfaces/security_certificate.go @@ -1,250 +0,0 @@ -package interfaces - -import ( - "fmt" - "strings" - - "github.com/hashicorp/terraform-plugin-log/tflog" - "github.com/mitchellh/mapstructure" - "github.com/netapp/terraform-provider-netapp-ontap/internal/restclient" - "github.com/netapp/terraform-provider-netapp-ontap/internal/utils" -) - -// SecurityCertificateGetDataModelONTAP describes the GET record data model using go types for mapping. -type SecurityCertificateGetDataModelONTAP struct { - Name string `mapstructure:"name"` - UUID string `mapstructure:"uuid"` - CommonName string `mapstructure:"common_name"` - SVM svm `mapstructure:"svm"` - Scope string `mapstructure:"scope"` - Type string `mapstructure:"type"` - SerialNumber string `mapstructure:"serial_number"` - CA string `mapstructure:"ca"` - HashFunction string `mapstructure:"hash_function"` - KeySize int64 `mapstructure:"key_size"` - ExpiryTime string `mapstructure:"expiry_time"` - PublicCertificate string `mapstructure:"public_certificate"` -} - -// SignedSecurityCertificateGetDataModelONTAP describes the GET record data model using go types for mapping. -type SignedSecurityCertificateGetDataModelONTAP struct { - SignedCertificate string `mapstructure:"public_certificate"` -} - -// SecurityCertificateResourceCreateBodyDataModelONTAP describes the create/install body data model using go types for mapping. -type SecurityCertificateResourceCreateBodyDataModelONTAP struct { - Name string `mapstructure:"name,omitempty"` - CommonName string `mapstructure:"common_name"` - Type string `mapstructure:"type"` - SVM svm `mapstructure:"svm,omitempty"` - Scope string `mapstructure:"scope,omitempty"` - PublicCertificate string `mapstructure:"public_certificate,omitempty"` - PrivateKey string `mapstructure:"private_key,omitempty"` - HashFunction string `mapstructure:"hash_function,omitempty"` - KeySize int64 `mapstructure:"key_size,omitempty"` - ExpiryTime string `mapstructure:"expiry_time,omitempty"` -} - -// SecurityCertificateResourceSignBodyDataModelONTAP describes the signing body data model using go types for mapping. -type SecurityCertificateResourceSignBodyDataModelONTAP struct { - SigningRequest string `mapstructure:"signing_request"` - HashFunction string `mapstructure:"hash_function,omitempty"` - ExpiryTime string `mapstructure:"expiry_time,omitempty"` -} - -// SecurityCertificateDataSourceFilterModel describes the data source data model for queries. -type SecurityCertificateDataSourceFilterModel struct { - SVMName string `mapstructure:"svm.name"` - Scope string `mapstructure:"scope"` - CommonName string `mapstructure:"common_name"` - Type string `mapstructure:"type"` -} - -// GetSecurityCertificate to get security_certificate info -// Retrieves the certificate with the given name and/or (common name & type) -func GetSecurityCertificate(errorHandler *utils.ErrorHandler, r restclient.RestClient, version versionModelONTAP, name string, common_name string, type_ string) (*SecurityCertificateGetDataModelONTAP, error) { - api := "security/certificates" - query := r.NewQuery() - if name != "" { - query.Set("name", name) - } else { - query.Set("common_name", common_name) - query.Set("type", type_) - } - var fields = []string{"uuid", "common_name", "svm.name", "scope", "type", "serial_number", "ca", "hash_function", "key_size", "expiry_time", "public_certificate"} - if version.Generation == 9 && version.Major >= 8 { - fields = append(fields, "name") - } - query.Fields(fields) - - statusCode, response, err := r.GetNilOrOneRecord(api, query, nil) - if err == nil && response == nil { - err = fmt.Errorf("no response for GET %s", api) - } - if err != nil { - if strings.Contains(err.Error(), "or more records when only one is expected") { - return nil, errorHandler.MakeAndReportError("error reading security_certificate info", "Duplicate records found with the same common_name.") - } - return nil, errorHandler.MakeAndReportError("error reading security_certificate info", fmt.Sprintf("error on GET %s: %s, statusCode %d", api, err, statusCode)) - } - - var dataONTAP SecurityCertificateGetDataModelONTAP - if err := mapstructure.Decode(response, &dataONTAP); err != nil { - return nil, errorHandler.MakeAndReportError(fmt.Sprintf("failed to decode response from GET %s", api), - fmt.Sprintf("error: %s, statusCode %d, response %#v", err, statusCode, response)) - } - tflog.Debug(errorHandler.Ctx, fmt.Sprintf("Read security_certificate data source: %#v", dataONTAP)) - return &dataONTAP, nil -} - -// GetSecurityCertificateByName to get security_certificate info -// Retrieves the certificate using its unique name -func GetSecurityCertificateByName(errorHandler *utils.ErrorHandler, r restclient.RestClient, version versionModelONTAP, name string) (*SecurityCertificateGetDataModelONTAP, error) { - api := "security/certificates" - query := r.NewQuery() - if version.Generation == 9 && version.Major >= 8 { - query.Add("name", name) - } else { - return nil, errorHandler.MakeAndReportError("error reading security_certificate info", "Attribute 'name' requires ONTAP 9.8 or later.") - } - query.Fields([]string{"uuid", "name", "common_name", "svm.name", "scope", "type", "serial_number", "ca", "hash_function", "key_size", "expiry_time", "public_certificate"}) - - statusCode, response, err := r.GetNilOrOneRecord(api, query, nil) - if err == nil && response == nil { - err = fmt.Errorf("no response for GET %s", api) - } - if err != nil { - return nil, errorHandler.MakeAndReportError("error reading security_certificate info", fmt.Sprintf("error on GET %s: %s, statusCode %d", api, err, statusCode)) - } - - var dataONTAP SecurityCertificateGetDataModelONTAP - if err := mapstructure.Decode(response, &dataONTAP); err != nil { - return nil, errorHandler.MakeAndReportError(fmt.Sprintf("failed to decode response from GET %s", api), - fmt.Sprintf("error: %s, statusCode %d, response %#v", err, statusCode, response)) - } - tflog.Debug(errorHandler.Ctx, fmt.Sprintf("Read security_certificate data source: %#v", dataONTAP)) - return &dataONTAP, nil -} - -// GetSecurityCertificateByUUID to get security_certificate info -// Retrieves the certificate using its UUID -func GetSecurityCertificateByUUID(errorHandler *utils.ErrorHandler, r restclient.RestClient, version versionModelONTAP, uuid string) (*SecurityCertificateGetDataModelONTAP, error) { - api := "security/certificates/" + uuid - query := r.NewQuery() - var fields = []string{"uuid", "common_name", "svm.name", "scope", "type", "serial_number", "ca", "hash_function", "key_size", "expiry_time", "public_certificate"} - if version.Generation == 9 && version.Major >= 8 { - fields = append(fields, "name") - } - query.Fields(fields) - statusCode, response, err := r.GetNilOrOneRecord(api, query, nil) - if err == nil && response == nil { - err = fmt.Errorf("no response for GET %s", api) - } - if err != nil { - return nil, errorHandler.MakeAndReportError("error reading security_certificate info", fmt.Sprintf("error on GET %s: %s, statusCode %d", api, err, statusCode)) - } - - var dataONTAP SecurityCertificateGetDataModelONTAP - if err := mapstructure.Decode(response, &dataONTAP); err != nil { - return nil, errorHandler.MakeAndReportError(fmt.Sprintf("failed to decode response from GET %s", api), - fmt.Sprintf("error: %s, statusCode %d, response %#v", err, statusCode, response)) - } - tflog.Debug(errorHandler.Ctx, fmt.Sprintf("Read security_certificate data source: %#v", dataONTAP)) - return &dataONTAP, nil -} - -// GetSecurityCertificates to get security_certificate info for all resources matching a filter -func GetSecurityCertificates(errorHandler *utils.ErrorHandler, r restclient.RestClient, version versionModelONTAP, filter *SecurityCertificateDataSourceFilterModel) ([]SecurityCertificateGetDataModelONTAP, error) { - api := "security/certificates" - query := r.NewQuery() - var fields = []string{"uuid", "common_name", "svm.name", "scope", "type", "serial_number", "ca", "hash_function", "key_size", "expiry_time", "public_certificate"} - if version.Generation == 9 && version.Major >= 8 { - fields = append(fields, "name") - } - query.Fields(fields) - - if filter != nil { - var filterMap map[string]interface{} - if err := mapstructure.Decode(filter, &filterMap); err != nil { - return nil, errorHandler.MakeAndReportError("error encoding security_certificates filter info", fmt.Sprintf("error on filter %#v: %s", filter, err)) - } - query.SetValues(filterMap) - } - - tflog.Debug(errorHandler.Ctx, fmt.Sprintf("security certificates filter: %+v", query)) - statusCode, response, err := r.GetZeroOrMoreRecords(api, query, nil) - if err == nil && response == nil { - err = fmt.Errorf("no response for GET %s", api) - } - if err != nil { - return nil, errorHandler.MakeAndReportError("error reading security_certificates info", fmt.Sprintf("error on GET %s: %s, statusCode %d", api, err, statusCode)) - } - - var dataONTAP []SecurityCertificateGetDataModelONTAP - for _, info := range response { - var record SecurityCertificateGetDataModelONTAP - if err := mapstructure.Decode(info, &record); err != nil { - return nil, errorHandler.MakeAndReportError(fmt.Sprintf("failed to decode response from GET %s", api), - fmt.Sprintf("error: %s, statusCode %d, info %#v", err, statusCode, info)) - } - dataONTAP = append(dataONTAP, record) - } - tflog.Debug(errorHandler.Ctx, fmt.Sprintf("Read security_certificates data source: %#v", dataONTAP)) - return dataONTAP, nil -} - -// CreateOrInstallSecurityCertificate to create/ install a security certificate -func CreateOrInstallSecurityCertificate(errorHandler *utils.ErrorHandler, r restclient.RestClient, body SecurityCertificateResourceCreateBodyDataModelONTAP, operation string) (*SecurityCertificateGetDataModelONTAP, error) { - api := "security/certificates" - var bodyMap map[string]interface{} - if err := mapstructure.Decode(body, &bodyMap); err != nil { - return nil, errorHandler.MakeAndReportError("error encoding security certificate body", fmt.Sprintf("error on encoding %s body: %s, body: %#v", api, err, body)) - } - query := r.NewQuery() - query.Add("return_records", "true") - - statusCode, response, err := r.CallCreateMethod(api, query, bodyMap) - if err != nil { - return nil, errorHandler.MakeAndReportError(fmt.Sprintf("error %s security certificate", operation), fmt.Sprintf("error on POST %s: %s, statusCode %d", api, err, statusCode)) - } - - var dataONTAP SecurityCertificateGetDataModelONTAP - if err := mapstructure.Decode(response.Records[0], &dataONTAP); err != nil { - return nil, errorHandler.MakeAndReportError("error decoding security certificate info", fmt.Sprintf("error on decode storage/security_certificatess info: %s, statusCode %d, response %#v", err, statusCode, response)) - } - tflog.Debug(errorHandler.Ctx, fmt.Sprintf("Created security certificate: %#v", dataONTAP)) - return &dataONTAP, nil -} - -// SignSecurityCertificate to sign a security_certificate -func SignSecurityCertificate(errorHandler *utils.ErrorHandler, r restclient.RestClient, uuid string, body SecurityCertificateResourceSignBodyDataModelONTAP) (*SignedSecurityCertificateGetDataModelONTAP, error) { - api := "security/certificates" - var bodyMap map[string]interface{} - if err := mapstructure.Decode(body, &bodyMap); err != nil { - return nil, errorHandler.MakeAndReportError("error encoding security certificate body", fmt.Sprintf("error on encoding %s body: %s, body: %#v", api, err, body)) - } - query := r.NewQuery() - query.Add("return_records", "true") - - statusCode, response, err := r.CallCreateMethod(api+"/"+uuid+"/sign", query, bodyMap) - if err != nil { - return nil, errorHandler.MakeAndReportError("error signing security certificate", fmt.Sprintf("error on POST %s: %s, statusCode %d", api, err, statusCode)) - } - - var dataONTAP SignedSecurityCertificateGetDataModelONTAP - if err := mapstructure.Decode(response.Records[0], &dataONTAP); err != nil { - return nil, errorHandler.MakeAndReportError("error decoding signed security certificate info", fmt.Sprintf("error on decode storage/security_certificatess/{ca.uuid}/sign info: %s, statusCode %d, response %#v", err, statusCode, response)) - } - tflog.Debug(errorHandler.Ctx, fmt.Sprintf("Signed security certificate: %#v", dataONTAP)) - return &dataONTAP, nil -} - -// DeleteSecurityCertificate to delete a security_certificate -func DeleteSecurityCertificate(errorHandler *utils.ErrorHandler, r restclient.RestClient, uuid string) error { - api := "security/certificates" - statusCode, _, err := r.CallDeleteMethod(api+"/"+uuid, nil, nil) - if err != nil { - return errorHandler.MakeAndReportError("error deleting security certificate", fmt.Sprintf("error on DELETE %s: %s, statusCode %d", api, err, statusCode)) - } - return nil -} diff --git a/internal/interfaces/storage_qtree.go b/internal/interfaces/storage_qtree.go index ab0caa2c..bcffa1af 100644 --- a/internal/interfaces/storage_qtree.go +++ b/internal/interfaces/storage_qtree.go @@ -62,7 +62,6 @@ type StorageQtreeResourceBodyDataModelONTAP struct { SVM svm `mapstructure:"svm"` UnixPermissions int `mapstructure:"unix_permissions,omitempty"` Volume qtreeVloume `mapstructure:"volume"` - ID int `mapstructure:"id,omitempty"` SecurityStyle string `mapstructure:"security_style,omitempty"` ExportPolicy qtreeExportPolicy `mapstructure:"export_policy,omitempty"` User qtreeUser `mapstructure:"user,omitempty"` diff --git a/internal/interfaces/storage_quota_rules.go b/internal/interfaces/storage_quota_rule.go similarity index 100% rename from internal/interfaces/storage_quota_rules.go rename to internal/interfaces/storage_quota_rule.go diff --git a/internal/interfaces/storage_volume_efficiency_policies.go b/internal/interfaces/storage_volume_efficiency_policy.go similarity index 100% rename from internal/interfaces/storage_volume_efficiency_policies.go rename to internal/interfaces/storage_volume_efficiency_policy.go diff --git a/internal/interfaces/storage_volumes_files.go b/internal/interfaces/storage_volume_file.go similarity index 100% rename from internal/interfaces/storage_volumes_files.go rename to internal/interfaces/storage_volume_file.go diff --git a/internal/interfaces/svm_peers.go b/internal/interfaces/svm_peer.go similarity index 100% rename from internal/interfaces/svm_peers.go rename to internal/interfaces/svm_peer.go diff --git a/internal/provider/cluster/cluster_peers_resource.go b/internal/provider/cluster/cluster_peer_resource.go similarity index 99% rename from internal/provider/cluster/cluster_peers_resource.go rename to internal/provider/cluster/cluster_peer_resource.go index 5caf29df..5733d22e 100644 --- a/internal/provider/cluster/cluster_peers_resource.go +++ b/internal/provider/cluster/cluster_peer_resource.go @@ -3,10 +3,11 @@ package cluster import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "reflect" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -25,10 +26,10 @@ var _ resource.Resource = &ClusterPeersResource{} var _ resource.ResourceWithImportState = &ClusterPeersResource{} // NewClusterPeersResource is a helper function to simplify the provider implementation. -func NewClusterPeersResource() resource.Resource { +func NewClusterPeerResource() resource.Resource { return &ClusterPeersResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "cluster_peers", + Name: "cluster_peer", }, } } diff --git a/internal/provider/cluster/cluster_peers_resource_test.go b/internal/provider/cluster/cluster_peer_resource_test.go similarity index 71% rename from internal/provider/cluster/cluster_peers_resource_test.go rename to internal/provider/cluster/cluster_peer_resource_test.go index 7c83251d..b819c38e 100644 --- a/internal/provider/cluster/cluster_peers_resource_test.go +++ b/internal/provider/cluster/cluster_peer_resource_test.go @@ -2,45 +2,46 @@ package cluster_test import ( "fmt" - ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" "os" "testing" + ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccClusterPeersResource(t *testing.T) { +func TestAccClusterPeerResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ // Create svm peer and read { - Config: testAccClusterPeersResourceConfig("10.193.180.110", "10.193.176.189"), + Config: testAccClusterPeerResourceConfig("10.193.180.110", "10.193.176.189"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_cluster_peers.example", "remote.ip_addresses.0", "10.193.180.110"), + resource.TestCheckResourceAttr("netapp-ontap_cluster_peer.example", "remote.ip_addresses.0", "10.193.180.110"), ), }, // Update applications { - Config: testAccClusterPeersResourceConfig("10.193.180.109", "10.193.176.189"), + Config: testAccClusterPeerResourceConfig("10.193.180.109", "10.193.176.189"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_cluster_peers.example", "remote.ip_addresses.0", "10.193.180.109"), + resource.TestCheckResourceAttr("netapp-ontap_cluster_peer.example", "remote.ip_addresses.0", "10.193.180.109"), ), }, // Import and read { - ResourceName: "netapp-ontap_cluster_peers.example", + ResourceName: "netapp-ontap_cluster_peer.example", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s", "acc_test_cluster2", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_cluster_peers.example", "name", "acc_test_cluster2"), + resource.TestCheckResourceAttr("netapp-ontap_cluster_peer.example", "name", "acc_test_cluster2"), ), }, }, }) } -func testAccClusterPeersResourceConfig(remotIP, sourceIP string) string { +func testAccClusterPeerResourceConfig(remotIP, sourceIP string) string { host := os.Getenv("TF_ACC_NETAPP_HOST2") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -70,7 +71,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_cluster_peers" "example" { +resource "netapp-ontap_cluster_peer" "example" { cx_profile_name = "cluster4" remote = { ip_addresses = ["%s"] diff --git a/internal/provider/name_services/name_services_dns_data_source.go b/internal/provider/name_services/name_services_dns_data_source.go index 968ea499..d9e82856 100644 --- a/internal/provider/name_services/name_services_dns_data_source.go +++ b/internal/provider/name_services/name_services_dns_data_source.go @@ -3,6 +3,7 @@ package name_services import ( "context" "fmt" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "github.com/hashicorp/terraform-plugin-framework/datasource" @@ -20,7 +21,7 @@ var _ datasource.DataSource = &NameServicesDNSDataSource{} func NewNameServicesDNSDataSource() datasource.DataSource { return &NameServicesDNSDataSource{ config: connection.ResourceOrDataSourceConfig{ - Name: "name_services_dns", + Name: "dns", }, } } diff --git a/internal/provider/name_services/name_services_dns_resource.go b/internal/provider/name_services/name_services_dns_resource.go index d8870200..42b154f1 100644 --- a/internal/provider/name_services/name_services_dns_resource.go +++ b/internal/provider/name_services/name_services_dns_resource.go @@ -3,12 +3,16 @@ package name_services import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/netapp/terraform-provider-netapp-ontap/internal/interfaces" @@ -23,7 +27,7 @@ var _ resource.ResourceWithImportState = &NameServicesDNSResource{} func NewNameServicesDNSResource() resource.Resource { return &NameServicesDNSResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "name_services_dns", + Name: "dns", }, } } @@ -35,11 +39,12 @@ type NameServicesDNSResource struct { // NameServicesDNSResourceModel describes the resource data model. type NameServicesDNSResourceModel struct { - CxProfileName types.String `tfsdk:"cx_profile_name"` - SVMName types.String `tfsdk:"svm_name"` - ID types.String `tfsdk:"id"` - Domains []types.String `tfsdk:"dns_domains"` - NameServers []types.String `tfsdk:"name_servers"` + CxProfileName types.String `tfsdk:"cx_profile_name"` + SVMName types.String `tfsdk:"svm_name"` + ID types.String `tfsdk:"id"` + SkipConfigValidation types.Bool `tfsdk:"skip_config_validation"` + Domains []types.String `tfsdk:"dns_domains"` + NameServers []types.String `tfsdk:"name_servers"` } // Metadata returns the resource type name. @@ -76,6 +81,15 @@ func (r *NameServicesDNSResource) Schema(ctx context.Context, req resource.Schem MarkdownDescription: "List of IPv4 addresses of name servers such as '123.123.123.123'.", Optional: true, }, + "skip_config_validation": schema.BoolAttribute{ + MarkdownDescription: "Indicates whether or not the validation for the specified DNS configuration is disabled. (9.9)", + Optional: true, + Computed: true, + Default: booldefault.StaticBool(false), + PlanModifiers: []planmodifier.Bool{ + boolplanmodifier.UseStateForUnknown(), + }, + }, }, } } @@ -129,20 +143,20 @@ func (r *NameServicesDNSResource) Read(ctx context.Context, req resource.ReadReq data.SVMName = types.StringValue(restInfo.SVM.Name) data.ID = types.StringValue(restInfo.SVM.UUID) - var servers []types.String - for _, v := range restInfo.Servers { - if !connection.StringInSlice(v, data.NameServers) { - servers = append(servers, types.StringValue(v)) + + if restInfo.Servers != nil { + data.NameServers = make([]types.String, len(restInfo.Servers)) + for index, server := range restInfo.Servers { + data.NameServers[index] = types.StringValue(server) } } - data.NameServers = servers - var domains []types.String - for _, v := range restInfo.Domains { - if !connection.StringInSlice(v, data.Domains) { - domains = append(domains, types.StringValue(v)) + + if restInfo.Domains != nil { + data.Domains = make([]types.String, len(restInfo.Domains)) + for index, domain := range restInfo.Domains { + data.Domains[index] = types.StringValue(domain) } } - data.Domains = domains // Write logs using the tflog package // Documentation: https://terraform.io/plugin/log @@ -168,6 +182,7 @@ func (r *NameServicesDNSResource) Create(ctx context.Context, req resource.Creat body.SVM.Name = data.SVMName.ValueString() body.SVM.UUID = data.ID.ValueString() + var servers, domains []string for _, v := range data.NameServers { servers = append(servers, v.ValueString()) @@ -177,7 +192,7 @@ func (r *NameServicesDNSResource) Create(ctx context.Context, req resource.Creat } body.Servers = servers body.Domains = domains - + body.SkipConfigValidation = data.SkipConfigValidation.ValueBool() client, err := connection.GetRestClient(errorHandler, r.config, data.CxProfileName) if err != nil { // error reporting done inside NewClient diff --git a/internal/provider/name_services/name_services_dns_resource_test.go b/internal/provider/name_services/name_services_dns_resource_test.go index 7f8b4985..7ff713e7 100644 --- a/internal/provider/name_services/name_services_dns_resource_test.go +++ b/internal/provider/name_services/name_services_dns_resource_test.go @@ -2,11 +2,12 @@ package name_services_test import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" "os" "regexp" "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" ) func TestAccNameServicesDNSResource(t *testing.T) { @@ -21,14 +22,20 @@ func TestAccNameServicesDNSResource(t *testing.T) { Config: testAccNameServicesDNSResourceConfig("non-existant"), ExpectError: regexp.MustCompile("2621462"), }, + { + Config: testAccNameServicesDNSResourceConfig("svm5"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("netapp-ontap_dns.dns", "svm_name", "svm5"), + ), + }, // Test importing a resource { - ResourceName: "netapp-ontap_name_services_dns.name_services_dns", + ResourceName: "netapp-ontap_dns.dns", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s", svmName, credName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_name_services_dns.name_services_dns", "svm_name", "ansibleSVM"), - resource.TestCheckResourceAttr("netapp-ontap_name_services_dns.name_services_dns", "name_servers.0", "netappad.com"), + resource.TestCheckResourceAttr("netapp-ontap_dns.dns", "svm_name", "ansibleSVM"), + resource.TestCheckResourceAttr("netapp-ontap_dns.dns", "name_servers.0", "netappad.com"), ), }, }, @@ -56,12 +63,13 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_name_services_dns" "name_services_dns" { +resource "netapp-ontap_dns" "dns" { # required to know which system to interface with cx_profile_name = "cluster4" svm_name = "%s" name_servers = ["1.1.1.1", "2.2.2.2"] dns_domains = ["foo.bar.com", "boo.bar.com"] + skip_config_validation = true } `, host, admin, password, svmName) } diff --git a/internal/provider/name_services/name_services_dnss_data_source.go b/internal/provider/name_services/name_services_dnss_data_source.go index b5c80441..d9ce9748 100644 --- a/internal/provider/name_services/name_services_dnss_data_source.go +++ b/internal/provider/name_services/name_services_dnss_data_source.go @@ -3,6 +3,7 @@ package name_services import ( "context" "fmt" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "github.com/hashicorp/terraform-plugin-framework/datasource" @@ -20,7 +21,7 @@ var _ datasource.DataSource = &NameServicesDNSsDataSource{} func NewNameServicesDNSsDataSource() datasource.DataSource { return &NameServicesDNSsDataSource{ config: connection.ResourceOrDataSourceConfig{ - Name: "name_services_dnss", + Name: "dnss", }, } } diff --git a/internal/provider/name_services/name_services_ldap_resource.go b/internal/provider/name_services/name_services_ldap_resource.go index a266cca3..b5e75398 100644 --- a/internal/provider/name_services/name_services_ldap_resource.go +++ b/internal/provider/name_services/name_services_ldap_resource.go @@ -3,9 +3,10 @@ package name_services import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -349,29 +350,29 @@ func (r *NameServicesLDAPResource) Create(ctx context.Context, req resource.Crea body.Servers = append(body.Servers, server.ValueString()) } } - if !data.Schema.IsNull() { + if !data.Schema.IsUnknown() { body.Schema = data.Schema.ValueString() } - if !data.AdDomain.IsNull() { + if !data.AdDomain.IsUnknown() { body.AdDomain = data.AdDomain.ValueString() } - if !data.BaseDN.IsNull() { + if !data.BaseDN.IsUnknown() { body.BaseDN = data.BaseDN.ValueString() } - if !data.BaseScope.IsNull() { + if !data.BaseScope.IsUnknown() { body.BaseScope = data.BaseScope.ValueString() } - if !data.BindDN.IsNull() { + if !data.BindDN.IsUnknown() { body.BindDN = data.BindDN.ValueString() } - if !data.BindAsCIFSServer.IsNull() { + if !data.BindAsCIFSServer.IsUnknown() { if cluster.Version.Generation == 9 && cluster.Version.Major >= 9 { body.BindAsCIFSServer = data.BindAsCIFSServer.ValueBool() } else { errors = append(errors, "bind_as_cifs_server") } } - if !data.BindPassword.IsNull() { + if !data.BindPassword.IsUnknown() { body.BindPassword = data.BindPassword.ValueString() } if data.PreferredADServers != nil { @@ -379,40 +380,40 @@ func (r *NameServicesLDAPResource) Create(ctx context.Context, req resource.Crea body.PreferredADServers = append(body.PreferredADServers, adserver.ValueString()) } } - if !data.Port.IsNull() { + if !data.Port.IsUnknown() { body.Port = data.Port.ValueInt64() } - if !data.QueryTimeout.IsNull() { + if !data.QueryTimeout.IsUnknown() { if cluster.Version.Generation == 9 && cluster.Version.Major >= 9 { body.QueryTimeout = data.QueryTimeout.ValueInt64() } else { errors = append(errors, "query_timeout") } } - if !data.MinBindLevel.IsNull() { + if !data.MinBindLevel.IsUnknown() { body.MinBindLevel = data.MinBindLevel.ValueString() } - if !data.UseStartTLS.IsNull() { + if !data.UseStartTLS.IsUnknown() { body.UseStartTLS = data.UseStartTLS.ValueBool() } - if !data.ReferralEnabled.IsNull() { + if !data.ReferralEnabled.IsUnknown() { if cluster.Version.Generation == 9 && cluster.Version.Major >= 9 { body.ReferralEnabled = data.ReferralEnabled.ValueBool() } else { errors = append(errors, "referral_enabled") } } - if !data.SessionSecurity.IsNull() { + if !data.SessionSecurity.IsUnknown() { body.SessionSecurity = data.SessionSecurity.ValueString() } - if !data.LDAPSEnabled.IsNull() { + if !data.LDAPSEnabled.IsUnknown() { if cluster.Version.Generation == 9 && cluster.Version.Major >= 9 { body.LDAPSEnabled = data.LDAPSEnabled.ValueBool() } else { errors = append(errors, "ldaps_enabled") } } - if !data.SkipConfigValidation.IsNull() { + if !data.SkipConfigValidation.IsUnknown() { if cluster.Version.Generation == 9 && cluster.Version.Major >= 9 { body.SkipConfigValidation = data.SkipConfigValidation.ValueBool() } else { diff --git a/internal/provider/name_services/name_services_ldap_resource_test.go b/internal/provider/name_services/name_services_ldap_resource_test.go index 5ebb8074..93745819 100644 --- a/internal/provider/name_services/name_services_ldap_resource_test.go +++ b/internal/provider/name_services/name_services_ldap_resource_test.go @@ -2,11 +2,12 @@ package name_services_test import ( "fmt" - ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" "os" "regexp" "testing" + ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) diff --git a/internal/provider/networking/networking_ip_interface_data_source.go b/internal/provider/networking/network_ip_interface_data_source.go similarity index 99% rename from internal/provider/networking/networking_ip_interface_data_source.go rename to internal/provider/networking/network_ip_interface_data_source.go index 3b932339..95c93b3b 100644 --- a/internal/provider/networking/networking_ip_interface_data_source.go +++ b/internal/provider/networking/network_ip_interface_data_source.go @@ -3,9 +3,10 @@ package networking import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "strconv" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/types" @@ -21,7 +22,7 @@ var _ datasource.DataSource = &IPInterfaceDataSource{} func NewIPInterfaceDataSource() datasource.DataSource { return &IPInterfaceDataSource{ config: connection.ResourceOrDataSourceConfig{ - Name: "networking_ip_interface", + Name: "network_ip_interface", }, } } diff --git a/internal/provider/networking/networking_ip_interface_resource.go b/internal/provider/networking/network_ip_interface_resource.go similarity index 99% rename from internal/provider/networking/networking_ip_interface_resource.go rename to internal/provider/networking/network_ip_interface_resource.go index 74496b5a..907cef08 100644 --- a/internal/provider/networking/networking_ip_interface_resource.go +++ b/internal/provider/networking/network_ip_interface_resource.go @@ -3,10 +3,11 @@ package networking import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "strconv" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" @@ -26,7 +27,7 @@ var _ resource.ResourceWithImportState = &IPInterfaceResource{} func NewIPInterfaceResource() resource.Resource { return &IPInterfaceResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "networking_ip_interface", + Name: "network_ip_interface", }, } } diff --git a/internal/provider/networking/networking_ip_interface_resource_test.go b/internal/provider/networking/network_ip_interface_resource_test.go similarity index 56% rename from internal/provider/networking/networking_ip_interface_resource_test.go rename to internal/provider/networking/network_ip_interface_resource_test.go index b52f6f4b..4ef33956 100644 --- a/internal/provider/networking/networking_ip_interface_resource_test.go +++ b/internal/provider/networking/network_ip_interface_resource_test.go @@ -2,60 +2,61 @@ package networking_test import ( "fmt" - ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" "os" "regexp" "testing" + ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccNetworkingIpInterfaceResource(t *testing.T) { +func TestAccNetworkIpInterfaceResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ // non-existant SVM return code 2621462. Must happen before create/read { - Config: testAccNetworkingIPInterfaceResourceConfig("non-existant", "10.10.10.10", "ontap_cluster_1-01"), + Config: testAccNetworkIPInterfaceResourceConfig("non-existant", "10.10.10.10", "ontap_cluster_1-01"), ExpectError: regexp.MustCompile("2621462"), }, // non-existant home node { - Config: testAccNetworkingIPInterfaceResourceConfig("svm0", "10.10.10.10", "non-existant_home_node"), + Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.10", "non-existant_home_node"), ExpectError: regexp.MustCompile("393271"), }, // Create and Read { - Config: testAccNetworkingIPInterfaceResourceConfig("svm0", "10.10.10.10", "ontap_cluster_1-01"), + Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.10", "ontap_cluster_1-01"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "name", "test-interface"), - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "svm_name", "svm0"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "name", "test-interface"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "svm_name", "svm0"), ), }, // Update and Read { - Config: testAccNetworkingIPInterfaceResourceConfig("svm0", "10.10.10.20", "ontap_cluster_1-01"), + Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.20", "ontap_cluster_1-01"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "name", "test-interface"), - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "ip.address", "10.10.10.20"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "name", "test-interface"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "ip.address", "10.10.10.20"), ), }, // Test importing a resource { - ResourceName: "netapp-ontap_networking_ip_interface.example", + ResourceName: "netapp-ontap_network_ip_interface.example", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s", "test-interface", "svm0", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "name", "test-interface"), - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "ip.address", "10.10.10.20"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "name", "test-interface"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "ip.address", "10.10.10.20"), ), }, }, }) } -func testAccNetworkingIPInterfaceResourceConfig(svmName, address, homeNode string) string { +func testAccNetworkIPInterfaceResourceConfig(svmName, address, homeNode string) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -76,7 +77,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_networking_ip_interface" "example" { +resource "netapp-ontap_network_ip_interface" "example" { cx_profile_name = "cluster4" name = "test-interface" svm_name = "%s" diff --git a/internal/provider/networking/networking_ip_interfaces_data_source.go b/internal/provider/networking/network_ip_interfaces_data_source.go similarity index 99% rename from internal/provider/networking/networking_ip_interfaces_data_source.go rename to internal/provider/networking/network_ip_interfaces_data_source.go index 012a2368..2ad3e291 100644 --- a/internal/provider/networking/networking_ip_interfaces_data_source.go +++ b/internal/provider/networking/network_ip_interfaces_data_source.go @@ -3,9 +3,10 @@ package networking import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "strconv" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/types" @@ -21,7 +22,7 @@ var _ datasource.DataSource = &IPInterfacesDataSource{} func NewIPInterfacesDataSource() datasource.DataSource { return &IPInterfacesDataSource{ config: connection.ResourceOrDataSourceConfig{ - Name: "networking_ip_interfaces", + Name: "network_ip_interfaces", }, } } diff --git a/internal/provider/networking/networking_ip_route_data_source.go b/internal/provider/networking/network_ip_route_data_source.go similarity index 99% rename from internal/provider/networking/networking_ip_route_data_source.go rename to internal/provider/networking/network_ip_route_data_source.go index 01941287..9e1ea554 100644 --- a/internal/provider/networking/networking_ip_route_data_source.go +++ b/internal/provider/networking/network_ip_route_data_source.go @@ -3,6 +3,7 @@ package networking import ( "context" "fmt" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "github.com/hashicorp/terraform-plugin-framework/datasource" @@ -20,7 +21,7 @@ var _ datasource.DataSource = &IPRouteDataSource{} func NewIPRouteDataSource() datasource.DataSource { return &IPRouteDataSource{ config: connection.ResourceOrDataSourceConfig{ - Name: "networking_ip_route", + Name: "network_ip_route", }, } } diff --git a/internal/provider/networking/networking_ip_route_resource.go b/internal/provider/networking/network_ip_route_resource.go similarity index 99% rename from internal/provider/networking/networking_ip_route_resource.go rename to internal/provider/networking/network_ip_route_resource.go index 78a93fec..3e4da86e 100644 --- a/internal/provider/networking/networking_ip_route_resource.go +++ b/internal/provider/networking/network_ip_route_resource.go @@ -3,9 +3,10 @@ package networking import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default" "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier" @@ -32,7 +33,7 @@ var _ resource.ResourceWithImportState = &IPRouteResource{} func NewIPRouteResource() resource.Resource { return &IPRouteResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "networking_ip_route", + Name: "network_ip_route", }, } } diff --git a/internal/provider/networking/networking_ip_route_resource_test.go b/internal/provider/networking/network_ip_route_resource_test.go similarity index 64% rename from internal/provider/networking/networking_ip_route_resource_test.go rename to internal/provider/networking/network_ip_route_resource_test.go index 294b549c..e76b850a 100644 --- a/internal/provider/networking/networking_ip_route_resource_test.go +++ b/internal/provider/networking/network_ip_route_resource_test.go @@ -2,61 +2,62 @@ package networking_test import ( "fmt" - ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" "os" "regexp" "testing" + ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccNetworkingIpRouteResource(t *testing.T) { +func TestAccNetworkIpRouteResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ // Missing Required argument { - Config: testAccNetworkingIPIRouteResourceConfigMissingVars("non-existent"), + Config: testAccNetworkIPIRouteResourceConfigMissingVars("non-existent"), ExpectError: regexp.MustCompile("Missing required argument"), }, // Non existent SVM { - Config: testAccNetworkingIPIRouteResourceConfig("non-existent"), + Config: testAccNetworkIPIRouteResourceConfig("non-existent"), ExpectError: regexp.MustCompile("2621462"), }, // Test create with no gateway { - Config: testAccNetworkingIPIRouteResourceConfig("ansibleSVM"), + Config: testAccNetworkIPIRouteResourceConfig("ansibleSVM"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_route.example", "svm_name", "ansibleSVM"), - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_route.example", "destination.address", "0.0.0.0"), - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_route.example", "destination.netmask", "0"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_route.example", "svm_name", "ansibleSVM"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_route.example", "destination.address", "0.0.0.0"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_route.example", "destination.netmask", "0"), ), }, // test create with a gateway { - Config: testAccNetworkingIPIRouteResourceWithGatewayConfig("ansibleSVM", "10.10.10.254", 20), + Config: testAccNetworkIPIRouteResourceWithGatewayConfig("ansibleSVM", "10.10.10.254", 20), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_route.example", "svm_name", "ansibleSVM"), - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_route.example", "destination.address", "10.10.10.254"), - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_route.example", "destination.netmask", "20"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_route.example", "svm_name", "ansibleSVM"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_route.example", "destination.address", "10.10.10.254"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_route.example", "destination.netmask", "20"), ), }, // Import and read { - ResourceName: "netapp-ontap_networking_ip_route.example", + ResourceName: "netapp-ontap_network_ip_route.example", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s", "carchi-test", "10.10.10.254", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_networking_ip_route.example", "svm_name", "carchi-test"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_route.example", "svm_name", "carchi-test"), ), }, }, }) } -func testAccNetworkingIPIRouteResourceConfig(svmName string) string { +func testAccNetworkIPIRouteResourceConfig(svmName string) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -77,7 +78,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_networking_ip_route" "example" { +resource "netapp-ontap_network_ip_route" "example" { cx_profile_name = "cluster4" svm_name = "%s" gateway = "10.10.10.1" @@ -85,7 +86,7 @@ resource "netapp-ontap_networking_ip_route" "example" { `, host, admin, password, svmName) } -func testAccNetworkingIPIRouteResourceWithGatewayConfig(svmName string, address string, netmask int) string { +func testAccNetworkIPIRouteResourceWithGatewayConfig(svmName string, address string, netmask int) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -106,7 +107,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_networking_ip_route" "example" { +resource "netapp-ontap_network_ip_route" "example" { cx_profile_name = "cluster4" svm_name = "%s" gateway = "10.10.10.1" @@ -118,7 +119,7 @@ resource "netapp-ontap_networking_ip_route" "example" { `, host, admin, password, svmName, address, netmask) } -func testAccNetworkingIPIRouteResourceConfigMissingVars(svmName string) string { +func testAccNetworkIPIRouteResourceConfigMissingVars(svmName string) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -139,7 +140,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_networking_ip_route" "example" { +resource "netapp-ontap_network_ip_route" "example" { cx_profile_name = "cluster4" svm_name = "%s" } diff --git a/internal/provider/networking/networking_ip_routes_data_source.go b/internal/provider/networking/network_ip_routes_data_source.go similarity index 99% rename from internal/provider/networking/networking_ip_routes_data_source.go rename to internal/provider/networking/network_ip_routes_data_source.go index ae8e7dda..5f3dcdc4 100644 --- a/internal/provider/networking/networking_ip_routes_data_source.go +++ b/internal/provider/networking/network_ip_routes_data_source.go @@ -3,6 +3,7 @@ package networking import ( "context" "fmt" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "github.com/hashicorp/terraform-plugin-framework/datasource" @@ -20,7 +21,7 @@ var _ datasource.DataSource = &IPRoutesDataSource{} func NewIPRoutesDataSource() datasource.DataSource { return &IPRoutesDataSource{ config: connection.ResourceOrDataSourceConfig{ - Name: "networking_ip_routes", + Name: "network_ip_routes", }, } } diff --git a/internal/provider/protocols/protocols_cifs_local_group_member_resource.go b/internal/provider/protocols/protocols_cifs_local_group_members_resource.go similarity index 99% rename from internal/provider/protocols/protocols_cifs_local_group_member_resource.go rename to internal/provider/protocols/protocols_cifs_local_group_members_resource.go index 3df05e10..8c79214c 100644 --- a/internal/provider/protocols/protocols_cifs_local_group_member_resource.go +++ b/internal/provider/protocols/protocols_cifs_local_group_members_resource.go @@ -3,10 +3,11 @@ package protocols import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "regexp" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -25,10 +26,10 @@ var _ resource.Resource = &CifsLocalGroupMemberResource{} var _ resource.ResourceWithImportState = &CifsLocalGroupMemberResource{} // NewCifsLocalGroupMemberResource is a helper function to simplify the provider implementation. -func NewCifsLocalGroupMemberResource() resource.Resource { +func NewCifsLocalGroupMembersResource() resource.Resource { return &CifsLocalGroupMemberResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "cifs_local_group_member", + Name: "cifs_local_group_members", }, } } diff --git a/internal/provider/protocols/protocols_cifs_local_group_member_resource_test.go b/internal/provider/protocols/protocols_cifs_local_group_members_resource_test.go similarity index 69% rename from internal/provider/protocols/protocols_cifs_local_group_member_resource_test.go rename to internal/provider/protocols/protocols_cifs_local_group_members_resource_test.go index 63f47937..9694ba7c 100644 --- a/internal/provider/protocols/protocols_cifs_local_group_member_resource_test.go +++ b/internal/provider/protocols/protocols_cifs_local_group_members_resource_test.go @@ -2,58 +2,59 @@ package protocols_test import ( "fmt" - ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" "os" "regexp" "testing" + ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccCifsLocalGroupMemberResource(t *testing.T) { +func TestAccCifsLocalGroupMembersResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccCifsLocalGroupMemberResourceConfigMissingVars("non-existant"), + Config: testAccCifsLocalGroupMembersResourceConfigMissingVars("non-existant"), ExpectError: regexp.MustCompile("Missing required argument"), }, // create with basic argument on a local group member { // configuration of group name and memmber name have to be double \ otherwise it will be treated as escape character - Config: testAccCifsLocalGroupMemberResourceConfig("svm3", "SVM3_SERVER\\\\accgroup1", "SVM3_SERVER\\\\accuser3"), + Config: testAccCifsLocalGroupMembersResourceConfig("svm3", "SVM3_SERVER\\\\accgroup1", "SVM3_SERVER\\\\accuser3"), Check: resource.ComposeTestCheckFunc( // check member - resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_member.example1", "member", "SVM3_SERVER\\accuser3"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_members.example1", "member", "SVM3_SERVER\\accuser3"), // check group_name - resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_member.example1", "group_name", "SVM3_SERVER\\accgroup1"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_members.example1", "group_name", "SVM3_SERVER\\accgroup1"), // check svm_name - resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_member.example1", "svm_name", "svm3"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_members.example1", "svm_name", "svm3"), // check ID - resource.TestCheckResourceAttrSet("netapp-ontap_cifs_local_group_member.example1", "id"), + resource.TestCheckResourceAttrSet("netapp-ontap_cifs_local_group_members.example1", "id"), ), }, // Test importing a resource { - ResourceName: "netapp-ontap_cifs_local_group_member.example1", + ResourceName: "netapp-ontap_cifs_local_group_members.example1", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s,%s", "SVM3_SERVER\\accuser3", "SVM3_SERVER\\accgroup1", "svm3", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_member.example1", "svm_name", "svm3"), - resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_member.example1", "group_name", "SVM3_SERVER\\accgroup1"), - resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_member.example1", "member", "SVM3_SERVER\\accuser3"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_members.example1", "svm_name", "svm3"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_members.example1", "group_name", "SVM3_SERVER\\accgroup1"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_local_group_members.example1", "member", "SVM3_SERVER\\accuser3"), // check id - resource.TestCheckResourceAttrSet("netapp-ontap_cifs_local_group_member.example1", "id"), + resource.TestCheckResourceAttrSet("netapp-ontap_cifs_local_group_members.example1", "id"), ), }, }, }) } -func testAccCifsLocalGroupMemberResourceConfigMissingVars(svmName string) string { +func testAccCifsLocalGroupMembersResourceConfigMissingVars(svmName string) string { return fmt.Sprintf(` -resource "netapp-ontap_cifs_local_group_member" "example1" { +resource "netapp-ontap_cifs_local_group_members" "example1" { svm_name = "%s" group_name = "SVM3_SERVER\\accgroup1" member = "SVM3_SERVER\\accuser3" @@ -61,7 +62,7 @@ resource "netapp-ontap_cifs_local_group_member" "example1" { `, svmName) } -func testAccCifsLocalGroupMemberResourceConfig(svmName, groupName, member string) string { +func testAccCifsLocalGroupMembersResourceConfig(svmName, groupName, member string) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -81,7 +82,7 @@ provider "netapp-ontap" { }, ] } -resource "netapp-ontap_cifs_local_group_member" "example1" { +resource "netapp-ontap_cifs_local_group_members" "example1" { cx_profile_name = "cluster4" svm_name = "%s" group_name = "%s" diff --git a/internal/provider/protocols/protocols_cifs_user_group_privilege_resource.go b/internal/provider/protocols/protocols_cifs_user_group_privileges_resource.go similarity index 99% rename from internal/provider/protocols/protocols_cifs_user_group_privilege_resource.go rename to internal/provider/protocols/protocols_cifs_user_group_privileges_resource.go index 73823c22..8354ec79 100644 --- a/internal/provider/protocols/protocols_cifs_user_group_privilege_resource.go +++ b/internal/provider/protocols/protocols_cifs_user_group_privileges_resource.go @@ -3,10 +3,11 @@ package protocols import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "regexp" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/path" @@ -29,7 +30,7 @@ var _ resource.ResourceWithImportState = &CifsUserGroupPrivilegeResource{} func NewCifsUserGroupPrivilegeResource() resource.Resource { return &CifsUserGroupPrivilegeResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "cifs_user_group_privilege", + Name: "cifs_user_group_privileges", }, } } diff --git a/internal/provider/protocols/protocols_cifs_user_group_privilege_resource_test.go b/internal/provider/protocols/protocols_cifs_user_group_privileges_resource_test.go similarity index 66% rename from internal/provider/protocols/protocols_cifs_user_group_privilege_resource_test.go rename to internal/provider/protocols/protocols_cifs_user_group_privileges_resource_test.go index ce02ac36..133f6225 100644 --- a/internal/provider/protocols/protocols_cifs_user_group_privilege_resource_test.go +++ b/internal/provider/protocols/protocols_cifs_user_group_privileges_resource_test.go @@ -2,75 +2,76 @@ package protocols_test import ( "fmt" - ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" "os" "regexp" "testing" + ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccCifsUserGroupPrivilegeResource(t *testing.T) { +func TestAccCifsUserGroupPrivilegesResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccCifsUserGroupPrivilegeResourceConfigMissingVars("non-existant"), + Config: testAccCifsUserGroupPrivilegesResourceConfigMissingVars("non-existant"), ExpectError: regexp.MustCompile("Missing required argument"), }, // create with basic argument on a local user { - Config: testAccCifsUserGroupPrivilegeResourceConfig("svm3", "accuser1", "sechangenotifyprivilege"), + Config: testAccCifsUserGroupPrivilegesResourceConfig("svm3", "accuser1", "sechangenotifyprivilege"), Check: resource.ComposeTestCheckFunc( // check name - resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privilege.example1", "name", "accuser1"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privileges.example1", "name", "accuser1"), // check svm_name - resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privilege.example1", "svm_name", "svm3"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privileges.example1", "svm_name", "svm3"), // check ID - resource.TestCheckResourceAttrSet("netapp-ontap_cifs_user_group_privilege.example1", "id"), + resource.TestCheckResourceAttrSet("netapp-ontap_cifs_user_group_privileges.example1", "id"), // check privileges - resource.TestCheckTypeSetElemAttr("netapp-ontap_cifs_user_group_privilege.example1", "privileges.*", "sechangenotifyprivilege"), + resource.TestCheckTypeSetElemAttr("netapp-ontap_cifs_user_group_privileges.example1", "privileges.*", "sechangenotifyprivilege"), ), }, // update one privilege { - Config: testAccCifsUserGroupPrivilegeResourceConfig("svm3", "accuser1", "setakeownershipprivilege"), + Config: testAccCifsUserGroupPrivilegesResourceConfig("svm3", "accuser1", "setakeownershipprivilege"), Check: resource.ComposeTestCheckFunc( // check user name - resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privilege.example1", "name", "accuser1"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privileges.example1", "name", "accuser1"), // check id - resource.TestCheckResourceAttrSet("netapp-ontap_cifs_user_group_privilege.example1", "id"), + resource.TestCheckResourceAttrSet("netapp-ontap_cifs_user_group_privileges.example1", "id"), // check updated privileges - resource.TestCheckTypeSetElemAttr("netapp-ontap_cifs_user_group_privilege.example1", "privileges.*", "setakeownershipprivilege"), + resource.TestCheckTypeSetElemAttr("netapp-ontap_cifs_user_group_privileges.example1", "privileges.*", "setakeownershipprivilege"), ), }, // Test importing a resource { - ResourceName: "netapp-ontap_cifs_user_group_privilege.example1", + ResourceName: "netapp-ontap_cifs_user_group_privileges.example1", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s", "accuser1", "svm3", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privilege.example1", "svm_name", "svm3"), - resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privilege.example1", "name", "accuser1"), - resource.TestCheckTypeSetElemAttr("netapp-ontap_cifs_user_group_privilege.example1", "privileges.*", "sesecurityprivilege"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privileges.example1", "svm_name", "svm3"), + resource.TestCheckResourceAttr("netapp-ontap_cifs_user_group_privileges.example1", "name", "accuser1"), + resource.TestCheckTypeSetElemAttr("netapp-ontap_cifs_user_group_privileges.example1", "privileges.*", "sesecurityprivilege"), // check id - resource.TestCheckResourceAttrSet("netapp-ontap_cifs_user_group_privilege.example1", "id"), + resource.TestCheckResourceAttrSet("netapp-ontap_cifs_user_group_privileges.example1", "id"), ), }, }, }) } -func testAccCifsUserGroupPrivilegeResourceConfigMissingVars(svmName string) string { +func testAccCifsUserGroupPrivilegesResourceConfigMissingVars(svmName string) string { return fmt.Sprintf(` - resource "netapp-ontap_cifs_user_group_privilege" "example1" { + resource "netapp-ontap_cifs_user_group_privileges" "example1" { svm_name = "%s" } `, svmName) } -func testAccCifsUserGroupPrivilegeResourceConfig(svmName string, name string, privilege string) string { +func testAccCifsUserGroupPrivilegesResourceConfig(svmName string, name string, privilege string) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -91,7 +92,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_cifs_user_group_privilege" "example1" { +resource "netapp-ontap_cifs_user_group_privileges" "example1" { cx_profile_name = "cluster4" svm_name = "%s" name = "%s" diff --git a/internal/provider/protocols/protocols_nfs_export_policies_data_source.go b/internal/provider/protocols/protocols_nfs_export_policies_data_source.go index bfd23b9f..0c88b946 100644 --- a/internal/provider/protocols/protocols_nfs_export_policies_data_source.go +++ b/internal/provider/protocols/protocols_nfs_export_policies_data_source.go @@ -3,6 +3,7 @@ package protocols import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/types" @@ -160,8 +161,8 @@ func (d *ExportPoliciesDataSource) Read(ctx context.Context, req datasource.Read CxProfileName: types.String(data.CxProfileName), Name: types.StringValue(record.Name), ID: types.Int64Value(int64(record.ID)), - SVMName: types.StringValue(record.Svm.Name), - SVMUUID: types.StringValue(record.Svm.UUID), + SVMName: types.StringValue(record.Svm), + SVMUUID: types.StringValue(record.SvmUUID), } } diff --git a/internal/provider/protocols/protocols_nfs_export_policy_resource.go b/internal/provider/protocols/protocols_nfs_export_policy_resource.go index 6e39346f..1aee3bcf 100644 --- a/internal/provider/protocols/protocols_nfs_export_policy_resource.go +++ b/internal/provider/protocols/protocols_nfs_export_policy_resource.go @@ -3,10 +3,11 @@ package protocols import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "strconv" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" @@ -104,7 +105,7 @@ func (r *ExportPolicyResource) Create(ctx context.Context, req resource.CreateRe // Read Terraform plan data into the model resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) - var request interfaces.ExportpolicyResourceModel + var request interfaces.ExportpolicyResourceBodyDataModelONTAP errorHandler := utils.NewErrorHandler(ctx, &resp.Diagnostics) if resp.Diagnostics.HasError() { return @@ -201,7 +202,7 @@ func (r *ExportPolicyResource) Update(ctx context.Context, req resource.UpdateRe return } - var request interfaces.ExportpolicyResourceModel + var request interfaces.ExportpolicyResourceBodyDataModelONTAP request.Name = data.Name.ValueString() err = interfaces.UpdateExportPolicy(errorHandler, *client, request, data.ID.ValueString()) diff --git a/internal/provider/protocols/protocols_nfs_service_resource.go b/internal/provider/protocols/protocols_nfs_service_resource.go index 535fbe29..4edf00fd 100644 --- a/internal/provider/protocols/protocols_nfs_service_resource.go +++ b/internal/provider/protocols/protocols_nfs_service_resource.go @@ -3,9 +3,10 @@ package protocols import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" @@ -550,7 +551,7 @@ func (r *ProtocolsNfsServiceResource) Create(ctx context.Context, req resource.C // Read Terraform plan data into the model resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) - var body interfaces.ProtocolsNfsServiceGetDataModelONTAP + var body interfaces.ProtocolsNfsServiceResourceDataModelONTAP errorHandler := utils.NewErrorHandler(ctx, &resp.Diagnostics) if resp.Diagnostics.HasError() { @@ -703,7 +704,7 @@ func (r *ProtocolsNfsServiceResource) Create(ctx context.Context, req resource.C return } - _, err = interfaces.CreateProtocolsNfsService(errorHandler, *client, body, svm.UUID) + _, err = interfaces.CreateProtocolsNfsService(errorHandler, *client, body) if err != nil { return } @@ -749,7 +750,7 @@ func (r *ProtocolsNfsServiceResource) Update(ctx context.Context, req resource.U errorHandler.MakeAndReportError("No cluster found", "Cluster not found.") return } - var request interfaces.ProtocolsNfsServiceGetDataModelONTAP + var request interfaces.ProtocolsNfsServiceResourceDataModelONTAP var errors []string if !data.Enabled.IsNull() { request.Enabled = data.Enabled.ValueBool() diff --git a/internal/provider/protocols/protocols_san_lun-maps_resource.go b/internal/provider/protocols/protocols_san_lun-map_resource.go similarity index 99% rename from internal/provider/protocols/protocols_san_lun-maps_resource.go rename to internal/provider/protocols/protocols_san_lun-map_resource.go index 4c253a18..4dad9766 100644 --- a/internal/provider/protocols/protocols_san_lun-maps_resource.go +++ b/internal/provider/protocols/protocols_san_lun-map_resource.go @@ -3,9 +3,10 @@ package protocols import ( "context" "fmt" + "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/svm" - "strings" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -24,10 +25,10 @@ var _ resource.Resource = &ProtocolsSanLunMapsResource{} var _ resource.ResourceWithImportState = &ProtocolsSanLunMapsResource{} // NewProtocolsSanLunMapsResource is a helper function to simplify the provider implementation. -func NewProtocolsSanLunMapsResource() resource.Resource { +func NewProtocolsSanLunMapResource() resource.Resource { return &ProtocolsSanLunMapsResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "san_lun-maps", + Name: "san_lun-map", }, } } diff --git a/internal/provider/protocols/protocols_san_lun-maps_resource_test.go b/internal/provider/protocols/protocols_san_lun-map_resource_test.go similarity index 71% rename from internal/provider/protocols/protocols_san_lun-maps_resource_test.go rename to internal/provider/protocols/protocols_san_lun-map_resource_test.go index 34488799..ccd1ddb8 100644 --- a/internal/provider/protocols/protocols_san_lun-maps_resource_test.go +++ b/internal/provider/protocols/protocols_san_lun-map_resource_test.go @@ -10,25 +10,25 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccProtocolsSanLunMapsResource(t *testing.T) { +func TestAccProtocolsSanLunMapResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ // Create protocols_san_lun-maps and read { - Config: testAccProtocolsSanLunMapsResourceBasicConfig("/vol/lunTest/ACC-import-lun", "test", "carchi-test"), + Config: testAccProtocolsSanLunMapResourceBasicConfig("/vol/lunTest/ACC-import-lun", "test", "carchi-test"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_san_lun-maps.example", "svm.name", "carchi-test"), + resource.TestCheckResourceAttr("netapp-ontap_san_lun-map.example", "svm.name", "carchi-test"), ), }, // Import and read { - ResourceName: "netapp-ontap_san_lun-maps.example", + ResourceName: "netapp-ontap_san_lun-map.example", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s,%s", "carchi-test", "acc_test", "/vol/lunTest/test", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_san_lun-maps.example", "svm.name", "carchi-test"), + resource.TestCheckResourceAttr("netapp-ontap_san_lun-map.example", "svm.name", "carchi-test"), ), }, // Delete testing automatically occurs in TestCase @@ -36,7 +36,7 @@ func TestAccProtocolsSanLunMapsResource(t *testing.T) { }) } -func testAccProtocolsSanLunMapsResourceBasicConfig(lunName string, igroupName string, svmName string) string { +func testAccProtocolsSanLunMapResourceBasicConfig(lunName string, igroupName string, svmName string) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -57,7 +57,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_san_lun-maps" "example" { +resource "netapp-ontap_san_lun-map" "example" { cx_profile_name = "cluster4" svm = { name = "%s" diff --git a/internal/provider/provider.go b/internal/provider/provider.go index f015c62c..f654cfac 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -115,7 +115,7 @@ func (p *ONTAPProvider) Schema(ctx context.Context, req provider.SchemaRequest, }, "function_name": schema.StringAttribute{ MarkdownDescription: "AWS Lambda function name", - Optional: true, + Required: true, }, "shared_config_profile": schema.StringAttribute{ MarkdownDescription: "AWS shared config profile. Region set in the profile will be ignored it it's different from the region set in Terraform. aws_access_key_id and aws_secret_access_key are required to be set in credentials", @@ -216,13 +216,13 @@ func (p *ONTAPProvider) Resources(ctx context.Context) []func() resource.Resourc return []func() resource.Resource{ storage.NewAggregateResource, protocols.NewCifsLocalGroupResource, - protocols.NewCifsLocalGroupMemberResource, + protocols.NewCifsLocalGroupMembersResource, protocols.NewCifsLocalUserResource, protocols.NewCifsServiceResource, protocols.NewCifsUserGroupPrivilegeResource, cluster.NewClusterResource, cluster.NewClusterLicensingLicenseResource, - cluster.NewClusterPeersResource, + cluster.NewClusterPeerResource, cluster.NewClusterScheduleResource, NewExampleResource, protocols.NewExportPolicyResource, @@ -234,24 +234,24 @@ func (p *ONTAPProvider) Resources(ctx context.Context) []func() resource.Resourc protocols.NewProtocolsCIFSShareResource, protocols.NewProtocolsNfsServiceResource, protocols.NewProtocolsSanIgroupResource, - protocols.NewProtocolsSanLunMapsResource, + protocols.NewProtocolsSanLunMapResource, security.NewSecurityAccountResource, security.NewSecurityCertificateResource, - security.NewSecurityRolesResource, + security.NewSecurityRoleResource, security.NewSecurityLoginMessageResource, snapmirror.NewSnapmirrorResource, snapmirror.NewSnapmirrorPolicyResource, - storage.NewQOSPoliciesResource, + storage.NewQOSPolicyResource, storage.NewStorageLunResource, storage.NewSnapshotPolicyResource, - storage.NewStorageQuotaRulesResource, + storage.NewStorageQuotaRuleResource, storage.NewStorageFlexcacheRsource, storage.NewStorageVolumeResource, - storage.NewVolumesFilesResource, + storage.NewVolumeFileResource, storage.NewStorageQtreeResource, - storage.NewStorageVolumeEfficiencyPoliciesResource, + storage.NewStorageVolumeEfficiencyPolicyResource, storage.NewStorageVolumeSnapshotResource, - svm.NewSVMPeersResource, + svm.NewSVMPeerResource, svm.NewSvmResource, } } @@ -299,6 +299,8 @@ func (p *ONTAPProvider) DataSources(ctx context.Context) []func() datasource.Dat protocols.NewProtocolsSanLunMapsDataSource, security.NewSecurityAccountDataSource, security.NewSecurityAccountsDataSource, + security.NewSecurityCertificateDataSource, + security.NewSecurityCertificatesDataSource, security.NewSecurityRoleDataSource, security.NewSecurityRolesDataSource, security.NewSecurityLoginMessageDataSource, diff --git a/internal/provider/security/security_account_resource.go b/internal/provider/security/security_account_resource.go index 67ab9f97..e337f631 100644 --- a/internal/provider/security/security_account_resource.go +++ b/internal/provider/security/security_account_resource.go @@ -31,7 +31,7 @@ var _ resource.ResourceWithImportState = &SecurityAccountResource{} func NewSecurityAccountResource() resource.Resource { return &SecurityAccountResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "security_accounts", + Name: "security_account", }, } } diff --git a/internal/provider/security/security_account_resource_test.go b/internal/provider/security/security_account_resource_test.go index 98fd3935..ee306d95 100644 --- a/internal/provider/security/security_account_resource_test.go +++ b/internal/provider/security/security_account_resource_test.go @@ -17,24 +17,24 @@ func TestAccSecurityAccountResource(t *testing.T) { { Config: testAccSecurityAccountResourceConfig("carchitest", "password"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_security_accounts.security_account", "name", "carchitest"), + resource.TestCheckResourceAttr("netapp-ontap_security_account.security_account", "name", "carchitest"), ), }, // Test updating a resource { Config: testAccSecurityAccountResourceConfig("carchitest", "password123"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_security_accounts.security_account", "name", "carchitest"), - resource.TestCheckResourceAttr("netapp-ontap_security_accounts.security_account", "password", "password123"), + resource.TestCheckResourceAttr("netapp-ontap_security_account.security_account", "name", "carchitest"), + resource.TestCheckResourceAttr("netapp-ontap_security_account.security_account", "password", "password123"), ), }, // Test importing a resource { - ResourceName: "netapp-ontap_security_accounts.security_account", + ResourceName: "netapp-ontap_security_account.security_account", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s", "acc_user", "cluster2"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_security_accounts.security_account", "name", "acc_user"), + resource.TestCheckResourceAttr("netapp-ontap_security_account.security_account", "name", "acc_user"), ), }, }, @@ -62,7 +62,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_security_accounts" "security_account" { +resource "netapp-ontap_security_account" "security_account" { # required to know which system to interface with cx_profile_name = "cluster2" name = "%s" diff --git a/internal/provider/security/security_certificate_data_source.go b/internal/provider/security/security_certificate_data_source.go new file mode 100644 index 00000000..cd13982d --- /dev/null +++ b/internal/provider/security/security_certificate_data_source.go @@ -0,0 +1,188 @@ +package security + +import ( + "context" + "fmt" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/netapp/terraform-provider-netapp-ontap/internal/interfaces" + "github.com/netapp/terraform-provider-netapp-ontap/internal/utils" +) + +// Ensure provider defined types fully satisfy framework interfaces +var _ datasource.DataSource = &SecurityCertificateDataSource{} + +// NewSecurityCertificateDataSource is a helper function to simplify the provider implementation. +func NewSecurityCertificateDataSource() datasource.DataSource { + return &SecurityCertificateDataSource{ + config: connection.ResourceOrDataSourceConfig{ + Name: "security_certificate", + }, + } +} + +// SecurityCertificateDataSource defines the data source implementation. +type SecurityCertificateDataSource struct { + config connection.ResourceOrDataSourceConfig +} + +// SecurityCertificateDataSourceModel describes the data source data model. +type SecurityCertificateDataSourceModel struct { + CxProfileName types.String `tfsdk:"cx_profile_name"` + Name types.String `tfsdk:"name"` + CommonName types.String `tfsdk:"common_name"` + SVMName types.String `tfsdk:"svm_name"` + Scope types.String `tfsdk:"scope"` + Type types.String `tfsdk:"type"` + SerialNumber types.String `tfsdk:"serial_number"` + CA types.String `tfsdk:"ca"` + HashFunction types.String `tfsdk:"hash_function"` + KeySize types.Int64 `tfsdk:"key_size"` + ExpiryTime types.String `tfsdk:"expiry_time"` + PublicCertificate types.String `tfsdk:"public_certificate"` + ID types.String `tfsdk:"id"` +} + +// Metadata returns the data source type name. +func (d *SecurityCertificateDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_" + d.config.Name +} + +// Schema defines the schema for the data source. +func (d *SecurityCertificateDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + // This description is used by the documentation generator and the language server. + MarkdownDescription: "SecurityCertificate data source", + + Attributes: map[string]schema.Attribute{ + "cx_profile_name": schema.StringAttribute{ + MarkdownDescription: "Connection profile name", + Required: true, + }, + "name": schema.StringAttribute{ + MarkdownDescription: "The unique name of the security certificate per SVM.", + Required: true, + }, + "common_name": schema.StringAttribute{ + MarkdownDescription: "Common name of the certificate.", + Computed: true, + }, + "type": schema.StringAttribute{ + MarkdownDescription: "Type of Certificate.", + Computed: true, + }, + "svm_name": schema.StringAttribute{ + MarkdownDescription: "SVM name in which the certificate is installed.", + Optional: true, + }, + "scope": schema.StringAttribute{ + MarkdownDescription: "Set to 'svm' for certificates installed in a SVM. Otherwise, set to 'cluster'.", + Computed: true, + }, + "serial_number": schema.StringAttribute{ + MarkdownDescription: "Serial number of certificate.", + Computed: true, + }, + "ca": schema.StringAttribute{ + MarkdownDescription: "Certificate authority.", + Computed: true, + }, + "hash_function": schema.StringAttribute{ + MarkdownDescription: "Hashing function.", + Computed: true, + }, + "key_size": schema.Int64Attribute{ + MarkdownDescription: "Key size of the certificate in bits.", + Computed: true, + }, + "expiry_time": schema.StringAttribute{ + MarkdownDescription: "Certificate expiration time, in ISO 8601 duration format or date and time format.", + Computed: true, + }, + "public_certificate": schema.StringAttribute{ + MarkdownDescription: "Public key Certificate in PEM format.", + Computed: true, + }, + "id": schema.StringAttribute{ + MarkdownDescription: "Certificate uuid.", + Computed: true, + }, + }, + } +} + +// Configure adds the provider configured client to the data source. +func (d *SecurityCertificateDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + config, ok := req.ProviderData.(connection.Config) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected Config, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + } + d.config.ProviderConfig = config +} + +// Read refreshes the Terraform state with the latest data. +func (d *SecurityCertificateDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data SecurityCertificateDataSourceModel + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + errorHandler := utils.NewErrorHandler(ctx, &resp.Diagnostics) + // we need to defer setting the client until we can read the connection profile name + client, err := connection.GetRestClient(errorHandler, d.config, data.CxProfileName) + if err != nil { + // error reporting done inside NewClient + return + } + + cluster, err := interfaces.GetCluster(errorHandler, *client) + if err != nil { + // error reporting done inside GetCluster + return + } + if cluster == nil { + errorHandler.MakeAndReportError("No cluster found", "cluster not found") + return + } + + restInfo, err := interfaces.GetSecurityCertificateByName(errorHandler, *client, cluster.Version, data.Name.ValueString()) + if err != nil { + // error reporting done inside GetSecurityCertificateByName + return + } + + data.Name = types.StringValue(restInfo.Name) + data.CommonName = types.StringValue(restInfo.CommonName) + data.SVMName = types.StringValue(restInfo.SVM.Name) + data.Scope = types.StringValue(restInfo.Scope) + data.Type = types.StringValue(restInfo.Type) + data.SerialNumber = types.StringValue(restInfo.SerialNumber) + data.CA = types.StringValue(restInfo.CA) + data.HashFunction = types.StringValue(restInfo.HashFunction) + data.KeySize = types.Int64Value(restInfo.KeySize) + data.ExpiryTime = types.StringValue(restInfo.ExpiryTime) + data.PublicCertificate = types.StringValue(restInfo.PublicCertificate) + data.ID = types.StringValue(restInfo.UUID) + + // Write logs using the tflog package + // Documentation: https://terraform.io/plugin/log + tflog.Debug(ctx, fmt.Sprintf("read a data source: %#v", data)) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} diff --git a/internal/provider/security/security_certificates_data_source.go b/internal/provider/security/security_certificates_data_source.go new file mode 100644 index 00000000..690efeca --- /dev/null +++ b/internal/provider/security/security_certificates_data_source.go @@ -0,0 +1,234 @@ +package security + +import ( + "context" + "fmt" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/netapp/terraform-provider-netapp-ontap/internal/interfaces" + "github.com/netapp/terraform-provider-netapp-ontap/internal/utils" +) + +// Ensure provider defined types fully satisfy framework interfaces +var _ datasource.DataSource = &SecurityCertificatesDataSource{} + +// NewSecurityCertificatesDataSource is a helper function to simplify the provider implementation. +func NewSecurityCertificatesDataSource() datasource.DataSource { + return &SecurityCertificatesDataSource{ + config: connection.ResourceOrDataSourceConfig{ + Name: "security_certificates", + }, + } +} + +// SecurityCertificatesDataSource defines the data source implementation. +type SecurityCertificatesDataSource struct { + config connection.ResourceOrDataSourceConfig +} + +// SecurityCertificatesDataSourceModel describes the data source data model. +type SecurityCertificatesDataSourceModel struct { + CxProfileName types.String `tfsdk:"cx_profile_name"` + SecurityCertificates []SecurityCertificateDataSourceModel `tfsdk:"security_certificates"` + Filter *SecurityCertificatesDataSourceFilterModel `tfsdk:"filter"` +} + +// SecurityCertificatesDataSourceFilterModel describes the data source data model for queries. +type SecurityCertificatesDataSourceFilterModel struct { + SVMName types.String `tfsdk:"svm_name"` + Scope types.String `tfsdk:"scope"` + CommonName types.String `tfsdk:"common_name"` + Type types.String `tfsdk:"type"` +} + +// Metadata returns the data source type name. +func (d *SecurityCertificatesDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_" + d.config.Name +} + +// Schema defines the schema for the data source. +func (d *SecurityCertificatesDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + // This description is used by the documentation generator and the language server. + MarkdownDescription: "SecurityCertificates data source", + + Attributes: map[string]schema.Attribute{ + "cx_profile_name": schema.StringAttribute{ + MarkdownDescription: "Connection profile name", + Required: true, + }, + "filter": schema.SingleNestedAttribute{ + Attributes: map[string]schema.Attribute{ + "svm_name": schema.StringAttribute{ + MarkdownDescription: "SVM name in which the certificate is installed.", + Optional: true, + }, + "scope": schema.StringAttribute{ + MarkdownDescription: "Set to 'svm' for certificates installed in a SVM. Otherwise, set to 'cluster'.", + Optional: true, + }, + "common_name": schema.StringAttribute{ + MarkdownDescription: "Common name of the certificate.", + Optional: true, + }, + "type": schema.StringAttribute{ + MarkdownDescription: "Type of certificate.", + Optional: true, + }, + }, + Optional: true, + }, + "security_certificates": schema.ListNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "cx_profile_name": schema.StringAttribute{ + MarkdownDescription: "Connection profile name", + Computed: true, + }, + "name": schema.StringAttribute{ + MarkdownDescription: "The unique name of the security certificate per SVM.", + Computed: true, + }, + "common_name": schema.StringAttribute{ + MarkdownDescription: "Common name of the certificate.", + Computed: true, + }, + "type": schema.StringAttribute{ + MarkdownDescription: "Type of certificate.", + Computed: true, + }, + "svm_name": schema.StringAttribute{ + MarkdownDescription: "SVM name in which the certificate is installed.", + Computed: true, + }, + "scope": schema.StringAttribute{ + MarkdownDescription: "Set to 'svm' for certificates installed in a SVM. Otherwise, set to 'cluster'.", + Computed: true, + }, + "serial_number": schema.StringAttribute{ + MarkdownDescription: "Serial number of certificate.", + Computed: true, + }, + "ca": schema.StringAttribute{ + MarkdownDescription: "Certificate authority.", + Computed: true, + }, + "hash_function": schema.StringAttribute{ + MarkdownDescription: "Hashing function.", + Computed: true, + }, + "key_size": schema.Int64Attribute{ + MarkdownDescription: "Key size of the certificate in bits.", + Computed: true, + }, + "expiry_time": schema.StringAttribute{ + MarkdownDescription: "Certificate expiration time, in ISO 8601 duration format or date and time format.", + Computed: true, + }, + "public_certificate": schema.StringAttribute{ + MarkdownDescription: "Public key Certificate in PEM format.", + Computed: true, + }, + "id": schema.StringAttribute{ + MarkdownDescription: "Certificate uuid.", + Computed: true, + }, + }, + }, + Computed: true, + MarkdownDescription: "", + }, + }, + } +} + +// Configure adds the provider configured client to the data source. +func (d *SecurityCertificatesDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + config, ok := req.ProviderData.(connection.Config) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected Config, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + } + d.config.ProviderConfig = config +} + +// Read refreshes the Terraform state with the latest data. +func (d *SecurityCertificatesDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data SecurityCertificatesDataSourceModel + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + errorHandler := utils.NewErrorHandler(ctx, &resp.Diagnostics) + // we need to defer setting the client until we can read the connection profile name + client, err := connection.GetRestClient(errorHandler, d.config, data.CxProfileName) + if err != nil { + // error reporting done inside NewClient + return + } + + cluster, err := interfaces.GetCluster(errorHandler, *client) + if err != nil { + // error reporting done inside GetCluster + return + } + if cluster == nil { + errorHandler.MakeAndReportError("No cluster found", "cluster not found") + return + } + + var filter *interfaces.SecurityCertificateDataSourceFilterModel = nil + if data.Filter != nil { + filter = &interfaces.SecurityCertificateDataSourceFilterModel{ + SVMName: data.Filter.SVMName.ValueString(), + Scope: data.Filter.Scope.ValueString(), + CommonName: data.Filter.CommonName.ValueString(), + Type: data.Filter.Type.ValueString(), + } + } + restInfo, err := interfaces.GetSecurityCertificates(errorHandler, *client, cluster.Version, filter) + if err != nil { + // error reporting done inside GetSecurityCertificates + return + } + + data.SecurityCertificates = make([]SecurityCertificateDataSourceModel, len(restInfo)) + for index, record := range restInfo { + data.SecurityCertificates[index] = SecurityCertificateDataSourceModel{ + CxProfileName: types.String(data.CxProfileName), + Name: types.StringValue(record.Name), + CommonName: types.StringValue(record.CommonName), + SVMName: types.StringValue(record.SVM.Name), + Scope: types.StringValue(record.Scope), + Type: types.StringValue(record.Type), + SerialNumber: types.StringValue(record.SerialNumber), + CA: types.StringValue(record.CA), + HashFunction: types.StringValue(record.HashFunction), + KeySize: types.Int64Value(record.KeySize), + ExpiryTime: types.StringValue(record.ExpiryTime), + PublicCertificate: types.StringValue(record.PublicCertificate), + ID: types.StringValue(record.UUID), + } + } + + // Write logs using the tflog package + // Documentation: https://terraform.io/plugin/log + tflog.Debug(ctx, fmt.Sprintf("read a data source: %#v", data)) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} diff --git a/internal/provider/security/security_login_message_resource.go b/internal/provider/security/security_login_message_resource.go index 8ce203d7..a92e6e5e 100644 --- a/internal/provider/security/security_login_message_resource.go +++ b/internal/provider/security/security_login_message_resource.go @@ -26,7 +26,7 @@ var _ resource.ResourceWithImportState = &SecurityLoginMessageResource{} func NewSecurityLoginMessageResource() resource.Resource { return &SecurityLoginMessageResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "security_login_messages", + Name: "security_login_message", }, } } diff --git a/internal/provider/security/security_security_login_message_resource_test.go b/internal/provider/security/security_login_message_resource_test.go similarity index 87% rename from internal/provider/security/security_security_login_message_resource_test.go rename to internal/provider/security/security_login_message_resource_test.go index 7c1eb021..9646b6e4 100644 --- a/internal/provider/security/security_security_login_message_resource_test.go +++ b/internal/provider/security/security_login_message_resource_test.go @@ -23,20 +23,20 @@ func TestAccSecurityLoginMessage(t *testing.T) { }, // Import and read with cluster { - ResourceName: "netapp-ontap_security_login_messages.example", + ResourceName: "netapp-ontap_security_login_message.example", ImportState: true, ImportStateId: "cluster1", Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_security_login_messages.example", "scope", "cluster"), + resource.TestCheckResourceAttr("netapp-ontap_security_login_message.example", "scope", "cluster"), ), }, // Import and read with svm { - ResourceName: "netapp-ontap_security_login_messages.example", + ResourceName: "netapp-ontap_security_login_message.example", ImportState: true, ImportStateId: "svm5,cluster1", Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_security_login_messages.example", "scope", "svm"), + resource.TestCheckResourceAttr("netapp-ontap_security_login_message.example", "scope", "svm"), ), }, // Update a option cannot tested in acc test @@ -66,7 +66,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_security_login_messages" "example" { +resource "netapp-ontap_security_login_message" "example" { cx_profile_name = "cluster1" message = "Test cluster only \n message\n on the cluster" show_cluster_message = true diff --git a/internal/provider/security/security_roles_resource.go b/internal/provider/security/security_role_resource.go similarity index 99% rename from internal/provider/security/security_roles_resource.go rename to internal/provider/security/security_role_resource.go index a3b675dd..84e366a9 100644 --- a/internal/provider/security/security_roles_resource.go +++ b/internal/provider/security/security_role_resource.go @@ -27,10 +27,10 @@ var _ resource.Resource = &SecurityRoleResource{} var _ resource.ResourceWithImportState = &SecurityRoleResource{} // NewSecurityRoleResource is a helper function to simplify the provider implementation. -func NewSecurityRolesResource() resource.Resource { +func NewSecurityRoleResource() resource.Resource { return &SecurityRoleResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "security_roles", + Name: "security_role", }, } } diff --git a/internal/provider/security/security_roles_resource_test.go b/internal/provider/security/security_role_resource_test.go similarity index 82% rename from internal/provider/security/security_roles_resource_test.go rename to internal/provider/security/security_role_resource_test.go index 4335fa6c..169af893 100644 --- a/internal/provider/security/security_roles_resource_test.go +++ b/internal/provider/security/security_role_resource_test.go @@ -9,7 +9,7 @@ import ( ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider" ) -func TestAccSecurityRolesResource(t *testing.T) { +func TestAccSecurityRoleResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, @@ -17,30 +17,30 @@ func TestAccSecurityRolesResource(t *testing.T) { { Config: testAccSecurityRoleResourceConfig("acc_test_security_role"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_security_roles.security_role", "name", "acc_test_security_role"), + resource.TestCheckResourceAttr("netapp-ontap_security_role.security_role", "name", "acc_test_security_role"), ), }, // Test adding a new priviledge to the security role { Config: AddPriviledge("acc_test_security_role"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_security_roles.security_role", "name", "acc_test_security_role"), + resource.TestCheckResourceAttr("netapp-ontap_security_role.security_role", "name", "acc_test_security_role"), ), }, // Test editing a priviledge and deleting a priviledge from the security role { Config: EditPriviledgeAndDeletePriviledge("acc_test_security_role"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_security_roles.security_role", "name", "acc_test_security_role"), + resource.TestCheckResourceAttr("netapp-ontap_security_role.security_role", "name", "acc_test_security_role"), ), }, // Test importing a security role { - ResourceName: "netapp-ontap_security_roles.security_role", + ResourceName: "netapp-ontap_security_role.security_role", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s", "acc_test_import_security_role", "acc_test", "cluster2"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_security_roles.security_role", "name", "acc_test_import_security_role"), + resource.TestCheckResourceAttr("netapp-ontap_security_role.security_role", "name", "acc_test_import_security_role"), ), }, }, @@ -68,7 +68,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_security_roles" "security_role" { +resource "netapp-ontap_security_role" "security_role" { # required to know which system to interface with cx_profile_name = "cluster2" name = "%s" @@ -104,7 +104,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_security_roles" "security_role" { +resource "netapp-ontap_security_role" "security_role" { # required to know which system to interface with cx_profile_name = "cluster2" name = "%s" @@ -145,7 +145,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_security_roles" "security_role" { +resource "netapp-ontap_security_role" "security_role" { # required to know which system to interface with cx_profile_name = "cluster2" name = "%s" diff --git a/internal/provider/storage/storage_qos_policies_resource.go b/internal/provider/storage/storage_qos_policy_resource.go similarity index 99% rename from internal/provider/storage/storage_qos_policies_resource.go rename to internal/provider/storage/storage_qos_policy_resource.go index 3c9d8d35..814bebc7 100644 --- a/internal/provider/storage/storage_qos_policies_resource.go +++ b/internal/provider/storage/storage_qos_policy_resource.go @@ -30,10 +30,10 @@ var _ resource.Resource = &QOSPoliciesResource{} var _ resource.ResourceWithImportState = &QOSPoliciesResource{} // NewQOSPoliciesResource is a helper function to simplify the provider implementation. -func NewQOSPoliciesResource() resource.Resource { +func NewQOSPolicyResource() resource.Resource { return &QOSPoliciesResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "qos_policies", + Name: "qos_policy", }, } } diff --git a/internal/provider/storage/storage_qos_policies_resource_test.go b/internal/provider/storage/storage_qos_policy_resource_test.go similarity index 63% rename from internal/provider/storage/storage_qos_policies_resource_test.go rename to internal/provider/storage/storage_qos_policy_resource_test.go index 30f1cc6d..14b792c1 100644 --- a/internal/provider/storage/storage_qos_policies_resource_test.go +++ b/internal/provider/storage/storage_qos_policy_resource_test.go @@ -10,33 +10,33 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccQOSPoliciesResource(t *testing.T) { +func TestAccQOSPolicyResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ - // Create qos_policies and read + // Create qos_policy and read { - Config: testAccQOSPoliciesResourceBasicConfig("terraform", "terraform", "1"), + Config: testAccQOSPolicyResourceBasicConfig("terraform", "terraform", "1"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_qos_policies.example", "name", "terraform"), + resource.TestCheckResourceAttr("netapp-ontap_qos_policy.example", "name", "terraform"), ), }, // Update a option { - Config: testAccQOSPoliciesResourceBasicConfig("terraform", "terraform", "2"), + Config: testAccQOSPolicyResourceBasicConfig("terraform", "terraform", "2"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_qos_policies.example", "fixed.max_throughput_iops", "2"), - resource.TestCheckResourceAttr("netapp-ontap_qos_policies.example", "name", "terraform"), + resource.TestCheckResourceAttr("netapp-ontap_qos_policy.example", "fixed.max_throughput_iops", "2"), + resource.TestCheckResourceAttr("netapp-ontap_qos_policy.example", "name", "terraform"), ), }, // Import and read { - ResourceName: "netapp-ontap_qos_policies.example", + ResourceName: "netapp-ontap_qos_policy.example", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s", "test", "terraform", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_qos_policies.example", "name", "test"), + resource.TestCheckResourceAttr("netapp-ontap_qos_policy.example", "name", "test"), ), }, // Delete testing automatically occurs in TestCase @@ -44,7 +44,7 @@ func TestAccQOSPoliciesResource(t *testing.T) { }) } -func testAccQOSPoliciesResourceBasicConfig(name string, svmName string, maxThroughputIOPS string) string { +func testAccQOSPolicyResourceBasicConfig(name string, svmName string, maxThroughputIOPS string) string { host := os.Getenv("TF_ACC_NETAPP_HOST5") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS2") @@ -65,7 +65,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_qos_policies" "example" { +resource "netapp-ontap_qos_policy" "example" { cx_profile_name = "cluster4" name = "%s" svm_name = "%s" diff --git a/internal/provider/storage/storage_qtrees_resource.go b/internal/provider/storage/storage_qtree_resource.go similarity index 99% rename from internal/provider/storage/storage_qtrees_resource.go rename to internal/provider/storage/storage_qtree_resource.go index 2361e6e0..c232aa10 100644 --- a/internal/provider/storage/storage_qtrees_resource.go +++ b/internal/provider/storage/storage_qtree_resource.go @@ -31,7 +31,7 @@ var _ resource.ResourceWithImportState = &StorageQtreeResource{} func NewStorageQtreeResource() resource.Resource { return &StorageQtreeResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "storage_qtrees", + Name: "qtree", }, } } @@ -96,7 +96,6 @@ func (r *StorageQtreeResource) Schema(ctx context.Context, req resource.SchemaRe "id": schema.Int64Attribute{ MarkdownDescription: "StorageQtree UUID", Computed: true, - Optional: true, PlanModifiers: []planmodifier.Int64{ int64planmodifier.UseStateForUnknown(), }, @@ -312,9 +311,6 @@ func (r *StorageQtreeResource) Create(ctx context.Context, req resource.CreateRe body.SVM.Name = data.SVMName.ValueString() body.Volume.Name = data.Volume.ValueString() - if !data.ID.IsUnknown() { - body.ID = int(data.ID.ValueInt64()) - } if !data.SecurityStyle.IsUnknown() { body.SecurityStyle = data.SecurityStyle.ValueString() } diff --git a/internal/provider/storage/storage_qtrees_resource_test.go b/internal/provider/storage/storage_qtree_resource_test.go similarity index 73% rename from internal/provider/storage/storage_qtrees_resource_test.go rename to internal/provider/storage/storage_qtree_resource_test.go index 574c56a9..8e58b8b0 100644 --- a/internal/provider/storage/storage_qtrees_resource_test.go +++ b/internal/provider/storage/storage_qtree_resource_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccStorageQtreesResource(t *testing.T) { +func TestAccStorageQtreeResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, @@ -19,25 +19,25 @@ func TestAccStorageQtreesResource(t *testing.T) { { Config: createQtree("acc_test_qtree", "temp_root", "temp"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_storage_qtrees.example", "name", "acc_test_qtree"), - resource.TestCheckResourceAttr("netapp-ontap_storage_qtrees.example", "user.name", "nobody"), + resource.TestCheckResourceAttr("netapp-ontap_qtree.example", "name", "acc_test_qtree"), + resource.TestCheckResourceAttr("netapp-ontap_qtree.example", "user.name", "nobody"), ), }, { Config: updateGroupAndUser("acc_test_qtree", "temp_root", "temp"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_storage_qtrees.example", "name", "acc_test_qtree"), - resource.TestCheckResourceAttr("netapp-ontap_storage_qtrees.example", "user.name", "root"), - resource.TestCheckResourceAttr("netapp-ontap_storage_qtrees.example", "group.name", "root"), + resource.TestCheckResourceAttr("netapp-ontap_qtree.example", "name", "acc_test_qtree"), + resource.TestCheckResourceAttr("netapp-ontap_qtree.example", "user.name", "root"), + resource.TestCheckResourceAttr("netapp-ontap_qtree.example", "group.name", "root"), ), }, // Test importing a resource { - ResourceName: "netapp-ontap_storage_qtrees.example", + ResourceName: "netapp-ontap_qtree.example", ImportState: true, - ImportStateId: fmt.Sprintf("%s,%s,%s,%s", "acc_import", "temp_root", "temp", "cluster5"), + ImportStateId: fmt.Sprintf("%s,%s,%s,%s", "acc_import", "acc_test_root", "acc_test", "cluster5"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_storage_qtrees.example", "name", "accFlexcache"), + resource.TestCheckResourceAttr("netapp-ontap_qtree.example", "name", "acc_import"), ), }, }, @@ -66,7 +66,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_storage_qtrees" "example" { +resource "netapp-ontap_qtree" "example" { cx_profile_name = "cluster5" name = "%s" volume_name = "%s" @@ -103,7 +103,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_storage_qtrees" "example" { +resource "netapp-ontap_qtree" "example" { cx_profile_name = "cluster5" name = "%s" volume_name = "%s" diff --git a/internal/provider/storage/storage_quota_rules_resource.go b/internal/provider/storage/storage_quota_rule_resource.go similarity index 99% rename from internal/provider/storage/storage_quota_rules_resource.go rename to internal/provider/storage/storage_quota_rule_resource.go index 2bdcc569..9f0fd4a9 100644 --- a/internal/provider/storage/storage_quota_rules_resource.go +++ b/internal/provider/storage/storage_quota_rule_resource.go @@ -27,10 +27,10 @@ var _ resource.Resource = &StorageQuotaRulesResource{} var _ resource.ResourceWithImportState = &StorageQuotaRulesResource{} // NewStorageQuotaRulesResource is a helper function to simplify the provider implementation. -func NewStorageQuotaRulesResource() resource.Resource { +func NewStorageQuotaRuleResource() resource.Resource { return &StorageQuotaRulesResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "quota_rules", + Name: "quota_rule", }, } } diff --git a/internal/provider/storage/storage_quota_rules_resource_test.go b/internal/provider/storage/storage_quota_rule_resource_test.go similarity index 64% rename from internal/provider/storage/storage_quota_rules_resource_test.go rename to internal/provider/storage/storage_quota_rule_resource_test.go index 30a1d794..01e3c20e 100644 --- a/internal/provider/storage/storage_quota_rules_resource_test.go +++ b/internal/provider/storage/storage_quota_rule_resource_test.go @@ -10,33 +10,33 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccStorageQuotaRulesResource(t *testing.T) { +func TestAccStorageQuotaRuleResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ - // Create storage_quota_rules and read + // Create storage_quota_rule and read { - Config: testAccStorageQuotaRulesResourceBasicConfig("lunTest", "carchi-test", 100, 80), + Config: testAccStorageQuotaRuleResourceBasicConfig("lunTest", "carchi-test", 100, 80), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_quota_rules.example", "qtree.name", ""), + resource.TestCheckResourceAttr("netapp-ontap_quota_rule.example", "qtree.name", ""), ), }, // Update a option { - Config: testAccStorageQuotaRulesResourceBasicConfig("lunTest", "carchi-test", 100, 70), + Config: testAccStorageQuotaRuleResourceBasicConfig("lunTest", "carchi-test", 100, 70), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_quota_rules.example", "files.hard_limit", "100"), - resource.TestCheckResourceAttr("netapp-ontap_quota_rules.example", "files.soft_limit", "70"), + resource.TestCheckResourceAttr("netapp-ontap_quota_rule.example", "files.hard_limit", "100"), + resource.TestCheckResourceAttr("netapp-ontap_quota_rule.example", "files.soft_limit", "70"), ), }, // Import and read { - ResourceName: "netapp-ontap_quota_rules.example", + ResourceName: "netapp-ontap_quota_rule.example", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s,%s,%s", "lunTest", "carchi-test", "tree", "testacc", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_quota_rules.example", "name", "name2"), + resource.TestCheckResourceAttr("netapp-ontap_quota_rule.example", "name", "name2"), ), }, // Delete testing automatically occurs in TestCase @@ -44,7 +44,7 @@ func TestAccStorageQuotaRulesResource(t *testing.T) { }) } -func testAccStorageQuotaRulesResourceBasicConfig(volumeName string, svmName string, hardLimit int64, softLimit int64) string { +func testAccStorageQuotaRuleResourceBasicConfig(volumeName string, svmName string, hardLimit int64, softLimit int64) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -65,7 +65,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_quota_rules" "example" { +resource "netapp-ontap_quota_rule" "example" { cx_profile_name = "cluster4" volume = { name = "%s" diff --git a/internal/provider/storage/storage_volume_efficiency_policies_resource.go b/internal/provider/storage/storage_volume_efficiency_policy_resource.go similarity index 99% rename from internal/provider/storage/storage_volume_efficiency_policies_resource.go rename to internal/provider/storage/storage_volume_efficiency_policy_resource.go index 7b0389f9..73f54710 100644 --- a/internal/provider/storage/storage_volume_efficiency_policies_resource.go +++ b/internal/provider/storage/storage_volume_efficiency_policy_resource.go @@ -29,10 +29,10 @@ var _ resource.Resource = &StorageVolumeEfficiencyPoliciesResource{} var _ resource.ResourceWithImportState = &StorageVolumeEfficiencyPoliciesResource{} // NewStorageVolumeEfficiencyPoliciesResource is a helper function to simplify the provider implementation. -func NewStorageVolumeEfficiencyPoliciesResource() resource.Resource { +func NewStorageVolumeEfficiencyPolicyResource() resource.Resource { return &StorageVolumeEfficiencyPoliciesResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "volume_efficiency_policies", + Name: "volume_efficiency_policy", }, } } diff --git a/internal/provider/storage/storage_volume_efficiency_policies_resource_test.go b/internal/provider/storage/storage_volume_efficiency_policy_resource_test.go similarity index 71% rename from internal/provider/storage/storage_volume_efficiency_policies_resource_test.go rename to internal/provider/storage/storage_volume_efficiency_policy_resource_test.go index c58e8250..0d9aa8f2 100644 --- a/internal/provider/storage/storage_volume_efficiency_policies_resource_test.go +++ b/internal/provider/storage/storage_volume_efficiency_policy_resource_test.go @@ -10,33 +10,33 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccStorageVolumeEfficiencyPoliciesResource(t *testing.T) { +func TestAccStorageVolumeEfficiencyPolicyResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ - // Create volume_efficiency_policies and read + // Create volume_efficiency_policy and read { - Config: testAccStorageVolumeEfficiencyPoliciesResourceBasicConfig("testacc", "terraform"), + Config: testAccStorageVolumeEfficiencyPolicyResourceBasicConfig("testacc", "terraform"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_volume_efficiency_policies.example", "name", "testacc"), + resource.TestCheckResourceAttr("netapp-ontap_volume_efficiency_policy.example", "name", "testacc"), ), }, // Update a option { - Config: testAccStorageVolumeEfficiencyPoliciesResourceUpdateConfig("testacc", "terraform", "test_comment"), + Config: testAccStorageVolumeEfficiencyPolicyResourceUpdateConfig("testacc", "terraform", "test_comment"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_volume_efficiency_policies.example", "comment", "test_comment"), - resource.TestCheckResourceAttr("netapp-ontap_volume_efficiency_policies.example", "name", "testacc"), + resource.TestCheckResourceAttr("netapp-ontap_volume_efficiency_policy.example", "comment", "test_comment"), + resource.TestCheckResourceAttr("netapp-ontap_volume_efficiency_policy.example", "name", "testacc"), ), }, // Import and read { - ResourceName: "netapp-ontap_volume_efficiency_policies.example", + ResourceName: "netapp-ontap_volume_efficiency_policy.example", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s", "test", "terraform", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_volume_efficiency_policies.example", "name", "test"), + resource.TestCheckResourceAttr("netapp-ontap_volume_efficiency_policy.example", "name", "test"), ), }, // Delete testing automatically occurs in TestCase @@ -44,7 +44,7 @@ func TestAccStorageVolumeEfficiencyPoliciesResource(t *testing.T) { }) } -func testAccStorageVolumeEfficiencyPoliciesResourceBasicConfig(name string, svmName string) string { +func testAccStorageVolumeEfficiencyPolicyResourceBasicConfig(name string, svmName string) string { host := os.Getenv("TF_ACC_NETAPP_HOST5") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS2") @@ -65,7 +65,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_volume_efficiency_policies" "example" { +resource "netapp-ontap_volume_efficiency_policy" "example" { cx_profile_name = "cluster4" name = "%s" svm = { @@ -74,7 +74,7 @@ resource "netapp-ontap_volume_efficiency_policies" "example" { }`, host, admin, password, name, svmName) } -func testAccStorageVolumeEfficiencyPoliciesResourceUpdateConfig(name string, svmName string, comment string) string { +func testAccStorageVolumeEfficiencyPolicyResourceUpdateConfig(name string, svmName string, comment string) string { host := os.Getenv("TF_ACC_NETAPP_HOST5") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS2") @@ -95,7 +95,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_volume_efficiency_policies" "example" { +resource "netapp-ontap_volume_efficiency_policy" "example" { cx_profile_name = "cluster4" name = "%s" svm = { diff --git a/internal/provider/storage/storage_volumes_files_resource.go b/internal/provider/storage/storage_volume_file_resource.go similarity index 99% rename from internal/provider/storage/storage_volumes_files_resource.go rename to internal/provider/storage/storage_volume_file_resource.go index aa12b8e0..a3c906db 100644 --- a/internal/provider/storage/storage_volumes_files_resource.go +++ b/internal/provider/storage/storage_volume_file_resource.go @@ -24,10 +24,10 @@ var _ resource.Resource = &VolumesFilesResource{} var _ resource.ResourceWithImportState = &VolumesFilesResource{} // NewVolumesFilesResource is a helper function to simplify the provider implementation. -func NewVolumesFilesResource() resource.Resource { +func NewVolumeFileResource() resource.Resource { return &VolumesFilesResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "volumes_files", + Name: "volume_file", }, } } diff --git a/internal/provider/storage/storage_volumes_files_resource_test.go b/internal/provider/storage/storage_volume_file_resource_test.go similarity index 72% rename from internal/provider/storage/storage_volumes_files_resource_test.go rename to internal/provider/storage/storage_volume_file_resource_test.go index 9286ab5e..d0edb68d 100644 --- a/internal/provider/storage/storage_volumes_files_resource_test.go +++ b/internal/provider/storage/storage_volume_file_resource_test.go @@ -10,32 +10,32 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccVolumesFilesResource(t *testing.T) { +func TestAccVolumeFileResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ // Create volumes_files and read { - Config: testAccVolumesFilesResourceBasicConfig("terraform", "terraform", "test"), + Config: testAccVolumeFileResourceBasicConfig("terraform", "terraform", "test"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_volumes_files.example", "path", "test"), + resource.TestCheckResourceAttr("netapp-ontap_volume_file.example", "path", "test"), ), }, // Update a option { - Config: testAccVolumesFilesResourceUpdateConfig("terraform", "terraform", "vol1"), + Config: testAccVolumeFileResourceUpdateConfig("terraform", "terraform", "vol1"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_volumes_files.example", "path", "vol1"), + resource.TestCheckResourceAttr("netapp-ontap_volume_file.example", "path", "vol1"), ), }, // Import and read { - ResourceName: "netapp-ontap_volumes_files.example", + ResourceName: "netapp-ontap_volume_file.example", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s,%s", "snap_dest2", "terraform", ".snapshot", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_volumes_files.example", "path", ".snapshot"), + resource.TestCheckResourceAttr("netapp-ontap_volume_file.example", "path", ".snapshot"), ), }, // Delete testing automatically occurs in TestCase @@ -43,7 +43,7 @@ func TestAccVolumesFilesResource(t *testing.T) { }) } -func testAccVolumesFilesResourceBasicConfig(volName string, svmName string, path string) string { +func testAccVolumeFileResourceBasicConfig(volName string, svmName string, path string) string { host := os.Getenv("TF_ACC_NETAPP_HOST5") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS2") @@ -64,7 +64,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_volumes_files" "example" { +resource "netapp-ontap_volume_file" "example" { cx_profile_name = "cluster4" volume_name = "%s" svm_name = "%s" @@ -74,7 +74,7 @@ resource "netapp-ontap_volumes_files" "example" { }`, host, admin, password, volName, svmName, path) } -func testAccVolumesFilesResourceUpdateConfig(volName string, svmName string, path string) string { +func testAccVolumeFileResourceUpdateConfig(volName string, svmName string, path string) string { host := os.Getenv("TF_ACC_NETAPP_HOST5") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS2") @@ -95,7 +95,7 @@ provider "netapp-ontap" { ] } - resource "netapp-ontap_volumes_files" "example" { + resource "netapp-ontap_volume_file" "example" { cx_profile_name = "cluster4" volume_name = "%s" svm_name = "%s" diff --git a/internal/provider/storage/storage_volumes_files_data_source.go b/internal/provider/storage/storage_volume_files_data_source.go similarity index 100% rename from internal/provider/storage/storage_volumes_files_data_source.go rename to internal/provider/storage/storage_volume_files_data_source.go diff --git a/internal/provider/svm/svm_peers_resource.go b/internal/provider/svm/svm_peer_resource.go similarity index 99% rename from internal/provider/svm/svm_peers_resource.go rename to internal/provider/svm/svm_peer_resource.go index 32c04f23..ac8e821e 100644 --- a/internal/provider/svm/svm_peers_resource.go +++ b/internal/provider/svm/svm_peer_resource.go @@ -3,11 +3,12 @@ package svm import ( "context" "fmt" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" - "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/snapmirror" "reflect" "strings" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection" + "github.com/netapp/terraform-provider-netapp-ontap/internal/provider/snapmirror" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" @@ -24,10 +25,10 @@ var _ resource.Resource = &SVMPeersResource{} var _ resource.ResourceWithImportState = &SVMPeersResource{} // NewSVMPeersResource is a helper function to simplify the provider implementation. -func NewSVMPeersResource() resource.Resource { +func NewSVMPeerResource() resource.Resource { return &SVMPeersResource{ config: connection.ResourceOrDataSourceConfig{ - Name: "svm_peers", + Name: "svm_peer", }, } } diff --git a/internal/provider/svm/svm_peers_resource_test.go b/internal/provider/svm/svm_peer_resource_test.go similarity index 85% rename from internal/provider/svm/svm_peers_resource_test.go rename to internal/provider/svm/svm_peer_resource_test.go index 28b036be..1b136e23 100644 --- a/internal/provider/svm/svm_peers_resource_test.go +++ b/internal/provider/svm/svm_peer_resource_test.go @@ -11,14 +11,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccSvmPeersResource(t *testing.T) { +func TestAccSvmPeerResource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { ntest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ // Test cluster peer non existant to do svm peer { - Config: testAccSvmPeersResourceConfig("testme", "testme2", "abcd", "snapmirror"), + Config: testAccSvmPeerResourceConfig("testme", "testme2", "abcd", "snapmirror"), ExpectError: regexp.MustCompile("9895941"), }, // Testing in VSIM is failing to peer @@ -39,17 +39,17 @@ func TestAccSvmPeersResource(t *testing.T) { // }, // Import and read { - ResourceName: "netapp-ontap_svm_peers.example", + ResourceName: "netapp-ontap_svm_peer.example", ImportState: true, ImportStateId: fmt.Sprintf("%s,%s,%s,%s", "terraform", "tf_peer", "swenjuncluster-1", "cluster4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netapp-ontap_svm_peers.example", "svm.name", "snapmirror_dest_dp"), + resource.TestCheckResourceAttr("netapp-ontap_svm_peer.example", "svm.name", "snapmirror_dest_dp"), ), }, }, }) } -func testAccSvmPeersResourceConfig(svm, peerSvm, peerCluster, applications string) string { +func testAccSvmPeerResourceConfig(svm, peerSvm, peerCluster, applications string) string { host := os.Getenv("TF_ACC_NETAPP_HOST5") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -79,7 +79,7 @@ provider "netapp-ontap" { ] } -resource "netapp-ontap_svm_peers" "example" { +resource "netapp-ontap_svm_peer" "example" { cx_profile_name = "cluster4" svm = { name = "%s" diff --git a/scripts/generate_docs.py b/scripts/generate_docs.py index 29879ac7..1377697a 100755 --- a/scripts/generate_docs.py +++ b/scripts/generate_docs.py @@ -2,9 +2,9 @@ import os import sys -# TO find the correct Catagory, check REST API to see what main header this API lives under +# TO find the correct Category, check REST API to see what main header this API lives under -CATAGORYS = { +CATEGORIES = { 'application': [], 'cloud': [], 'cluster': [ @@ -25,7 +25,7 @@ "protocols_cifs_local_group_resource.md", "protocols_cifs_local_group_member_data_source.md", "protocols_cifs_local_group_members_data_source.md", - "protocols_cifs_local_group_member_resource.md", + "protocols_cifs_local_group_members_resource.md", "protocols_cifs_local_user_data_source.md", "protocols_cifs_local_users_data_source.md", "protocols_cifs_local_user_resource.md", @@ -57,12 +57,12 @@ ], 'ndmp': [], 'networking': [ - "networking_ip_interface_data_source.md", - "networking_ip_interfaces_data_source.md", - "networking_ip_interface_resource.md", - "networking_ip_route_data_source.md", - "networking_ip_routes_data_source.md", - "networking_ip_route_resource.md"], + "network_ip_interface_data_source.md", + "network_ip_interfaces_data_source.md", + "network_ip_interface_resource.md", + "network_ip_route_data_source.md", + "network_ip_routes_data_source.md", + "network_ip_route_resource.md"], 'nvme': [], 'object-store': [], 'san': [ @@ -78,12 +78,16 @@ "security_accounts_data_source.md", "security_account_resource.md", "security_login_message_data_source.md", + "security_login_message_resource.md", "security_login_messages_data_source.md", "security_role_data_source.md", "security_roles_data_source.md", "security_roles_resource.md", "security_login_message_resource.md", + "security_certificate_data_source.md", + "security_certificates_data_source.md", "security_certificate_resource.md", + ], 'snaplock': [], 'snapmirror': [ @@ -103,7 +107,12 @@ "storage_lun_data_source.md", "storage_luns_data_source.md", "storage_lun_resource.md", - "storage_quota_rules_resource.md", + "storage_qos_policies_data_source.md", + "storage_qos_policy_data_source.md", + "storage_qos_policy_resoruce.md", + "storage_quota_rule_data_source.md", + "storage_quota_rules_data_source.md", + "storage_quota_rule_resource.md", "storage_qtree_data_source.md", "storage_qtrees_data_source.md", "storage_qtree_resource.md", @@ -119,7 +128,7 @@ "storage_volume_snapshot_resource.md"], 'support': [], 'svm': ["svm_resource.md", - "svm_peers_resource.md", + "svm_peer_resource.md", "svm_peer_data_source.md", "svm_peers_data_source.md",], } @@ -129,12 +138,12 @@ def main(): print("===== Generating docs =====") generate_doc() remove_example() - print("===== Adding Catagories =====") + print("===== Adding Categories =====") add_catagories() print("===== Validate =====") validate() print("===== Errors =====") - issue = warn_missing_catagory(["docs/data-sources/", "docs/resources/"]) + issue = warn_missing_category(["docs/data-sources/", "docs/resources/"]) if issue: sys.exit(1) @@ -157,25 +166,25 @@ def remove_example(): def add_catagories(): - for catagory in CATAGORYS: - for page in CATAGORYS[catagory]: + for category in CATEGORIES: + for page in CATEGORIES[category]: if 'data_source' in page: - update_datasource(page, catagory) + update_datasource(page, category) if 'resource' in page: - update_resouces(page, catagory) + update_resouces(page, category) -def update_datasource(page, catagory): +def update_datasource(page, category): path = "docs/data-sources/" + page - update_md_file(path, catagory) + update_md_file(path, category) -def update_resouces(page, catagory): +def update_resouces(page, category): path = "docs/resources/" + page - update_md_file(path, catagory) + update_md_file(path, category) -def update_md_file(path, catagory): +def update_md_file(path, category): print("Updating %s" % path) try: with open(path) as f: @@ -183,7 +192,7 @@ def update_md_file(path, catagory): for i, line in enumerate(lines): if line.startswith('subcategory: "'): split_line = line.split('subcategory: "') - new_line = split_line[0] + 'subcategory: "' + catagory + split_line[1] + new_line = split_line[0] + 'subcategory: "' + category + split_line[1] lines[i] = new_line break with open(path, 'w') as f: @@ -191,7 +200,7 @@ def update_md_file(path, catagory): except: return -def warn_missing_catagory(directory_paths): +def warn_missing_category(directory_paths): issue = False for directory_path in directory_paths: full_path = os.path.join(os.getcwd(), directory_path) @@ -200,7 +209,7 @@ def warn_missing_catagory(directory_paths): with open(os.path.join(full_path, filename), 'r') as f: file_content = f.read() if 'subcategory: ""' in file_content: - print('%s is missing a catagory' % filename) + print('%s is missing a category' % filename) issue = True return issue