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/MANIFEST.in b/azure-mgmt-redis/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-redis/MANIFEST.in +++ b/azure-mgmt-redis/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.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..ef3205181237 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py +++ b/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py @@ -9,35 +9,68 @@ # 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 +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 +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, @@ -67,12 +100,18 @@ 'RedisLinkedServerCreateParameters', 'OperationDisplay', 'Operation', + 'CheckNameAvailabilityParameters', + 'UpgradeNotification', + 'NotificationListResponse', '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 new file mode 100644 index 000000000000..9bb074b9b03f --- /dev/null +++ b/azure-mgmt-redis/azure/mgmt/redis/models/check_name_availability_parameters.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, **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 new file mode 100644 index 000000000000..94c031595548 --- /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, **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 0e5439172f3f..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. @@ -27,11 +29,15 @@ class RedisCreateParameters(Model): :param shard_count: The number of shards to be created on a Premium Cluster Cache. :type shard_count: int - :param sku: The SKU of the Redis cache to deploy. + :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/{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. @@ -39,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] @@ -57,6 +63,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,15 +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, 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.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 21b8f1ecf9a5..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,33 +12,56 @@ 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 RedisKeyType(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(str, 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(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" @@ -51,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_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_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 b3f699f7e808..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 @@ -40,19 +42,27 @@ class RedisResource(TrackedResource): :param shard_count: The number of shards to be created on a Premium Cluster Cache. :type shard_count: int - :param sku: The SKU of the Redis cache to deploy. + :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/{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. :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 +106,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,15 +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, 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.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 @@ -125,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 da3c389c52b9..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 @@ -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): - 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.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 new file mode 100644 index 000000000000..2c15877908ec --- /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 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): + 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 656c865d695d..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 @@ -22,8 +22,8 @@ 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. - :ivar api_version: Client Api Version. Constant value: "2017-10-01". + :param deserializer: An object model deserializer. + :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 @@ -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'), @@ -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) @@ -106,6 +105,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 +134,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'), @@ -149,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()) @@ -161,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) @@ -182,6 +182,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 +205,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'), @@ -219,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: @@ -228,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) @@ -246,6 +247,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 +269,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'), @@ -282,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: @@ -291,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) @@ -302,3 +303,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..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 @@ -24,8 +24,8 @@ 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. - :ivar api_version: Client Api Version. Constant value: "2017-10-01". + :param deserializer: An object model deserializer. + :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 @@ -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'), @@ -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,14 @@ 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( self, resource_group_name, name, linked_server_name, custom_headers=None, raw=False, **operation_config): @@ -186,7 +170,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'), @@ -201,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: @@ -210,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) @@ -221,6 +204,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 +229,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'), @@ -260,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: @@ -269,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) @@ -287,6 +271,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 +296,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'), @@ -329,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: @@ -338,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) @@ -358,3 +342,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..064b8a11bd8b 100644 --- a/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py +++ b/azure-mgmt-redis/azure/mgmt/redis/operations/operations.py @@ -22,8 +22,8 @@ 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. - :ivar api_version: Client Api Version. Constant value: "2017-10-01". + :param deserializer: An object model deserializer. + :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 @@ -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 = {} @@ -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) @@ -97,3 +96,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..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 @@ -22,8 +22,9 @@ 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. - :ivar api_version: Client Api Version. Constant value: "2017-10-01". + :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". """ models = models @@ -33,10 +34,82 @@ 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.default = "default" 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 @@ -61,10 +134,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) @@ -75,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()) @@ -87,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) @@ -108,6 +182,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 +202,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) @@ -141,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: @@ -150,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) @@ -161,6 +236,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 +257,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) @@ -195,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: @@ -204,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) @@ -222,3 +299,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..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 @@ -24,8 +24,8 @@ 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. - :ivar api_version: Client Api Version. Constant value: "2017-10-01". + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-03-01". """ models = models @@ -35,15 +35,139 @@ 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, 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. 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 + 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, header_parameters, body_content) + response = self._client.send(request, 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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'), @@ -57,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()) @@ -69,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) @@ -92,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. @@ -103,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( @@ -120,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: @@ -152,12 +257,14 @@ 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( self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): @@ -180,7 +287,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'), @@ -194,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()) @@ -206,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) @@ -225,12 +332,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'), @@ -244,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: @@ -253,10 +360,10 @@ 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, 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 @@ -266,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. @@ -274,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( @@ -289,40 +398,20 @@ 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, 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( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +432,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'), @@ -357,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: @@ -366,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) @@ -384,6 +473,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 +495,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') @@ -422,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: @@ -431,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) @@ -451,6 +540,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 +560,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') } @@ -486,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: @@ -495,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) @@ -515,6 +604,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 +626,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'), @@ -550,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: @@ -559,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) @@ -577,6 +667,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 +694,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'), @@ -617,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()) @@ -629,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) @@ -648,6 +739,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 +770,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'), @@ -692,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()) @@ -704,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) @@ -723,6 +815,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 +823,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'), @@ -756,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) @@ -770,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. @@ -782,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( @@ -799,46 +893,26 @@ 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'} 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'), @@ -864,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) @@ -878,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. @@ -888,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( @@ -904,37 +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 6052a4cf3fbb..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,10 +86,10 @@ 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 = '2017-10-01' + self.api_version = '2018-03-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_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 diff --git a/azure-mgmt-redis/sdk_packaging.toml b/azure-mgmt-redis/sdk_packaging.toml index 697bf3080149..eed7a785a212 100644 --- a/azure-mgmt-redis/sdk_packaging.toml +++ b/azure-mgmt-redis/sdk_packaging.toml @@ -5,3 +5,4 @@ package_pprint_name = "Redis Cache Management" package_doc_id = "redis" is_stable = true is_arm = true +need_msrestazure = true 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