Skip to content

Commit 9dc22c6

Browse files
authored
[Storage] az storage file symoblic-link create/show: Support NFS fileshare symbolic link (#32187)
1 parent 856aed8 commit 9dc22c6

20 files changed

+2089
-1905
lines changed

src/azure-cli-core/azure/cli/core/profiles/_shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def default_api_version(self):
206206
ResourceType.DATA_KEYVAULT_ADMINISTRATION_ACCESS_CONTROL: '7.4',
207207
ResourceType.DATA_STORAGE_BLOB: '2022-11-02',
208208
ResourceType.DATA_STORAGE_FILEDATALAKE: '2021-08-06',
209-
ResourceType.DATA_STORAGE_FILESHARE: '2025-05-05',
209+
ResourceType.DATA_STORAGE_FILESHARE: '2025-07-05',
210210
ResourceType.DATA_STORAGE_QUEUE: '2018-03-28',
211211
ResourceType.DATA_STORAGE_TABLE: None,
212212
ResourceType.MGMT_SERVICEBUS: None,

src/azure-cli/azure/cli/command_modules/storage/_help.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3190,3 +3190,26 @@
31903190
text: |
31913191
az storage file hard-link create --account-name MyAccount --share-name share --path link_path --target original_path
31923192
"""
3193+
3194+
helps['storage file symbolic-link'] = """
3195+
type: group
3196+
short-summary: Manage storage file symbolic-link.
3197+
"""
3198+
3199+
helps['storage file symbolic-link create'] = """
3200+
type: command
3201+
short-summary: NFS only. Creates a symbolic link to the specified file.
3202+
examples:
3203+
- name: Create a symbolic link to an NFS file specified by path.
3204+
text: |
3205+
az storage file symbolic-link create --account-name MyAccount --share-name share --path link_path --target target_path --metadata meta1=value1 meta2=value2 --file-creation-time now --file-last-write-time now --owner 6 --group 7
3206+
"""
3207+
3208+
helps['storage file symbolic-link show'] = """
3209+
type: command
3210+
short-summary: NFS only. Gets the symbolic link for the file client.
3211+
examples:
3212+
- name: Show the symbolic link to an NFS file specified by path.
3213+
text: |
3214+
az storage file symbolic-link show --account-name MyAccount --share-name share --path link_path
3215+
"""

src/azure-cli/azure/cli/command_modules/storage/_params.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2798,3 +2798,23 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
27982798
'same share and the same storage account.')
27992799
c.extra('lease',
28002800
help='Lease id, required if the file has an active lease.')
2801+
2802+
with self.argument_context('storage file symbolic-link create') as c:
2803+
c.extra('share_name', share_name_type, required=True)
2804+
c.register_path_argument()
2805+
c.argument('target', required=True,
2806+
help='Specifies the file path the symbolic link will point to. '
2807+
'The file path can be either relative or absolute.')
2808+
c.extra('metadata', nargs='+',
2809+
help='Metadata in space-separated key=value pairs. This overwrites any existing metadata.',
2810+
validator=validate_metadata)
2811+
c.extra('file_creation_time', help='Creation time for the file.')
2812+
c.extra('file_last_write_time', help='Last write time for the file.')
2813+
c.extra('owner', help='The owner of the file.')
2814+
c.extra('group', help='The owning group of the file.')
2815+
c.extra('lease',
2816+
help='Lease id, required if the file has an active lease. ')
2817+
2818+
with self.argument_context('storage file symbolic-link show') as c:
2819+
c.extra('share_name', share_name_type, required=True)
2820+
c.register_path_argument()

src/azure-cli/azure/cli/command_modules/storage/commands.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,8 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.MGM
699699
transform=transform_file_show_result)
700700
g.storage_custom_command_oauth('download-batch', 'storage_file_download_batch', client_factory=cf_share_client)
701701
g.storage_command_oauth('hard-link create', 'create_hardlink')
702+
g.storage_command_oauth('symbolic-link create', 'create_symlink')
703+
g.storage_command_oauth('symbolic-link show', 'get_symlink')
702704

703705
with self.command_group('storage cors', get_custom_sdk('cors', multi_service_properties_factory)) as g:
704706
from ._transformers import transform_cors_list_output

0 commit comments

Comments
 (0)