diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py b/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py index 9b5561b358cc..40ef8200d75c 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py @@ -37,10 +37,13 @@ from .operation_paged import OperationPaged from .redis_resource_paged import RedisResourcePaged from .redis_firewall_rule_paged import RedisFirewallRulePaged +from .redis_patch_schedule_paged import RedisPatchSchedulePaged from .redis_linked_server_with_properties_paged import RedisLinkedServerWithPropertiesPaged from .redis_management_client_enums import ( SkuName, SkuFamily, + TlsVersion, + ProvisioningState, RedisKeyType, RebootType, DayOfWeek, @@ -76,9 +79,12 @@ 'OperationPaged', 'RedisResourcePaged', 'RedisFirewallRulePaged', + 'RedisPatchSchedulePaged', 'RedisLinkedServerWithPropertiesPaged', 'SkuName', 'SkuFamily', + 'TlsVersion', + 'ProvisioningState', 'RedisKeyType', 'RebootType', 'DayOfWeek', diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters.py b/azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters.py index 46651c191caf..79a0fb012c55 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters.py @@ -13,20 +13,26 @@ class CheckNameAvailabilityParameters(Model): - """Parameters body to pass for name availability check. + """Parameters body to pass for resource name availability check. :param name: Resource name. :type name: str - :param type: Resource type. + :param type: Resource type. The only legal value of this property for + checking redis cache name availability is 'Microsoft.Cache/redis'. :type type: str """ + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, name=None, type=None): + def __init__(self, name, type): super(CheckNameAvailabilityParameters, self).__init__() self.name = name self.type = type diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_create_parameters.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_create_parameters.py index 0e5439172f3f..063b6ba813b9 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_create_parameters.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_create_parameters.py @@ -27,6 +27,10 @@ class RedisCreateParameters(Model): :param shard_count: The number of shards to be created on a Premium Cluster Cache. :type shard_count: int + :param minimum_tls_version: Optional: requires clients to use a specified + TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible + values include: '1.0', '1.1', '1.2' + :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion :param sku: The SKU of the Redis cache to deploy. :type sku: ~azure.mgmt.redis.models.Sku :param subnet_id: The full resource ID of a subnet in a virtual network to @@ -57,6 +61,7 @@ class RedisCreateParameters(Model): 'enable_non_ssl_port': {'key': 'properties.enableNonSslPort', 'type': 'bool'}, 'tenant_settings': {'key': 'properties.tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'properties.shardCount', 'type': 'int'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, 'sku': {'key': 'properties.sku', 'type': 'Sku'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'static_ip': {'key': 'properties.staticIP', 'type': 'str'}, @@ -65,12 +70,13 @@ class RedisCreateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, sku, location, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, subnet_id=None, static_ip=None, zones=None, tags=None): + def __init__(self, sku, location, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, minimum_tls_version=None, subnet_id=None, static_ip=None, zones=None, tags=None): super(RedisCreateParameters, self).__init__() self.redis_configuration = redis_configuration self.enable_non_ssl_port = enable_non_ssl_port self.tenant_settings = tenant_settings self.shard_count = shard_count + self.minimum_tls_version = minimum_tls_version self.sku = sku self.subnet_id = subnet_id self.static_ip = static_ip diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_management_client_enums.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_management_client_enums.py index 21b8f1ecf9a5..38ef095312e5 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_management_client_enums.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_management_client_enums.py @@ -25,6 +25,29 @@ class SkuFamily(Enum): p = "P" +class TlsVersion(Enum): + + one_full_stop_zero = "1.0" + one_full_stop_one = "1.1" + one_full_stop_two = "1.2" + + +class ProvisioningState(Enum): + + creating = "Creating" + deleting = "Deleting" + disabled = "Disabled" + failed = "Failed" + linking = "Linking" + provisioning = "Provisioning" + recovering_scale_failure = "RecoveringScaleFailure" + scaling = "Scaling" + succeeded = "Succeeded" + unlinking = "Unlinking" + unprovisioning = "Unprovisioning" + updating = "Updating" + + class RedisKeyType(Enum): primary = "Primary" diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule_paged.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule_paged.py new file mode 100644 index 000000000000..c5196704d8b8 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule_paged.py @@ -0,0 +1,27 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RedisPatchSchedulePaged(Paged): + """ + A paging container for iterating over a list of :class:`RedisPatchSchedule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RedisPatchSchedule]'} + } + + def __init__(self, *args, **kwargs): + + super(RedisPatchSchedulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py index b3f699f7e808..92ddb379f469 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py @@ -40,6 +40,10 @@ class RedisResource(TrackedResource): :param shard_count: The number of shards to be created on a Premium Cluster Cache. :type shard_count: int + :param minimum_tls_version: Optional: requires clients to use a specified + TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible + values include: '1.0', '1.1', '1.2' + :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion :param sku: The SKU of the Redis cache to deploy. :type sku: ~azure.mgmt.redis.models.Sku :param subnet_id: The full resource ID of a subnet in a virtual network to @@ -51,8 +55,12 @@ class RedisResource(TrackedResource): :type static_ip: str :ivar redis_version: Redis version. :vartype redis_version: str - :ivar provisioning_state: Redis instance provisioning status. - :vartype provisioning_state: str + :ivar provisioning_state: Redis instance provisioning status. Possible + values include: 'Creating', 'Deleting', 'Disabled', 'Failed', 'Linking', + 'Provisioning', 'RecoveringScaleFailure', 'Scaling', 'Succeeded', + 'Unlinking', 'Unprovisioning', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.redis.models.ProvisioningState :ivar host_name: Redis host name. :vartype host_name: str :ivar port: Redis non-SSL port. @@ -96,6 +104,7 @@ class RedisResource(TrackedResource): 'enable_non_ssl_port': {'key': 'properties.enableNonSslPort', 'type': 'bool'}, 'tenant_settings': {'key': 'properties.tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'properties.shardCount', 'type': 'int'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, 'sku': {'key': 'properties.sku', 'type': 'Sku'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'static_ip': {'key': 'properties.staticIP', 'type': 'str'}, @@ -109,12 +118,13 @@ class RedisResource(TrackedResource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, location, sku, tags=None, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, subnet_id=None, static_ip=None, zones=None): + def __init__(self, location, sku, tags=None, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, minimum_tls_version=None, subnet_id=None, static_ip=None, zones=None): super(RedisResource, self).__init__(tags=tags, location=location) self.redis_configuration = redis_configuration self.enable_non_ssl_port = enable_non_ssl_port self.tenant_settings = tenant_settings self.shard_count = shard_count + self.minimum_tls_version = minimum_tls_version self.sku = sku self.subnet_id = subnet_id self.static_ip = static_ip diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_update_parameters.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_update_parameters.py index da3c389c52b9..b02b9bbc1e2f 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_update_parameters.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_update_parameters.py @@ -27,6 +27,10 @@ class RedisUpdateParameters(Model): :param shard_count: The number of shards to be created on a Premium Cluster Cache. :type shard_count: int + :param minimum_tls_version: Optional: requires clients to use a specified + TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible + values include: '1.0', '1.1', '1.2' + :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion :param sku: The SKU of the Redis cache to deploy. :type sku: ~azure.mgmt.redis.models.Sku :param tags: Resource tags. @@ -38,15 +42,17 @@ class RedisUpdateParameters(Model): 'enable_non_ssl_port': {'key': 'properties.enableNonSslPort', 'type': 'bool'}, 'tenant_settings': {'key': 'properties.tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'properties.shardCount', 'type': 'int'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, 'sku': {'key': 'properties.sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, sku=None, tags=None): + def __init__(self, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, minimum_tls_version=None, sku=None, tags=None): super(RedisUpdateParameters, self).__init__() self.redis_configuration = redis_configuration self.enable_non_ssl_port = enable_non_ssl_port self.tenant_settings = tenant_settings self.shard_count = shard_count + self.minimum_tls_version = minimum_tls_version self.sku = sku self.tags = tags diff --git a/azure-mgmt-redis/azure/mgmt/redis/operations/firewall_rules_operations.py b/azure-mgmt-redis/azure/mgmt/redis/operations/firewall_rules_operations.py index 9b52e0ff2909..ed3a6de66f43 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/firewall_rules_operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/firewall_rules_operations.py @@ -23,7 +23,7 @@ class FirewallRulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2017-10-01". + :ivar api_version: Client Api Version. Constant value: "2018-03-01". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01" + self.api_version = "2018-03-01" self.config = config diff --git a/azure-mgmt-redis/azure/mgmt/redis/operations/linked_server_operations.py b/azure-mgmt-redis/azure/mgmt/redis/operations/linked_server_operations.py index e61e45f7f2a4..80baaaa2caab 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/linked_server_operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/linked_server_operations.py @@ -25,7 +25,7 @@ class LinkedServerOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2017-10-01". + :ivar api_version: Client Api Version. Constant value: "2018-03-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01" + self.api_version = "2018-03-01" self.config = config diff --git a/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py b/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py index 9cfaf3a733e1..7c7e63159d7e 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2017-10-01". + :ivar api_version: Client Api Version. Constant value: "2018-03-01". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01" + self.api_version = "2018-03-01" self.config = config diff --git a/azure-mgmt-redis/azure/mgmt/redis/operations/patch_schedules_operations.py b/azure-mgmt-redis/azure/mgmt/redis/operations/patch_schedules_operations.py index 5ef94ae2f355..278ffe5fbd30 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/patch_schedules_operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/patch_schedules_operations.py @@ -23,8 +23,8 @@ class PatchSchedulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-03-01". :ivar default: Default string modeled as parameter for auto generation to work correctly. Constant value: "default". - :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ models = models @@ -34,11 +34,83 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2018-03-01" self.default = "default" - self.api_version = "2017-10-01" self.config = config + def list_by_redis_resource( + self, resource_group_name, cache_name, custom_headers=None, raw=False, **operation_config): + """Gets all patch schedules in the specified redis cache (there is only + one). + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cache_name: The name of the Redis cache. + :type cache_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RedisPatchSchedule + :rtype: + ~azure.mgmt.redis.models.RedisPatchSchedulePaged[~azure.mgmt.redis.models.RedisPatchSchedule] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_redis_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'cacheName': self._serialize.url("cache_name", cache_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RedisPatchSchedulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RedisPatchSchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_redis_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/patchSchedules'} + def create_or_update( self, resource_group_name, name, schedule_entries, custom_headers=None, raw=False, **operation_config): """Create or replace the patching schedule for Redis cache (requires diff --git a/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py b/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py index 758d58c8789c..dcf064c9a975 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py @@ -25,7 +25,7 @@ class RedisOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2017-10-01". + :ivar api_version: Client Api Version. Constant value: "2018-03-01". """ models = models @@ -35,17 +35,18 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01" + self.api_version = "2018-03-01" self.config = config def check_name_availability( - self, name=None, type=None, custom_headers=None, raw=False, **operation_config): + self, name, type, custom_headers=None, raw=False, **operation_config): """Checks that the redis cache name is valid and is not already in use. :param name: Resource name. :type name: str - :param type: Resource type. + :param type: Resource type. The only legal value of this property for + checking redis cache name availability is 'Microsoft.Cache/redis'. :type type: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -382,7 +383,7 @@ def _delete_initial( request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -434,7 +435,7 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp diff --git a/azure-mgmt-redis/azure/mgmt/redis/redis_management_client.py b/azure-mgmt-redis/azure/mgmt/redis/redis_management_client.py index 6052a4cf3fbb..e3032d25f099 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/redis_management_client.py +++ b/azure-mgmt-redis/azure/mgmt/redis/redis_management_client.py @@ -89,7 +89,7 @@ def __init__( self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-10-01' + self.api_version = '2018-03-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models)