From b094e9f04360e4626b8851104eae03481e4f5495 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 1 Oct 2018 02:47:24 +0000 Subject: [PATCH] Generated from 76883a32f2c9aa596a7c0ceefb356637708d6ed3 Change 'primary' to 'master' in replication specs --- .../azure/mgmt/rdbms/mysql/models/__init__.py | 3 + .../azure/mgmt/rdbms/mysql/models/server.py | 14 +++ .../models/server_properties_for_create.py | 5 +- .../server_properties_for_create_py3.py | 5 +- .../models/server_properties_for_replica.py | 51 ++++++++ .../server_properties_for_replica_py3.py | 51 ++++++++ .../mgmt/rdbms/mysql/models/server_py3.py | 16 ++- .../mysql/models/server_update_parameters.py | 4 + .../models/server_update_parameters_py3.py | 6 +- .../rdbms/mysql/my_sql_management_client.py | 5 + .../mgmt/rdbms/mysql/operations/__init__.py | 2 + .../mysql/operations/replicas_operations.py | 110 ++++++++++++++++++ 12 files changed, 266 insertions(+), 6 deletions(-) create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_replica.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_replica_py3.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/replicas_operations.py diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py index 303de26f6bb1..7abae0f1efde 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py @@ -17,6 +17,7 @@ from .server_properties_for_default_create_py3 import ServerPropertiesForDefaultCreate from .server_properties_for_restore_py3 import ServerPropertiesForRestore from .server_properties_for_geo_restore_py3 import ServerPropertiesForGeoRestore + from .server_properties_for_replica_py3 import ServerPropertiesForReplica from .sku_py3 import Sku from .server_py3 import Server from .server_for_create_py3 import ServerForCreate @@ -42,6 +43,7 @@ from .server_properties_for_default_create import ServerPropertiesForDefaultCreate from .server_properties_for_restore import ServerPropertiesForRestore from .server_properties_for_geo_restore import ServerPropertiesForGeoRestore + from .server_properties_for_replica import ServerPropertiesForReplica from .sku import Sku from .server import Server from .server_for_create import ServerForCreate @@ -85,6 +87,7 @@ 'ServerPropertiesForDefaultCreate', 'ServerPropertiesForRestore', 'ServerPropertiesForGeoRestore', + 'ServerPropertiesForReplica', 'Sku', 'Server', 'ServerForCreate', diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server.py index 116986a98b90..03ac4096b901 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server.py @@ -54,6 +54,13 @@ class Server(TrackedResource): :type earliest_restore_date: datetime :param storage_profile: Storage profile of a server. :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile + :param replication_role: The replication role of the server. + :type replication_role: str + :param master_server_id: The master server id of a relica server. + :type master_server_id: str + :param replica_capacity: The maximum number of replicas that a master + server can have. + :type replica_capacity: int """ _validation = { @@ -61,6 +68,7 @@ class Server(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'replica_capacity': {'minimum': 0}, } _attribute_map = { @@ -77,6 +85,9 @@ class Server(TrackedResource): 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'replication_role': {'key': 'properties.replicationRole', 'type': 'str'}, + 'master_server_id': {'key': 'properties.masterServerId', 'type': 'str'}, + 'replica_capacity': {'key': 'properties.replicaCapacity', 'type': 'int'}, } def __init__(self, **kwargs): @@ -89,3 +100,6 @@ def __init__(self, **kwargs): self.fully_qualified_domain_name = kwargs.get('fully_qualified_domain_name', None) self.earliest_restore_date = kwargs.get('earliest_restore_date', None) self.storage_profile = kwargs.get('storage_profile', None) + self.replication_role = kwargs.get('replication_role', None) + self.master_server_id = kwargs.get('master_server_id', None) + self.replica_capacity = kwargs.get('replica_capacity', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py index 9484fd87e327..3c99ea2a4f90 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py @@ -17,7 +17,8 @@ class ServerPropertiesForCreate(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ServerPropertiesForDefaultCreate, - ServerPropertiesForRestore, ServerPropertiesForGeoRestore + ServerPropertiesForRestore, ServerPropertiesForGeoRestore, + ServerPropertiesForReplica All required parameters must be populated in order to send to Azure. @@ -45,7 +46,7 @@ class ServerPropertiesForCreate(Model): } _subtype_map = { - 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'} + 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore', 'Replica': 'ServerPropertiesForReplica'} } def __init__(self, **kwargs): diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create_py3.py index 99460d06ef3d..97ae29e318f1 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create_py3.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create_py3.py @@ -17,7 +17,8 @@ class ServerPropertiesForCreate(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ServerPropertiesForDefaultCreate, - ServerPropertiesForRestore, ServerPropertiesForGeoRestore + ServerPropertiesForRestore, ServerPropertiesForGeoRestore, + ServerPropertiesForReplica All required parameters must be populated in order to send to Azure. @@ -45,7 +46,7 @@ class ServerPropertiesForCreate(Model): } _subtype_map = { - 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'} + 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore', 'Replica': 'ServerPropertiesForReplica'} } def __init__(self, *, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None: diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_replica.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_replica.py new file mode 100644 index 000000000000..4af6fae1e5fe --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_replica.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .server_properties_for_create import ServerPropertiesForCreate + + +class ServerPropertiesForReplica(ServerPropertiesForCreate): + """The properties to create a new replica. + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + :param source_server_id: Required. The master server id to create replica + from. + :type source_server_id: str + """ + + _validation = { + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerPropertiesForReplica, self).__init__(**kwargs) + self.source_server_id = kwargs.get('source_server_id', None) + self.create_mode = 'Replica' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_replica_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_replica_py3.py new file mode 100644 index 000000000000..0505acc6c8cc --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_replica_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .server_properties_for_create_py3 import ServerPropertiesForCreate + + +class ServerPropertiesForReplica(ServerPropertiesForCreate): + """The properties to create a new replica. + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + :param source_server_id: Required. The master server id to create replica + from. + :type source_server_id: str + """ + + _validation = { + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + } + + def __init__(self, *, source_server_id: str, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None: + super(ServerPropertiesForReplica, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs) + self.source_server_id = source_server_id + self.create_mode = 'Replica' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_py3.py index 74b39f0e3560..157822716bdb 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_py3.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_py3.py @@ -54,6 +54,13 @@ class Server(TrackedResource): :type earliest_restore_date: datetime :param storage_profile: Storage profile of a server. :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile + :param replication_role: The replication role of the server. + :type replication_role: str + :param master_server_id: The master server id of a relica server. + :type master_server_id: str + :param replica_capacity: The maximum number of replicas that a master + server can have. + :type replica_capacity: int """ _validation = { @@ -61,6 +68,7 @@ class Server(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'replica_capacity': {'minimum': 0}, } _attribute_map = { @@ -77,9 +85,12 @@ class Server(TrackedResource): 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'replication_role': {'key': 'properties.replicationRole', 'type': 'str'}, + 'master_server_id': {'key': 'properties.masterServerId', 'type': 'str'}, + 'replica_capacity': {'key': 'properties.replicaCapacity', 'type': 'int'}, } - def __init__(self, *, location: str, tags=None, sku=None, administrator_login: str=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name: str=None, earliest_restore_date=None, storage_profile=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, sku=None, administrator_login: str=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name: str=None, earliest_restore_date=None, storage_profile=None, replication_role: str=None, master_server_id: str=None, replica_capacity: int=None, **kwargs) -> None: super(Server, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.administrator_login = administrator_login @@ -89,3 +100,6 @@ def __init__(self, *, location: str, tags=None, sku=None, administrator_login: s self.fully_qualified_domain_name = fully_qualified_domain_name self.earliest_restore_date = earliest_restore_date self.storage_profile = storage_profile + self.replication_role = replication_role + self.master_server_id = master_server_id + self.replica_capacity = replica_capacity diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py index 08a3d3dbc8e9..222299107d6a 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py @@ -29,6 +29,8 @@ class ServerUpdateParameters(Model): server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum + :param replication_role: The replication role of the server. + :type replication_role: str :param tags: Application-specific metadata in the form of key-value pairs. :type tags: dict[str, str] """ @@ -39,6 +41,7 @@ class ServerUpdateParameters(Model): 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'replication_role': {'key': 'properties.replicationRole', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -49,4 +52,5 @@ def __init__(self, **kwargs): self.administrator_login_password = kwargs.get('administrator_login_password', None) self.version = kwargs.get('version', None) self.ssl_enforcement = kwargs.get('ssl_enforcement', None) + self.replication_role = kwargs.get('replication_role', None) self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters_py3.py index 4d06bdc1e3ca..869a81a0767e 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters_py3.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters_py3.py @@ -29,6 +29,8 @@ class ServerUpdateParameters(Model): server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum + :param replication_role: The replication role of the server. + :type replication_role: str :param tags: Application-specific metadata in the form of key-value pairs. :type tags: dict[str, str] """ @@ -39,14 +41,16 @@ class ServerUpdateParameters(Model): 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'replication_role': {'key': 'properties.replicationRole', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, sku=None, storage_profile=None, administrator_login_password: str=None, version=None, ssl_enforcement=None, tags=None, **kwargs) -> None: + def __init__(self, *, sku=None, storage_profile=None, administrator_login_password: str=None, version=None, ssl_enforcement=None, replication_role: str=None, tags=None, **kwargs) -> None: super(ServerUpdateParameters, self).__init__(**kwargs) self.sku = sku self.storage_profile = storage_profile self.administrator_login_password = administrator_login_password self.version = version self.ssl_enforcement = ssl_enforcement + self.replication_role = replication_role self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py index 7982031ce894..fa95461b700b 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py @@ -14,6 +14,7 @@ from msrestazure import AzureConfiguration from .version import VERSION from .operations.servers_operations import ServersOperations +from .operations.replicas_operations import ReplicasOperations from .operations.firewall_rules_operations import FirewallRulesOperations from .operations.virtual_network_rules_operations import VirtualNetworkRulesOperations from .operations.databases_operations import DatabasesOperations @@ -67,6 +68,8 @@ class MySQLManagementClient(SDKClient): :ivar servers: Servers operations :vartype servers: azure.mgmt.rdbms.mysql.operations.ServersOperations + :ivar replicas: Replicas operations + :vartype replicas: azure.mgmt.rdbms.mysql.operations.ReplicasOperations :ivar firewall_rules: FirewallRules operations :vartype firewall_rules: azure.mgmt.rdbms.mysql.operations.FirewallRulesOperations :ivar virtual_network_rules: VirtualNetworkRules operations @@ -108,6 +111,8 @@ def __init__( self.servers = ServersOperations( self._client, self.config, self._serialize, self._deserialize) + self.replicas = ReplicasOperations( + self._client, self.config, self._serialize, self._deserialize) self.firewall_rules = FirewallRulesOperations( self._client, self.config, self._serialize, self._deserialize) self.virtual_network_rules = VirtualNetworkRulesOperations( diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py index 27ac2e7b90d4..ba9e371e6e75 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from .servers_operations import ServersOperations +from .replicas_operations import ReplicasOperations from .firewall_rules_operations import FirewallRulesOperations from .virtual_network_rules_operations import VirtualNetworkRulesOperations from .databases_operations import DatabasesOperations @@ -22,6 +23,7 @@ __all__ = [ 'ServersOperations', + 'ReplicasOperations', 'FirewallRulesOperations', 'VirtualNetworkRulesOperations', 'DatabasesOperations', diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/replicas_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/replicas_operations.py new file mode 100644 index 000000000000..17718800d840 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/replicas_operations.py @@ -0,0 +1,110 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ReplicasOperations(object): + """ReplicasOperations operations. + + :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: The API version to use for the request. Constant value: "2017-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-01" + + self.config = config + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """List all the replicas for a given server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_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 Server + :rtype: + ~azure.mgmt.rdbms.mysql.models.ServerPaged[~azure.mgmt.rdbms.mysql.models.Server] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_server.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'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ServerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/replicas'}