diff --git a/sdk/redis/azure-mgmt-redis/README.md b/sdk/redis/azure-mgmt-redis/README.md index 1fd5bb09dc89..f47d0d0e47f0 100644 --- a/sdk/redis/azure-mgmt-redis/README.md +++ b/sdk/redis/azure-mgmt-redis/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Redis Cache Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. +# Usage -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. - -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. - -## Usage - -For code examples, see [Redis Cache -Management](https://docs.microsoft.com/python/api/overview/azure/redis) +For code examples, see [Redis Cache Management](https://docs.microsoft.com/python/api/overview/azure/redis) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-redis%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-redis%2FREADME.png) diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models.py index c06ef1776621..95d44b942295 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models.py @@ -568,6 +568,8 @@ class RedisInstanceDetails(Model): :vartype zone: str :ivar shard_id: If clustering is enabled, the Shard ID of Redis Instance :vartype shard_id: int + :ivar is_master: Specifies whether the instance is a master node. + :vartype is_master: bool """ _validation = { @@ -575,6 +577,7 @@ class RedisInstanceDetails(Model): 'non_ssl_port': {'readonly': True}, 'zone': {'readonly': True}, 'shard_id': {'readonly': True}, + 'is_master': {'readonly': True}, } _attribute_map = { @@ -582,6 +585,7 @@ class RedisInstanceDetails(Model): 'non_ssl_port': {'key': 'nonSslPort', 'type': 'int'}, 'zone': {'key': 'zone', 'type': 'str'}, 'shard_id': {'key': 'shardId', 'type': 'int'}, + 'is_master': {'key': 'isMaster', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -590,6 +594,7 @@ def __init__(self, **kwargs): self.non_ssl_port = None self.zone = None self.shard_id = None + self.is_master = None class RedisLinkedServer(Model): @@ -747,30 +752,29 @@ def __init__(self, **kwargs): class RedisRebootParameters(Model): """Specifies which Redis node(s) to reboot. - All required parameters must be populated in order to send to Azure. - - :param reboot_type: Required. Which Redis node(s) to reboot. Depending on - this value data loss is possible. Possible values include: 'PrimaryNode', + :param reboot_type: Which Redis node(s) to reboot. Depending on this value + data loss is possible. Possible values include: 'PrimaryNode', 'SecondaryNode', 'AllNodes' :type reboot_type: str or ~azure.mgmt.redis.models.RebootType :param shard_id: If clustering is enabled, the ID of the shard to be rebooted. :type shard_id: int + :param ports: A list of redis instances to reboot, specified by + per-instance SSL ports or non-SSL ports. + :type ports: list[int] """ - _validation = { - 'reboot_type': {'required': True}, - } - _attribute_map = { 'reboot_type': {'key': 'rebootType', 'type': 'str'}, 'shard_id': {'key': 'shardId', 'type': 'int'}, + 'ports': {'key': 'ports', 'type': '[int]'}, } def __init__(self, **kwargs): super(RedisRebootParameters, self).__init__(**kwargs) self.reboot_type = kwargs.get('reboot_type', None) self.shard_id = kwargs.get('shard_id', None) + self.ports = kwargs.get('ports', None) class RedisRegenerateKeyParameters(Model): diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models_py3.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models_py3.py index def2565847ed..cc4c5fc4a0ec 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models_py3.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models_py3.py @@ -568,6 +568,8 @@ class RedisInstanceDetails(Model): :vartype zone: str :ivar shard_id: If clustering is enabled, the Shard ID of Redis Instance :vartype shard_id: int + :ivar is_master: Specifies whether the instance is a master node. + :vartype is_master: bool """ _validation = { @@ -575,6 +577,7 @@ class RedisInstanceDetails(Model): 'non_ssl_port': {'readonly': True}, 'zone': {'readonly': True}, 'shard_id': {'readonly': True}, + 'is_master': {'readonly': True}, } _attribute_map = { @@ -582,6 +585,7 @@ class RedisInstanceDetails(Model): 'non_ssl_port': {'key': 'nonSslPort', 'type': 'int'}, 'zone': {'key': 'zone', 'type': 'str'}, 'shard_id': {'key': 'shardId', 'type': 'int'}, + 'is_master': {'key': 'isMaster', 'type': 'bool'}, } def __init__(self, **kwargs) -> None: @@ -590,6 +594,7 @@ def __init__(self, **kwargs) -> None: self.non_ssl_port = None self.zone = None self.shard_id = None + self.is_master = None class RedisLinkedServer(Model): @@ -747,30 +752,29 @@ def __init__(self, *, schedule_entries, **kwargs) -> None: class RedisRebootParameters(Model): """Specifies which Redis node(s) to reboot. - All required parameters must be populated in order to send to Azure. - - :param reboot_type: Required. Which Redis node(s) to reboot. Depending on - this value data loss is possible. Possible values include: 'PrimaryNode', + :param reboot_type: Which Redis node(s) to reboot. Depending on this value + data loss is possible. Possible values include: 'PrimaryNode', 'SecondaryNode', 'AllNodes' :type reboot_type: str or ~azure.mgmt.redis.models.RebootType :param shard_id: If clustering is enabled, the ID of the shard to be rebooted. :type shard_id: int + :param ports: A list of redis instances to reboot, specified by + per-instance SSL ports or non-SSL ports. + :type ports: list[int] """ - _validation = { - 'reboot_type': {'required': True}, - } - _attribute_map = { 'reboot_type': {'key': 'rebootType', 'type': 'str'}, 'shard_id': {'key': 'shardId', 'type': 'int'}, + 'ports': {'key': 'ports', 'type': '[int]'}, } - def __init__(self, *, reboot_type, shard_id: int=None, **kwargs) -> None: + def __init__(self, *, reboot_type=None, shard_id: int=None, ports=None, **kwargs) -> None: super(RedisRebootParameters, self).__init__(**kwargs) self.reboot_type = reboot_type self.shard_id = shard_id + self.ports = ports class RedisRegenerateKeyParameters(Model): diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_redis_operations.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_redis_operations.py index 2ad41ccf40f2..12342176ca06 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_redis_operations.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_redis_operations.py @@ -743,7 +743,7 @@ def regenerate_key( regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey'} def force_reboot( - self, resource_group_name, name, reboot_type, shard_id=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): """Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. @@ -751,13 +751,8 @@ def force_reboot( :type resource_group_name: str :param name: The name of the Redis cache. :type name: str - :param reboot_type: Which Redis node(s) to reboot. Depending on this - value data loss is possible. Possible values include: 'PrimaryNode', - 'SecondaryNode', 'AllNodes' - :type reboot_type: str or ~azure.mgmt.redis.models.RebootType - :param shard_id: If clustering is enabled, the ID of the shard to be - rebooted. - :type shard_id: int + :param parameters: Specifies which Redis node(s) to reboot. + :type parameters: ~azure.mgmt.redis.models.RedisRebootParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -768,8 +763,6 @@ def force_reboot( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.RedisRebootParameters(reboot_type=reboot_type, shard_id=shard_id) - # Construct URL url = self.force_reboot.metadata['url'] path_format_arguments = { diff --git a/sdk/redis/azure-mgmt-redis/setup.py b/sdk/redis/azure-mgmt-redis/setup.py index 82bc6ad68e8c..5e26243a1c12 100644 --- a/sdk/redis/azure-mgmt-redis/setup.py +++ b/sdk/redis/azure-mgmt-redis/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -67,6 +69,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,