From 3e84007c2e3baa9cde8d330b8711151168bc4c39 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 7 Dec 2020 09:49:23 +0000 Subject: [PATCH] CodeGen from PR 11939 in Azure/azure-rest-api-specs [Hub Generated] Public private branch 'credscan-fix' (#11939) * Fix credscan * Fix more credentials --- .../mgmt/redis/_redis_management_client.py | 12 +- .../azure/mgmt/redis/models/__init__.py | 31 ++ .../azure/mgmt/redis/models/_models.py | 306 +++++++++++++++- .../azure/mgmt/redis/models/_models_py3.py | 318 +++++++++++++++- .../azure/mgmt/redis/models/_paged_models.py | 26 ++ .../models/_redis_management_client_enums.py | 21 ++ .../azure/mgmt/redis/operations/__init__.py | 4 + .../operations/_firewall_rules_operations.py | 45 +-- .../operations/_linked_server_operations.py | 43 +-- .../mgmt/redis/operations/_operations.py | 12 +- .../operations/_patch_schedules_operations.py | 48 ++- ...private_endpoint_connections_operations.py | 341 ++++++++++++++++++ .../_private_link_resources_operations.py | 111 ++++++ .../redis/operations/_redis_operations.py | 124 +++---- 14 files changed, 1281 insertions(+), 161 deletions(-) create mode 100644 sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_private_link_resources_operations.py diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/_redis_management_client.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/_redis_management_client.py index 534f882e4171..34e5bc5a46a3 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/_redis_management_client.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/_redis_management_client.py @@ -18,6 +18,8 @@ from .operations import FirewallRulesOperations from .operations import PatchSchedulesOperations from .operations import LinkedServerOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations from . import models @@ -37,6 +39,10 @@ class RedisManagementClient(SDKClient): :vartype patch_schedules: azure.mgmt.redis.operations.PatchSchedulesOperations :ivar linked_server: LinkedServer operations :vartype linked_server: azure.mgmt.redis.operations.LinkedServerOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.redis.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.redis.operations.PrivateLinkResourcesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -55,7 +61,7 @@ def __init__( 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 = '2019-07-01' + self.api_version = '2020-06-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -69,3 +75,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.linked_server = LinkedServerOperations( self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py index e3195f664086..55c4a40bb79d 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/__init__.py @@ -11,11 +11,18 @@ try: from ._models_py3 import CheckNameAvailabilityParameters + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import ExportRDBParameters from ._models_py3 import ImportRDBParameters from ._models_py3 import NotificationListResponse from ._models_py3 import Operation from ._models_py3 import OperationDisplay + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import ProxyResource from ._models_py3 import RedisAccessKeys from ._models_py3 import RedisCreateParameters @@ -38,11 +45,18 @@ from ._models_py3 import UpgradeNotification except (SyntaxError, ImportError): from ._models import CheckNameAvailabilityParameters + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException from ._models import ExportRDBParameters from ._models import ImportRDBParameters from ._models import NotificationListResponse from ._models import Operation from ._models import OperationDisplay + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateLinkResource + from ._models import PrivateLinkServiceConnectionState from ._models import ProxyResource from ._models import RedisAccessKeys from ._models import RedisCreateParameters @@ -64,6 +78,8 @@ from ._models import TrackedResource from ._models import UpgradeNotification from ._paged_models import OperationPaged +from ._paged_models import PrivateEndpointConnectionPaged +from ._paged_models import PrivateLinkResourcePaged from ._paged_models import RedisFirewallRulePaged from ._paged_models import RedisLinkedServerWithPropertiesPaged from ._paged_models import RedisPatchSchedulePaged @@ -72,7 +88,10 @@ SkuName, SkuFamily, TlsVersion, + PublicNetworkAccess, ProvisioningState, + PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, RedisKeyType, RebootType, DayOfWeek, @@ -81,11 +100,18 @@ __all__ = [ 'CheckNameAvailabilityParameters', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', 'ExportRDBParameters', 'ImportRDBParameters', 'NotificationListResponse', 'Operation', 'OperationDisplay', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkServiceConnectionState', 'ProxyResource', 'RedisAccessKeys', 'RedisCreateParameters', @@ -111,10 +137,15 @@ 'RedisFirewallRulePaged', 'RedisPatchSchedulePaged', 'RedisLinkedServerWithPropertiesPaged', + 'PrivateEndpointConnectionPaged', + 'PrivateLinkResourcePaged', 'SkuName', 'SkuFamily', 'TlsVersion', + 'PublicNetworkAccess', 'ProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'PrivateEndpointConnectionProvisioningState', 'RedisKeyType', 'RebootType', 'DayOfWeek', diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models.py index 7e5e609a2751..7c6289a8e9ae 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class CheckNameAvailabilityParameters(Model): @@ -49,6 +50,110 @@ class CloudError(Model): } +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.redis.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.redis.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: ~azure.mgmt.redis.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class ExportRDBParameters(Model): """Parameters for Redis export operation. @@ -182,6 +287,29 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + class Resource(Model): """The Resource definition. @@ -215,6 +343,131 @@ def __init__(self, **kwargs): self.type = None +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection 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 private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.redis.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.redis.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.redis.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PrivateLinkResource(Resource): + """A private link resource. + + 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 + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.redis.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + class ProxyResource(Resource): """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. @@ -298,6 +551,13 @@ class RedisCommonProperties(Model): TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion + :param public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess """ _attribute_map = { @@ -307,6 +567,7 @@ class RedisCommonProperties(Model): 'tenant_settings': {'key': 'tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, } def __init__(self, **kwargs): @@ -317,6 +578,7 @@ def __init__(self, **kwargs): 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.public_network_access = kwargs.get('public_network_access', None) class RedisCreateParameters(Model): @@ -343,6 +605,13 @@ class RedisCreateParameters(Model): TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion + :param public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess :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 @@ -375,6 +644,7 @@ class RedisCreateParameters(Model): 'tenant_settings': {'key': 'properties.tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'properties.shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, 'sku': {'key': 'properties.sku', 'type': 'Sku'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'static_ip': {'key': 'properties.staticIP', 'type': 'str'}, @@ -391,6 +661,7 @@ def __init__(self, **kwargs): 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.public_network_access = kwargs.get('public_network_access', None) self.sku = kwargs.get('sku', None) self.subnet_id = kwargs.get('subnet_id', None) self.static_ip = kwargs.get('static_ip', None) @@ -423,6 +694,13 @@ class RedisCreateProperties(RedisCommonProperties): 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 public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess :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 @@ -447,6 +725,7 @@ class RedisCreateProperties(RedisCommonProperties): 'tenant_settings': {'key': 'tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'subnet_id': {'key': 'subnetId', 'type': 'str'}, 'static_ip': {'key': 'staticIP', 'type': 'str'}, @@ -878,6 +1157,13 @@ class RedisResource(TrackedResource): TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion + :param public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess :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 @@ -908,6 +1194,10 @@ class RedisResource(TrackedResource): :vartype linked_servers: list[~azure.mgmt.redis.models.RedisLinkedServer] :ivar instances: List of the Redis instances associated with the cache :vartype instances: list[~azure.mgmt.redis.models.RedisInstanceDetails] + :ivar private_endpoint_connections: List of private endpoint connection + associated with the specified redis cache + :vartype private_endpoint_connections: + list[~azure.mgmt.redis.models.PrivateEndpointConnection] :param zones: A list of availability zones denoting where the resource needs to come from. :type zones: list[str] @@ -929,6 +1219,7 @@ class RedisResource(TrackedResource): 'access_keys': {'readonly': True}, 'linked_servers': {'readonly': True}, 'instances': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -943,6 +1234,7 @@ class RedisResource(TrackedResource): 'tenant_settings': {'key': 'properties.tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'properties.shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, 'sku': {'key': 'properties.sku', 'type': 'Sku'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'static_ip': {'key': 'properties.staticIP', 'type': 'str'}, @@ -954,6 +1246,7 @@ class RedisResource(TrackedResource): 'access_keys': {'key': 'properties.accessKeys', 'type': 'RedisAccessKeys'}, 'linked_servers': {'key': 'properties.linkedServers', 'type': '[RedisLinkedServer]'}, 'instances': {'key': 'properties.instances', 'type': '[RedisInstanceDetails]'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, 'zones': {'key': 'zones', 'type': '[str]'}, } @@ -965,6 +1258,7 @@ def __init__(self, **kwargs): 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.public_network_access = kwargs.get('public_network_access', None) self.sku = kwargs.get('sku', None) self.subnet_id = kwargs.get('subnet_id', None) self.static_ip = kwargs.get('static_ip', None) @@ -976,6 +1270,7 @@ def __init__(self, **kwargs): self.access_keys = None self.linked_servers = None self.instances = None + self.private_endpoint_connections = None self.zones = kwargs.get('zones', None) @@ -1001,6 +1296,13 @@ class RedisUpdateParameters(Model): TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion + :param public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess :param sku: The SKU of the Redis cache to deploy. :type sku: ~azure.mgmt.redis.models.Sku :param tags: Resource tags. @@ -1014,6 +1316,7 @@ class RedisUpdateParameters(Model): 'tenant_settings': {'key': 'properties.tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'properties.shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, 'sku': {'key': 'properties.sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -1026,6 +1329,7 @@ def __init__(self, **kwargs): 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.public_network_access = kwargs.get('public_network_access', None) self.sku = kwargs.get('sku', None) self.tags = kwargs.get('tags', None) @@ -1079,7 +1383,7 @@ class Sku(Model): :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, 5). + (Premium) family (1, 2, 3, 4). :type capacity: int """ diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models_py3.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models_py3.py index 1c91dba42161..2d87cd5e0416 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models_py3.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_models_py3.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class CheckNameAvailabilityParameters(Model): @@ -49,6 +50,110 @@ class CloudError(Model): } +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.redis.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.redis.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: ~azure.mgmt.redis.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class ExportRDBParameters(Model): """Parameters for Redis export operation. @@ -182,6 +287,29 @@ def __init__(self, *, provider: str=None, operation: str=None, resource: str=Non self.description = description +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + class Resource(Model): """The Resource definition. @@ -215,6 +343,131 @@ def __init__(self, **kwargs) -> None: self.type = None +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection 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 private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.redis.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.redis.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.redis.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, private_link_service_connection_state, private_endpoint=None, provisioning_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state + + +class PrivateLinkResource(Resource): + """A private link resource. + + 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 + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, *, required_zone_names=None, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.redis.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, actions_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + class ProxyResource(Resource): """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. @@ -298,6 +551,13 @@ class RedisCommonProperties(Model): TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion + :param public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess """ _attribute_map = { @@ -307,9 +567,10 @@ class RedisCommonProperties(Model): 'tenant_settings': {'key': 'tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, } - def __init__(self, *, redis_configuration=None, enable_non_ssl_port: bool=None, replicas_per_master: int=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, **kwargs) -> None: + def __init__(self, *, redis_configuration=None, enable_non_ssl_port: bool=None, replicas_per_master: int=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, public_network_access=None, **kwargs) -> None: super(RedisCommonProperties, self).__init__(**kwargs) self.redis_configuration = redis_configuration self.enable_non_ssl_port = enable_non_ssl_port @@ -317,6 +578,7 @@ def __init__(self, *, redis_configuration=None, enable_non_ssl_port: bool=None, self.tenant_settings = tenant_settings self.shard_count = shard_count self.minimum_tls_version = minimum_tls_version + self.public_network_access = public_network_access class RedisCreateParameters(Model): @@ -343,6 +605,13 @@ class RedisCreateParameters(Model): TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion + :param public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess :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 @@ -375,6 +644,7 @@ class RedisCreateParameters(Model): 'tenant_settings': {'key': 'properties.tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'properties.shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, 'sku': {'key': 'properties.sku', 'type': 'Sku'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'static_ip': {'key': 'properties.staticIP', 'type': 'str'}, @@ -383,7 +653,7 @@ class RedisCreateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, sku, location: str, redis_configuration=None, enable_non_ssl_port: bool=None, replicas_per_master: int=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: + def __init__(self, *, sku, location: str, redis_configuration=None, enable_non_ssl_port: bool=None, replicas_per_master: int=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, public_network_access=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 @@ -391,6 +661,7 @@ def __init__(self, *, sku, location: str, redis_configuration=None, enable_non_s self.tenant_settings = tenant_settings self.shard_count = shard_count self.minimum_tls_version = minimum_tls_version + self.public_network_access = public_network_access self.sku = sku self.subnet_id = subnet_id self.static_ip = static_ip @@ -423,6 +694,13 @@ class RedisCreateProperties(RedisCommonProperties): 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 public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess :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 @@ -447,13 +725,14 @@ class RedisCreateProperties(RedisCommonProperties): 'tenant_settings': {'key': 'tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'subnet_id': {'key': 'subnetId', 'type': 'str'}, 'static_ip': {'key': 'staticIP', 'type': 'str'}, } - def __init__(self, *, sku, redis_configuration=None, enable_non_ssl_port: bool=None, replicas_per_master: int=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, subnet_id: str=None, static_ip: str=None, **kwargs) -> None: - super(RedisCreateProperties, self).__init__(redis_configuration=redis_configuration, enable_non_ssl_port=enable_non_ssl_port, replicas_per_master=replicas_per_master, tenant_settings=tenant_settings, shard_count=shard_count, minimum_tls_version=minimum_tls_version, **kwargs) + def __init__(self, *, sku, redis_configuration=None, enable_non_ssl_port: bool=None, replicas_per_master: int=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, public_network_access=None, subnet_id: str=None, static_ip: str=None, **kwargs) -> None: + super(RedisCreateProperties, self).__init__(redis_configuration=redis_configuration, enable_non_ssl_port=enable_non_ssl_port, replicas_per_master=replicas_per_master, tenant_settings=tenant_settings, shard_count=shard_count, minimum_tls_version=minimum_tls_version, public_network_access=public_network_access, **kwargs) self.sku = sku self.subnet_id = subnet_id self.static_ip = static_ip @@ -878,6 +1157,13 @@ class RedisResource(TrackedResource): TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion + :param public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess :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 @@ -908,6 +1194,10 @@ class RedisResource(TrackedResource): :vartype linked_servers: list[~azure.mgmt.redis.models.RedisLinkedServer] :ivar instances: List of the Redis instances associated with the cache :vartype instances: list[~azure.mgmt.redis.models.RedisInstanceDetails] + :ivar private_endpoint_connections: List of private endpoint connection + associated with the specified redis cache + :vartype private_endpoint_connections: + list[~azure.mgmt.redis.models.PrivateEndpointConnection] :param zones: A list of availability zones denoting where the resource needs to come from. :type zones: list[str] @@ -929,6 +1219,7 @@ class RedisResource(TrackedResource): 'access_keys': {'readonly': True}, 'linked_servers': {'readonly': True}, 'instances': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -943,6 +1234,7 @@ class RedisResource(TrackedResource): 'tenant_settings': {'key': 'properties.tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'properties.shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, 'sku': {'key': 'properties.sku', 'type': 'Sku'}, 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'static_ip': {'key': 'properties.staticIP', 'type': 'str'}, @@ -954,10 +1246,11 @@ class RedisResource(TrackedResource): 'access_keys': {'key': 'properties.accessKeys', 'type': 'RedisAccessKeys'}, 'linked_servers': {'key': 'properties.linkedServers', 'type': '[RedisLinkedServer]'}, 'instances': {'key': 'properties.instances', 'type': '[RedisInstanceDetails]'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, *, location: str, sku, tags=None, redis_configuration=None, enable_non_ssl_port: bool=None, replicas_per_master: int=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, subnet_id: str=None, static_ip: str=None, zones=None, **kwargs) -> None: + def __init__(self, *, location: str, sku, tags=None, redis_configuration=None, enable_non_ssl_port: bool=None, replicas_per_master: int=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, public_network_access=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 @@ -965,6 +1258,7 @@ def __init__(self, *, location: str, sku, tags=None, redis_configuration=None, e self.tenant_settings = tenant_settings self.shard_count = shard_count self.minimum_tls_version = minimum_tls_version + self.public_network_access = public_network_access self.sku = sku self.subnet_id = subnet_id self.static_ip = static_ip @@ -976,6 +1270,7 @@ def __init__(self, *, location: str, sku, tags=None, redis_configuration=None, e self.access_keys = None self.linked_servers = None self.instances = None + self.private_endpoint_connections = None self.zones = zones @@ -1001,6 +1296,13 @@ class RedisUpdateParameters(Model): TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' :type minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion + :param public_network_access: Whether or not public endpoint access is + allowed for this cache. Value is optional but if passed in, must be + 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the + exclusive access method. Default value is 'Enabled'. Possible values + include: 'Enabled', 'Disabled' + :type public_network_access: str or + ~azure.mgmt.redis.models.PublicNetworkAccess :param sku: The SKU of the Redis cache to deploy. :type sku: ~azure.mgmt.redis.models.Sku :param tags: Resource tags. @@ -1014,11 +1316,12 @@ class RedisUpdateParameters(Model): 'tenant_settings': {'key': 'properties.tenantSettings', 'type': '{str}'}, 'shard_count': {'key': 'properties.shardCount', 'type': 'int'}, 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', '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, replicas_per_master: int=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, sku=None, tags=None, **kwargs) -> None: + def __init__(self, *, redis_configuration=None, enable_non_ssl_port: bool=None, replicas_per_master: int=None, tenant_settings=None, shard_count: int=None, minimum_tls_version=None, public_network_access=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 @@ -1026,6 +1329,7 @@ def __init__(self, *, redis_configuration=None, enable_non_ssl_port: bool=None, self.tenant_settings = tenant_settings self.shard_count = shard_count self.minimum_tls_version = minimum_tls_version + self.public_network_access = public_network_access self.sku = sku self.tags = tags @@ -1079,7 +1383,7 @@ class Sku(Model): :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, 5). + (Premium) family (1, 2, 3, 4). :type capacity: int """ diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_paged_models.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_paged_models.py index 8b9d7b951f13..d1c3345a94d9 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_paged_models.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_paged_models.py @@ -77,3 +77,29 @@ class RedisLinkedServerWithPropertiesPaged(Paged): def __init__(self, *args, **kwargs): super(RedisLinkedServerWithPropertiesPaged, self).__init__(*args, **kwargs) +class PrivateEndpointConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) +class PrivateLinkResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkResource]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_redis_management_client_enums.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_redis_management_client_enums.py index 4c475a383569..274ecdbe2439 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_redis_management_client_enums.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/models/_redis_management_client_enums.py @@ -32,6 +32,12 @@ class TlsVersion(str, Enum): one_full_stop_two = "1.2" +class PublicNetworkAccess(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class ProvisioningState(str, Enum): creating = "Creating" @@ -48,6 +54,21 @@ class ProvisioningState(str, Enum): updating = "Updating" +class PrivateEndpointServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + + +class PrivateEndpointConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + failed = "Failed" + + class RedisKeyType(str, Enum): primary = "Primary" diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/__init__.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/__init__.py index 11b9d4d15725..252a24196fe9 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/__init__.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/__init__.py @@ -14,6 +14,8 @@ from ._firewall_rules_operations import FirewallRulesOperations from ._patch_schedules_operations import PatchSchedulesOperations from ._linked_server_operations import LinkedServerOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations __all__ = [ 'Operations', @@ -21,4 +23,6 @@ 'FirewallRulesOperations', 'PatchSchedulesOperations', 'LinkedServerOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', ] diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_firewall_rules_operations.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_firewall_rules_operations.py index 45b5e892ce4f..e3842fdddd88 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_firewall_rules_operations.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_firewall_rules_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class FirewallRulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-07-01". + :ivar api_version: Client Api Version. Constant value: "2020-06-01". """ models = models @@ -35,11 +34,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2020-06-01" self.config = config - def list_by_redis_resource( + def list( self, resource_group_name, cache_name, custom_headers=None, raw=False, **operation_config): """Gets all firewall rules in the specified redis cache. @@ -55,12 +54,13 @@ def list_by_redis_resource( :return: An iterator like instance of RedisFirewallRule :rtype: ~azure.mgmt.redis.models.RedisFirewallRulePaged[~azure.mgmt.redis.models.RedisFirewallRule] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_redis_resource.metadata['url'] + url = self.list.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'), @@ -96,9 +96,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -109,7 +107,7 @@ def internal_paging(next_link=None): deserialized = models.RedisFirewallRulePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_redis_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules'} + list.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): @@ -133,7 +131,8 @@ def create_or_update( :return: RedisFirewallRule or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.RedisFirewallRule or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ parameters = models.RedisFirewallRuleCreateParameters(start_ip=start_ip, end_ip=end_ip) @@ -170,9 +169,7 @@ def create_or_update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -185,7 +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}'} + 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): @@ -205,7 +202,8 @@ def get( :return: RedisFirewallRule or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.RedisFirewallRule or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -236,9 +234,7 @@ def get( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -249,7 +245,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'} + 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): @@ -268,7 +264,8 @@ def delete( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -298,11 +295,9 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) 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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}'} diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_linked_server_operations.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_linked_server_operations.py index 941d67751254..2aab48973685 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_linked_server_operations.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_linked_server_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -27,7 +26,7 @@ class LinkedServerOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-07-01". + :ivar api_version: Client Api Version. Constant value: "2020-06-01". """ models = models @@ -37,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2020-06-01" self.config = config @@ -77,9 +76,7 @@ def _create_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -121,7 +118,8 @@ def create( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.redis.models.RedisLinkedServerWithProperties] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.redis.models.RedisLinkedServerWithProperties]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._create_initial( resource_group_name=resource_group_name, @@ -149,7 +147,7 @@ def get_long_running_output(response): 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}'} + 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): @@ -169,7 +167,8 @@ def delete( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -198,15 +197,13 @@ def delete( 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) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) 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}'} + 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): @@ -228,7 +225,8 @@ def get( raw=true :rtype: ~azure.mgmt.redis.models.RedisLinkedServerWithProperties or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -259,9 +257,7 @@ def get( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -272,7 +268,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'} + 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): @@ -291,7 +287,8 @@ def list( :return: An iterator like instance of RedisLinkedServerWithProperties :rtype: ~azure.mgmt.redis.models.RedisLinkedServerWithPropertiesPaged[~azure.mgmt.redis.models.RedisLinkedServerWithProperties] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -332,9 +329,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -345,4 +340,4 @@ def internal_paging(next_link=None): deserialized = models.RedisLinkedServerWithPropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers'} diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_operations.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_operations.py index 43b4879e8b37..14162b12f82b 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_operations.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-07-01". + :ivar api_version: Client Api Version. Constant value: "2020-06-01". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2020-06-01" self.config = config @@ -52,7 +51,8 @@ def list( :return: An iterator like instance of Operation :rtype: ~azure.mgmt.redis.models.OperationPaged[~azure.mgmt.redis.models.Operation] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -87,9 +87,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorResponseException(self._deserialize, response) return response diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_patch_schedules_operations.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_patch_schedules_operations.py index d8f7074a7e45..f0eeebb72599 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_patch_schedules_operations.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_patch_schedules_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class PatchSchedulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-07-01". + :ivar api_version: Client Api Version. Constant value: "2020-06-01". :ivar default: Default string modeled as parameter for auto generation to work correctly. Constant value: "default". """ @@ -36,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2020-06-01" self.default = "default" self.config = config @@ -58,7 +57,8 @@ def list_by_redis_resource( :return: An iterator like instance of RedisPatchSchedule :rtype: ~azure.mgmt.redis.models.RedisPatchSchedulePaged[~azure.mgmt.redis.models.RedisPatchSchedule] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -99,9 +99,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -112,12 +110,11 @@ def internal_paging(next_link=None): deserialized = models.RedisPatchSchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_redis_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/patchSchedules'} + 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 - Premium SKU). + """Create or replace the patching schedule for Redis cache. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -133,7 +130,8 @@ def create_or_update( :return: RedisPatchSchedule or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.RedisPatchSchedule or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ parameters = models.RedisPatchSchedule(schedule_entries=schedule_entries) @@ -170,9 +168,7 @@ def create_or_update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -185,11 +181,11 @@ 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}'} + 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): - """Deletes the patching schedule of a redis cache (requires Premium SKU). + """Deletes the patching schedule of a redis cache. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -202,7 +198,8 @@ def delete( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -232,18 +229,16 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) 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}'} + 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): - """Gets the patching schedule of a redis cache (requires Premium SKU). + """Gets the patching schedule of a redis cache. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -257,7 +252,8 @@ def get( :return: RedisPatchSchedule or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.RedisPatchSchedule or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -288,9 +284,7 @@ def get( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -301,4 +295,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}'} diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_private_endpoint_connections_operations.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..74870de60cd7 --- /dev/null +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,341 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2020-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-01" + + self.config = config + + def list( + self, resource_group_name, cache_name, custom_headers=None, raw=False, **operation_config): + """List all the private endpoint connections associated with the redis + cache. + + :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 PrivateEndpointConnection + :rtype: + ~azure.mgmt.redis.models.PrivateEndpointConnectionPaged[~azure.mgmt.redis.models.PrivateEndpointConnection] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + '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') + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections'} + + def get( + self, resource_group_name, cache_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + redis cache. + + :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 private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.redis.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + 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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _put_initial( + self, resource_group_name, cache_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.put.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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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') + + # 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()) + 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(properties, 'PrivateEndpointConnection') + + # Construct and send request + 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 [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put( + self, resource_group_name, cache_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the state of specified private endpoint connection associated + with the redis cache. + + :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 private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: ~azure.mgmt.redis.models.PrivateEndpointConnection + :param dict custom_headers: headers that will be added to the request + :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 + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.redis.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.redis.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._put_initial( + resource_group_name=resource_group_name, + cache_name=cache_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.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) + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def delete( + self, resource_group_name, cache_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Deletes the specified private endpoint connection associated with the + redis cache. + + :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 private_endpoint_connection_name: The name of the private + endpoint connection associated with the Azure resource + :type private_endpoint_connection_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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') + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_private_link_resources_operations.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..94f1f6300c6d --- /dev/null +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_private_link_resources_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2020-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-01" + + self.config = config + + def list_by_redis_cache( + self, resource_group_name, cache_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a redis + cache. + + :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 PrivateLinkResource + :rtype: + ~azure.mgmt.redis.models.PrivateLinkResourcePaged[~azure.mgmt.redis.models.PrivateLinkResource] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_redis_cache.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'), + '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') + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_redis_cache.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateLinkResources'} diff --git a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_redis_operations.py b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_redis_operations.py index 12342176ca06..9c0b28722dd7 100644 --- a/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_redis_operations.py +++ b/sdk/redis/azure-mgmt-redis/azure/mgmt/redis/operations/_redis_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -27,7 +26,7 @@ class RedisOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-07-01". + :ivar api_version: Client Api Version. Constant value: "2020-06-01". """ models = models @@ -37,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2020-06-01" self.config = config @@ -57,7 +56,8 @@ def check_name_availability( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ parameters = models.CheckNameAvailabilityParameters(name=name, type=type) @@ -90,9 +90,7 @@ def check_name_availability( 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 + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -118,7 +116,8 @@ def list_upgrade_notifications( :return: NotificationListResponse or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.NotificationListResponse or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.list_upgrade_notifications.metadata['url'] @@ -149,9 +148,7 @@ def list_upgrade_notifications( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -162,7 +159,7 @@ def list_upgrade_notifications( return client_raw_response return deserialized - list_upgrade_notifications.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listUpgradeNotifications'} + list_upgrade_notifications.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/listUpgradeNotifications'} def _create_initial( @@ -199,9 +196,7 @@ def _create_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -238,7 +233,8 @@ def create( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.redis.models.RedisResource] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.redis.models.RedisResource]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._create_initial( resource_group_name=resource_group_name, @@ -265,7 +261,7 @@ def get_long_running_output(response): 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}'} + 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): @@ -285,7 +281,8 @@ def update( :return: RedisResource or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.RedisResource or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.update.metadata['url'] @@ -319,9 +316,7 @@ def update( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -332,7 +327,7 @@ def update( return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}'} def _delete_initial( @@ -364,9 +359,7 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -389,7 +382,8 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -411,7 +405,7 @@ def get_long_running_output(response): 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}'} + 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): @@ -429,7 +423,8 @@ def get( :return: RedisResource or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.RedisResource or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -459,9 +454,7 @@ def get( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -472,7 +465,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'} + 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): @@ -488,7 +481,8 @@ def list_by_resource_group( :return: An iterator like instance of RedisResource :rtype: ~azure.mgmt.redis.models.RedisResourcePaged[~azure.mgmt.redis.models.RedisResource] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -528,9 +522,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -541,9 +533,9 @@ def internal_paging(next_link=None): deserialized = models.RedisResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis'} - def list( + def list_by_subscription( self, custom_headers=None, raw=False, **operation_config): """Gets all Redis caches in the specified subscription. @@ -555,12 +547,13 @@ def list( :return: An iterator like instance of RedisResource :rtype: ~azure.mgmt.redis.models.RedisResourcePaged[~azure.mgmt.redis.models.RedisResource] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list_by_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -594,9 +587,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -607,7 +598,7 @@ def internal_paging(next_link=None): deserialized = models.RedisResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis'} + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Cache/redis'} def list_keys( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): @@ -626,7 +617,8 @@ def list_keys( :return: RedisAccessKeys or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.RedisAccessKeys or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.list_keys.metadata['url'] @@ -656,9 +648,7 @@ def list_keys( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -669,7 +659,7 @@ def list_keys( return client_raw_response return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys'} + 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): @@ -691,7 +681,8 @@ def regenerate_key( :return: RedisAccessKeys or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.RedisAccessKeys or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ parameters = models.RedisRegenerateKeyParameters(key_type=key_type) @@ -727,9 +718,7 @@ def regenerate_key( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -740,7 +729,7 @@ def regenerate_key( return client_raw_response return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey'} + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/regenerateKey'} def force_reboot( self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): @@ -761,7 +750,8 @@ def force_reboot( :return: RedisForceRebootResponse or ClientRawResponse if raw=true :rtype: ~azure.mgmt.redis.models.RedisForceRebootResponse or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.force_reboot.metadata['url'] @@ -795,9 +785,7 @@ def force_reboot( 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -808,7 +796,7 @@ def force_reboot( return client_raw_response return deserialized - force_reboot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot'} + force_reboot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/forceReboot'} def _import_data_initial( @@ -846,9 +834,7 @@ def _import_data_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -875,7 +861,8 @@ def import_data( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._import_data_initial( resource_group_name=resource_group_name, @@ -899,7 +886,7 @@ def get_long_running_output(response): 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'} + import_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/import'} def _export_data_initial( @@ -935,9 +922,7 @@ def _export_data_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -962,7 +947,8 @@ def export_data( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._export_data_initial( resource_group_name=resource_group_name, @@ -985,4 +971,4 @@ def get_long_running_output(response): 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'} + export_data.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/export'}