diff --git a/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py b/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py index f20f4854d218..f109b095d341 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py @@ -21,6 +21,7 @@ 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_resource_paged import RedisResourcePaged from .redis_management_client_enums import ( SkuName, @@ -43,6 +44,7 @@ 'ImportRDBParameters', 'ScheduleEntry', 'RedisPatchSchedule', + 'RedisForceRebootResponse', 'RedisResourcePaged', 'SkuName', 'SkuFamily', 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 new file mode 100644 index 000000000000..0de3a865d8b1 --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_force_reboot_response.py @@ -0,0 +1,34 @@ +# 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): + self.message = None 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 4d172b7a3908..96ac7c1d5534 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py @@ -59,6 +59,10 @@ class RedisResource(Resource): :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: :class:`RedisAccessKeys + ` """ _validation = { @@ -73,6 +77,7 @@ class RedisResource(Resource): 'host_name': {'readonly': True}, 'port': {'readonly': True}, 'ssl_port': {'readonly': True}, + 'access_keys': {'readonly': True}, } _attribute_map = { @@ -93,6 +98,7 @@ class RedisResource(Resource): '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'}, } def __init__(self, location, tags=None, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, subnet_id=None, static_ip=None, sku=None): @@ -109,3 +115,4 @@ def __init__(self, location, tags=None, redis_configuration=None, enable_non_ssl self.host_name = None self.port = None self.ssl_port = None + self.access_keys = None 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 a44e4576abac..3b6a5c037924 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 @@ -89,7 +89,7 @@ def create_or_update( response = self._client.send( request, header_parameters, body_content, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 201]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -98,6 +98,8 @@ def create_or_update( if response.status_code == 200: deserialized = self._deserialize('RedisPatchSchedule', response) + if response.status_code == 201: + deserialized = self._deserialize('RedisPatchSchedule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -205,7 +207,7 @@ def get( request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) - if response.status_code not in [200, 404]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp 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 aef9547ccb37..9665c469373c 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/redis_operations.py @@ -622,7 +622,8 @@ def force_reboot( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: None + :rtype: :class:`RedisForceRebootResponse + ` :rtype: :class:`ClientRawResponse` if raw=true :raises: :class:`CloudError` @@ -660,15 +661,22 @@ def force_reboot( response = self._client.send( request, header_parameters, body_content, **operation_config) - if response.status_code not in [200, 204]: + 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('RedisForceRebootResponse', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + return deserialized + def import_data( self, resource_group_name, name, files, format=None, custom_headers=None, raw=False, **operation_config): """Import data into Redis cache. @@ -736,7 +744,7 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): - if response.status_code not in [202]: + if response.status_code not in [202, 200, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -820,7 +828,7 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): - if response.status_code not in [202]: + if response.status_code not in [202, 200, 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 6a173c88e222..0e5f6f511ee2 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/redis_management_client.py +++ b/azure-mgmt-redis/azure/mgmt/redis/redis_management_client.py @@ -32,22 +32,11 @@ class RedisManagementClientConfiguration(AzureConfiguration): :type subscription_id: str :param api_version: Client Api Version. :type api_version: str - :param accept_language: Gets or sets the preferred language for the - response. - :type accept_language: str - :param long_running_operation_retry_timeout: Gets or sets the retry - timeout in seconds for Long Running Operations. Default value is 30. - :type long_running_operation_retry_timeout: int - :param generate_client_request_id: When set to true a unique - x-ms-client-request-id value is generated and included in each request. - Default is true. - :type generate_client_request_id: bool :param str base_url: Service URL - :param str filepath: Existing config """ def __init__( - self, credentials, subscription_id, api_version='2016-04-01', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): + self, credentials, subscription_id, api_version='2016-04-01', base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") @@ -57,12 +46,10 @@ def __init__( raise TypeError("Parameter 'subscription_id' must be str.") if api_version is not None and not isinstance(api_version, str): raise TypeError("Optional parameter 'api_version' must be str.") - if accept_language is not None and not isinstance(accept_language, str): - raise TypeError("Optional parameter 'accept_language' must be str.") if not base_url: base_url = 'https://management.azure.com' - super(RedisManagementClientConfiguration, self).__init__(base_url, filepath) + super(RedisManagementClientConfiguration, self).__init__(base_url) self.add_user_agent('redismanagementclient/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') @@ -70,9 +57,6 @@ def __init__( self.credentials = credentials self.subscription_id = subscription_id self.api_version = api_version - self.accept_language = accept_language - self.long_running_operation_retry_timeout = long_running_operation_retry_timeout - self.generate_client_request_id = generate_client_request_id class RedisManagementClient(object): @@ -95,24 +79,13 @@ class RedisManagementClient(object): :type subscription_id: str :param api_version: Client Api Version. :type api_version: str - :param accept_language: Gets or sets the preferred language for the - response. - :type accept_language: str - :param long_running_operation_retry_timeout: Gets or sets the retry - timeout in seconds for Long Running Operations. Default value is 30. - :type long_running_operation_retry_timeout: int - :param generate_client_request_id: When set to true a unique - x-ms-client-request-id value is generated and included in each request. - Default is true. - :type generate_client_request_id: bool :param str base_url: Service URL - :param str filepath: Existing config """ def __init__( - self, credentials, subscription_id, api_version='2016-04-01', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): + self, credentials, subscription_id, api_version='2016-04-01', base_url=None): - self.config = RedisManagementClientConfiguration(credentials, subscription_id, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self.config = RedisManagementClientConfiguration(credentials, subscription_id, api_version, base_url) self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}