Skip to content
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
30 changes: 28 additions & 2 deletions azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from .replication_link import ReplicationLink
from .server import Server
from .server_metric import ServerMetric
from .service_objective import ServiceObjective
from .recommended_elastic_pool_metric import RecommendedElasticPoolMetric
from .slo_usage_metric import SloUsageMetric
from .service_tier_advisor import ServiceTierAdvisor
Expand All @@ -46,10 +47,16 @@
from .elastic_pool_activity import ElasticPoolActivity
from .elastic_pool_database_activity import ElasticPoolDatabaseActivity
from .database_metric import DatabaseMetric
from .service_objective import ServiceObjective
from .transparent_data_encryption_activity import TransparentDataEncryptionActivity
from .server_azure_ad_administrator import ServerAzureADAdministrator
from .sql_sub_resource import SqlSubResource
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 import FailoverGroup
from .vnet_firewall_rule import VnetFirewallRule
from .restore_point_paged import RestorePointPaged
from .replication_link_paged import ReplicationLinkPaged
from .database_paged import DatabasePaged
Expand All @@ -65,6 +72,9 @@
from .elastic_pool_database_activity_paged import ElasticPoolDatabaseActivityPaged
from .recommended_elastic_pool_paged import RecommendedElasticPoolPaged
from .recommended_elastic_pool_metric_paged import RecommendedElasticPoolMetricPaged
from .server_azure_ad_administrator_paged import ServerAzureADAdministratorPaged
from .failover_group_paged import FailoverGroupPaged
from .vnet_firewall_rule_paged import VnetFirewallRulePaged
from .sql_management_client_enums import (
RestorePointTypes,
CapabilityStatus,
Expand Down Expand Up @@ -92,6 +102,9 @@
SecurityAlertPolicyEmailAccountAdmins,
SecurityAlertPolicyUseServerDefault,
BlobAuditingPolicyState,
ReadWriteEndpointFailoverPolicy,
ReadOnlyEndpointFailoverPolicy,
FailoverGroupReplicationRole,
)

__all__ = [
Expand Down Expand Up @@ -120,6 +133,7 @@
'ReplicationLink',
'Server',
'ServerMetric',
'ServiceObjective',
'RecommendedElasticPoolMetric',
'SloUsageMetric',
'ServiceTierAdvisor',
Expand All @@ -132,10 +146,16 @@
'ElasticPoolActivity',
'ElasticPoolDatabaseActivity',
'DatabaseMetric',
'ServiceObjective',
'TransparentDataEncryptionActivity',
'ServerAzureADAdministrator',
'SqlSubResource',
'DatabaseSecurityAlertPolicy',
'DatabaseBlobAuditingPolicy',
'FailoverGroupReadWriteEndpoint',
'FailoverGroupReadOnlyEndpoint',
'PartnerInfo',
'FailoverGroup',
'VnetFirewallRule',
'RestorePointPaged',
'ReplicationLinkPaged',
'DatabasePaged',
Expand All @@ -151,6 +171,9 @@
'ElasticPoolDatabaseActivityPaged',
'RecommendedElasticPoolPaged',
'RecommendedElasticPoolMetricPaged',
'ServerAzureADAdministratorPaged',
'FailoverGroupPaged',
'VnetFirewallRulePaged',
'RestorePointTypes',
'CapabilityStatus',
'MaxSizeUnits',
Expand All @@ -177,4 +200,7 @@
'SecurityAlertPolicyEmailAccountAdmins',
'SecurityAlertPolicyUseServerDefault',
'BlobAuditingPolicyState',
'ReadWriteEndpointFailoverPolicy',
'ReadOnlyEndpointFailoverPolicy',
'FailoverGroupReplicationRole',
]
4 changes: 2 additions & 2 deletions azure-mgmt-sql/azure/mgmt/sql/models/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ class Database(TrackedResource):
:ivar recommended_index: The recommended indices for this database.
:vartype recommended_index: list of :class:`RecommendedIndex
<azure.mgmt.sql.models.RecommendedIndex>`
:ivar failover_group_id: The id indicating the failover group containing
this database.
:ivar failover_group_id: The resource identifier of the failover group
containing this database.
:vartype failover_group_id: str
:param read_scale: Conditional. If the database is a geo-secondary,
readScale indicates whether read-only connections are allowed to this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class DatabaseBlobAuditingPolicy(ProxyResource):
"""Contains information about a database Blob Auditing policy.
"""A database blob auditing policy.

Variables are only populated by the server, and will be ignored when
sending a request.
Expand All @@ -24,8 +24,6 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: The geo-location where the resource lives
:type location: str
:ivar kind: Resource kind.
:vartype kind: str
:param state: Specifies the state of the policy. If state is Enabled,
Expand Down Expand Up @@ -60,14 +58,12 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
'name': {'readonly': True},
'type': {'readonly': True},
'kind': {'readonly': True},
'state': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'kind': {'key': 'kind', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'},
'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'},
Expand All @@ -78,9 +74,8 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'},
}

def __init__(self, state, location=None, storage_endpoint=None, storage_account_access_key=None, retention_days=None, audit_actions_and_groups=None, storage_account_subscription_id=None, is_storage_secondary_key_in_use=None):
def __init__(self, state=None, storage_endpoint=None, storage_account_access_key=None, retention_days=None, audit_actions_and_groups=None, storage_account_subscription_id=None, is_storage_secondary_key_in_use=None):
super(DatabaseBlobAuditingPolicy, self).__init__()
self.location = location
self.kind = None
self.state = state
self.storage_endpoint = storage_endpoint
Expand Down
85 changes: 85 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/failover_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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 FailoverGroup(ProxyResource):
"""A 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
:ivar location: Resource location.
:vartype 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},
'location': {'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, tags=None, read_write_endpoint=None, read_only_endpoint=None, partner_servers=None, databases=None):
super(FailoverGroup, self).__init__()
self.location = None
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
27 changes: 27 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/failover_group_paged.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.paging import Paged


class FailoverGroupPaged(Paged):
"""
A paging container for iterating over a list of FailoverGroup object
"""

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

def __init__(self, *args, **kwargs):

super(FailoverGroupPaged, self).__init__(*args, **kwargs)
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):
"""Read-only endpoint of the failover group instance.

: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):
"""Read-write endpoint of the failover group instance.

: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
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):
"""Partner server information for the failover group.

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
Loading