From a05884c3332fa315ae048c1c91bc6ea9a5e942c0 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 2 Mar 2018 12:36:16 -0800 Subject: [PATCH 1/7] [AutoPR redis/resource-manager] Swagger completeness for Redis Cache (#2055) * Generated from adccbe159e32ef8112a0aadccc07d3c6c5390d11 Name change for notification * Generated from fdcb7d3837ae11e3fe8af22e28dadb032c498672 Fixing code review comments in PR --- .../azure/mgmt/redis/models/__init__.py | 6 + .../check_name_availability_parameters.py | 32 ++++ .../models/notification_list_response.py | 39 +++++ .../mgmt/redis/models/upgrade_notification.py | 45 +++++ .../operations/firewall_rules_operations.py | 14 +- .../operations/linked_server_operations.py | 14 +- .../azure/mgmt/redis/operations/operations.py | 5 +- .../operations/patch_schedules_operations.py | 16 +- .../mgmt/redis/operations/redis_operations.py | 159 ++++++++++++++++-- 9 files changed, 302 insertions(+), 28 deletions(-) create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py b/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py index 475a799a870f..9b5561b358cc 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py @@ -31,6 +31,9 @@ from .redis_linked_server_create_parameters import RedisLinkedServerCreateParameters from .operation_display import OperationDisplay from .operation import Operation +from .check_name_availability_parameters import CheckNameAvailabilityParameters +from .upgrade_notification import UpgradeNotification +from .notification_list_response import NotificationListResponse from .operation_paged import OperationPaged from .redis_resource_paged import RedisResourcePaged from .redis_firewall_rule_paged import RedisFirewallRulePaged @@ -67,6 +70,9 @@ 'RedisLinkedServerCreateParameters', 'OperationDisplay', 'Operation', + 'CheckNameAvailabilityParameters', + 'UpgradeNotification', + 'NotificationListResponse', 'OperationPaged', 'RedisResourcePaged', 'RedisFirewallRulePaged', 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 new file mode 100644 index 000000000000..46651c191caf --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters.py @@ -0,0 +1,32 @@ +# 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.serialization import Model + + +class CheckNameAvailabilityParameters(Model): + """Parameters body to pass for name availability check. + + :param name: Resource name. + :type name: str + :param type: Resource type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, name=None, type=None): + super(CheckNameAvailabilityParameters, self).__init__() + self.name = name + self.type = type diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response.py b/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response.py new file mode 100644 index 000000000000..b816703e32d6 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response.py @@ -0,0 +1,39 @@ +# 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.serialization import Model + + +class NotificationListResponse(Model): + """The response of listUpgradeNotifications. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: List of all notifications. + :type value: list[~azure.mgmt.redis.models.UpgradeNotification] + :ivar next_link: Link for next set of notifications. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpgradeNotification]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, value=None): + super(NotificationListResponse, self).__init__() + self.value = value + self.next_link = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py b/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py new file mode 100644 index 000000000000..51e8c487c71a --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py @@ -0,0 +1,45 @@ +# 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.serialization import Model + + +class UpgradeNotification(Model): + """Properties of upgrade notification. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of upgrade notification. + :vartype name: str + :ivar timestamp: Timestamp when upgrade notification occured. + :vartype timestamp: datetime + :ivar upsell_notification: Details about this upgrade notification + :vartype upsell_notification: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'upsell_notification': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'upsell_notification': {'key': 'upsellNotification', 'type': '{str}'}, + } + + def __init__(self): + super(UpgradeNotification, self).__init__() + self.name = None + self.timestamp = None + self.upsell_notification = None 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 656c865d695d..9b52e0ff2909 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 @@ -22,7 +22,7 @@ class FirewallRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules' + 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'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_redis_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules'} def create_or_update( self, resource_group_name, cache_name, rule_name, start_ip, end_ip, custom_headers=None, raw=False, **operation_config): @@ -134,7 +135,7 @@ def create_or_update( parameters = models.RedisFirewallRuleCreateParameters(start_ip=start_ip, end_ip=end_ip) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'cacheName': self._serialize.url("cache_name", cache_name, 'str'), @@ -182,6 +183,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'} def get( self, resource_group_name, cache_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -204,7 +206,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'cacheName': self._serialize.url("cache_name", cache_name, 'str'), @@ -246,6 +248,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'} def delete( self, resource_group_name, cache_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -267,7 +270,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'cacheName': self._serialize.url("cache_name", cache_name, 'str'), @@ -302,3 +305,4 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'} 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 558e4b3957a5..e61e45f7f2a4 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 @@ -24,7 +24,7 @@ class LinkedServerOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, name, linked_server_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -164,6 +164,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'} def delete( self, resource_group_name, name, linked_server_name, custom_headers=None, raw=False, **operation_config): @@ -186,7 +187,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -221,6 +222,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'} def get( self, resource_group_name, name, linked_server_name, custom_headers=None, raw=False, **operation_config): @@ -245,7 +247,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -287,6 +289,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'} def list( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): @@ -311,7 +314,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -358,3 +361,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers'} diff --git a/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py b/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py index e6a4bf94c4ff..9cfaf3a733e1 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Cache/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -97,3 +97,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Cache/operations'} 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 63cac4c68ca3..5ef94ae2f355 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 @@ -22,7 +22,8 @@ class PatchSchedulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. + :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". """ @@ -33,6 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.default = "default" self.api_version = "2017-10-01" self.config = config @@ -61,10 +63,11 @@ def create_or_update( parameters = models.RedisPatchSchedule(schedule_entries=schedule_entries) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), + 'default': self._serialize.url("self.default", self.default, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -108,6 +111,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}'} def delete( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): @@ -127,10 +131,11 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), + 'default': self._serialize.url("self.default", self.default, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -161,6 +166,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}'} def get( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): @@ -181,10 +187,11 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), + 'default': self._serialize.url("self.default", self.default, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -222,3 +229,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}'} 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 1e2f521d8626..758d58c8789c 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py @@ -24,7 +24,7 @@ class RedisOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -39,11 +39,135 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def check_name_availability( + self, name=None, type=None, 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. + :type type: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.CheckNameAvailabilityParameters(name=name, type=type) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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 body + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Cache/CheckNameAvailability'} + + def list_upgrade_notifications( + self, resource_group_name, name, history, custom_headers=None, raw=False, **operation_config): + """Gets any upgrade notifications for a Redis cache. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the Redis cache. + :type name: str + :param history: how many minutes in past to look for upgrade + notifications + :type history: float + :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: NotificationListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.redis.models.NotificationListResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_upgrade_notifications.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + query_parameters['history'] = self._serialize.query("history", history, 'float') + + # 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 + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NotificationListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_upgrade_notifications.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listUpgradeNotifications'} + def _create_initial( self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -158,6 +282,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'} def update( self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): @@ -180,7 +305,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -225,12 +350,13 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'} def _delete_initial( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -323,6 +449,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'} def get( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +470,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -384,6 +511,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -405,7 +533,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -451,6 +579,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -470,7 +599,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -515,6 +644,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis'} def list_keys( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +666,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -577,6 +707,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys'} def regenerate_key( self, resource_group_name, name, key_type, custom_headers=None, raw=False, **operation_config): @@ -603,7 +734,7 @@ def regenerate_key( parameters = models.RedisRegenerateKeyParameters(key_type=key_type) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -648,6 +779,7 @@ def regenerate_key( return client_raw_response return deserialized + 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): @@ -678,7 +810,7 @@ def force_reboot( parameters = models.RedisRebootParameters(reboot_type=reboot_type, shard_id=shard_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot' + url = self.force_reboot.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -723,6 +855,7 @@ def force_reboot( return client_raw_response return deserialized + force_reboot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot'} def _import_data_initial( @@ -730,7 +863,7 @@ def _import_data_initial( parameters = models.ImportRDBParameters(format=format, files=files) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/import' + url = self.import_data.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -833,12 +966,13 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + import_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/import'} def _export_data_initial( self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/export' + url = self.export_data.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -938,3 +1072,4 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + export_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/export'} From ec66ebf357fa0bfcb0d1b3cacd1c4a5eb37fe947 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 3 May 2018 11:20:17 -0700 Subject: [PATCH 2/7] [AutoPR redis/resource-manager] Improve redis Swagger. (#2485) * Generated from d7abeaa6ae57648be6ecde4bc11c226d9c85166c Improve redis Swagger. Documenting list all patchSchedules to fix #2968. Documenting the CheckNameAvailability.type property better to fix #2967. And use a realistic timespan value in PatchSchedule examples. * Generated from 4f7e77b990601e0cc00b69a5870b50157525364d Implementing suggested usability improvement for redis cache: by not modelling CheckNameAvailabilityParameters.resourceType as a string, it can instead be treated as a cosntant, so that the parameter becomes optional! * Generated from 44e3bae7be1e5d63ad1531c7710d586f47405970 Backport to the Microsoft.cache/redis 2017-10-01 swagger (from 2018-03-01). --- .../azure/mgmt/redis/models/__init__.py | 6 ++ .../check_name_availability_parameters.py | 12 ++- .../redis/models/redis_create_parameters.py | 8 +- .../models/redis_management_client_enums.py | 23 ++++++ .../models/redis_patch_schedule_paged.py | 27 +++++++ .../azure/mgmt/redis/models/redis_resource.py | 16 +++- .../redis/models/redis_update_parameters.py | 8 +- .../operations/firewall_rules_operations.py | 4 +- .../operations/linked_server_operations.py | 4 +- .../azure/mgmt/redis/operations/operations.py | 4 +- .../operations/patch_schedules_operations.py | 76 ++++++++++++++++++- .../mgmt/redis/operations/redis_operations.py | 13 ++-- .../mgmt/redis/redis_management_client.py | 2 +- 13 files changed, 180 insertions(+), 23 deletions(-) create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule_paged.py 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) From 1e3475410527f9887445982a3e8617d4ac74520d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 4 Dec 2018 10:31:27 -0800 Subject: [PATCH 3/7] [AutoPR redis/resource-manager] typo: redis/resource-manager/Microsoft.Cache (#3984) * Generated from 5c7c95d799e03d2c657ef9b8864b02e26f895949 typo: redis/resource-manager/Microsoft.Cache - subid -> subscriptionId - properites -> properties - occured -> occurred - Trim trailing space * Packaging update of azure-mgmt-redis --- azure-mgmt-redis/MANIFEST.in | 4 +- azure-mgmt-redis/README.rst | 8 +- azure-mgmt-redis/azure/__init__.py | 2 +- azure-mgmt-redis/azure/mgmt/__init__.py | 2 +- .../redis/models/redis_create_parameters.py | 2 +- .../azure/mgmt/redis/models/redis_resource.py | 2 +- .../mgmt/redis/models/upgrade_notification.py | 2 +- azure-mgmt-redis/azure_bdist_wheel.py | 533 ------------------ azure-mgmt-redis/sdk_packaging.toml | 8 + azure-mgmt-redis/setup.cfg | 1 - azure-mgmt-redis/setup.py | 25 +- 11 files changed, 34 insertions(+), 555 deletions(-) delete mode 100644 azure-mgmt-redis/azure_bdist_wheel.py create mode 100644 azure-mgmt-redis/sdk_packaging.toml diff --git a/azure-mgmt-redis/MANIFEST.in b/azure-mgmt-redis/MANIFEST.in index 9ecaeb15de50..6ceb27f7a96e 100644 --- a/azure-mgmt-redis/MANIFEST.in +++ b/azure-mgmt-redis/MANIFEST.in @@ -1,2 +1,4 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-redis/README.rst b/azure-mgmt-redis/README.rst index af688d055ff0..45de4e6b43dd 100644 --- a/azure-mgmt-redis/README.rst +++ b/azure-mgmt-redis/README.rst @@ -1,12 +1,12 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure Redis Cache Management Client Library. +This is the Microsoft Azure MyService Management Client Library. 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.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -36,8 +36,8 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Redis Cache Management -`__ +For code examples, see `MyService Management +`__ on docs.microsoft.com. diff --git a/azure-mgmt-redis/azure/__init__.py b/azure-mgmt-redis/azure/__init__.py index 849489fca33c..0260537a02bb 100644 --- a/azure-mgmt-redis/azure/__init__.py +++ b/azure-mgmt-redis/azure/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-redis/azure/mgmt/__init__.py b/azure-mgmt-redis/azure/mgmt/__init__.py index 849489fca33c..0260537a02bb 100644 --- a/azure-mgmt-redis/azure/mgmt/__init__.py +++ b/azure-mgmt-redis/azure/mgmt/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file 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 063b6ba813b9..d498c1951e60 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 @@ -35,7 +35,7 @@ class RedisCreateParameters(Model): :type sku: ~azure.mgmt.redis.models.Sku :param subnet_id: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: - /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 :type subnet_id: str :param static_ip: Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network. 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 92ddb379f469..e72ac9664964 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py @@ -48,7 +48,7 @@ class RedisResource(TrackedResource): :type sku: ~azure.mgmt.redis.models.Sku :param subnet_id: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: - /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 :type subnet_id: str :param static_ip: Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network. diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py b/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py index 51e8c487c71a..718fb1a1889b 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py @@ -20,7 +20,7 @@ class UpgradeNotification(Model): :ivar name: Name of upgrade notification. :vartype name: str - :ivar timestamp: Timestamp when upgrade notification occured. + :ivar timestamp: Timestamp when upgrade notification occurred. :vartype timestamp: datetime :ivar upsell_notification: Details about this upgrade notification :vartype upsell_notification: dict[str, str] diff --git a/azure-mgmt-redis/azure_bdist_wheel.py b/azure-mgmt-redis/azure_bdist_wheel.py deleted file mode 100644 index 61ec571a9743..000000000000 --- a/azure-mgmt-redis/azure_bdist_wheel.py +++ /dev/null @@ -1,533 +0,0 @@ -""" -"wheel" copyright (c) 2012-2017 Daniel Holth and -contributors. - -The MIT License - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Create a Azure wheel (.whl) distribution (a wheel is a built archive format). - -This file is a copy of the official bdist_wheel file from wheel 0.30.0a0, enhanced -of the bottom with some Microsoft extension for Azure SDK for Python - -""" - -import csv -import hashlib -import os -import subprocess -import warnings -import shutil -import json -import sys - -try: - import sysconfig -except ImportError: # pragma nocover - # Python < 2.7 - import distutils.sysconfig as sysconfig - -import pkg_resources - -safe_name = pkg_resources.safe_name -safe_version = pkg_resources.safe_version - -from shutil import rmtree -from email.generator import Generator - -from distutils.core import Command -from distutils.sysconfig import get_python_version - -from distutils import log as logger - -from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag, get_platform -from wheel.util import native, open_for_csv -from wheel.archive import archive_wheelfile -from wheel.pkginfo import read_pkg_info, write_pkg_info -from wheel.metadata import pkginfo_to_dict -from wheel import pep425tags, metadata -from wheel import __version__ as wheel_version - -def safer_name(name): - return safe_name(name).replace('-', '_') - -def safer_version(version): - return safe_version(version).replace('-', '_') - -class bdist_wheel(Command): - - description = 'create a wheel distribution' - - user_options = [('bdist-dir=', 'b', - "temporary directory for creating the distribution"), - ('plat-name=', 'p', - "platform name to embed in generated filenames " - "(default: %s)" % get_platform()), - ('keep-temp', 'k', - "keep the pseudo-installation tree around after " + - "creating the distribution archive"), - ('dist-dir=', 'd', - "directory to put final built distributions in"), - ('skip-build', None, - "skip rebuilding everything (for testing/debugging)"), - ('relative', None, - "build the archive using relative paths" - "(default: false)"), - ('owner=', 'u', - "Owner name used when creating a tar file" - " [default: current user]"), - ('group=', 'g', - "Group name used when creating a tar file" - " [default: current group]"), - ('universal', None, - "make a universal wheel" - " (default: false)"), - ('python-tag=', None, - "Python implementation compatibility tag" - " (default: py%s)" % get_impl_ver()[0]), - ] - - boolean_options = ['keep-temp', 'skip-build', 'relative', 'universal'] - - def initialize_options(self): - self.bdist_dir = None - self.data_dir = None - self.plat_name = None - self.plat_tag = None - self.format = 'zip' - self.keep_temp = False - self.dist_dir = None - self.distinfo_dir = None - self.egginfo_dir = None - self.root_is_pure = None - self.skip_build = None - self.relative = False - self.owner = None - self.group = None - self.universal = False - self.python_tag = 'py' + get_impl_ver()[0] - self.plat_name_supplied = False - - def finalize_options(self): - if self.bdist_dir is None: - bdist_base = self.get_finalized_command('bdist').bdist_base - self.bdist_dir = os.path.join(bdist_base, 'wheel') - - self.data_dir = self.wheel_dist_name + '.data' - self.plat_name_supplied = self.plat_name is not None - - need_options = ('dist_dir', 'plat_name', 'skip_build') - - self.set_undefined_options('bdist', - *zip(need_options, need_options)) - - self.root_is_pure = not (self.distribution.has_ext_modules() - or self.distribution.has_c_libraries()) - - # Support legacy [wheel] section for setting universal - wheel = self.distribution.get_option_dict('wheel') - if 'universal' in wheel: - # please don't define this in your global configs - val = wheel['universal'][1].strip() - if val.lower() in ('1', 'true', 'yes'): - self.universal = True - - @property - def wheel_dist_name(self): - """Return distribution full name with - replaced with _""" - return '-'.join((safer_name(self.distribution.get_name()), - safer_version(self.distribution.get_version()))) - - def get_tag(self): - # bdist sets self.plat_name if unset, we should only use it for purepy - # wheels if the user supplied it. - if self.plat_name_supplied: - plat_name = self.plat_name - elif self.root_is_pure: - plat_name = 'any' - else: - plat_name = self.plat_name or get_platform() - if plat_name in ('linux-x86_64', 'linux_x86_64') and sys.maxsize == 2147483647: - plat_name = 'linux_i686' - plat_name = plat_name.replace('-', '_').replace('.', '_') - - - if self.root_is_pure: - if self.universal: - impl = 'py2.py3' - else: - impl = self.python_tag - tag = (impl, 'none', plat_name) - else: - impl_name = get_abbr_impl() - impl_ver = get_impl_ver() - # PEP 3149 - abi_tag = str(get_abi_tag()).lower() - tag = (impl_name + impl_ver, abi_tag, plat_name) - supported_tags = pep425tags.get_supported( - supplied_platform=plat_name if self.plat_name_supplied else None) - # XXX switch to this alternate implementation for non-pure: - assert tag == supported_tags[0], "%s != %s" % (tag, supported_tags[0]) - return tag - - def get_archive_basename(self): - """Return archive name without extension""" - - impl_tag, abi_tag, plat_tag = self.get_tag() - - archive_basename = "%s-%s-%s-%s" % ( - self.wheel_dist_name, - impl_tag, - abi_tag, - plat_tag) - return archive_basename - - def run(self): - build_scripts = self.reinitialize_command('build_scripts') - build_scripts.executable = 'python' - - if not self.skip_build: - self.run_command('build') - - install = self.reinitialize_command('install', - reinit_subcommands=True) - install.root = self.bdist_dir - install.compile = False - install.skip_build = self.skip_build - install.warn_dir = False - - # A wheel without setuptools scripts is more cross-platform. - # Use the (undocumented) `no_ep` option to setuptools' - # install_scripts command to avoid creating entry point scripts. - install_scripts = self.reinitialize_command('install_scripts') - install_scripts.no_ep = True - - # Use a custom scheme for the archive, because we have to decide - # at installation time which scheme to use. - for key in ('headers', 'scripts', 'data', 'purelib', 'platlib'): - setattr(install, - 'install_' + key, - os.path.join(self.data_dir, key)) - - basedir_observed = '' - - if os.name == 'nt': - # win32 barfs if any of these are ''; could be '.'? - # (distutils.command.install:change_roots bug) - basedir_observed = os.path.normpath(os.path.join(self.data_dir, '..')) - self.install_libbase = self.install_lib = basedir_observed - - setattr(install, - 'install_purelib' if self.root_is_pure else 'install_platlib', - basedir_observed) - - logger.info("installing to %s", self.bdist_dir) - - self.run_command('install') - - archive_basename = self.get_archive_basename() - - pseudoinstall_root = os.path.join(self.dist_dir, archive_basename) - if not self.relative: - archive_root = self.bdist_dir - else: - archive_root = os.path.join( - self.bdist_dir, - self._ensure_relative(install.install_base)) - - self.set_undefined_options( - 'install_egg_info', ('target', 'egginfo_dir')) - self.distinfo_dir = os.path.join(self.bdist_dir, - '%s.dist-info' % self.wheel_dist_name) - self.egg2dist(self.egginfo_dir, - self.distinfo_dir) - - self.write_wheelfile(self.distinfo_dir) - - self.write_record(self.bdist_dir, self.distinfo_dir) - - # Make the archive - if not os.path.exists(self.dist_dir): - os.makedirs(self.dist_dir) - wheel_name = archive_wheelfile(pseudoinstall_root, archive_root) - - # Sign the archive - if 'WHEEL_TOOL' in os.environ: - subprocess.call([os.environ['WHEEL_TOOL'], 'sign', wheel_name]) - - # Add to 'Distribution.dist_files' so that the "upload" command works - getattr(self.distribution, 'dist_files', []).append( - ('bdist_wheel', get_python_version(), wheel_name)) - - if not self.keep_temp: - if self.dry_run: - logger.info('removing %s', self.bdist_dir) - else: - rmtree(self.bdist_dir) - - def write_wheelfile(self, wheelfile_base, generator='bdist_wheel (' + wheel_version + ')'): - from email.message import Message - msg = Message() - msg['Wheel-Version'] = '1.0' # of the spec - msg['Generator'] = generator - msg['Root-Is-Purelib'] = str(self.root_is_pure).lower() - - # Doesn't work for bdist_wininst - impl_tag, abi_tag, plat_tag = self.get_tag() - for impl in impl_tag.split('.'): - for abi in abi_tag.split('.'): - for plat in plat_tag.split('.'): - msg['Tag'] = '-'.join((impl, abi, plat)) - - wheelfile_path = os.path.join(wheelfile_base, 'WHEEL') - logger.info('creating %s', wheelfile_path) - with open(wheelfile_path, 'w') as f: - Generator(f, maxheaderlen=0).flatten(msg) - - def _ensure_relative(self, path): - # copied from dir_util, deleted - drive, path = os.path.splitdrive(path) - if path[0:1] == os.sep: - path = drive + path[1:] - return path - - def _pkginfo_to_metadata(self, egg_info_path, pkginfo_path): - return metadata.pkginfo_to_metadata(egg_info_path, pkginfo_path) - - def license_file(self): - """Return license filename from a license-file key in setup.cfg, or None.""" - metadata = self.distribution.get_option_dict('metadata') - if not 'license_file' in metadata: - return None - return metadata['license_file'][1] - - def setupcfg_requirements(self): - """Generate requirements from setup.cfg as - ('Requires-Dist', 'requirement; qualifier') tuples. From a metadata - section in setup.cfg: - - [metadata] - provides-extra = extra1 - extra2 - requires-dist = requirement; qualifier - another; qualifier2 - unqualified - - Yields - - ('Provides-Extra', 'extra1'), - ('Provides-Extra', 'extra2'), - ('Requires-Dist', 'requirement; qualifier'), - ('Requires-Dist', 'another; qualifier2'), - ('Requires-Dist', 'unqualified') - """ - metadata = self.distribution.get_option_dict('metadata') - - # our .ini parser folds - to _ in key names: - for key, title in (('provides_extra', 'Provides-Extra'), - ('requires_dist', 'Requires-Dist')): - if not key in metadata: - continue - field = metadata[key] - for line in field[1].splitlines(): - line = line.strip() - if not line: - continue - yield (title, line) - - def add_requirements(self, metadata_path): - """Add additional requirements from setup.cfg to file metadata_path""" - additional = list(self.setupcfg_requirements()) - if not additional: return - pkg_info = read_pkg_info(metadata_path) - if 'Provides-Extra' in pkg_info or 'Requires-Dist' in pkg_info: - warnings.warn('setup.cfg requirements overwrite values from setup.py') - del pkg_info['Provides-Extra'] - del pkg_info['Requires-Dist'] - for k, v in additional: - pkg_info[k] = v - write_pkg_info(metadata_path, pkg_info) - - def egg2dist(self, egginfo_path, distinfo_path): - """Convert an .egg-info directory into a .dist-info directory""" - def adios(p): - """Appropriately delete directory, file or link.""" - if os.path.exists(p) and not os.path.islink(p) and os.path.isdir(p): - shutil.rmtree(p) - elif os.path.exists(p): - os.unlink(p) - - adios(distinfo_path) - - if not os.path.exists(egginfo_path): - # There is no egg-info. This is probably because the egg-info - # file/directory is not named matching the distribution name used - # to name the archive file. Check for this case and report - # accordingly. - import glob - pat = os.path.join(os.path.dirname(egginfo_path), '*.egg-info') - possible = glob.glob(pat) - err = "Egg metadata expected at %s but not found" % (egginfo_path,) - if possible: - alt = os.path.basename(possible[0]) - err += " (%s found - possible misnamed archive file?)" % (alt,) - - raise ValueError(err) - - if os.path.isfile(egginfo_path): - # .egg-info is a single file - pkginfo_path = egginfo_path - pkg_info = self._pkginfo_to_metadata(egginfo_path, egginfo_path) - os.mkdir(distinfo_path) - else: - # .egg-info is a directory - pkginfo_path = os.path.join(egginfo_path, 'PKG-INFO') - pkg_info = self._pkginfo_to_metadata(egginfo_path, pkginfo_path) - - # ignore common egg metadata that is useless to wheel - shutil.copytree(egginfo_path, distinfo_path, - ignore=lambda x, y: set(('PKG-INFO', - 'requires.txt', - 'SOURCES.txt', - 'not-zip-safe',))) - - # delete dependency_links if it is only whitespace - dependency_links_path = os.path.join(distinfo_path, 'dependency_links.txt') - with open(dependency_links_path, 'r') as dependency_links_file: - dependency_links = dependency_links_file.read().strip() - if not dependency_links: - adios(dependency_links_path) - - write_pkg_info(os.path.join(distinfo_path, 'METADATA'), pkg_info) - - # XXX deprecated. Still useful for current distribute/setuptools. - metadata_path = os.path.join(distinfo_path, 'METADATA') - self.add_requirements(metadata_path) - - # XXX intentionally a different path than the PEP. - metadata_json_path = os.path.join(distinfo_path, 'metadata.json') - pymeta = pkginfo_to_dict(metadata_path, - distribution=self.distribution) - - if 'description' in pymeta: - description_filename = 'DESCRIPTION.rst' - description_text = pymeta.pop('description') - description_path = os.path.join(distinfo_path, - description_filename) - with open(description_path, "wb") as description_file: - description_file.write(description_text.encode('utf-8')) - pymeta['extensions']['python.details']['document_names']['description'] = description_filename - - # XXX heuristically copy any LICENSE/LICENSE.txt? - license = self.license_file() - if license: - license_filename = 'LICENSE.txt' - shutil.copy(license, os.path.join(self.distinfo_dir, license_filename)) - pymeta['extensions']['python.details']['document_names']['license'] = license_filename - - with open(metadata_json_path, "w") as metadata_json: - json.dump(pymeta, metadata_json, sort_keys=True) - - adios(egginfo_path) - - def write_record(self, bdist_dir, distinfo_dir): - from wheel.util import urlsafe_b64encode - - record_path = os.path.join(distinfo_dir, 'RECORD') - record_relpath = os.path.relpath(record_path, bdist_dir) - - def walk(): - for dir, dirs, files in os.walk(bdist_dir): - dirs.sort() - for f in sorted(files): - yield os.path.join(dir, f) - - def skip(path): - """Wheel hashes every possible file.""" - return (path == record_relpath) - - with open_for_csv(record_path, 'w+') as record_file: - writer = csv.writer(record_file) - for path in walk(): - relpath = os.path.relpath(path, bdist_dir) - if skip(relpath): - hash = '' - size = '' - else: - with open(path, 'rb') as f: - data = f.read() - digest = hashlib.sha256(data).digest() - hash = 'sha256=' + native(urlsafe_b64encode(digest)) - size = len(data) - record_path = os.path.relpath( - path, bdist_dir).replace(os.path.sep, '/') - writer.writerow((record_path, hash, size)) - - -#------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -#-------------------------------------------------------------------------- - -from distutils import log as logger -import os.path - -#from wheel.bdist_wheel import bdist_wheel -class azure_bdist_wheel(bdist_wheel): - - description = "Create an Azure wheel distribution" - - user_options = bdist_wheel.user_options + \ - [('azure-namespace-package=', None, - "Name of the deepest nspkg used")] - - def initialize_options(self): - bdist_wheel.initialize_options(self) - self.azure_namespace_package = None - - def finalize_options(self): - bdist_wheel.finalize_options(self) - if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): - raise ValueError("azure_namespace_package must finish by -nspkg") - - def run(self): - if not self.distribution.install_requires: - self.distribution.install_requires = [] - self.distribution.install_requires.append( - "{}>=2.0.0".format(self.azure_namespace_package)) - bdist_wheel.run(self) - - def write_record(self, bdist_dir, distinfo_dir): - if self.azure_namespace_package: - # Split and remove last part, assuming it's "nspkg" - subparts = self.azure_namespace_package.split('-')[0:-1] - folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] - for azure_sub_package in folder_with_init: - init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') - if os.path.isfile(init_file): - logger.info("manually remove {} while building the wheel".format(init_file)) - os.remove(init_file) - else: - raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) - bdist_wheel.write_record(self, bdist_dir, distinfo_dir) -cmdclass = { - 'bdist_wheel': azure_bdist_wheel, -} diff --git a/azure-mgmt-redis/sdk_packaging.toml b/azure-mgmt-redis/sdk_packaging.toml new file mode 100644 index 000000000000..f82db9d1bdf8 --- /dev/null +++ b/azure-mgmt-redis/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-redis" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-redis/setup.cfg b/azure-mgmt-redis/setup.cfg index 856f4164982c..3c6e79cf31da 100644 --- a/azure-mgmt-redis/setup.cfg +++ b/azure-mgmt-redis/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-redis/setup.py b/azure-mgmt-redis/setup.py index 17430393a548..ecee6aed40ae 100644 --- a/azure-mgmt-redis/setup.py +++ b/azure-mgmt-redis/setup.py @@ -10,16 +10,10 @@ import os.path from io import open from setuptools import find_packages, setup -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") - cmdclass = {} # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-redis" -PACKAGE_PPRINT_NAME = "Redis Cache Management" +PACKAGE_PPRINT_NAME = "MyService Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -64,7 +58,7 @@ author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 5 - Production/Stable', + 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=find_packages(exclude=["tests"]), + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), install_requires=[ - 'msrestazure>=0.4.20,<2.0.0', + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } ) From 950946b427a1a6b586c8cfd8e00f4d35b68a5567 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 15 Jan 2019 19:21:34 +0000 Subject: [PATCH 4/7] Rebuild by https://github.com/Azure/azure-sdk-for-python/pull/2091 --- .../azure/mgmt/redis/models/__init__.py | 77 ++++-- .../check_name_availability_parameters.py | 17 +- .../check_name_availability_parameters_py3.py | 41 +++ .../redis/models/export_rdb_parameters.py | 16 +- .../redis/models/export_rdb_parameters_py3.py | 43 +++ .../redis/models/import_rdb_parameters.py | 12 +- .../redis/models/import_rdb_parameters_py3.py | 38 +++ .../models/notification_list_response.py | 6 +- .../models/notification_list_response_py3.py | 39 +++ .../azure/mgmt/redis/models/operation.py | 8 +- .../mgmt/redis/models/operation_display.py | 12 +- .../redis/models/operation_display_py3.py | 41 +++ .../azure/mgmt/redis/models/operation_py3.py | 32 +++ .../azure/mgmt/redis/models/proxy_resource.py | 10 +- .../mgmt/redis/models/proxy_resource_py3.py | 43 +++ .../mgmt/redis/models/redis_access_keys.py | 4 +- .../redis/models/redis_access_keys_py3.py | 42 +++ .../redis/models/redis_create_parameters.py | 32 ++- .../models/redis_create_parameters_py3.py | 87 ++++++ .../mgmt/redis/models/redis_firewall_rule.py | 14 +- .../redis_firewall_rule_create_parameters.py | 14 +- ...dis_firewall_rule_create_parameters_py3.py | 39 +++ .../redis/models/redis_firewall_rule_py3.py | 55 ++++ .../models/redis_force_reboot_response.py | 4 +- .../models/redis_force_reboot_response_py3.py | 35 +++ .../mgmt/redis/models/redis_linked_server.py | 4 +- .../redis_linked_server_create_parameters.py | 23 +- ...dis_linked_server_create_parameters_py3.py | 47 ++++ .../redis/models/redis_linked_server_py3.py | 35 +++ .../redis_linked_server_with_properties.py | 23 +- ...redis_linked_server_with_properties_py3.py | 68 +++++ .../models/redis_management_client_enums.py | 16 +- .../mgmt/redis/models/redis_patch_schedule.py | 11 +- .../redis/models/redis_patch_schedule_py3.py | 50 ++++ .../redis/models/redis_reboot_parameters.py | 14 +- .../models/redis_reboot_parameters_py3.py | 41 +++ .../models/redis_regenerate_key_parameters.py | 12 +- .../redis_regenerate_key_parameters_py3.py | 35 +++ .../azure/mgmt/redis/models/redis_resource.py | 28 +- .../mgmt/redis/models/redis_resource_py3.py | 140 ++++++++++ .../redis/models/redis_update_parameters.py | 18 +- .../models/redis_update_parameters_py3.py | 58 ++++ .../azure/mgmt/redis/models/resource.py | 4 +- .../azure/mgmt/redis/models/resource_py3.py | 45 +++ .../azure/mgmt/redis/models/schedule_entry.py | 21 +- .../mgmt/redis/models/schedule_entry_py3.py | 47 ++++ .../azure/mgmt/redis/models/sku.py | 24 +- .../azure/mgmt/redis/models/sku_py3.py | 49 ++++ .../mgmt/redis/models/tracked_resource.py | 12 +- .../mgmt/redis/models/tracked_resource_py3.py | 53 ++++ .../mgmt/redis/models/upgrade_notification.py | 4 +- .../redis/models/upgrade_notification_py3.py | 45 +++ .../operations/firewall_rules_operations.py | 24 +- .../operations/linked_server_operations.py | 75 ++--- .../azure/mgmt/redis/operations/operations.py | 7 +- .../operations/patch_schedules_operations.py | 24 +- .../mgmt/redis/operations/redis_operations.py | 261 ++++++------------ .../mgmt/redis/redis_management_client.py | 6 +- 58 files changed, 1648 insertions(+), 437 deletions(-) create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/export_rdb_parameters_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/import_rdb_parameters_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/operation_display_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/operation_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/proxy_resource_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_access_keys_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_create_parameters_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_create_parameters_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_force_reboot_response_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_create_parameters_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_with_properties_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_regenerate_key_parameters_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_resource_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/redis_update_parameters_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/resource_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/schedule_entry_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/sku_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/tracked_resource_py3.py create mode 100644 azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification_py3.py diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py b/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py index 40ef8200d75c..ef3205181237 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py @@ -9,31 +9,58 @@ # regenerated. # -------------------------------------------------------------------------- -from .sku import Sku -from .redis_access_keys import RedisAccessKeys -from .redis_linked_server import RedisLinkedServer -from .resource import Resource -from .proxy_resource import ProxyResource -from .tracked_resource import TrackedResource -from .redis_create_parameters import RedisCreateParameters -from .redis_update_parameters import RedisUpdateParameters -from .redis_firewall_rule import RedisFirewallRule -from .redis_firewall_rule_create_parameters import RedisFirewallRuleCreateParameters -from .redis_resource import RedisResource -from .redis_regenerate_key_parameters import RedisRegenerateKeyParameters -from .redis_reboot_parameters import RedisRebootParameters -from .export_rdb_parameters import ExportRDBParameters -from .import_rdb_parameters import ImportRDBParameters -from .schedule_entry import ScheduleEntry -from .redis_patch_schedule import RedisPatchSchedule -from .redis_force_reboot_response import RedisForceRebootResponse -from .redis_linked_server_with_properties import RedisLinkedServerWithProperties -from .redis_linked_server_create_parameters import RedisLinkedServerCreateParameters -from .operation_display import OperationDisplay -from .operation import Operation -from .check_name_availability_parameters import CheckNameAvailabilityParameters -from .upgrade_notification import UpgradeNotification -from .notification_list_response import NotificationListResponse +try: + from .sku_py3 import Sku + from .redis_access_keys_py3 import RedisAccessKeys + from .redis_linked_server_py3 import RedisLinkedServer + from .resource_py3 import Resource + from .proxy_resource_py3 import ProxyResource + from .tracked_resource_py3 import TrackedResource + from .redis_create_parameters_py3 import RedisCreateParameters + from .redis_update_parameters_py3 import RedisUpdateParameters + from .redis_firewall_rule_py3 import RedisFirewallRule + from .redis_firewall_rule_create_parameters_py3 import RedisFirewallRuleCreateParameters + from .redis_resource_py3 import RedisResource + from .redis_regenerate_key_parameters_py3 import RedisRegenerateKeyParameters + from .redis_reboot_parameters_py3 import RedisRebootParameters + from .export_rdb_parameters_py3 import ExportRDBParameters + from .import_rdb_parameters_py3 import ImportRDBParameters + from .schedule_entry_py3 import ScheduleEntry + from .redis_patch_schedule_py3 import RedisPatchSchedule + from .redis_force_reboot_response_py3 import RedisForceRebootResponse + from .redis_linked_server_with_properties_py3 import RedisLinkedServerWithProperties + from .redis_linked_server_create_parameters_py3 import RedisLinkedServerCreateParameters + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .check_name_availability_parameters_py3 import CheckNameAvailabilityParameters + from .upgrade_notification_py3 import UpgradeNotification + from .notification_list_response_py3 import NotificationListResponse +except (SyntaxError, ImportError): + from .sku import Sku + from .redis_access_keys import RedisAccessKeys + from .redis_linked_server import RedisLinkedServer + from .resource import Resource + from .proxy_resource import ProxyResource + from .tracked_resource import TrackedResource + from .redis_create_parameters import RedisCreateParameters + from .redis_update_parameters import RedisUpdateParameters + from .redis_firewall_rule import RedisFirewallRule + from .redis_firewall_rule_create_parameters import RedisFirewallRuleCreateParameters + from .redis_resource import RedisResource + from .redis_regenerate_key_parameters import RedisRegenerateKeyParameters + from .redis_reboot_parameters import RedisRebootParameters + from .export_rdb_parameters import ExportRDBParameters + from .import_rdb_parameters import ImportRDBParameters + from .schedule_entry import ScheduleEntry + from .redis_patch_schedule import RedisPatchSchedule + from .redis_force_reboot_response import RedisForceRebootResponse + from .redis_linked_server_with_properties import RedisLinkedServerWithProperties + from .redis_linked_server_create_parameters import RedisLinkedServerCreateParameters + from .operation_display import OperationDisplay + from .operation import Operation + from .check_name_availability_parameters import CheckNameAvailabilityParameters + from .upgrade_notification import UpgradeNotification + from .notification_list_response import NotificationListResponse from .operation_paged import OperationPaged from .redis_resource_paged import RedisResourcePaged from .redis_firewall_rule_paged import RedisFirewallRulePaged 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 79a0fb012c55..9bb074b9b03f 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 @@ -15,10 +15,13 @@ class CheckNameAvailabilityParameters(Model): """Parameters body to pass for resource name availability check. - :param name: Resource name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name. :type name: str - :param type: Resource type. The only legal value of this property for - checking redis cache name availability is 'Microsoft.Cache/redis'. + :param type: Required. Resource type. The only legal value of this + property for checking redis cache name availability is + 'Microsoft.Cache/redis'. :type type: str """ @@ -32,7 +35,7 @@ class CheckNameAvailabilityParameters(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, name, type): - super(CheckNameAvailabilityParameters, self).__init__() - self.name = name - self.type = type + def __init__(self, **kwargs): + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..0c9e0e2f63da --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters_py3.py @@ -0,0 +1,41 @@ +# 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.serialization import Model + + +class CheckNameAvailabilityParameters(Model): + """Parameters body to pass for resource name availability check. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name. + :type name: str + :param type: Required. 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: str, type: str, **kwargs) -> None: + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/export_rdb_parameters.py b/azure-mgmt-redis/azure/mgmt/redis/models/export_rdb_parameters.py index e2825b9fa51f..58892151d87f 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/export_rdb_parameters.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/export_rdb_parameters.py @@ -15,11 +15,13 @@ class ExportRDBParameters(Model): """Parameters for Redis export operation. + All required parameters must be populated in order to send to Azure. + :param format: File format. :type format: str - :param prefix: Prefix to use for exported files. + :param prefix: Required. Prefix to use for exported files. :type prefix: str - :param container: Container name to export to. + :param container: Required. Container name to export to. :type container: str """ @@ -34,8 +36,8 @@ class ExportRDBParameters(Model): 'container': {'key': 'container', 'type': 'str'}, } - def __init__(self, prefix, container, format=None): - super(ExportRDBParameters, self).__init__() - self.format = format - self.prefix = prefix - self.container = container + def __init__(self, **kwargs): + super(ExportRDBParameters, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.prefix = kwargs.get('prefix', None) + self.container = kwargs.get('container', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/export_rdb_parameters_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/export_rdb_parameters_py3.py new file mode 100644 index 000000000000..161d9bceeb74 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/export_rdb_parameters_py3.py @@ -0,0 +1,43 @@ +# 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.serialization import Model + + +class ExportRDBParameters(Model): + """Parameters for Redis export operation. + + All required parameters must be populated in order to send to Azure. + + :param format: File format. + :type format: str + :param prefix: Required. Prefix to use for exported files. + :type prefix: str + :param container: Required. Container name to export to. + :type container: str + """ + + _validation = { + 'prefix': {'required': True}, + 'container': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'prefix': {'key': 'prefix', 'type': 'str'}, + 'container': {'key': 'container', 'type': 'str'}, + } + + def __init__(self, *, prefix: str, container: str, format: str=None, **kwargs) -> None: + super(ExportRDBParameters, self).__init__(**kwargs) + self.format = format + self.prefix = prefix + self.container = container diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/import_rdb_parameters.py b/azure-mgmt-redis/azure/mgmt/redis/models/import_rdb_parameters.py index f64784c9c2f0..a41e32f71aae 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/import_rdb_parameters.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/import_rdb_parameters.py @@ -15,9 +15,11 @@ class ImportRDBParameters(Model): """Parameters for Redis import operation. + All required parameters must be populated in order to send to Azure. + :param format: File format. :type format: str - :param files: files to import. + :param files: Required. files to import. :type files: list[str] """ @@ -30,7 +32,7 @@ class ImportRDBParameters(Model): 'files': {'key': 'files', 'type': '[str]'}, } - def __init__(self, files, format=None): - super(ImportRDBParameters, self).__init__() - self.format = format - self.files = files + def __init__(self, **kwargs): + super(ImportRDBParameters, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.files = kwargs.get('files', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/import_rdb_parameters_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/import_rdb_parameters_py3.py new file mode 100644 index 000000000000..8c077e7fe779 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/import_rdb_parameters_py3.py @@ -0,0 +1,38 @@ +# 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.serialization import Model + + +class ImportRDBParameters(Model): + """Parameters for Redis import operation. + + All required parameters must be populated in order to send to Azure. + + :param format: File format. + :type format: str + :param files: Required. files to import. + :type files: list[str] + """ + + _validation = { + 'files': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'files': {'key': 'files', 'type': '[str]'}, + } + + def __init__(self, *, files, format: str=None, **kwargs) -> None: + super(ImportRDBParameters, self).__init__(**kwargs) + self.format = format + self.files = files diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response.py b/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response.py index b816703e32d6..94c031595548 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response.py @@ -33,7 +33,7 @@ class NotificationListResponse(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(NotificationListResponse, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(NotificationListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response_py3.py new file mode 100644 index 000000000000..e24afe3b445b --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/notification_list_response_py3.py @@ -0,0 +1,39 @@ +# 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.serialization import Model + + +class NotificationListResponse(Model): + """The response of listUpgradeNotifications. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: List of all notifications. + :type value: list[~azure.mgmt.redis.models.UpgradeNotification] + :ivar next_link: Link for next set of notifications. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpgradeNotification]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(NotificationListResponse, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/operation.py b/azure-mgmt-redis/azure/mgmt/redis/models/operation.py index 84eb5fa64cac..954a6c5f9d38 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/operation.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/operation.py @@ -26,7 +26,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, name=None, display=None): - super(Operation, self).__init__() - self.name = name - self.display = display + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/operation_display.py b/azure-mgmt-redis/azure/mgmt/redis/models/operation_display.py index 0d0264d39c11..d0fde0c4a0b9 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/operation_display.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/operation_display.py @@ -33,9 +33,9 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, operation=None, resource=None, description=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.operation = operation - self.resource = resource - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.operation = kwargs.get('operation', None) + self.resource = kwargs.get('resource', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/operation_display_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/operation_display_py3.py new file mode 100644 index 000000000000..37858ea03adb --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/operation_display_py3.py @@ -0,0 +1,41 @@ +# 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.serialization import Model + + +class OperationDisplay(Model): + """The object that describes the operation. + + :param provider: Friendly name of the resource provider + :type provider: str + :param operation: Operation type: read, write, delete, listKeys/action, + etc. + :type operation: str + :param resource: Resource type on which the operation is performed. + :type resource: str + :param description: Friendly name of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, operation: str=None, resource: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.operation = operation + self.resource = resource + self.description = description diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/operation_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/operation_py3.py new file mode 100644 index 000000000000..031e0253a7bd --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/operation_py3.py @@ -0,0 +1,32 @@ +# 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.serialization import Model + + +class Operation(Model): + """REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that describes the operation. + :type display: ~azure.mgmt.redis.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/proxy_resource.py b/azure-mgmt-redis/azure/mgmt/redis/models/proxy_resource.py index 867983bc956d..012ff087a08b 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/proxy_resource.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/proxy_resource.py @@ -33,5 +33,11 @@ class ProxyResource(Resource): 'type': {'readonly': True}, } - def __init__(self): - super(ProxyResource, self).__init__() + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/proxy_resource_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/proxy_resource_py3.py new file mode 100644 index 000000000000..63938413f36c --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/proxy_resource_py3.py @@ -0,0 +1,43 @@ +# 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 .resource_py3 import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_access_keys.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_access_keys.py index 84964a6f0f31..d3834847addb 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_access_keys.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_access_keys.py @@ -36,7 +36,7 @@ class RedisAccessKeys(Model): 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, } - def __init__(self): - super(RedisAccessKeys, self).__init__() + def __init__(self, **kwargs): + super(RedisAccessKeys, self).__init__(**kwargs) self.primary_key = None self.secondary_key = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_access_keys_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_access_keys_py3.py new file mode 100644 index 000000000000..b096d23be9a0 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_access_keys_py3.py @@ -0,0 +1,42 @@ +# 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.serialization import Model + + +class RedisAccessKeys(Model): + """Redis cache access keys. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar primary_key: The current primary key that clients can use to + authenticate with Redis cache. + :vartype primary_key: str + :ivar secondary_key: The current secondary key that clients can use to + authenticate with Redis cache. + :vartype secondary_key: str + """ + + _validation = { + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(RedisAccessKeys, self).__init__(**kwargs) + self.primary_key = None + self.secondary_key = None 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 d498c1951e60..fa6342821fe4 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 @@ -15,6 +15,8 @@ class RedisCreateParameters(Model): """Parameters supplied to the Create Redis operation. + All required parameters must be populated in order to send to Azure. + :param redis_configuration: All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. @@ -31,7 +33,7 @@ class RedisCreateParameters(Model): 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. + :param sku: Required. 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 deploy the Redis cache in. Example format: @@ -43,7 +45,7 @@ class RedisCreateParameters(Model): :param zones: A list of availability zones denoting where the resource needs to come from. :type zones: list[str] - :param location: The geo-location where the resource lives + :param location: Required. The geo-location where the resource lives :type location: str :param tags: Resource tags. :type tags: dict[str, str] @@ -70,16 +72,16 @@ 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, 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 - self.zones = zones - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(RedisCreateParameters, self).__init__(**kwargs) + self.redis_configuration = kwargs.get('redis_configuration', None) + self.enable_non_ssl_port = kwargs.get('enable_non_ssl_port', None) + self.tenant_settings = kwargs.get('tenant_settings', None) + self.shard_count = kwargs.get('shard_count', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + self.sku = kwargs.get('sku', None) + self.subnet_id = kwargs.get('subnet_id', None) + self.static_ip = kwargs.get('static_ip', None) + self.zones = kwargs.get('zones', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_create_parameters_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_create_parameters_py3.py new file mode 100644 index 000000000000..3e2d65274514 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_create_parameters_py3.py @@ -0,0 +1,87 @@ +# 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.serialization import Model + + +class RedisCreateParameters(Model): + """Parameters supplied to the Create Redis operation. + + All required parameters must be populated in order to send to Azure. + + :param redis_configuration: All Redis Settings. Few possible keys: + rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + etc. + :type redis_configuration: dict[str, str] + :param enable_non_ssl_port: Specifies whether the non-ssl Redis server + port (6379) is enabled. + :type enable_non_ssl_port: bool + :param tenant_settings: A dictionary of tenant settings + :type tenant_settings: dict[str, str] + :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: Required. 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 + deploy the Redis cache in. Example format: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + :type subnet_id: str + :param static_ip: Static IP address. Required when deploying a Redis cache + inside an existing Azure Virtual Network. + :type static_ip: str + :param zones: A list of availability zones denoting where the resource + needs to come from. + :type zones: list[str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'sku': {'required': True}, + 'subnet_id': {'pattern': r'^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$'}, + 'static_ip': {'pattern': r'^\d+\.\d+\.\d+\.\d+$'}, + 'location': {'required': True}, + } + + _attribute_map = { + 'redis_configuration': {'key': 'properties.redisConfiguration', 'type': '{str}'}, + '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'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku, location: str, redis_configuration=None, enable_non_ssl_port: bool=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, subnet_id: str=None, static_ip: str=None, zones=None, tags=None, **kwargs) -> None: + super(RedisCreateParameters, self).__init__(**kwargs) + 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 + self.zones = zones + self.location = location + self.tags = tags diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule.py index c35f74038ecc..7dce7e164a66 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule.py @@ -19,15 +19,17 @@ class RedisFirewallRule(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param start_ip: lowest IP address included in the range + :param start_ip: Required. lowest IP address included in the range :type start_ip: str - :param end_ip: highest IP address included in the range + :param end_ip: Required. highest IP address included in the range :type end_ip: str """ @@ -47,7 +49,7 @@ class RedisFirewallRule(ProxyResource): 'end_ip': {'key': 'properties.endIP', 'type': 'str'}, } - def __init__(self, start_ip, end_ip): - super(RedisFirewallRule, self).__init__() - self.start_ip = start_ip - self.end_ip = end_ip + def __init__(self, **kwargs): + super(RedisFirewallRule, self).__init__(**kwargs) + self.start_ip = kwargs.get('start_ip', None) + self.end_ip = kwargs.get('end_ip', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_create_parameters.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_create_parameters.py index f333f9869516..e550027f98d3 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_create_parameters.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_create_parameters.py @@ -15,9 +15,11 @@ class RedisFirewallRuleCreateParameters(Model): """Parameters required for creating a firewall rule on redis cache. - :param start_ip: lowest IP address included in the range + All required parameters must be populated in order to send to Azure. + + :param start_ip: Required. lowest IP address included in the range :type start_ip: str - :param end_ip: highest IP address included in the range + :param end_ip: Required. highest IP address included in the range :type end_ip: str """ @@ -31,7 +33,7 @@ class RedisFirewallRuleCreateParameters(Model): 'end_ip': {'key': 'properties.endIP', 'type': 'str'}, } - def __init__(self, start_ip, end_ip): - super(RedisFirewallRuleCreateParameters, self).__init__() - self.start_ip = start_ip - self.end_ip = end_ip + def __init__(self, **kwargs): + super(RedisFirewallRuleCreateParameters, self).__init__(**kwargs) + self.start_ip = kwargs.get('start_ip', None) + self.end_ip = kwargs.get('end_ip', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_create_parameters_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_create_parameters_py3.py new file mode 100644 index 000000000000..c780849f2fcf --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_create_parameters_py3.py @@ -0,0 +1,39 @@ +# 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.serialization import Model + + +class RedisFirewallRuleCreateParameters(Model): + """Parameters required for creating a firewall rule on redis cache. + + All required parameters must be populated in order to send to Azure. + + :param start_ip: Required. lowest IP address included in the range + :type start_ip: str + :param end_ip: Required. highest IP address included in the range + :type end_ip: str + """ + + _validation = { + 'start_ip': {'required': True}, + 'end_ip': {'required': True}, + } + + _attribute_map = { + 'start_ip': {'key': 'properties.startIP', 'type': 'str'}, + 'end_ip': {'key': 'properties.endIP', 'type': 'str'}, + } + + def __init__(self, *, start_ip: str, end_ip: str, **kwargs) -> None: + super(RedisFirewallRuleCreateParameters, self).__init__(**kwargs) + self.start_ip = start_ip + self.end_ip = end_ip diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_py3.py new file mode 100644 index 000000000000..3825c8f2e6da --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_firewall_rule_py3.py @@ -0,0 +1,55 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class RedisFirewallRule(ProxyResource): + """A firewall rule on a redis cache has a name, and describes a contiguous + range of IP addresses permitted to connect. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param start_ip: Required. lowest IP address included in the range + :type start_ip: str + :param end_ip: Required. highest IP address included in the range + :type end_ip: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_ip': {'required': True}, + 'end_ip': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_ip': {'key': 'properties.startIP', 'type': 'str'}, + 'end_ip': {'key': 'properties.endIP', 'type': 'str'}, + } + + def __init__(self, *, start_ip: str, end_ip: str, **kwargs) -> None: + super(RedisFirewallRule, self).__init__(**kwargs) + self.start_ip = start_ip + self.end_ip = end_ip diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_force_reboot_response.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_force_reboot_response.py index f607a65618a1..53c1a5a81b92 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_force_reboot_response.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_force_reboot_response.py @@ -30,6 +30,6 @@ class RedisForceRebootResponse(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(RedisForceRebootResponse, self).__init__() + def __init__(self, **kwargs): + super(RedisForceRebootResponse, self).__init__(**kwargs) self.message = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_force_reboot_response_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_force_reboot_response_py3.py new file mode 100644 index 000000000000..88e585bb33c4 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_force_reboot_response_py3.py @@ -0,0 +1,35 @@ +# 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.serialization import Model + + +class RedisForceRebootResponse(Model): + """Response to force reboot for Redis cache. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar message: Status message + :vartype message: str + """ + + _validation = { + 'message': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(RedisForceRebootResponse, self).__init__(**kwargs) + self.message = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server.py index 3c47ad6c6ff5..4f0e1508255f 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server.py @@ -30,6 +30,6 @@ class RedisLinkedServer(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self): - super(RedisLinkedServer, self).__init__() + def __init__(self, **kwargs): + super(RedisLinkedServer, self).__init__(**kwargs) self.id = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_create_parameters.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_create_parameters.py index 3e5fe4e6669f..efea29185bdf 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_create_parameters.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_create_parameters.py @@ -15,13 +15,16 @@ class RedisLinkedServerCreateParameters(Model): """Parameter required for creating a linked server to redis cache. - :param linked_redis_cache_id: Fully qualified resourceId of the linked - redis cache. + All required parameters must be populated in order to send to Azure. + + :param linked_redis_cache_id: Required. Fully qualified resourceId of the + linked redis cache. :type linked_redis_cache_id: str - :param linked_redis_cache_location: Location of the linked redis cache. + :param linked_redis_cache_location: Required. Location of the linked redis + cache. :type linked_redis_cache_location: str - :param server_role: Role of the linked server. Possible values include: - 'Primary', 'Secondary' + :param server_role: Required. Role of the linked server. Possible values + include: 'Primary', 'Secondary' :type server_role: str or ~azure.mgmt.redis.models.ReplicationRole """ @@ -37,8 +40,8 @@ class RedisLinkedServerCreateParameters(Model): 'server_role': {'key': 'properties.serverRole', 'type': 'ReplicationRole'}, } - def __init__(self, linked_redis_cache_id, linked_redis_cache_location, server_role): - super(RedisLinkedServerCreateParameters, self).__init__() - self.linked_redis_cache_id = linked_redis_cache_id - self.linked_redis_cache_location = linked_redis_cache_location - self.server_role = server_role + def __init__(self, **kwargs): + super(RedisLinkedServerCreateParameters, self).__init__(**kwargs) + self.linked_redis_cache_id = kwargs.get('linked_redis_cache_id', None) + self.linked_redis_cache_location = kwargs.get('linked_redis_cache_location', None) + self.server_role = kwargs.get('server_role', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_create_parameters_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_create_parameters_py3.py new file mode 100644 index 000000000000..8b8d16ae799a --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_create_parameters_py3.py @@ -0,0 +1,47 @@ +# 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.serialization import Model + + +class RedisLinkedServerCreateParameters(Model): + """Parameter required for creating a linked server to redis cache. + + All required parameters must be populated in order to send to Azure. + + :param linked_redis_cache_id: Required. Fully qualified resourceId of the + linked redis cache. + :type linked_redis_cache_id: str + :param linked_redis_cache_location: Required. Location of the linked redis + cache. + :type linked_redis_cache_location: str + :param server_role: Required. Role of the linked server. Possible values + include: 'Primary', 'Secondary' + :type server_role: str or ~azure.mgmt.redis.models.ReplicationRole + """ + + _validation = { + 'linked_redis_cache_id': {'required': True}, + 'linked_redis_cache_location': {'required': True}, + 'server_role': {'required': True}, + } + + _attribute_map = { + 'linked_redis_cache_id': {'key': 'properties.linkedRedisCacheId', 'type': 'str'}, + 'linked_redis_cache_location': {'key': 'properties.linkedRedisCacheLocation', 'type': 'str'}, + 'server_role': {'key': 'properties.serverRole', 'type': 'ReplicationRole'}, + } + + def __init__(self, *, linked_redis_cache_id: str, linked_redis_cache_location: str, server_role, **kwargs) -> None: + super(RedisLinkedServerCreateParameters, self).__init__(**kwargs) + self.linked_redis_cache_id = linked_redis_cache_id + self.linked_redis_cache_location = linked_redis_cache_location + self.server_role = server_role diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_py3.py new file mode 100644 index 000000000000..2dac0b9ce4fd --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_py3.py @@ -0,0 +1,35 @@ +# 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.serialization import Model + + +class RedisLinkedServer(Model): + """Linked server Id. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Linked server Id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(RedisLinkedServer, self).__init__(**kwargs) + self.id = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_with_properties.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_with_properties.py index 5c54848080f1..d4982b6a62d0 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_with_properties.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_with_properties.py @@ -18,19 +18,22 @@ class RedisLinkedServerWithProperties(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param linked_redis_cache_id: Fully qualified resourceId of the linked - redis cache. + :param linked_redis_cache_id: Required. Fully qualified resourceId of the + linked redis cache. :type linked_redis_cache_id: str - :param linked_redis_cache_location: Location of the linked redis cache. + :param linked_redis_cache_location: Required. Location of the linked redis + cache. :type linked_redis_cache_location: str - :param server_role: Role of the linked server. Possible values include: - 'Primary', 'Secondary' + :param server_role: Required. Role of the linked server. Possible values + include: 'Primary', 'Secondary' :type server_role: str or ~azure.mgmt.redis.models.ReplicationRole :ivar provisioning_state: Terminal state of the link between primary and secondary redis cache. @@ -57,9 +60,9 @@ class RedisLinkedServerWithProperties(ProxyResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, linked_redis_cache_id, linked_redis_cache_location, server_role): - super(RedisLinkedServerWithProperties, self).__init__() - self.linked_redis_cache_id = linked_redis_cache_id - self.linked_redis_cache_location = linked_redis_cache_location - self.server_role = server_role + def __init__(self, **kwargs): + super(RedisLinkedServerWithProperties, self).__init__(**kwargs) + self.linked_redis_cache_id = kwargs.get('linked_redis_cache_id', None) + self.linked_redis_cache_location = kwargs.get('linked_redis_cache_location', None) + self.server_role = kwargs.get('server_role', None) self.provisioning_state = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_with_properties_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_with_properties_py3.py new file mode 100644 index 000000000000..2dd908e478ea --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_linked_server_with_properties_py3.py @@ -0,0 +1,68 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class RedisLinkedServerWithProperties(ProxyResource): + """Response to put/get linked server (with properties) for Redis cache. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param linked_redis_cache_id: Required. Fully qualified resourceId of the + linked redis cache. + :type linked_redis_cache_id: str + :param linked_redis_cache_location: Required. Location of the linked redis + cache. + :type linked_redis_cache_location: str + :param server_role: Required. Role of the linked server. Possible values + include: 'Primary', 'Secondary' + :type server_role: str or ~azure.mgmt.redis.models.ReplicationRole + :ivar provisioning_state: Terminal state of the link between primary and + secondary redis cache. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'linked_redis_cache_id': {'required': True}, + 'linked_redis_cache_location': {'required': True}, + 'server_role': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'linked_redis_cache_id': {'key': 'properties.linkedRedisCacheId', 'type': 'str'}, + 'linked_redis_cache_location': {'key': 'properties.linkedRedisCacheLocation', 'type': 'str'}, + 'server_role': {'key': 'properties.serverRole', 'type': 'ReplicationRole'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, linked_redis_cache_id: str, linked_redis_cache_location: str, server_role, **kwargs) -> None: + super(RedisLinkedServerWithProperties, self).__init__(**kwargs) + self.linked_redis_cache_id = linked_redis_cache_id + self.linked_redis_cache_location = linked_redis_cache_location + self.server_role = server_role + self.provisioning_state = None 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 38ef095312e5..4c475a383569 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 @@ -12,27 +12,27 @@ from enum import Enum -class SkuName(Enum): +class SkuName(str, Enum): basic = "Basic" standard = "Standard" premium = "Premium" -class SkuFamily(Enum): +class SkuFamily(str, Enum): c = "C" p = "P" -class TlsVersion(Enum): +class TlsVersion(str, Enum): one_full_stop_zero = "1.0" one_full_stop_one = "1.1" one_full_stop_two = "1.2" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" deleting = "Deleting" @@ -48,20 +48,20 @@ class ProvisioningState(Enum): updating = "Updating" -class RedisKeyType(Enum): +class RedisKeyType(str, Enum): primary = "Primary" secondary = "Secondary" -class RebootType(Enum): +class RebootType(str, Enum): primary_node = "PrimaryNode" secondary_node = "SecondaryNode" all_nodes = "AllNodes" -class DayOfWeek(Enum): +class DayOfWeek(str, Enum): monday = "Monday" tuesday = "Tuesday" @@ -74,7 +74,7 @@ class DayOfWeek(Enum): weekend = "Weekend" -class ReplicationRole(Enum): +class ReplicationRole(str, Enum): primary = "Primary" secondary = "Secondary" diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule.py index e61738de236c..4c49a4a89927 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule.py @@ -18,13 +18,16 @@ class RedisPatchSchedule(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param schedule_entries: List of patch schedules for a Redis cache. + :param schedule_entries: Required. List of patch schedules for a Redis + cache. :type schedule_entries: list[~azure.mgmt.redis.models.ScheduleEntry] """ @@ -42,6 +45,6 @@ class RedisPatchSchedule(ProxyResource): 'schedule_entries': {'key': 'properties.scheduleEntries', 'type': '[ScheduleEntry]'}, } - def __init__(self, schedule_entries): - super(RedisPatchSchedule, self).__init__() - self.schedule_entries = schedule_entries + def __init__(self, **kwargs): + super(RedisPatchSchedule, self).__init__(**kwargs) + self.schedule_entries = kwargs.get('schedule_entries', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule_py3.py new file mode 100644 index 000000000000..a3a72874e8c4 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_patch_schedule_py3.py @@ -0,0 +1,50 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class RedisPatchSchedule(ProxyResource): + """Response to put/get patch schedules for Redis cache. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param schedule_entries: Required. List of patch schedules for a Redis + cache. + :type schedule_entries: list[~azure.mgmt.redis.models.ScheduleEntry] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'schedule_entries': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'schedule_entries': {'key': 'properties.scheduleEntries', 'type': '[ScheduleEntry]'}, + } + + def __init__(self, *, schedule_entries, **kwargs) -> None: + super(RedisPatchSchedule, self).__init__(**kwargs) + self.schedule_entries = schedule_entries diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters.py index 7dc1a8138e53..b43bc6f4ad9b 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters.py @@ -15,8 +15,10 @@ class RedisRebootParameters(Model): """Specifies which Redis node(s) to reboot. - :param reboot_type: Which Redis node(s) to reboot. Depending on this value - data loss is possible. Possible values include: 'PrimaryNode', + 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', '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 @@ -33,7 +35,7 @@ class RedisRebootParameters(Model): 'shard_id': {'key': 'shardId', 'type': 'int'}, } - def __init__(self, reboot_type, shard_id=None): - super(RedisRebootParameters, self).__init__() - self.reboot_type = reboot_type - self.shard_id = shard_id + 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) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters_py3.py new file mode 100644 index 000000000000..0a6e741a5b44 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_reboot_parameters_py3.py @@ -0,0 +1,41 @@ +# 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.serialization import Model + + +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', + '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 + """ + + _validation = { + 'reboot_type': {'required': True}, + } + + _attribute_map = { + 'reboot_type': {'key': 'rebootType', 'type': 'str'}, + 'shard_id': {'key': 'shardId', 'type': 'int'}, + } + + def __init__(self, *, reboot_type, shard_id: int=None, **kwargs) -> None: + super(RedisRebootParameters, self).__init__(**kwargs) + self.reboot_type = reboot_type + self.shard_id = shard_id diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_regenerate_key_parameters.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_regenerate_key_parameters.py index a54f9ce0f8be..989dedf553f6 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_regenerate_key_parameters.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_regenerate_key_parameters.py @@ -15,8 +15,10 @@ class RedisRegenerateKeyParameters(Model): """Specifies which Redis access keys to reset. - :param key_type: The Redis access key to regenerate. Possible values - include: 'Primary', 'Secondary' + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The Redis access key to regenerate. Possible + values include: 'Primary', 'Secondary' :type key_type: str or ~azure.mgmt.redis.models.RedisKeyType """ @@ -28,6 +30,6 @@ class RedisRegenerateKeyParameters(Model): 'key_type': {'key': 'keyType', 'type': 'RedisKeyType'}, } - def __init__(self, key_type): - super(RedisRegenerateKeyParameters, self).__init__() - self.key_type = key_type + def __init__(self, **kwargs): + super(RedisRegenerateKeyParameters, self).__init__(**kwargs) + self.key_type = kwargs.get('key_type', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_regenerate_key_parameters_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..a95b676264f7 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# 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.serialization import Model + + +class RedisRegenerateKeyParameters(Model): + """Specifies which Redis access keys to reset. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The Redis access key to regenerate. Possible + values include: 'Primary', 'Secondary' + :type key_type: str or ~azure.mgmt.redis.models.RedisKeyType + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'RedisKeyType'}, + } + + def __init__(self, *, key_type, **kwargs) -> None: + super(RedisRegenerateKeyParameters, self).__init__(**kwargs) + self.key_type = key_type 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 e72ac9664964..50892f16123d 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py @@ -18,6 +18,8 @@ class RedisResource(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. @@ -26,7 +28,7 @@ class RedisResource(TrackedResource): :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] - :param location: The geo-location where the resource lives + :param location: Required. The geo-location where the resource lives :type location: str :param redis_configuration: All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value @@ -44,7 +46,7 @@ class RedisResource(TrackedResource): 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. + :param sku: Required. 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 deploy the Redis cache in. Example format: @@ -118,16 +120,16 @@ 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, 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 + def __init__(self, **kwargs): + super(RedisResource, self).__init__(**kwargs) + self.redis_configuration = kwargs.get('redis_configuration', None) + self.enable_non_ssl_port = kwargs.get('enable_non_ssl_port', None) + self.tenant_settings = kwargs.get('tenant_settings', None) + self.shard_count = kwargs.get('shard_count', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + self.sku = kwargs.get('sku', None) + self.subnet_id = kwargs.get('subnet_id', None) + self.static_ip = kwargs.get('static_ip', None) self.redis_version = None self.provisioning_state = None self.host_name = None @@ -135,4 +137,4 @@ def __init__(self, location, sku, tags=None, redis_configuration=None, enable_no self.ssl_port = None self.access_keys = None self.linked_servers = None - self.zones = zones + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource_py3.py new file mode 100644 index 000000000000..f255542bb7ba --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource_py3.py @@ -0,0 +1,140 @@ +# 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 .tracked_resource_py3 import TrackedResource + + +class RedisResource(TrackedResource): + """A single Redis item in List or Get Operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param redis_configuration: All Redis Settings. Few possible keys: + rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + etc. + :type redis_configuration: dict[str, str] + :param enable_non_ssl_port: Specifies whether the non-ssl Redis server + port (6379) is enabled. + :type enable_non_ssl_port: bool + :param tenant_settings: A dictionary of tenant settings + :type tenant_settings: dict[str, str] + :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: Required. 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 + deploy the Redis cache in. Example format: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + :type subnet_id: str + :param static_ip: Static IP address. Required when deploying a Redis cache + inside an existing Azure Virtual Network. + :type static_ip: str + :ivar redis_version: Redis version. + :vartype redis_version: 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. + :vartype port: int + :ivar ssl_port: Redis SSL port. + :vartype ssl_port: int + :ivar access_keys: The keys of the Redis cache - not set if this object is + not the response to Create or Update redis cache + :vartype access_keys: ~azure.mgmt.redis.models.RedisAccessKeys + :ivar linked_servers: List of the linked servers associated with the cache + :vartype linked_servers: list[~azure.mgmt.redis.models.RedisLinkedServer] + :param zones: A list of availability zones denoting where the resource + needs to come from. + :type zones: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'subnet_id': {'pattern': r'^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$'}, + 'static_ip': {'pattern': r'^\d+\.\d+\.\d+\.\d+$'}, + 'redis_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_name': {'readonly': True}, + 'port': {'readonly': True}, + 'ssl_port': {'readonly': True}, + 'access_keys': {'readonly': True}, + 'linked_servers': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'redis_configuration': {'key': 'properties.redisConfiguration', 'type': '{str}'}, + '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'}, + 'redis_version': {'key': 'properties.redisVersion', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'ssl_port': {'key': 'properties.sslPort', 'type': 'int'}, + 'access_keys': {'key': 'properties.accessKeys', 'type': 'RedisAccessKeys'}, + 'linked_servers': {'key': 'properties.linkedServers', 'type': '[RedisLinkedServer]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str, sku, tags=None, redis_configuration=None, enable_non_ssl_port: bool=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, subnet_id: str=None, static_ip: str=None, zones=None, **kwargs) -> None: + super(RedisResource, self).__init__(tags=tags, location=location, **kwargs) + 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 + self.redis_version = None + self.provisioning_state = None + self.host_name = None + self.port = None + self.ssl_port = None + self.access_keys = None + self.linked_servers = None + self.zones = zones 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 b02b9bbc1e2f..dbdb5941733e 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 @@ -47,12 +47,12 @@ class RedisUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - 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 + def __init__(self, **kwargs): + super(RedisUpdateParameters, self).__init__(**kwargs) + self.redis_configuration = kwargs.get('redis_configuration', None) + self.enable_non_ssl_port = kwargs.get('enable_non_ssl_port', None) + self.tenant_settings = kwargs.get('tenant_settings', None) + self.shard_count = kwargs.get('shard_count', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/redis_update_parameters_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/redis_update_parameters_py3.py new file mode 100644 index 000000000000..89b7a30e037f --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_update_parameters_py3.py @@ -0,0 +1,58 @@ +# 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.serialization import Model + + +class RedisUpdateParameters(Model): + """Parameters supplied to the Update Redis operation. + + :param redis_configuration: All Redis Settings. Few possible keys: + rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + etc. + :type redis_configuration: dict[str, str] + :param enable_non_ssl_port: Specifies whether the non-ssl Redis server + port (6379) is enabled. + :type enable_non_ssl_port: bool + :param tenant_settings: A dictionary of tenant settings + :type tenant_settings: dict[str, str] + :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. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'redis_configuration': {'key': 'properties.redisConfiguration', 'type': '{str}'}, + '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: bool=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, sku=None, tags=None, **kwargs) -> None: + super(RedisUpdateParameters, self).__init__(**kwargs) + 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/models/resource.py b/azure-mgmt-redis/azure/mgmt/redis/models/resource.py index 4c19e5a753f7..9706b9c2a5fa 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/resource.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/resource.py @@ -38,8 +38,8 @@ class Resource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/resource_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/resource_py3.py new file mode 100644 index 000000000000..3fb7e9f8a2b0 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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.serialization import Model + + +class Resource(Model): + """The Resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/schedule_entry.py b/azure-mgmt-redis/azure/mgmt/redis/models/schedule_entry.py index 50e204a434e6..9121b5ed67a9 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/schedule_entry.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/schedule_entry.py @@ -15,11 +15,14 @@ class ScheduleEntry(Model): """Patch schedule entry for a Premium Redis Cache. - :param day_of_week: Day of the week when a cache can be patched. Possible - values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', - 'Saturday', 'Sunday', 'Everyday', 'Weekend' + All required parameters must be populated in order to send to Azure. + + :param day_of_week: Required. Day of the week when a cache can be patched. + Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', + 'Friday', 'Saturday', 'Sunday', 'Everyday', 'Weekend' :type day_of_week: str or ~azure.mgmt.redis.models.DayOfWeek - :param start_hour_utc: Start hour after which cache patching can start. + :param start_hour_utc: Required. Start hour after which cache patching can + start. :type start_hour_utc: int :param maintenance_window: ISO8601 timespan specifying how much time cache patching can take. @@ -37,8 +40,8 @@ class ScheduleEntry(Model): 'maintenance_window': {'key': 'maintenanceWindow', 'type': 'duration'}, } - def __init__(self, day_of_week, start_hour_utc, maintenance_window=None): - super(ScheduleEntry, self).__init__() - self.day_of_week = day_of_week - self.start_hour_utc = start_hour_utc - self.maintenance_window = maintenance_window + def __init__(self, **kwargs): + super(ScheduleEntry, self).__init__(**kwargs) + self.day_of_week = kwargs.get('day_of_week', None) + self.start_hour_utc = kwargs.get('start_hour_utc', None) + self.maintenance_window = kwargs.get('maintenance_window', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/schedule_entry_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/schedule_entry_py3.py new file mode 100644 index 000000000000..1819b1faacff --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/schedule_entry_py3.py @@ -0,0 +1,47 @@ +# 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.serialization import Model + + +class ScheduleEntry(Model): + """Patch schedule entry for a Premium Redis Cache. + + All required parameters must be populated in order to send to Azure. + + :param day_of_week: Required. Day of the week when a cache can be patched. + Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', + 'Friday', 'Saturday', 'Sunday', 'Everyday', 'Weekend' + :type day_of_week: str or ~azure.mgmt.redis.models.DayOfWeek + :param start_hour_utc: Required. Start hour after which cache patching can + start. + :type start_hour_utc: int + :param maintenance_window: ISO8601 timespan specifying how much time cache + patching can take. + :type maintenance_window: timedelta + """ + + _validation = { + 'day_of_week': {'required': True}, + 'start_hour_utc': {'required': True}, + } + + _attribute_map = { + 'day_of_week': {'key': 'dayOfWeek', 'type': 'DayOfWeek'}, + 'start_hour_utc': {'key': 'startHourUtc', 'type': 'int'}, + 'maintenance_window': {'key': 'maintenanceWindow', 'type': 'duration'}, + } + + def __init__(self, *, day_of_week, start_hour_utc: int, maintenance_window=None, **kwargs) -> None: + super(ScheduleEntry, self).__init__(**kwargs) + self.day_of_week = day_of_week + self.start_hour_utc = start_hour_utc + self.maintenance_window = maintenance_window diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/sku.py b/azure-mgmt-redis/azure/mgmt/redis/models/sku.py index 803c794dd3be..528e638372ac 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/sku.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/sku.py @@ -15,16 +15,18 @@ class Sku(Model): """SKU parameters supplied to the create Redis operation. - :param name: The type of Redis cache to deploy. Valid values: (Basic, - Standard, Premium). Possible values include: 'Basic', 'Standard', + All required parameters must be populated in order to send to Azure. + + :param name: Required. The type of Redis cache to deploy. Valid values: + (Basic, Standard, Premium). Possible values include: 'Basic', 'Standard', 'Premium' :type name: str or ~azure.mgmt.redis.models.SkuName - :param family: The SKU family to use. Valid values: (C, P). (C = + :param family: Required. The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' :type family: str or ~azure.mgmt.redis.models.SkuFamily - :param capacity: The size of the Redis cache to deploy. Valid values: for - C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P (Premium) family - (1, 2, 3, 4). + :param capacity: Required. The size of the Redis cache to deploy. Valid + values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + (Premium) family (1, 2, 3, 4). :type capacity: int """ @@ -40,8 +42,8 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name, family, capacity): - super(Sku, self).__init__() - self.name = name - self.family = family - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/sku_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/sku_py3.py new file mode 100644 index 000000000000..0710a4ae474b --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/sku_py3.py @@ -0,0 +1,49 @@ +# 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.serialization import Model + + +class Sku(Model): + """SKU parameters supplied to the create Redis operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The type of Redis cache to deploy. Valid values: + (Basic, Standard, Premium). Possible values include: 'Basic', 'Standard', + 'Premium' + :type name: str or ~azure.mgmt.redis.models.SkuName + :param family: Required. The SKU family to use. Valid values: (C, P). (C = + Basic/Standard, P = Premium). Possible values include: 'C', 'P' + :type family: str or ~azure.mgmt.redis.models.SkuFamily + :param capacity: Required. The size of the Redis cache to deploy. Valid + values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + (Premium) family (1, 2, 3, 4). + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'family': {'required': True}, + 'capacity': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name, family, capacity: int, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.family = family + self.capacity = capacity diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/tracked_resource.py b/azure-mgmt-redis/azure/mgmt/redis/models/tracked_resource.py index c3b5b64ae856..7895c56cc28b 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/tracked_resource.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/tracked_resource.py @@ -18,6 +18,8 @@ class TrackedResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. @@ -26,7 +28,7 @@ class TrackedResource(Resource): :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] - :param location: The geo-location where the resource lives + :param location: Required. The geo-location where the resource lives :type location: str """ @@ -45,7 +47,7 @@ class TrackedResource(Resource): 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, location, tags=None): - super(TrackedResource, self).__init__() - self.tags = tags - self.location = location + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/tracked_resource_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/tracked_resource_py3.py new file mode 100644 index 000000000000..399c8104ccbb --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/tracked_resource_py3.py @@ -0,0 +1,53 @@ +# 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 .resource_py3 import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py b/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py index 718fb1a1889b..2c15877908ec 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py @@ -38,8 +38,8 @@ class UpgradeNotification(Model): 'upsell_notification': {'key': 'upsellNotification', 'type': '{str}'}, } - def __init__(self): - super(UpgradeNotification, self).__init__() + def __init__(self, **kwargs): + super(UpgradeNotification, self).__init__(**kwargs) self.name = None self.timestamp = None self.upsell_notification = None diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification_py3.py b/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification_py3.py new file mode 100644 index 000000000000..dd1fd8c3066d --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification_py3.py @@ -0,0 +1,45 @@ +# 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.serialization import Model + + +class UpgradeNotification(Model): + """Properties of upgrade notification. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of upgrade notification. + :vartype name: str + :ivar timestamp: Timestamp when upgrade notification occurred. + :vartype timestamp: datetime + :ivar upsell_notification: Details about this upgrade notification + :vartype upsell_notification: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'upsell_notification': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'upsell_notification': {'key': 'upsellNotification', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(UpgradeNotification, self).__init__(**kwargs) + self.name = None + self.timestamp = None + self.upsell_notification = None 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 ed3a6de66f43..dc8ad9ba54ae 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 @@ -77,7 +77,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -86,9 +86,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -150,6 +149,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -162,9 +162,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'RedisFirewallRuleCreateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -221,7 +220,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -230,8 +229,8 @@ def get( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -285,7 +284,6 @@ def delete( # 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: @@ -294,8 +292,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) 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 80baaaa2caab..ced93d5094a8 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 @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -58,6 +58,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -70,9 +71,8 @@ def _create_initial( body_content = self._serialize.body(parameters, 'RedisLinkedServerCreateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -93,7 +93,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, name, linked_server_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, linked_server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Adds a linked server to the Redis cache (requires Premium SKU). :param resource_group_name: The name of the resource group. @@ -108,13 +108,17 @@ def create( :type parameters: ~azure.mgmt.redis.models.RedisLinkedServerCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RedisLinkedServerWithProperties or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + RedisLinkedServerWithProperties or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.redis.models.RedisLinkedServerWithProperties] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.redis.models.RedisLinkedServerWithProperties]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -126,30 +130,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RedisLinkedServerWithProperties', response) if raw: @@ -158,12 +140,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'} def delete( @@ -202,7 +185,6 @@ def delete( # 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: @@ -211,8 +193,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -262,7 +244,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -271,8 +253,8 @@ def get( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -332,7 +314,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -341,9 +323,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py b/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py index 7c7e63159d7e..064b8a11bd8b 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py @@ -68,7 +68,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -77,9 +77,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 278ffe5fbd30..17b4d1a7de85 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 @@ -80,7 +80,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -89,9 +89,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -150,6 +149,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -162,9 +162,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'RedisPatchSchedule') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -218,7 +217,6 @@ def delete( # 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: @@ -227,8 +225,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -274,7 +272,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -283,8 +281,8 @@ def get( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 dcf064c9a975..ad59bee4c081 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -84,9 +84,8 @@ def check_name_availability( body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameters') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -135,7 +134,7 @@ def list_upgrade_notifications( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -144,8 +143,8 @@ def list_upgrade_notifications( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -182,6 +181,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -194,9 +194,8 @@ def _create_initial( body_content = self._serialize.body(parameters, 'RedisCreateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -217,7 +216,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. @@ -228,13 +227,16 @@ def create( :param parameters: Parameters supplied to the Create Redis operation. :type parameters: ~azure.mgmt.redis.models.RedisCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RedisResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RedisResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.redis.models.RedisResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.redis.models.RedisResource]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -245,30 +247,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RedisResource', response) if raw: @@ -277,12 +257,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'} def update( @@ -320,6 +301,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -332,9 +314,8 @@ def update( body_content = self._serialize.body(parameters, 'RedisUpdateParameters') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -371,7 +352,6 @@ def _delete_initial( # 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: @@ -380,8 +360,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -393,7 +373,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a Redis cache. :param resource_group_name: The name of the resource group. @@ -401,12 +381,14 @@ def delete( :param name: The name of the Redis cache. :type 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 - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -416,40 +398,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'} def get( @@ -485,7 +446,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -494,8 +455,8 @@ def get( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -551,7 +512,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -560,9 +521,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -616,7 +576,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -625,9 +585,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -681,7 +640,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -690,8 +649,8 @@ def list_keys( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -749,6 +708,7 @@ def regenerate_key( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -761,9 +721,8 @@ def regenerate_key( body_content = self._serialize.body(parameters, 'RedisRegenerateKeyParameters') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -825,6 +784,7 @@ def force_reboot( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -837,9 +797,8 @@ def force_reboot( body_content = self._serialize.body(parameters, 'RedisRebootParameters') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -890,9 +849,8 @@ def _import_data_initial( body_content = self._serialize.body(parameters, 'ImportRDBParameters') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -904,7 +862,7 @@ def _import_data_initial( return client_raw_response def import_data( - self, resource_group_name, name, files, format=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, files, format=None, custom_headers=None, raw=False, polling=True, **operation_config): """Import data into Redis cache. :param resource_group_name: The name of the resource group. @@ -916,12 +874,14 @@ def import_data( :param format: File format. :type format: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._import_data_initial( @@ -933,40 +893,19 @@ def import_data( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) import_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/import'} @@ -999,9 +938,8 @@ def _export_data_initial( body_content = self._serialize.body(parameters, 'ExportRDBParameters') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -1013,7 +951,7 @@ def _export_data_initial( return client_raw_response def export_data( - self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Export data from the redis cache to blobs in a container. :param resource_group_name: The name of the resource group. @@ -1023,12 +961,14 @@ def export_data( :param parameters: Parameters for Redis export operation. :type parameters: ~azure.mgmt.redis.models.ExportRDBParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._export_data_initial( @@ -1039,38 +979,17 @@ def export_data( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) export_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/export'} 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 e3032d25f099..54383690dce2 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/redis_management_client.py +++ b/azure-mgmt-redis/azure/mgmt/redis/redis_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -55,7 +55,7 @@ def __init__( self.subscription_id = subscription_id -class RedisManagementClient(object): +class RedisManagementClient(SDKClient): """REST API for Azure Redis Cache Service. :ivar config: Configuration for client. @@ -86,7 +86,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = RedisManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(RedisManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2018-03-01' From 161565d308a18053e17c37f383007dbe6853a257 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 15 Jan 2019 11:51:39 -0800 Subject: [PATCH 5/7] 6.0.0 --- azure-mgmt-redis/HISTORY.rst | 44 +++- azure-mgmt-redis/azure/mgmt/redis/version.py | 2 +- azure-mgmt-redis/build.json | 225 ------------------- 3 files changed, 44 insertions(+), 227 deletions(-) delete mode 100644 azure-mgmt-redis/build.json diff --git a/azure-mgmt-redis/HISTORY.rst b/azure-mgmt-redis/HISTORY.rst index 85be7056fdd0..6f9d423d12b6 100644 --- a/azure-mgmt-redis/HISTORY.rst +++ b/azure-mgmt-redis/HISTORY.rst @@ -3,13 +3,55 @@ Release History =============== +6.0.0 (2019-01-15) +++++++++++++++++++ + +**Note** + +- azure-mgmt-nspkg is not installed anymore on Python 3 (PEP420-based namespace package) + +**Features** + +- Client class can be used as a context manager to keep the underlying HTTP session open for performance +- Model RedisCreateParameters has a new parameter minimum_tls_version +- Model RedisResource has a new parameter minimum_tls_version +- Model RedisUpdateParameters has a new parameter minimum_tls_version +- Added operation PatchSchedulesOperations.list_by_redis_resource +- Added operation RedisOperations.list_upgrade_notifications +- Added operation RedisOperations.check_name_availability + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + 5.0.0 (2018-02-08) ++++++++++++++++++ **Disclaimer** Several model (like RedisCreateParameters) have positional arguments shuffled, due to constraints -in our code generator. This is not breaking if you use keyword arguments. If you are using +in our code generator. This is not breaking if you use keyword arguments. If you are using positional arguments, we strongly suggest to use keyword only arguments for Model creation, since next version 6.0.0 will use keyword only arguments for models. diff --git a/azure-mgmt-redis/azure/mgmt/redis/version.py b/azure-mgmt-redis/azure/mgmt/redis/version.py index 654c55a24205..37725706ef72 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/version.py +++ b/azure-mgmt-redis/azure/mgmt/redis/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "6.0.0" diff --git a/azure-mgmt-redis/build.json b/azure-mgmt-redis/build.json deleted file mode 100644 index d5356f60b700..000000000000 --- a/azure-mgmt-redis/build.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "autorest": [ - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4168", - "engines": { - "node": ">=7.10.0" - }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/async-io": "~1.0.22", - "@microsoft.azure/extension": "~1.2.12", - "@types/commonmark": "^0.27.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.28", - "@types/pify": "0.0.28", - "@types/source-map": "^0.5.0", - "@types/yargs": "^8.0.2", - "commonmark": "^0.27.0", - "file-url": "^2.0.2", - "get-uri": "^2.0.0", - "jsonpath": "^0.2.11", - "linq-es2015": "^2.4.25", - "mocha": "3.4.2", - "mocha-typescript": "1.1.5", - "pify": "^3.0.0", - "safe-eval": "^0.3.0", - "shx": "^0.2.2", - "source-map": "^0.5.6", - "source-map-support": "^0.4.15", - "strip-bom": "^3.0.0", - "typescript": "2.5.3", - "untildify": "^3.0.2", - "urijs": "^1.18.10", - "vscode-jsonrpc": "^3.3.1", - "yaml-ast-parser": "https://github.com/olydis/yaml-ast-parser/releases/download/0.0.34/yaml-ast-parser-0.0.34.tgz", - "yargs": "^8.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_shasum": "33813111fc9bfa488bd600fbba48bc53cc9182c7", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest-core@2.0.4168", - "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.0.21", - "dependencies": { - "dotnet-2.0.0": "^1.3.2" - }, - "optionalDependencies": {}, - "devDependencies": { - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.1.1", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "3ce7d3939124b31830be15e5de99b9b7768afb90", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.0.21", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.1.22", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "ca425289fa38a210d279729048a4a91673f09c67", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.1.22", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.python", - "version": "2.0.19", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/autorest.testserver": "^1.9.0", - "autorest": "^2.0.0", - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "_shasum": "e069166c16fd903c8e1fdf9395b433f3043cb6e3", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.python@2.0.19", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "_where": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - } - ], - "autorest_bootstrap": {} -} \ No newline at end of file From 3381778f796d9742d0b74f5d2307202ffc15e87f Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 15 Jan 2019 11:52:43 -0800 Subject: [PATCH 6/7] Redis packaging --- azure-mgmt-redis/MANIFEST.in | 1 + azure-mgmt-redis/README.rst | 6 +++--- azure-mgmt-redis/setup.py | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/azure-mgmt-redis/MANIFEST.in b/azure-mgmt-redis/MANIFEST.in index ac87972df424..6ceb27f7a96e 100644 --- a/azure-mgmt-redis/MANIFEST.in +++ b/azure-mgmt-redis/MANIFEST.in @@ -1,3 +1,4 @@ include *.rst include azure/__init__.py include azure/mgmt/__init__.py + diff --git a/azure-mgmt-redis/README.rst b/azure-mgmt-redis/README.rst index 45de4e6b43dd..a9fad04b31f7 100644 --- a/azure-mgmt-redis/README.rst +++ b/azure-mgmt-redis/README.rst @@ -1,7 +1,7 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure MyService Management Client Library. +This is the Microsoft Azure Redis Cache Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). @@ -36,8 +36,8 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `MyService Management -`__ +For code examples, see `Redis Cache Management +`__ on docs.microsoft.com. diff --git a/azure-mgmt-redis/setup.py b/azure-mgmt-redis/setup.py index ecee6aed40ae..e9f9148f8e99 100644 --- a/azure-mgmt-redis/setup.py +++ b/azure-mgmt-redis/setup.py @@ -13,7 +13,7 @@ # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-redis" -PACKAGE_PPRINT_NAME = "MyService Management" +PACKAGE_PPRINT_NAME = "Redis Cache Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -58,7 +58,7 @@ author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', From 121375a4317c170040d26ee05aa27cb373487e65 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 15 Jan 2019 12:09:21 -0800 Subject: [PATCH 7/7] Record simple tests --- .../test_mgmt_redis.test_redis.yaml | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/azure-mgmt-redis/tests/recordings/test_mgmt_redis.test_redis.yaml b/azure-mgmt-redis/tests/recordings/test_mgmt_redis.test_redis.yaml index 09543768bcb9..b71c75337e61 100644 --- a/azure-mgmt-redis/tests/recordings/test_mgmt_redis.test_redis.yaml +++ b/azure-mgmt-redis/tests/recordings/test_mgmt_redis.test_redis.yaml @@ -8,27 +8,27 @@ interactions: Connection: [keep-alive] Content-Length: ['94'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.20 azure-mgmt-redis/5.0.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.3 (Windows-10-10.0.17134-SP0) msrest/0.6.3 msrest_azure/0.4.34 + azure-mgmt-redis/6.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/Redis/mycachename?api-version=2017-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/Redis/mycachename?api-version=2018-03-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/Redis/mycachename","location":"West - US","name":"mycachename","type":"Microsoft.Cache/Redis","tags":{},"properties":{"provisioningState":"Creating","redisVersion":"3.2.7","sku":{"name":"Basic","family":"C","capacity":1},"enableNonSslPort":false,"redisConfiguration":{"maxclients":"1000","maxmemory-reserved":"50","maxfragmentationmemory-reserved":"50","maxmemory-delta":"50"},"accessKeys":{"primaryKey":"hp424Tqg3z71yVrrjGfP49cCeu+417QrvGVzXutin9U=","secondaryKey":"a9IOl0zTf6iNErNDNRMG1ciWhEUW+wGrCCUIMRJ8TVU="},"hostName":"mycachename.redis.cache.windows.net","port":6379,"sslPort":6380,"linkedServers":[]}}'} + US","name":"mycachename","type":"Microsoft.Cache/Redis","tags":{},"properties":{"provisioningState":"Creating","redisVersion":"3.2.7","sku":{"name":"Basic","family":"C","capacity":1},"enableNonSslPort":false,"redisConfiguration":{"maxclients":"1000","maxmemory-reserved":"50","maxfragmentationmemory-reserved":"50","maxmemory-delta":"50"},"accessKeys":{"primaryKey":"Do0LH2LJE3NbqiDF76FASXf8N5pCXFlgKHhdS20hf98=","secondaryKey":"mZt23KvYBPny443+Fs8KESPbcSOoOF9swJbq2KxNCLo="},"hostName":"mycachename.redis.cache.windows.net","port":6379,"sslPort":6380,"linkedServers":[]}}'} headers: cache-control: [no-cache] content-length: ['743'] content-type: [application/json; charset=utf-8] - date: ['Thu, 08 Feb 2018 19:00:32 GMT'] + date: ['Tue, 15 Jan 2019 19:54:50 GMT'] expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/redis/mycachename?api-version=2017-10-01'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/redis/mycachename?api-version=2018-03-01'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] strict-transport-security: [max-age=31536000; includeSubDomains] x-content-type-options: [nosniff] x-ms-ratelimit-remaining-subscription-writes: ['1199'] - x-rp-server-mvid: [dd6c791d-5fa3-4f01-8490-cebc87c949a0] + x-rp-server-mvid: [aadf55cb-e2b0-4ab7-be35-33ec319e15cd] status: {code: 201, message: Created} - request: body: null @@ -36,10 +36,10 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.20 azure-mgmt-redis/5.0.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.3 (Windows-10-10.0.17134-SP0) msrest/0.6.3 msrest_azure/0.4.34 + azure-mgmt-redis/6.0.0 Azure-SDK-For-Python] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/redis/mycachename?api-version=2017-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/redis/mycachename?api-version=2018-03-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/Redis/mycachename","location":"West US","name":"mycachename","type":"Microsoft.Cache/Redis","tags":{},"properties":{"provisioningState":"Creating","redisVersion":"3.2.7","sku":{"name":"Basic","family":"C","capacity":1},"enableNonSslPort":false,"redisConfiguration":{"maxclients":"1000","maxmemory-reserved":"50","maxfragmentationmemory-reserved":"50","maxmemory-delta":"50"},"accessKeys":null,"hostName":"mycachename.redis.cache.windows.net","port":6379,"sslPort":6380,"linkedServers":[]}}'} @@ -47,7 +47,7 @@ interactions: cache-control: [no-cache] content-length: ['624'] content-type: [application/json; charset=utf-8] - date: ['Thu, 08 Feb 2018 19:01:03 GMT'] + date: ['Tue, 15 Jan 2019 19:55:21 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -55,7 +55,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-rp-server-mvid: [dd6c791d-5fa3-4f01-8490-cebc87c949a0] + x-rp-server-mvid: [0c754f3e-9500-4348-9eb7-28174ccdd12b] status: {code: 200, message: OK} - request: body: null @@ -63,12 +63,11 @@ interactions: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.20 azure-mgmt-redis/5.0.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.3 (Windows-10-10.0.17134-SP0) msrest/0.6.3 msrest_azure/0.4.34 + azure-mgmt-redis/6.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/Redis/mycachename?api-version=2017-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/Redis/mycachename?api-version=2018-03-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_redis_test_redis91300aaf/providers/Microsoft.Cache/Redis/mycachename","location":"West US","name":"mycachename","type":"Microsoft.Cache/Redis","tags":{},"properties":{"provisioningState":"Creating","redisVersion":"3.2.7","sku":{"name":"Basic","family":"C","capacity":1},"enableNonSslPort":false,"redisConfiguration":{"maxclients":"1000","maxmemory-reserved":"50","maxfragmentationmemory-reserved":"50","maxmemory-delta":"50"},"accessKeys":null,"hostName":"mycachename.redis.cache.windows.net","port":6379,"sslPort":6380,"linkedServers":[]}}'} @@ -76,7 +75,7 @@ interactions: cache-control: [no-cache] content-length: ['624'] content-type: [application/json; charset=utf-8] - date: ['Thu, 08 Feb 2018 19:01:03 GMT'] + date: ['Tue, 15 Jan 2019 19:55:21 GMT'] expires: ['-1'] pragma: [no-cache] server: [Microsoft-HTTPAPI/2.0] @@ -84,6 +83,6 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-content-type-options: [nosniff] - x-rp-server-mvid: [dd6c791d-5fa3-4f01-8490-cebc87c949a0] + x-rp-server-mvid: [aadf55cb-e2b0-4ab7-be35-33ec319e15cd] status: {code: 200, message: OK} version: 1