directory
Creates, updates, deletes, gets or lists a directory resource.
Overview
| Name | directory |
| Type | Resource |
| Id | azure.storage_file_share.directory |
Fields
The following fields are returned by SELECT queries:
- list_files_and_directories_segment
| Name | Datatype | Description |
|---|---|---|
DirectoryId | string | :vartype directory_id: str |
DirectoryPath | string | Required. |
Encoded | boolean | :vartype encoded: bool |
Marker | string | :vartype marker: str |
MaxResults | integer | :vartype max_results: int |
NextMarker | string | Required. |
Prefix | object | Required. |
Segment | object | Abstract for entries that can be listed from Directory. Required. |
ServiceEndpoint | string | Required. |
ShareName | string | Required. |
ShareSnapshot | string | :vartype share_snapshot: str |
Methods
The following methods are available for this resource:
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account | string | Storage account name. (default: ) |
x-ms-version | string | |
include | array | Include this parameter to specify one or more datasets to include in the response. Default value is None. |
marker | string | A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client. Default value is None. |
maxresults | integer | Specifies the maximum number of entries to return. If the request does not specify maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 items. Default value is None. |
prefix | string | Filters the results to return only entries whose name begins with the specified prefix. Default value is None. |
sharesnapshot | string | The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. Default value is None. |
timeout | integer | The timeout parameter is expressed in seconds. For more information, see |
x-ms-allow-trailing-dot | boolean | |
x-ms-file-attributes | string | If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. Default value is "none". |
x-ms-file-change-time | string | Change time for the file/directory. Default value: Now. Default value is None. |
x-ms-file-creation-time | string | Creation time for the file/directory. Default value: Now. Default value is "now". |
x-ms-file-extended-info | boolean | Include extended information. Default value is None. |
x-ms-file-last-write-time | string | Last write time for the file/directory. Default value: Now. Default value is "now". |
x-ms-file-permission | string | If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. Default value is "inherit". |
x-ms-file-permission-format | string | Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. Known values are: "Sddl" and "Binary". Default value is None. |
x-ms-file-permission-key | string | Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. Default value is None. |
x-ms-file-property-semantics | string | SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. Restore will apply changes without further modification. Known values are: "New" and "Restore". Default value is None. |
x-ms-file-request-intent | string | |
x-ms-group | string | Optional, NFS only. The owning group of the file or directory. Default value is None. |
x-ms-meta | object | A name-value pair to associate with a file storage object. Default value is None. |
x-ms-mode | string | Optional, NFS only. The file mode of the file or directory. Default value is None. |
x-ms-owner | string | Optional, NFS only. The owner of the file or directory. Default value is None. |
SELECT examples
- list_files_and_directories_segment
Returns a list of files or directories under the specified share or directory. It lists the contents only for a single level of the directory hierarchy.
SELECT
DirectoryId,
DirectoryPath,
Encoded,
Marker,
MaxResults,
NextMarker,
Prefix,
Segment,
ServiceEndpoint,
ShareName,
ShareSnapshot
FROM azure.storage_file_share.directory
WHERE x-ms-version = '{{ x-ms-version }}' -- required
AND account = '{{ account }}' -- required
AND prefix = '{{ prefix }}'
AND sharesnapshot = '{{ sharesnapshot }}'
AND marker = '{{ marker }}'
AND maxresults = '{{ maxresults }}'
AND timeout = '{{ timeout }}'
AND include = '{{ include }}'
AND x-ms-file-extended-info = '{{ x-ms-file-extended-info }}'
AND x-ms-allow-trailing-dot = '{{ x-ms-allow-trailing-dot }}'
AND x-ms-file-request-intent = '{{ x-ms-file-request-intent }}'
;
INSERT examples
- create
- Manifest
Creates a new directory under the specified share or parent directory.
INSERT INTO azure.storage_file_share.directory (
x-ms-version,
account,
timeout,
x-ms-meta,
x-ms-file-permission,
x-ms-file-permission-format,
x-ms-file-permission-key,
x-ms-file-attributes,
x-ms-file-creation-time,
x-ms-file-last-write-time,
x-ms-file-change-time,
x-ms-owner,
x-ms-group,
x-ms-mode,
x-ms-file-property-semantics,
x-ms-allow-trailing-dot,
x-ms-file-request-intent
)
SELECT
'{{ x-ms-version }}',
'{{ account }}',
'{{ timeout }}',
'{{ x-ms-meta }}',
'{{ x-ms-file-permission }}',
'{{ x-ms-file-permission-format }}',
'{{ x-ms-file-permission-key }}',
'{{ x-ms-file-attributes }}',
'{{ x-ms-file-creation-time }}',
'{{ x-ms-file-last-write-time }}',
'{{ x-ms-file-change-time }}',
'{{ x-ms-owner }}',
'{{ x-ms-group }}',
'{{ x-ms-mode }}',
'{{ x-ms-file-property-semantics }}',
'{{ x-ms-allow-trailing-dot }}',
'{{ x-ms-file-request-intent }}'
;
# Description fields are for documentation purposes
- name: directory
props:
- name: x-ms-version
value: "{{ x-ms-version }}"
description: Required parameter for the directory resource.
- name: account
value: "{{ account }}"
description: Required parameter for the directory resource.
- name: timeout
value: {{ timeout }}
description: The timeout parameter is expressed in seconds. For more information, see
description: The timeout parameter is expressed in seconds. For more information, see
- name: x-ms-meta
value: "{{ x-ms-meta }}"
description: A name-value pair to associate with a file storage object. Default value is None.
description: A name-value pair to associate with a file storage object. Default value is None.
- name: x-ms-file-permission
value: "{{ x-ms-file-permission }}"
description: If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. Default value is "inherit".
description: If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. Default value is "inherit".
- name: x-ms-file-permission-format
value: "{{ x-ms-file-permission-format }}"
description: Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. Known values are: "Sddl" and "Binary". Default value is None.
description: Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. Known values are: "Sddl" and "Binary". Default value is None.
- name: x-ms-file-permission-key
value: "{{ x-ms-file-permission-key }}"
description: Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. Default value is None.
description: Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. Default value is None.
- name: x-ms-file-attributes
value: "{{ x-ms-file-attributes }}"
description: If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. Default value is "none".
description: If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. Default value is "none".
- name: x-ms-file-creation-time
value: "{{ x-ms-file-creation-time }}"
description: Creation time for the file/directory. Default value: Now. Default value is "now".
description: Creation time for the file/directory. Default value: Now. Default value is "now".
- name: x-ms-file-last-write-time
value: "{{ x-ms-file-last-write-time }}"
description: Last write time for the file/directory. Default value: Now. Default value is "now".
description: Last write time for the file/directory. Default value: Now. Default value is "now".
- name: x-ms-file-change-time
value: "{{ x-ms-file-change-time }}"
description: Change time for the file/directory. Default value: Now. Default value is None.
description: Change time for the file/directory. Default value: Now. Default value is None.
- name: x-ms-owner
value: "{{ x-ms-owner }}"
description: Optional, NFS only. The owner of the file or directory. Default value is None.
description: Optional, NFS only. The owner of the file or directory. Default value is None.
- name: x-ms-group
value: "{{ x-ms-group }}"
description: Optional, NFS only. The owning group of the file or directory. Default value is None.
description: Optional, NFS only. The owning group of the file or directory. Default value is None.
- name: x-ms-mode
value: "{{ x-ms-mode }}"
description: Optional, NFS only. The file mode of the file or directory. Default value is None.
description: Optional, NFS only. The file mode of the file or directory. Default value is None.
- name: x-ms-file-property-semantics
value: "{{ x-ms-file-property-semantics }}"
description: SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. Restore will apply changes without further modification. Known values are: "New" and "Restore". Default value is None.
description: SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. Restore will apply changes without further modification. Known values are: "New" and "Restore". Default value is None.
- name: x-ms-allow-trailing-dot
value: {{ x-ms-allow-trailing-dot }}
- name: x-ms-file-request-intent
value: "{{ x-ms-file-request-intent }}"
DELETE examples
- delete
Removes the specified empty directory. Note that the directory must be empty before it can be deleted.
DELETE FROM azure.storage_file_share.directory
WHERE x-ms-version = '{{ x-ms-version }}' --required
AND account = '{{ account }}' --required
AND timeout = '{{ timeout }}'
AND x-ms-allow-trailing-dot = '{{ x-ms-allow-trailing-dot }}'
AND x-ms-file-request-intent = '{{ x-ms-file-request-intent }}'
;