Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f9703ae
response header verification for start copy async
weirongw23-msft Apr 23, 2024
c237019
reverted back preprod
weirongw23-msft Apr 23, 2024
d7f4229
added tests for upload range to verify copy source error and status c…
weirongw23-msft Apr 24, 2024
a4cf425
work in progress: blob client start copy from url async tests
weirongw23-msft Apr 24, 2024
be0fe5f
copy source error and status code for start copy sync & async
weirongw23-msft Apr 24, 2024
7ed1a03
fixed test case to include copysourceerrormessage prefix
weirongw23-msft Apr 24, 2024
1c45995
surfaced copy source status and error code for upload blob from url (…
weirongw23-msft Apr 25, 2024
49d6d44
surfaced copy source status and error code for stage block from url
weirongw23-msft Apr 25, 2024
8e1c28e
surfaced copy source error and status code for upload pages from url
weirongw23-msft Apr 25, 2024
2495ad2
surfaced copy source error and status code for append block from url
weirongw23-msft Apr 25, 2024
1c1fd42
test recordings for copy source error and status code for blob package
weirongw23-msft Apr 25, 2024
68ab98d
Merge branch 'feature/storage-stg94' into weirongw23/errcode-copy-blob
weirongw23-msft Apr 26, 2024
77ffa00
re-recorded blob tests
weirongw23-msft Apr 26, 2024
74e486a
fixed test recordings by replacing sv dates
weirongw23-msft Apr 26, 2024
c26a42a
added test recordings for authentication error details
weirongw23-msft Apr 26, 2024
e25229f
removed date from se in auth err details tests
weirongw23-msft Apr 26, 2024
2954578
fixed typo for se in auth err details tests
weirongw23-msft Apr 26, 2024
50b7c6e
prototype to test out retry policy for timeout with copy blob error c…
weirongw23-msft Apr 27, 2024
e78005f
included all errors to retry surfaced from copy-source-status-code
weirongw23-msft Apr 27, 2024
24b8087
updated retry policy and tests to retry on specified error codes
weirongw23-msft May 1, 2024
8235de8
updated generate code to include get_account_info
weirongw23-msft May 1, 2024
968e8bf
updated test recordings after code regen, added recording for retry test
weirongw23-msft May 1, 2024
8f3025a
modified se= test recordings for get account info
weirongw23-msft May 1, 2024
78c769d
moved retry logic to all packages, added sync test in blob
weirongw23-msft May 1, 2024
ed4eda9
added sync versions of error code for copy blob tests and recordings
weirongw23-msft May 2, 2024
c87a0d5
removed copysourceerrormessage asserts and updated recordings
weirongw23-msft May 6, 2024
338f2dc
updated response handler logic to account for case senitivity in mess…
weirongw23-msft May 7, 2024
8b68407
fixed authentication error detail message capitalization check in sha…
weirongw23-msft May 7, 2024
adedf47
updated style to lowercasing strings
weirongw23-msft May 7, 2024
27707f6
fixed mypy errors for additional_data and error_dict types
weirongw23-msft May 8, 2024
4c0be2d
fixed pylint errors for too many branches in process storage errors
weirongw23-msft May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated generate code to include get_account_info
  • Loading branch information
weirongw23-msft committed May 1, 2024
commit 8235de880dd558e28552f3249d2427c3e11c7f2e
Original file line number Diff line number Diff line change
Expand Up @@ -2607,9 +2607,20 @@ async def set_tier( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, response_headers) # type: ignore

@distributed_trace_async
async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
async def get_account_info( # pylint: disable=inconsistent-return-statements
self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
) -> None:
"""Returns the sku name and account kind.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`. Default value is None.
:type timeout: int
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
value is None.
:type request_id_parameter: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -2631,6 +2642,8 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco

_request = build_get_account_info_request(
url=self._config.url,
timeout=timeout,
request_id_parameter=request_id_parameter,
restype=restype,
comp=comp,
version=self._config.version,
Expand Down Expand Up @@ -2661,6 +2674,7 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name"))
response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind"))
response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled"))

if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1737,9 +1737,20 @@ async def list_blob_hierarchy_segment(
return deserialized # type: ignore

@distributed_trace_async
async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
async def get_account_info( # pylint: disable=inconsistent-return-statements
self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
) -> None:
"""Returns the sku name and account kind.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`. Default value is None.
:type timeout: int
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
value is None.
:type request_id_parameter: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -1761,6 +1772,8 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco

_request = build_get_account_info_request(
url=self._config.url,
timeout=timeout,
request_id_parameter=request_id_parameter,
restype=restype,
comp=comp,
version=self._config.version,
Expand Down Expand Up @@ -1791,6 +1804,7 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name"))
response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind"))
response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled"))

if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,20 @@ async def get_user_delegation_key(
return deserialized # type: ignore

@distributed_trace_async
async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
async def get_account_info( # pylint: disable=inconsistent-return-statements
self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
) -> None:
"""Returns the sku name and account kind.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`. Default value is None.
:type timeout: int
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
value is None.
:type request_id_parameter: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -508,6 +519,8 @@ async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inco

_request = build_get_account_info_request(
url=self._config.url,
timeout=timeout,
request_id_parameter=request_id_parameter,
restype=restype,
comp=comp,
version=self._config.version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,9 @@ def build_set_tier_request(
return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)


def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest:
def build_get_account_info_request(
url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

Expand All @@ -1275,9 +1277,13 @@ def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest:
# Construct parameters
_params["restype"] = _SERIALIZER.query("restype", restype, "str")
_params["comp"] = _SERIALIZER.query("comp", comp, "str")
if timeout is not None:
_params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0)

# Construct headers
_headers["x-ms-version"] = _SERIALIZER.header("version", version, "str")
if request_id_parameter is not None:
_headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")

return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
Expand Down Expand Up @@ -4008,9 +4014,20 @@ def set_tier( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, response_headers) # type: ignore

@distributed_trace
def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
def get_account_info( # pylint: disable=inconsistent-return-statements
self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
) -> None:
"""Returns the sku name and account kind.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`. Default value is None.
:type timeout: int
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
value is None.
:type request_id_parameter: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -4032,6 +4049,8 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste

_request = build_get_account_info_request(
url=self._config.url,
timeout=timeout,
request_id_parameter=request_id_parameter,
restype=restype,
comp=comp,
version=self._config.version,
Expand Down Expand Up @@ -4062,6 +4081,7 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name"))
response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind"))
response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled"))

if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,9 @@ def build_list_blob_hierarchy_segment_request( # pylint: disable=name-too-long
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)


def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest:
def build_get_account_info_request(
url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

Expand All @@ -871,9 +873,13 @@ def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest:
# Construct parameters
_params["restype"] = _SERIALIZER.query("restype", restype, "str")
_params["comp"] = _SERIALIZER.query("comp", comp, "str")
if timeout is not None:
_params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0)

# Construct headers
_headers["x-ms-version"] = _SERIALIZER.header("version", version, "str")
if request_id_parameter is not None:
_headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")

return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
Expand Down Expand Up @@ -2562,9 +2568,20 @@ def list_blob_hierarchy_segment(
return deserialized # type: ignore

@distributed_trace
def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
def get_account_info( # pylint: disable=inconsistent-return-statements
self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
) -> None:
"""Returns the sku name and account kind.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`. Default value is None.
:type timeout: int
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
value is None.
:type request_id_parameter: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -2586,6 +2603,8 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste

_request = build_get_account_info_request(
url=self._config.url,
timeout=timeout,
request_id_parameter=request_id_parameter,
restype=restype,
comp=comp,
version=self._config.version,
Expand Down Expand Up @@ -2616,6 +2635,7 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name"))
response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind"))
response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled"))

if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ def build_get_user_delegation_key_request(
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, content=content, **kwargs)


def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest:
def build_get_account_info_request(
url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

Expand All @@ -248,9 +250,13 @@ def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest:
# Construct parameters
_params["restype"] = _SERIALIZER.query("restype", restype, "str")
_params["comp"] = _SERIALIZER.query("comp", comp, "str")
if timeout is not None:
_params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0)

# Construct headers
_headers["x-ms-version"] = _SERIALIZER.header("version", version, "str")
if request_id_parameter is not None:
_headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")

return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
Expand Down Expand Up @@ -786,9 +792,20 @@ def get_user_delegation_key(
return deserialized # type: ignore

@distributed_trace
def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
def get_account_info( # pylint: disable=inconsistent-return-statements
self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
) -> None:
"""Returns the sku name and account kind.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
Timeouts for Blob Service Operations.</a>`. Default value is None.
:type timeout: int
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
value is None.
:type request_id_parameter: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -810,6 +827,8 @@ def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsiste

_request = build_get_account_info_request(
url=self._config.url,
timeout=timeout,
request_id_parameter=request_id_parameter,
restype=restype,
comp=comp,
version=self._config.version,
Expand Down