Skip to content

Commit

Permalink
Merge pull request #183 from NetApp/27-protocolscifsshares-change-pat…
Browse files Browse the repository at this point in the history
…h-to-required

Change path to required.
  • Loading branch information
carchi8py authored Apr 24, 2024
2 parents 01b5604 + f6ff242 commit d1f5102
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/resources/cluster_peers_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Required:
- `ip_addresses` (Set of String) list of the remote ip addresses

<a id="nestedatt--source_details"></a>
### Nested Schema for `remote`
### Nested Schema for `source_details`

Required:

Expand Down
10 changes: 5 additions & 5 deletions docs/resources/protocols_cifs_share_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ resource "netapp-ontap_protocols_cifs_share_resource" "protocols_cifs_share" {
is a home directory share then the share name includes the pattern as
%w (Windows user name), %u (UNIX user name) and %d (Windows domain name)
variables in any combination with this parameter to generate shares dynamically.
- `path` (String) The fully-qualified pathname in the owning SVM namespace that is shared through this share.
If this is a home directory share then the path should be dynamic by specifying the pattern
%w (Windows user name), %u (UNIX user name), or %d (domain name) variables in any combination.
ONTAP generates the path dynamically for the connected user and this path is appended to each
search path to find the full Home Directory path.
- `svm_name` (String) svm name

### Optional
Expand Down Expand Up @@ -80,11 +85,6 @@ resource "netapp-ontap_protocols_cifs_share_resource" "protocols_cifs_share" {
and may use those files in an offline mode even if the share is available.
- `oplocks` (Boolean) Specify whether opportunistic locks are enabled on this share. "Oplocks" allow clients to lock files and cache content locally,
which can increase performance for file operations.
- `path` (String) The fully-qualified pathname in the owning SVM namespace that is shared through this share.
If this is a home directory share then the path should be dynamic by specifying the pattern
%w (Windows user name), %u (UNIX user name), or %d (domain name) variables in any combination.
ONTAP generates the path dynamically for the connected user and this path is appended to each
search path to find the full Home Directory path.
- `show_snapshot` (Boolean) Specifies whether or not the Snapshot copies can be viewed and traversed by clients.
- `unix_symlink` (String) Controls the access of UNIX symbolic links to CIFS clients.
The supported values are:
Expand Down
10 changes: 2 additions & 8 deletions internal/provider/protocols_cifs_share_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,7 @@ func (r *ProtocolsCIFSShareResource) Schema(ctx context.Context, req resource.Sc
ONTAP generates the path dynamically for the connected user and this path is appended to each
search path to find the full Home Directory path.
`,
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
Required: true,
},
"show_snapshot": schema.BoolAttribute{
MarkdownDescription: `Specifies whether or not the Snapshot copies can be viewed and traversed by clients.`,
Expand Down Expand Up @@ -434,6 +430,7 @@ func (r *ProtocolsCIFSShareResource) Create(ctx context.Context, req resource.Cr

body.Name = data.Name.ValueString()
body.SVM.Name = data.SVMName.ValueString()
body.Path = data.Path.ValueString()

if !data.Acls.IsUnknown() {
aclsList := []interfaces.Acls{}
Expand Down Expand Up @@ -497,9 +494,6 @@ func (r *ProtocolsCIFSShareResource) Create(ctx context.Context, req resource.Cr
if !data.Oplocks.IsUnknown() {
body.Oplocks = data.Oplocks.ValueBool()
}
if !data.Path.IsUnknown() {
body.Path = data.Path.ValueString()
}
if !data.ShowSnapshot.IsUnknown() {
body.ShowSnapshot = data.ShowSnapshot.ValueBool()
}
Expand Down

0 comments on commit d1f5102

Please sign in to comment.