Skip to content

Commit

Permalink
Added changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjun666 committed Sep 17, 2024
1 parent df1370d commit e8bbee2
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 58 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ BREAKING CHANGES:
* **Rename Resource:** `netapp-ontap_cifs_local_group_member` is now renamed to `netapp-ontap_cifs_local_group_members`
* **Rename Resource:** `netapp-ontap_cifs_user_group_privilege` is now renamed to `netapp-ontap_cifs_user_group_privileges`
* **Rename Resource:** `netapp-ontap_san_lun-maps` is now renamed to `netapp-ontap_san_lun-map`
* **Rename Resource:** `netapp-ontap_security_accounts` is now renamed to `netapp-ontap_security_account`
* **Rename Resource:** `netapp-ontap_security_login_messages` is now renamed to `netapp-ontap_security_login_message`
* **Rename Resource:** `netapp-ontap_security_roles` is now renamed to `netapp-ontap_security_role`


FEATURES:
Expand Down
6 changes: 3 additions & 3 deletions docs/resources/cluster_peer_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Create/Modify/Delete a cluster peer.
## Example Usage

```
resource "netapp-ontap_cluster_peer" "cluster_peers" {
resource "netapp-ontap_cluster_peer" "cluster_peer" {
# required to know which system to interface with
cx_profile_name = "cluster3"
name = "testme"
Expand All @@ -50,7 +50,7 @@ resource "netapp-ontap_cluster_peer" "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
Expand Down Expand Up @@ -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_peer.example" "cluster_peers_import" {
resource "netapp-ontap_cluster_peer.example" "cluster_peer_import" {
cx_profile_name = "cluster3"
name = "test"
generate_passphrase = false
Expand Down
12 changes: 6 additions & 6 deletions docs/resources/protocols_cifs_local_group_members_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ description: |-
CifsLocalGroupMembers resource
---

# Resource Protocols Cifs Local Group Mmember
# Resource Protocols Cifs Local Group Mmembers

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
Expand All @@ -23,7 +23,7 @@ Create/Read/Delete one or more members in a local group resource
## Example Usage

```terraform
resource "netapp-ontap_cifs_local_group_members" "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"
Expand All @@ -37,12 +37,12 @@ resource "netapp-ontap_cifs_local_group_members" "protocols_cifs_local_group_mem
### 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


Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,16 +21,16 @@ vserver cifs users-and-groups privilege reset-privilege

## 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"
svm_name = "testsvm"
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"
Expand Down
12 changes: 6 additions & 6 deletions docs/resources/security_account_resource.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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"
}
```
Expand All @@ -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 = [
Expand Down
16 changes: 8 additions & 8 deletions docs/resources/security_login_message.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -25,15 +25,15 @@ The `security_login_messages` resource does not support creation or deletion ope
## 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"
scope = "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"
Expand Down Expand Up @@ -67,11 +67,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
Expand All @@ -80,7 +80,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"
}
```
Expand All @@ -93,7 +93,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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

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"
scope = "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"
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (p *ONTAPProvider) Resources(ctx context.Context) []func() resource.Resourc
protocols.NewProtocolsSanIgroupResource,
protocols.NewProtocolsSanLunMapResource,
security.NewSecurityAccountResource,
security.NewSecurityRolesResource,
security.NewSecurityRoleResource,
security.NewSecurityLoginMessageResource,
snapmirror.NewSnapmirrorResource,
snapmirror.NewSnapmirrorPolicyResource,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/security/security_account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var _ resource.ResourceWithImportState = &SecurityAccountResource{}
func NewSecurityAccountResource() resource.Resource {
return &SecurityAccountResource{
config: connection.ResourceOrDataSourceConfig{
Name: "security_accounts",
Name: "security_account",
},
}
}
Expand Down
12 changes: 6 additions & 6 deletions internal/provider/security/security_account_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
},
},
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}
}
Expand Down
Loading

0 comments on commit e8bbee2

Please sign in to comment.