Skip to content

Commit

Permalink
CodeGen from PR 20869 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Redis Cache] New API Version 2022-06-01 with some extra linked server properties added for server role update/failover support (Azure#20869)

* Adds base for updating Microsoft.Cache from version stable/2022-05-01 to version 2022-06-01

* Updates readme

* Updates API version in new specs and examples

* API version 2022-06-01 with new linked server properties

* PR comments fix

* Updating description

* Updating description to make it more clear

* Updating to latest merge in swagger.
  • Loading branch information
SDKAuto committed Sep 30, 2022
1 parent 6603308 commit 79df0b3
Show file tree
Hide file tree
Showing 23 changed files with 523 additions and 127 deletions.
10 changes: 5 additions & 5 deletions sdk/redis/azure-mgmt-redis/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.8.4",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.1.4",
"@autorest/modelerfour@4.23.5"
"@autorest/python@6.1.9",
"@autorest/modelerfour@4.24.3"
],
"commit": "30ffead0fbaed3aaa8154418d5c55ef6f5e11f42",
"commit": "ec278eb936001b993e0413d66d8cc88e73540331",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/redis/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.4 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
"autorest_command": "autorest specification/redis/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.9 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/redis/resource-manager/readme.md"
}
4 changes: 2 additions & 2 deletions sdk/redis/azure-mgmt-redis/azure/mgmt/redis/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class RedisManagementClientConfiguration(Configuration): # pylint: disable=too-
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(RedisManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-05-01") # type: str
api_version = kwargs.pop("api_version", "2022-06-01") # type: str

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RedisManagementClient: # pylint: disable=client-accepts-api-version-keywo
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down
2 changes: 1 addition & 1 deletion sdk/redis/azure-mgmt-redis/azure/mgmt/redis/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "14.0.0"
VERSION = "12.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class RedisManagementClientConfiguration(Configuration): # pylint: disable=too-
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(RedisManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-05-01") # type: str
api_version = kwargs.pop("api_version", "2022-06-01") # type: str

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RedisManagementClient: # pylint: disable=client-accepts-api-version-keywo
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
Expand Down Expand Up @@ -62,7 +63,12 @@ async def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.
:rtype: ~azure.mgmt.redis.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
Expand Down Expand Up @@ -78,7 +79,12 @@ def list(
api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
cls = kwargs.pop("cls", None) # type: ClsType[_models.RedisFirewallRuleListResult]

error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

def prepare_request(next_link=None):
Expand Down Expand Up @@ -223,7 +229,12 @@ async def create_or_update(
:rtype: ~azure.mgmt.redis.models.RedisFirewallRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
Expand Down Expand Up @@ -298,7 +309,12 @@ async def get(
:rtype: ~azure.mgmt.redis.models.RedisFirewallRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
Expand Down Expand Up @@ -357,7 +373,12 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
Expand Down Expand Up @@ -67,7 +68,12 @@ async def _create_initial(
parameters: Union[_models.RedisLinkedServerCreateParameters, IO],
**kwargs: Any
) -> _models.RedisLinkedServerWithProperties:
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
Expand Down Expand Up @@ -293,7 +299,12 @@ def get_long_running_output(pipeline_response):
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, name: str, linked_server_name: str, **kwargs: Any
) -> None:
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
Expand Down Expand Up @@ -415,7 +426,12 @@ async def get(
:rtype: ~azure.mgmt.redis.models.RedisLinkedServerWithProperties
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
Expand Down Expand Up @@ -480,7 +496,12 @@ def list(
api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
cls = kwargs.pop("cls", None) # type: ClsType[_models.RedisLinkedServerWithPropertiesList]

error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

def prepare_request(next_link=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
Expand Down Expand Up @@ -66,7 +67,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult]

error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

def prepare_request(next_link=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
Expand Down Expand Up @@ -78,7 +79,12 @@ def list_by_redis_resource(
api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
cls = kwargs.pop("cls", None) # type: ClsType[_models.RedisPatchScheduleListResult]

error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

def prepare_request(next_link=None):
Expand Down Expand Up @@ -138,7 +144,7 @@ async def create_or_update(
self,
resource_group_name: str,
name: str,
default: Union[str, "_models.DefaultName"],
default: Union[str, _models.DefaultName],
parameters: _models.RedisPatchSchedule,
*,
content_type: str = "application/json",
Expand Down Expand Up @@ -169,7 +175,7 @@ async def create_or_update(
self,
resource_group_name: str,
name: str,
default: Union[str, "_models.DefaultName"],
default: Union[str, _models.DefaultName],
parameters: IO,
*,
content_type: str = "application/json",
Expand Down Expand Up @@ -200,7 +206,7 @@ async def create_or_update(
self,
resource_group_name: str,
name: str,
default: Union[str, "_models.DefaultName"],
default: Union[str, _models.DefaultName],
parameters: Union[_models.RedisPatchSchedule, IO],
**kwargs: Any
) -> _models.RedisPatchSchedule:
Expand All @@ -224,7 +230,12 @@ async def create_or_update(
:rtype: ~azure.mgmt.redis.models.RedisPatchSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
Expand Down Expand Up @@ -284,7 +295,7 @@ async def create_or_update(

@distributed_trace_async
async def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, name: str, default: Union[str, "_models.DefaultName"], **kwargs: Any
self, resource_group_name: str, name: str, default: Union[str, _models.DefaultName], **kwargs: Any
) -> None:
"""Deletes the patching schedule of a redis cache.
Expand All @@ -300,7 +311,12 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
Expand Down Expand Up @@ -340,7 +356,7 @@ async def delete( # pylint: disable=inconsistent-return-statements

@distributed_trace_async
async def get(
self, resource_group_name: str, name: str, default: Union[str, "_models.DefaultName"], **kwargs: Any
self, resource_group_name: str, name: str, default: Union[str, _models.DefaultName], **kwargs: Any
) -> _models.RedisPatchSchedule:
"""Gets the patching schedule of a redis cache.
Expand All @@ -356,7 +372,12 @@ async def get(
:rtype: ~azure.mgmt.redis.models.RedisPatchSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
Expand Down
Loading

0 comments on commit 79df0b3

Please sign in to comment.