[AutoRelease] t2-storage-2024-06-27-00088(can only be merged by SDK owner) (#36262)
* code and test * update-changelog * Update CHANGELOG.md * update-testcase --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <v-chenjiang@microsoft.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
This commit is contained in:
Родитель
a4dddb01c8
Коммит
9d63a2d2a2
|
@ -1,5 +1,13 @@
|
|||
# Release History
|
||||
|
||||
## 21.2.1 (2024-06-27)
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
- Fix signature `maxpagesize` type of Operation StorageTaskAssignmentInstancesReportOperations.list from str to int
|
||||
- Fix signature `maxpagesize` type of Operation StorageTaskAssignmentsInstancesReportOperations.list from str to int
|
||||
- Fix signature `maxpagesize` type of Operation StorageTaskAssignmentsOperations.list from str to int
|
||||
|
||||
## 21.2.0 (2024-06-17)
|
||||
|
||||
### Features Added
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"commit": "b22c642b361e6d6e7d72a2347a09b0bcf6075d70",
|
||||
"commit": "43f10d3b8bacd5fc6b01254b5050c613f26c3573",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
|
||||
"autorest": "3.10.2",
|
||||
"use": [
|
||||
"@autorest/python@6.13.16",
|
||||
"@autorest/python@6.13.19",
|
||||
"@autorest/modelerfour@4.27.0"
|
||||
],
|
||||
"autorest_command": "autorest specification/storage/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.16 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
|
||||
"autorest_command": "autorest specification/storage/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.19 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
|
||||
"readme": "specification/storage/resource-manager/readme.md",
|
||||
"package-2023-01": "2023-07-20 11:56:40 -0700 3e6b4ddca225530c27273d0f816466a905c0151b Microsoft.Storage/stable/2023-01-01/table.json",
|
||||
"package-2022-09": "2022-11-13 19:43:16 -0800 da0cfefaa0e6c237e1e3819f1cb2e11d7606878d Microsoft.Storage/stable/2022-09-01/table.json",
|
||||
|
@ -29,5 +29,5 @@
|
|||
"package-2016-12": "2020-05-21 10:20:08 +0200 db0f437ba79086e20570d648fe932c4266e7a7ed Microsoft.Storage/stable/2016-12-01/storage.json",
|
||||
"package-2016-01": "2019-06-26 12:38:19 -0400 26df0a691d94445b2c96d348f5ecc31f6f9a2099 Microsoft.Storage/stable/2016-01-01/storage.json",
|
||||
"package-2015-06": "2019-06-26 12:38:19 -0400 26df0a691d94445b2c96d348f5ecc31f6f9a2099 Microsoft.Storage/stable/2015-06-15/storage.json",
|
||||
"package-2023-05": "2024-06-04 20:39:42 -0700 09c187c9589a143a477ed02c6639e914a4818179 Microsoft.Storage/stable/2023-05-01/storageTaskAssignments.json"
|
||||
"package-2023-05": "2024-06-26 09:32:01 -0700 db377f47cf7bf53bf077aa42967112a9783980d5 Microsoft.Storage/stable/2023-05-01/storageTaskAssignments.json"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"AssetsRepo": "Azure/azure-sdk-assets",
|
||||
"AssetsRepoPrefixPath": "python",
|
||||
"TagPrefix": "python/storage/azure-mgmt-storage",
|
||||
"Tag": "python/storage/azure-mgmt-storage_745b7ea500"
|
||||
}
|
|
@ -1447,7 +1447,7 @@ class Deserializer(object):
|
|||
elif isinstance(response, type) and issubclass(response, Enum):
|
||||
return self.deserialize_enum(data, response)
|
||||
|
||||
if data is None:
|
||||
if data is None or data is CoreNull:
|
||||
return data
|
||||
try:
|
||||
attributes = response._attribute_map # type: ignore
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
# license information.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "21.2.0"
|
||||
VERSION = "21.2.1"
|
|
@ -64,7 +64,7 @@ class StorageTaskAssignmentInstancesReportOperations: # pylint: disable=name-to
|
|||
resource_group_name: str,
|
||||
account_name: str,
|
||||
storage_task_assignment_name: str,
|
||||
maxpagesize: Optional[str] = None,
|
||||
maxpagesize: Optional[int] = None,
|
||||
filter: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> AsyncIterable["_models.StorageTaskReportInstance"]:
|
||||
|
@ -83,7 +83,7 @@ class StorageTaskAssignmentInstancesReportOperations: # pylint: disable=name-to
|
|||
:type storage_task_assignment_name: str
|
||||
:param maxpagesize: Optional, specifies the maximum number of storage task assignment instances
|
||||
to be included in the list response. Default value is None.
|
||||
:type maxpagesize: str
|
||||
:type maxpagesize: int
|
||||
:param filter: Optional. When specified, it can be used to query using reporting properties.
|
||||
See `Constructing Filter Strings
|
||||
<https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings>`_
|
||||
|
|
|
@ -63,7 +63,7 @@ class StorageTaskAssignmentsInstancesReportOperations: # pylint: disable=name-t
|
|||
self,
|
||||
resource_group_name: str,
|
||||
account_name: str,
|
||||
maxpagesize: Optional[str] = None,
|
||||
maxpagesize: Optional[int] = None,
|
||||
filter: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> AsyncIterable["_models.StorageTaskReportInstance"]:
|
||||
|
@ -78,7 +78,7 @@ class StorageTaskAssignmentsInstancesReportOperations: # pylint: disable=name-t
|
|||
:type account_name: str
|
||||
:param maxpagesize: Optional, specifies the maximum number of storage task assignment instances
|
||||
to be included in the list response. Default value is None.
|
||||
:type maxpagesize: str
|
||||
:type maxpagesize: int
|
||||
:param filter: Optional. When specified, it can be used to query using reporting properties.
|
||||
See `Constructing Filter Strings
|
||||
<https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings>`_
|
||||
|
|
|
@ -709,7 +709,7 @@ class StorageTaskAssignmentsOperations:
|
|||
|
||||
@distributed_trace
|
||||
def list(
|
||||
self, resource_group_name: str, account_name: str, maxpagesize: Optional[str] = None, **kwargs: Any
|
||||
self, resource_group_name: str, account_name: str, maxpagesize: Optional[int] = None, **kwargs: Any
|
||||
) -> AsyncIterable["_models.StorageTaskAssignment"]:
|
||||
"""List all the storage task assignments in an account.
|
||||
|
||||
|
@ -722,7 +722,7 @@ class StorageTaskAssignmentsOperations:
|
|||
:type account_name: str
|
||||
:param maxpagesize: Optional, specifies the maximum number of storage task assignment Ids to be
|
||||
included in the list response. Default value is None.
|
||||
:type maxpagesize: str
|
||||
:type maxpagesize: int
|
||||
:return: An iterator like instance of either StorageTaskAssignment or the result of
|
||||
cls(response)
|
||||
:rtype:
|
||||
|
|
|
@ -47,7 +47,7 @@ def build_list_request(
|
|||
storage_task_assignment_name: str,
|
||||
subscription_id: str,
|
||||
*,
|
||||
maxpagesize: Optional[str] = None,
|
||||
maxpagesize: Optional[int] = None,
|
||||
filter: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> HttpRequest:
|
||||
|
@ -84,7 +84,7 @@ def build_list_request(
|
|||
|
||||
# Construct parameters
|
||||
if maxpagesize is not None:
|
||||
_params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "str")
|
||||
_params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "int")
|
||||
if filter is not None:
|
||||
_params["$filter"] = _SERIALIZER.query("filter", filter, "str")
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
@ -121,7 +121,7 @@ class StorageTaskAssignmentInstancesReportOperations: # pylint: disable=name-to
|
|||
resource_group_name: str,
|
||||
account_name: str,
|
||||
storage_task_assignment_name: str,
|
||||
maxpagesize: Optional[str] = None,
|
||||
maxpagesize: Optional[int] = None,
|
||||
filter: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> Iterable["_models.StorageTaskReportInstance"]:
|
||||
|
@ -140,7 +140,7 @@ class StorageTaskAssignmentInstancesReportOperations: # pylint: disable=name-to
|
|||
:type storage_task_assignment_name: str
|
||||
:param maxpagesize: Optional, specifies the maximum number of storage task assignment instances
|
||||
to be included in the list response. Default value is None.
|
||||
:type maxpagesize: str
|
||||
:type maxpagesize: int
|
||||
:param filter: Optional. When specified, it can be used to query using reporting properties.
|
||||
See `Constructing Filter Strings
|
||||
<https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings>`_
|
||||
|
|
|
@ -46,7 +46,7 @@ def build_list_request(
|
|||
account_name: str,
|
||||
subscription_id: str,
|
||||
*,
|
||||
maxpagesize: Optional[str] = None,
|
||||
maxpagesize: Optional[int] = None,
|
||||
filter: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> HttpRequest:
|
||||
|
@ -75,7 +75,7 @@ def build_list_request(
|
|||
|
||||
# Construct parameters
|
||||
if maxpagesize is not None:
|
||||
_params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "str")
|
||||
_params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "int")
|
||||
if filter is not None:
|
||||
_params["$filter"] = _SERIALIZER.query("filter", filter, "str")
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
@ -111,7 +111,7 @@ class StorageTaskAssignmentsInstancesReportOperations: # pylint: disable=name-t
|
|||
self,
|
||||
resource_group_name: str,
|
||||
account_name: str,
|
||||
maxpagesize: Optional[str] = None,
|
||||
maxpagesize: Optional[int] = None,
|
||||
filter: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> Iterable["_models.StorageTaskReportInstance"]:
|
||||
|
@ -126,7 +126,7 @@ class StorageTaskAssignmentsInstancesReportOperations: # pylint: disable=name-t
|
|||
:type account_name: str
|
||||
:param maxpagesize: Optional, specifies the maximum number of storage task assignment instances
|
||||
to be included in the list response. Default value is None.
|
||||
:type maxpagesize: str
|
||||
:type maxpagesize: int
|
||||
:param filter: Optional. When specified, it can be used to query using reporting properties.
|
||||
See `Constructing Filter Strings
|
||||
<https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings>`_
|
||||
|
|
|
@ -227,7 +227,7 @@ def build_list_request(
|
|||
account_name: str,
|
||||
subscription_id: str,
|
||||
*,
|
||||
maxpagesize: Optional[str] = None,
|
||||
maxpagesize: Optional[int] = None,
|
||||
**kwargs: Any
|
||||
) -> HttpRequest:
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
|
@ -255,7 +255,7 @@ def build_list_request(
|
|||
|
||||
# Construct parameters
|
||||
if maxpagesize is not None:
|
||||
_params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "str")
|
||||
_params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "int")
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
||||
# Construct headers
|
||||
|
@ -925,7 +925,7 @@ class StorageTaskAssignmentsOperations:
|
|||
|
||||
@distributed_trace
|
||||
def list(
|
||||
self, resource_group_name: str, account_name: str, maxpagesize: Optional[str] = None, **kwargs: Any
|
||||
self, resource_group_name: str, account_name: str, maxpagesize: Optional[int] = None, **kwargs: Any
|
||||
) -> Iterable["_models.StorageTaskAssignment"]:
|
||||
"""List all the storage task assignments in an account.
|
||||
|
||||
|
@ -938,7 +938,7 @@ class StorageTaskAssignmentsOperations:
|
|||
:type account_name: str
|
||||
:param maxpagesize: Optional, specifies the maximum number of storage task assignment Ids to be
|
||||
included in the list response. Default value is None.
|
||||
:type maxpagesize: str
|
||||
:type maxpagesize: int
|
||||
:return: An iterator like instance of either StorageTaskAssignment or the result of
|
||||
cls(response)
|
||||
:rtype:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
-e ../../../tools/azure-sdk-tools
|
||||
aiohttp>=3.0; python_version >= '3.5'
|
||||
azure-mgmt-network==19.0.0
|
||||
-e ../../resources/azure-mgmt-resource
|
|
@ -23,10 +23,28 @@
|
|||
# IN THE SOFTWARE.
|
||||
#
|
||||
# --------------------------------------------------------------------------
|
||||
import os
|
||||
import platform
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
# Ignore async tests for Python < 3.5
|
||||
collect_ignore_glob = []
|
||||
if sys.version_info < (3, 5) or platform.python_implementation() == "PyPy":
|
||||
collect_ignore_glob.append("*_async.py")
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from devtools_testutils import test_proxy, add_general_regex_sanitizer
|
||||
from devtools_testutils import add_header_regex_sanitizer, add_body_key_sanitizer
|
||||
|
||||
load_dotenv()
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def add_sanitizers(test_proxy):
|
||||
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
|
||||
tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
|
||||
client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000")
|
||||
client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000")
|
||||
add_general_regex_sanitizer(regex=subscription_id, value="00000000-0000-0000-0000-000000000000")
|
||||
add_general_regex_sanitizer(regex=tenant_id, value="00000000-0000-0000-0000-000000000000")
|
||||
add_general_regex_sanitizer(regex=client_id, value="00000000-0000-0000-0000-000000000000")
|
||||
add_general_regex_sanitizer(regex=client_secret, value="00000000-0000-0000-0000-000000000000")
|
||||
add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
|
||||
add_header_regex_sanitizer(key="Cookie", value="cookie;")
|
||||
add_body_key_sanitizer(json_path="$..access_token", value="access_token")
|
|
@ -0,0 +1,26 @@
|
|||
# coding: utf-8
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for
|
||||
# license information.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
from azure.mgmt.storage import StorageManagementClient
|
||||
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
|
||||
|
||||
AZURE_LOCATION = 'eastus'
|
||||
|
||||
class TestMgmtStorage(AzureMgmtRecordedTestCase):
|
||||
|
||||
def setup_method(self, method):
|
||||
self.client = self.create_mgmt_client(StorageManagementClient)
|
||||
|
||||
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
|
||||
@recorded_by_proxy
|
||||
def test_list_by_resource_group(self, resource_group):
|
||||
assert list(self.client.storage_accounts.list_by_resource_group(resource_group.name)) == []
|
||||
|
||||
@recorded_by_proxy
|
||||
def test_list_operations(self):
|
||||
assert list(self.client.operations.list())
|
Загрузка…
Ссылка в новой задаче