Skip to content
Closed
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
16 changes: 16 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
from .operation_list_result import OperationListResult
from .database_security_alert_policy import DatabaseSecurityAlertPolicy
from .database_blob_auditing_policy import DatabaseBlobAuditingPolicy
from .failover_group_read_write_endpoint import FailoverGroupReadWriteEndpoint
from .failover_group_read_only_endpoint import FailoverGroupReadOnlyEndpoint
from .partner_info import PartnerInfo
from .failover_group_resource import FailoverGroupResource
from .failover_group_resource_list import FailoverGroupResourceList
from .firewall_rule_paged import FirewallRulePaged
from .replication_link_paged import ReplicationLinkPaged
from .restore_point_paged import RestorePointPaged
Expand Down Expand Up @@ -88,6 +93,9 @@
SecurityAlertPolicyEmailAccountAdmins,
SecurityAlertPolicyUseServerDefault,
BlobAuditingPolicyState,
ReadWriteEndpointFailoverPolicy,
ReadOnlyEndpointFailoverPolicy,
FailoverGroupReplicationRole,
)

__all__ = [
Expand Down Expand Up @@ -128,6 +136,11 @@
'OperationListResult',
'DatabaseSecurityAlertPolicy',
'DatabaseBlobAuditingPolicy',
'FailoverGroupReadWriteEndpoint',
'FailoverGroupReadOnlyEndpoint',
'PartnerInfo',
'FailoverGroupResource',
'FailoverGroupResourceList',
'FirewallRulePaged',
'ReplicationLinkPaged',
'RestorePointPaged',
Expand Down Expand Up @@ -169,4 +182,7 @@
'SecurityAlertPolicyEmailAccountAdmins',
'SecurityAlertPolicyUseServerDefault',
'BlobAuditingPolicyState',
'ReadWriteEndpointFailoverPolicy',
'ReadOnlyEndpointFailoverPolicy',
'FailoverGroupReplicationRole',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class FailoverGroupReadOnlyEndpoint(Model):
"""FailoverGroupReadOnlyEndpoint.

:param failover_policy: Failover policy of the read-only endpoint for the
failover group. Possible values include: 'Disabled', 'Enabled'
:type failover_policy: str or :class:`ReadOnlyEndpointFailoverPolicy
<azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy>`
"""

_attribute_map = {
'failover_policy': {'key': 'failoverPolicy', 'type': 'str'},
}

def __init__(self, failover_policy=None):
self.failover_policy = failover_policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class FailoverGroupReadWriteEndpoint(Model):
"""FailoverGroupReadWriteEndpoint.

:param failover_policy: Failover policy of the read-write endpoint for the
failover group. Possible values include: 'Manual', 'Automatic'
:type failover_policy: str or :class:`ReadWriteEndpointFailoverPolicy
<azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy>`
:param failover_with_data_loss_grace_period_minutes: Grace period before
failover with data loss is attempted for the read-write endpoint.
:type failover_with_data_loss_grace_period_minutes: int
"""

_attribute_map = {
'failover_policy': {'key': 'failoverPolicy', 'type': 'str'},
'failover_with_data_loss_grace_period_minutes': {'key': 'failoverWithDataLossGracePeriodMinutes', 'type': 'int'},
}

def __init__(self, failover_policy=None, failover_with_data_loss_grace_period_minutes=None):
self.failover_policy = failover_policy
self.failover_with_data_loss_grace_period_minutes = failover_with_data_loss_grace_period_minutes
84 changes: 84 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/failover_group_resource.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .proxy_resource import ProxyResource


class FailoverGroupResource(ProxyResource):
"""Contains information about failover group.

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
:param location: The geo-location where the resource lives.
:type location: str
:param tags: Resource tags.
:type tags: dict
:param read_write_endpoint: Read-write endpoint of the failover group
instance.
:type read_write_endpoint: :class:`FailoverGroupReadWriteEndpoint
<azure.mgmt.sql.models.FailoverGroupReadWriteEndpoint>`
:param read_only_endpoint: Read-only endpoint of the failover group
instance.
:type read_only_endpoint: :class:`FailoverGroupReadOnlyEndpoint
<azure.mgmt.sql.models.FailoverGroupReadOnlyEndpoint>`
:ivar replication_role: Local replication role of the failover group
instance. Possible values include: 'Primary', 'Secondary'
:vartype replication_role: str or :class:`FailoverGroupReplicationRole
<azure.mgmt.sql.models.FailoverGroupReplicationRole>`
:ivar replication_state: Replication state of the failover group instance.
:vartype replication_state: str
:param partner_servers: List of partner server information for the
failover group.
:type partner_servers: list of :class:`PartnerInfo
<azure.mgmt.sql.models.PartnerInfo>`
:param databases: List of databases in the failover group.
:type databases: list of str
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'replication_role': {'readonly': True},
'replication_state': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'read_write_endpoint': {'key': 'properties.readWriteEndpoint', 'type': 'FailoverGroupReadWriteEndpoint'},
'read_only_endpoint': {'key': 'properties.readOnlyEndpoint', 'type': 'FailoverGroupReadOnlyEndpoint'},
'replication_role': {'key': 'properties.replicationRole', 'type': 'str'},
'replication_state': {'key': 'properties.replicationState', 'type': 'str'},
'partner_servers': {'key': 'properties.partnerServers', 'type': '[PartnerInfo]'},
'databases': {'key': 'properties.databases', 'type': '[str]'},
}

def __init__(self, location=None, tags=None, read_write_endpoint=None, read_only_endpoint=None, partner_servers=None, databases=None):
super(FailoverGroupResource, self).__init__()
self.location = location
self.tags = tags
self.read_write_endpoint = read_write_endpoint
self.read_only_endpoint = read_only_endpoint
self.replication_role = None
self.replication_state = None
self.partner_servers = partner_servers
self.databases = databases
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class FailoverGroupResourceList(Model):
"""A list of failover groups.

:param value:
:type value: list of :class:`FailoverGroupResource
<azure.mgmt.sql.models.FailoverGroupResource>`
:param next_link:
:type next_link: str
"""

_attribute_map = {
'value': {'key': 'value', 'type': '[FailoverGroupResource]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}

def __init__(self, value=None, next_link=None):
self.value = value
self.next_link = next_link
45 changes: 45 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/partner_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class PartnerInfo(Model):
"""PartnerInfo.

Variables are only populated by the server, and will be ignored when
sending a request.

:param id: Resource identifier of the partner server.
:type id: str
:ivar location: Geo location of the partner server.
:vartype location: str
:ivar replication_role: Replication role of the partner server. Possible
values include: 'Primary', 'Secondary'
:vartype replication_role: str or :class:`FailoverGroupReplicationRole
<azure.mgmt.sql.models.FailoverGroupReplicationRole>`
"""

_validation = {
'location': {'readonly': True},
'replication_role': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'replication_role': {'key': 'replicationRole', 'type': 'str'},
}

def __init__(self, id=None):
self.id = id
self.location = None
self.replication_role = None
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,21 @@ class BlobAuditingPolicyState(Enum):

enabled = "Enabled"
disabled = "Disabled"


class ReadWriteEndpointFailoverPolicy(Enum):

manual = "Manual"
automatic = "Automatic"


class ReadOnlyEndpointFailoverPolicy(Enum):

disabled = "Disabled"
enabled = "Enabled"


class FailoverGroupReplicationRole(Enum):

primary = "Primary"
secondary = "Secondary"
2 changes: 2 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .servers_operations import ServersOperations
from .elastic_pools_operations import ElasticPoolsOperations
from .recommended_elastic_pools_operations import RecommendedElasticPoolsOperations
from .failover_groups_operations import FailoverGroupsOperations

__all__ = [
'CapabilitiesOperations',
Expand All @@ -23,4 +24,5 @@
'ServersOperations',
'ElasticPoolsOperations',
'RecommendedElasticPoolsOperations',
'FailoverGroupsOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ def get_replication_link(

def failover_replication_link(
self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config):
"""Failover the database replication link.
"""Sets which replica database is primary by failing over from the current
primary replica database.

:param resource_group_name: The name of the resource group that
contains the resource. You can obtain this value from the Azure
Expand Down Expand Up @@ -558,8 +559,8 @@ def get_long_running_output(response):

def failover_replication_link_allow_data_loss(
self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config):
"""Force failover the database replication link, which may result in data
loss.
"""Sets which replica database is primary by failing over from the current
primary replica database. This operation might result in data loss.

:param resource_group_name: The name of the resource group that
contains the resource. You can obtain this value from the Azure
Expand Down
Loading