From ce9aa1a6876756a8bdd4e53958617fc0bc3128a3 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 2 Mar 2018 12:36:16 -0800 Subject: [PATCH] [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'}