@@ -1778,6 +1778,10 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
17781778 'default.' )
17791779 c .argument ('quota' , type = int , help = 'Specifies the maximum size of the share, in gigabytes. Must be greater '
17801780 'than 0, and less than or equal to 5TB (5120).' )
1781+ t_share_protocols_type = self .get_sdk ('_models#ShareProtocols' ,
1782+ resource_type = ResourceType .DATA_STORAGE_FILESHARE )
1783+ c .extra ('protocols' , options_list = ['--protocol' ], arg_type = get_enum_type (t_share_protocols_type ),
1784+ help = 'The protocol to enable for the share.' )
17811785
17821786 with self .argument_context ('storage share url' ) as c :
17831787 c .extra ('unc' , action = 'store_true' , help = 'Output UNC network path.' )
@@ -1941,6 +1945,16 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
19411945
19421946 with self .argument_context ('storage directory create' ) as c :
19431947 c .argument ('fail_on_exist' , help = 'Throw an exception if the directory already exists.' )
1948+ c .extra ('file_mode' ,
1949+ help = 'Only applicable to NFS Directory. The mode permissions to be set on the directory. '
1950+ 'Symbolic (rwxrw-rw-) is supported. The sticky bit is also supported and its represented '
1951+ 'either by the letter t or T in the final character-place depending on whether the execution '
1952+ 'bit for the others category is set or unset respectively, absence of t or T indicates sticky '
1953+ 'bit not set."' )
1954+ c .extra ('owner' , help = 'Only applicable to NFS Directory. The owner user identifier (UID) to be set on the '
1955+ 'directory. The default value is 0 (root).' )
1956+ c .extra ('group' , help = 'Only applicable to NFS Directory. The owner group identifier (GID) to be set on the '
1957+ 'directory. The default value is 0 (root group).' )
19441958
19451959 with self .argument_context ('storage directory delete' ) as c :
19461960 c .argument ('fail_not_exist' , help = 'Throw an exception if the directory does not exist.' )
@@ -1969,6 +1983,33 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
19691983 help = 'Metadata in space-separated key=value pairs. This overwrites any existing metadata.' ,
19701984 validator = validate_metadata )
19711985 c .extra ('timeout' , help = 'Request timeout in seconds. Applies to each call to the service.' , type = int )
1986+ c .extra ('file_mode' ,
1987+ help = 'The mode permissions to be set on the file. Only applicable to NFS Files. '
1988+ 'Only work together with parameter `--file-mode-copy-mode Override`. '
1989+ 'Symbolic (rwxrw-rw-) is supported. '
1990+ 'The sticky bit is also supported and its represented '
1991+ 'either by the letter t or T in the final character-place depending on whether the execution '
1992+ 'bit for the others category is set or unset respectively, absence of t or T indicates sticky '
1993+ 'bit not set."' )
1994+ c .extra ('owner' , help = 'Only applicable to NFS Files. Only work together with parameter '
1995+ '`--owner-copy-mode Override`. The owner user identifier (UID) '
1996+ 'to be set on the directory. The default value is 0 (root).' )
1997+ c .extra ('group' , help = 'Only applicable to NFS Files. Only work together with parameter '
1998+ '`--owner-copy-mode Override`. The owner group identifier (GID) '
1999+ 'to be set on the directory. The default value is 0 (root group).' )
2000+ t_file_mode_copy_mode_type = self .get_sdk ('_generated.models._azure_file_storage_enums#ModeCopyMode' ,
2001+ resource_type = ResourceType .DATA_STORAGE_FILESHARE )
2002+ c .extra ('file_mode_copy_mode' ,
2003+ arg_type = get_enum_type (t_file_mode_copy_mode_type ),
2004+ help = 'Only applicable to NFS Files. Applicable only when the copy source is a File. '
2005+ 'Determines the copy behavior of the mode bits of the destination file. '
2006+ 'If not populated, the destination file will have the default File Mode.' )
2007+ t_owner_copy_mode_type = self .get_sdk ('_generated.models._azure_file_storage_enums#OwnerCopyMode' ,
2008+ resource_type = ResourceType .DATA_STORAGE_FILESHARE )
2009+ c .extra ('owner_copy_mode' , arg_type = get_enum_type (t_owner_copy_mode_type ),
2010+ help = 'Only applicable to NFS Files. Applicable only when the copy source is a File. '
2011+ 'Determines the copy behavior of the owner and group of the destination file. '
2012+ 'If not populated, the destination file will have the default Owner and Group.' )
19722013
19732014 with self .argument_context ('storage file copy cancel' ) as c :
19742015 c .register_path_argument (options_list = ('--destination-path' , '-p' ))
@@ -2116,6 +2157,19 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
21162157 'already validate. Note that this MD5 hash is not stored with the file.' )
21172158 c .extra ('file_url' , help = 'The full endpoint URL to the File, including SAS token if used.' )
21182159
2160+ for cmd in ['file update' , 'file upload' ]:
2161+ with self .argument_context (f'storage { cmd } ' ) as c :
2162+ c .extra ('file_mode' ,
2163+ help = 'Only applicable to NFS Files. The mode permissions to be set on the file. '
2164+ 'Symbolic (rwxrw-rw-) is supported. The sticky bit is also supported and its represented '
2165+ 'either by the letter t or T in the final character-place depending on whether the execution '
2166+ 'bit for the others category is set or unset respectively, absence of t or T indicates sticky '
2167+ 'bit not set."' )
2168+ c .extra ('owner' , help = 'Only applicable to NFS Files. The owner user identifier (UID) to be set on the '
2169+ 'file. The default value is 0 (root).' )
2170+ c .extra ('group' , help = 'Only applicable to NFS Files. The owner group identifier (GID) to be set on the '
2171+ 'file. The default value is 0 (root group).' )
2172+
21192173 with self .argument_context ('storage file url' ) as c :
21202174 c .register_path_argument (fileshare = True )
21212175 c .extra ('share_name' , share_name_type , required = True )
@@ -2701,3 +2755,13 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
27012755 c .extra ('disallow_source_trailing_dot' , arg_type = get_three_state_flag (), default = False ,
27022756 options_list = ["--disallow-source-trailing-dot" , "--disallow-src-trailing" ],
27032757 help = "If true, the trailing dot will be trimmed from the source URI. Default to False" )
2758+
2759+ with self .argument_context ('storage file hard-link create' ) as c :
2760+ c .extra ('share_name' , share_name_type , required = True )
2761+ c .register_path_argument ()
2762+ c .extra ('target' , required = True ,
2763+ help = 'Specifies the path of the target file to which the link will be created, up to 2 KiB in length. '
2764+ 'It should be the full path of the target starting from the root. The target file must be in the '
2765+ 'same share and the same storage account.' )
2766+ c .extra ('lease' ,
2767+ help = 'Lease id, required if the file has an active lease.' )
0 commit comments