Skip to content

Commit

Permalink
Merge pull request #154 from NetApp/28-new-data-source-protocolscifss…
Browse files Browse the repository at this point in the history
…hares

Add new data source for cifs share and shares
  • Loading branch information
wenjun666 authored Apr 5, 2024
2 parents 887384a + 603d8ea commit 0e5cf5c
Show file tree
Hide file tree
Showing 16 changed files with 1,081 additions and 4 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@ FEATURES:
* **New Data Source:** `netapp_ontap_storage_flexcaches_data_source` ([#47](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/47))
* **New Data Source:** `netapp-ontap_name_services_ldap_data_source` ([#26](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/26))
* **New Data Source:** `netapp-ontap_name_services_ldaps_data_source` ([#26](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/26))
* **New Data Source:** `netapp-ontap_protocols_cifs_share_data_source` ([#28](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/28))
* **New Data Source:** `netapp-ontap_protocols_cifs_shares_data_source` ([#28](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/28))
* **New Data Source:** `netapp-ontap_protocols_san_lun-map_data_source` ([#14](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/14))
* **New Data Source:** `netapp-ontap_protocols_san_lun-maps_data_source` ([#14](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/14))
* **New Resource:** `netapp-ontap_protocols_cifs_local_group_resource` ([#53](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/53))
* **New Resource:** `netapp-ontap_protocols_cifs_local_user_resource` ([#56](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/56))
* **New Resource:** `netapp-ontap_protocols_cifs_user_group_privilege_resource` ([#58](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/58))
* **New Resource:** `netapp-ontap_svm_peers_resource` ([#51](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/51))
* **New Resource:** `netapp-ontap_protocols_cifs_user_group_member_resource` ([#123](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/123))
<<<<<<< HEAD
* **New Resource:** `netapp-ontap_storage_flexcache_resource` ([#46](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/46))
* **New Resource:** `netapp-protocols_san_lun-maps_resource` ([#13](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/13))
=======
* **New Resource:** `netapp-ontap_protocols_san_lun-maps_resource` ([#13](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/13))
>>>>>>> 08705260ad53b105d048877da271567bc286b2fb
* **New Resource:** `netapp-ontap_name_services_ldap_resource` ([#25](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/25))
* **New Resource:** `netapp-ontap_protocols_cifs_service_resource` ([#23](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/23))

Expand Down
101 changes: 101 additions & 0 deletions docs/data-sources/protocols_cifs_share_data_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_protocols_cifs_share_data_source Data Source - terraform-provider-netapp-ontap"
subcategory: "nas"
description: |-
ProtocolsCIFSShare data source
---

# netapp-ontap_protocols_cifs_share_data_source (Data Source)

Retrieves the details of a cifs share

### Related ONTAP commands
* vserver cifs share show
* vserver cifs share properties show

## Example Usage
```terraform
data "netapp-ontap_protocols_cifs_share_data_source" "protocols_cifs_share" {
# required to know which system to interface with
cx_profile_name = "cluster5"
name = "cifs_share"
svm_name = "testSVM"
}
```

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

### Required

- `cx_profile_name` (String) Connection profile name
- `name` (String) Specifies the name of the CIFS share that you want to create. If this
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.

### Optional

- `svm_name` (String) IPInterface svm name

### Read-Only

- `acls` (Attributes Set) The permissions that users and groups have on a CIFS share. (see [below for nested schema](#nestedatt--acls))
- `change_notify` (Boolean) Specifies whether CIFS clients can request for change notifications for directories on this share.
- `comment` (String) Specify the CIFS share descriptions.
- `continuously_available` (Boolean) Specifies whether or not the clients connecting to this share can open files in a persistent manner.Files opened in this way are protected from disruptive events, such as, failover and giveback.
- `dir_umask` (Number) Directory Mode Creation Mask to be viewed as an octal number.
- `encryption` (Boolean) Specifies that SMB encryption must be used when accessing this share. Clients that do not support encryption are not able to access this share.
- `file_umask` (Number) File Mode Creation Mask to be viewed as an octal number.
- `force_group_for_create` (String) Specifies that all files that CIFS users create in a specific share belong to the same group
(also called the force-group). The force-group must be a predefined group in the UNIX group
database. This setting has no effect unless the security style of the volume is UNIX or mixed
security style.
- `home_directory` (Boolean) Specifies whether or not the share is a home directory share, where the share and path names are dynamic.
ONTAP home directory functionality automatically offer each user a dynamic share to their home directory without creating an
individual SMB share for each user.
The ONTAP CIFS home directory feature enable us to configure a share that maps to
different directories based on the user that connects to it. Instead of creating a separate shares for each user,
a single share with a home directory parameters can be created.
In a home directory share, ONTAP dynamically generates the share-name and share-path by substituting
%w, %u, and %d variables with the corresponding Windows user name, UNIX user name, and domain name, respectively.
- `namespace_caching` (Boolean) Specifies whether or not the SMB clients connecting to this share can cache the directory enumeration
results returned by the CIFS servers.
- `no_strict_security` (Boolean) Specifies whether or not CIFS clients can follow a unix symlinks outside the share boundaries.
- `offline_files` (String) Offline Files. The supported values are:
none - Clients are not permitted to cache files for offline access.
manual - Clients may cache files that are explicitly selected by the user for offline access.
documents - Clients may automatically cache files that are used by the user for offline access.
programs - Clients may automatically cache files that are used by the user for offline access
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:
* local - Enables only local symbolic links which is within the same CIFS share.
* widelink - Enables both local symlinks and widelinks.
* disable - Disables local symlinks and widelinks.
- `vscan_profile` (String) Vscan File-Operations Profile
The supported values are:
no_scan - Virus scans are never triggered for accesses to this share.
standard - Virus scans can be triggered by open, close, and rename operations.
strict - Virus scans can be triggered by open, read, close, and rename operations.
writes_only - Virus scans can be triggered only when a file that has been modified is closed.

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

Read-Only:

- `permission` (String) Specifies the access rights that a user or group has on the defined CIFS Share.
- `type` (String) string Specifies the type of the user or group to add to the access control list of a CIFS share.
- `user_or_group` (String) Specifies the user or group name to add to the access control list of a CIFS share.


127 changes: 127 additions & 0 deletions docs/data-sources/protocols_cifs_shares_data_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_protocols_cifs_shares_data_source Data Source - terraform-provider-netapp-ontap"
subcategory: "nas"
description: |-
ProtocolsCIFSShares data source
---

# netapp-ontap_protocols_cifs_shares_data_source (Data Source)

Retrieves the details of one or more cifs shares by filter

### Related ONTAP commands
* vserver cifs share show
* vserver cifs share properties show

## Example Usage
```terraform
data "netapp-ontap_protocols_cifs_shares_data_source" "protocols_cifs_shares" {
# required to know which system to interface with
cx_profile_name = "cluster5"
filter = {
svm_name = "testSVM"
}
}
```


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

### Required

- `cx_profile_name` (String) Connection profile name

### Optional

- `filter` (Attributes) (see [below for nested schema](#nestedatt--filter))

### Read-Only

- `protocols_cifs_shares` (Attributes List) (see [below for nested schema](#nestedatt--protocols_cifs_shares))

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

Optional:

- `name` (String) ProtocolsCIFSShare name
- `svm_name` (String) ProtocolsCIFSShare svm name


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

Required:

- `cx_profile_name` (String) Connection profile name
- `name` (String) Specifies the name of the CIFS share that you want to create. If this
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.

Optional:

- `svm_name` (String) IPInterface svm name

Read-Only:

- `acls` (Attributes Set) The permissions that users and groups have on a CIFS share. (see [below for nested schema](#nestedatt--protocols_cifs_shares--acls))
- `change_notify` (Boolean) Specifies whether CIFS clients can request for change notifications for directories on this share.
- `comment` (String) Specify the CIFS share descriptions.
- `continuously_available` (Boolean) Specifies whether or not the clients connecting to this share can open files in a persistent manner.Files opened in this way are protected from disruptive events, such as, failover and giveback.
- `dir_umask` (Number) Directory Mode Creation Mask to be viewed as an octal number.
- `encryption` (Boolean) Specifies that SMB encryption must be used when accessing this share. Clients that do not support encryption are not able to access this share.
- `file_umask` (Number) File Mode Creation Mask to be viewed as an octal number.
- `force_group_for_create` (String) Specifies that all files that CIFS users create in a specific share belong to the same group
(also called the force-group). The force-group must be a predefined group in the UNIX group
database. This setting has no effect unless the security style of the volume is UNIX or mixed
security style.
- `home_directory` (Boolean) Specifies whether or not the share is a home directory share, where the share and path names are dynamic.
ONTAP home directory functionality automatically offer each user a dynamic share to their home directory without creating an
individual SMB share for each user.
The ONTAP CIFS home directory feature enable us to configure a share that maps to
different directories based on the user that connects to it. Instead of creating a separate shares for each user,
a single share with a home directory parameters can be created.
In a home directory share, ONTAP dynamically generates the share-name and share-path by substituting
%w, %u, and %d variables with the corresponding Windows user name, UNIX user name, and domain name, respectively.
- `namespace_caching` (Boolean) Specifies whether or not the SMB clients connecting to this share can cache the directory enumeration
results returned by the CIFS servers.
- `no_strict_security` (Boolean) Specifies whether or not CIFS clients can follow a unix symlinks outside the share boundaries.
- `offline_files` (String) Offline Files. The supported values are:
none - Clients are not permitted to cache files for offline access.
manual - Clients may cache files that are explicitly selected by the user for offline access.
documents - Clients may automatically cache files that are used by the user for offline access.
programs - Clients may automatically cache files that are used by the user for offline access
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:
* local - Enables only local symbolic links which is within the same CIFS share.
* widelink - Enables both local symlinks and widelinks.
* disable - Disables local symlinks and widelinks.
- `vscan_profile` (String) Vscan File-Operations Profile
The supported values are:
no_scan - Virus scans are never triggered for accesses to this share.
standard - Virus scans can be triggered by open, close, and rename operations.
strict - Virus scans can be triggered by open, read, close, and rename operations.
writes_only - Virus scans can be triggered only when a file that has been modified is closed.

<a id="nestedatt--protocols_cifs_shares--acls"></a>
### Nested Schema for `protocols_cifs_shares.acls`

Read-Only:

- `permission` (String) Specifies the access rights that a user or group has on the defined CIFS Share.
- `type` (String) string Specifies the type of the user or group to add to the access control list of a CIFS share.
- `user_or_group` (String) Specifies the user or group name to add to the access control list of a CIFS share.


Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
data "netapp-ontap_protocols_cifs_share_data_source" "protocols_cifs_share" {
# required to know which system to interface with
cx_profile_name = "cluster5"
name = "share1"
svm_name = "testSVM"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "netapp-ontap_protocols_cifs_shares_data_source" "protocols_cifs_shares" {
# required to know which system to interface with
cx_profile_name = "cluster5"
filter = {
svm_name = "testSVM"
}
}
Loading

0 comments on commit 0e5cf5c

Please sign in to comment.