Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR mysql/resource-manager] Add mysql replica APIs into spec #3468

Merged
merged 1 commit into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -85,6 +87,7 @@
'ServerPropertiesForDefaultCreate',
'ServerPropertiesForRestore',
'ServerPropertiesForGeoRestore',
'ServerPropertiesForReplica',
'Sku',
'Server',
'ServerForCreate',
Expand Down
14 changes: 14 additions & 0 deletions azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,21 @@ 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 = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'replica_capacity': {'minimum': 0},
}

_attribute_map = {
Expand All @@ -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):
Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
@@ -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'
16 changes: 15 additions & 1 deletion azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,21 @@ 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 = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'replica_capacity': {'minimum': 0},
}

_attribute_map = {
Expand All @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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]
"""
Expand All @@ -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}'},
}

Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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]
"""
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,6 +23,7 @@

__all__ = [
'ServersOperations',
'ReplicasOperations',
'FirewallRulesOperations',
'VirtualNetworkRulesOperations',
'DatabasesOperations',
Expand Down
Loading