2121 from ._models import PremiumPageBlobTier , StandardBlobTier
2222
2323
24- def _parse_url (
25- account_url : str ,
26- container_name : str ,
27- ) -> Tuple ["ParseResult" , Any ]:
28- """Performs initial input validation and returns the parsed URL and SAS token.
29- :param str account_url: The URL to the storage account.
30- :param str container_name: The name of the container.
31- :returns: The parsed URL and SAS token.
32- :rtype: Tuple[ParseResult, Any]
33- """
24+ def _parse_url (account_url : str , container_name : str ) -> Tuple ["ParseResult" , Any ]:
3425 try :
3526 if not account_url .lower ().startswith ('http' ):
3627 account_url = "https://" + account_url
@@ -47,19 +38,6 @@ def _parse_url(
4738 return parsed_url , sas_token
4839
4940def _format_url (container_name : Union [bytes , str ], hostname : str , scheme : str , query_str : str ) -> str :
50- """Format the endpoint URL according to the current location mode hostname.
51-
52- :param Union[bytes, str] container_name:
53- The name of the container.
54- :param str hostname:
55- The current location mode hostname.
56- :param str scheme:
57- The scheme for the current location mode hostname.
58- :param str query_str:
59- The query string of the endpoint URL being formatted.
60- :returns: The formatted endpoint URL according to the specified location mode hostname.
61- :rtype: str
62- """
6341 if isinstance (container_name , str ):
6442 container_name = container_name .encode ('UTF-8' )
6543 return f"{ scheme } ://{ hostname } /{ quote (container_name )} { query_str } "
@@ -75,27 +53,6 @@ def _generate_delete_blobs_subrequest_options(
7553 modified_access_conditions : Optional ["ModifiedAccessConditions" ] = None ,
7654 ** kwargs
7755) -> Tuple [Dict [str , Any ], Dict [str , Any ]]:
78- """Creates a dictionary containing the options for a delete blob sub-request operation.
79-
80- :param AzureBlobStorage client:
81- The generated Blob Storage client.
82- :param Optional[str] snapshot:
83- The snapshot data of the blob.
84- :param Optional[str] version_id:
85- The version id parameter is a value that, when present, specifies the version of the blob to delete.
86- :param Optional[str] delete_snapshots:
87- Required if the blob has associated snapshots. Values include:
88- - "only": Deletes only the blobs snapshots.
89- - "include": Deletes the blob along with all snapshots.
90- :param lease_access_conditions:
91- The access conditions associated with the lease.
92- :type lease_access_conditions: Optional[LeaseAccessConditions]
93- :param modified_access_conditions:
94- The modified access conditions associated with the lease.
95- :type modified_access_conditions: Optional[LeaseAccessConditions]
96- :returns: A dictionary containing the delete blobs sub-request options.
97- :rtype: Tuple[Dict[str, Any], Dict[str, Any]]
98- """
9956 lease_id = None
10057 if lease_access_conditions is not None :
10158 lease_id = lease_access_conditions .lease_id
@@ -157,46 +114,6 @@ def _generate_delete_blobs_options(
157114 * blobs : Union [str , Dict [str , Any ], BlobProperties ],
158115 ** kwargs : Any
159116) -> Tuple [List [HttpRequest ], Dict [str , Any ]]:
160- """Creates a dictionary containing the options for a delete blob operation.
161-
162- :param str query_str:
163- The query string of the endpoint URL.
164- :param str container_name:
165- The name of the container.
166- :param AzureBlobStorage client:
167- The generated Blob Storage client.
168- :param blobs:
169- The blobs to delete. This can be a single blob, or multiple values can
170- be supplied, where each value is either the name of the blob (str) or BlobProperties.
171-
172- .. note::
173- When the blob type is dict, here's a list of keys, value rules.
174-
175- blob name:
176- key: 'name', value type: str
177- snapshot you want to delete:
178- key: 'snapshot', value type: str
179- version id:
180- key: 'version_id', value type: str
181- whether to delete snapshots when deleting blob:
182- key: 'delete_snapshots', value: 'include' or 'only'
183- if the blob modified or not:
184- key: 'if_modified_since', 'if_unmodified_since', value type: datetime
185- etag:
186- key: 'etag', value type: str
187- match the etag or not:
188- key: 'match_condition', value type: MatchConditions
189- tags match condition:
190- key: 'if_tags_match_condition', value type: str
191- lease:
192- key: 'lease_id', value type: Union[str, LeaseClient]
193- timeout for subrequest:
194- key: 'timeout', value type: int
195-
196- :type blobs: Union[str, Dict[str, Any], BlobProperties]
197- :returns: A tuple containing the list of HttpRequests and the delete blobs options.
198- :rtype: Tuple[List[HttpRequest], Dict[str, Any]]
199- """
200117 timeout = kwargs .pop ('timeout' , None )
201118 raise_on_any_failure = kwargs .pop ('raise_on_any_failure' , True )
202119 delete_snapshots = kwargs .pop ('delete_snapshots' , None )
@@ -259,25 +176,6 @@ def _generate_set_tiers_subrequest_options(
259176 lease_access_conditions : Optional ["LeaseAccessConditions" ] = None ,
260177 ** kwargs : Any
261178) -> Tuple [Dict [str , Any ], Dict [str , Any ]]:
262- """Creates a dictionary containing the options for a set tiers sub-request operation.
263-
264- :param AzureBlobStorage client:
265- The generated Blob Storage client.
266- :param tier:
267- Indicates the tier to be set on the blobs.
268- :type tier: Optional[Union["PremiumPageBlobTier", "StandardBlobTier", str]]
269- :param Optional[str] snapshot:
270- The snapshot data of the blob.
271- :param Optional[str] version_id:
272- The version id parameter is a value that, when present, specifies the version of the blob to delete.
273- :param Optional[RehydratePriority] rehydrate_priority:
274- Indicates the priority with which to rehydrate an archived blob.
275- :param lease_access_conditions:
276- The access conditions associated with the lease.
277- :type lease_access_conditions: Optional[LeaseAccessConditions]
278- :returns: A dictionary containing the set tiers sub-request options.
279- :rtype: Dict[str, Any]
280- """
281179 if not tier :
282180 raise ValueError ("A blob tier must be specified" )
283181 if snapshot and version_id :
@@ -321,49 +219,6 @@ def _generate_set_tiers_options(
321219 * blobs : Union [str , Dict [str , Any ], BlobProperties ],
322220 ** kwargs : Any
323221) -> Tuple [List [HttpRequest ], Dict [str , Any ]]:
324- """Creates a dictionary containing the options for a set tiers operation.
325-
326- :param str query_str:
327- The query string of the endpoint URL.
328- :param str container_name:
329- The name of the container.
330- :param blob_tier:
331- Indicates the tier to be set on the blobs.
332- :type blob_tier: Optional[Union["PremiumPageBlobTier", "StandardBlobTier", str]]
333- :param AzureBlobStorage client:
334- The generated Blob Storage client.
335- :param blobs:
336- The blobs to delete. This can be a single blob, or multiple values can
337- be supplied, where each value is either the name of the blob (str) or BlobProperties.
338-
339- .. note::
340- When the blob type is dict, here's a list of keys, value rules.
341-
342- blob name:
343- key: 'name', value type: str
344- snapshot you want to delete:
345- key: 'snapshot', value type: str
346- version id:
347- key: 'version_id', value type: str
348- whether to delete snapshots when deleting blob:
349- key: 'delete_snapshots', value: 'include' or 'only'
350- if the blob modified or not:
351- key: 'if_modified_since', 'if_unmodified_since', value type: datetime
352- etag:
353- key: 'etag', value type: str
354- match the etag or not:
355- key: 'match_condition', value type: MatchConditions
356- tags match condition:
357- key: 'if_tags_match_condition', value type: str
358- lease:
359- key: 'lease_id', value type: Union[str, LeaseClient]
360- timeout for subrequest:
361- key: 'timeout', value type: int
362-
363- :type blobs: Union[str, Dict[str, Any], BlobProperties]
364- :returns: A tuple containing the list of HttpRequests and the set tiers options.
365- :rtype: Tuple[List[HttpRequest], Dict[str, Any]]
366- """
367222 timeout = kwargs .pop ('timeout' , None )
368223 raise_on_any_failure = kwargs .pop ('raise_on_any_failure' , True )
369224 rehydrate_priority = kwargs .pop ('rehydrate_priority' , None )
0 commit comments