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 sql/resource-manager] Adding SQL managedDatabases swagger for API v2018-06-01-preview #7329

Merged
merged 1 commit into from
Sep 18, 2019
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
15 changes: 10 additions & 5 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
from .operations import LongTermRetentionBackupsOperations
from .operations import BackupLongTermRetentionPoliciesOperations
from .operations import ManagedBackupShortTermRetentionPoliciesOperations
from .operations import ManagedDatabasesOperations
from .operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations
from .operations import ServerAutomaticTuningOperations
from .operations import ServerDnsAliasesOperations
Expand Down Expand Up @@ -96,6 +95,8 @@
from .operations import InstancePoolsOperations
from .operations import UsagesOperations
from .operations import ManagedInstancesOperations
from .operations import ManagedDatabaseRestoreDetailsOperations
from .operations import ManagedDatabasesOperations
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from . import models
Expand Down Expand Up @@ -211,8 +212,6 @@ class SqlManagementClient(SDKClient):
:vartype backup_long_term_retention_policies: azure.mgmt.sql.operations.BackupLongTermRetentionPoliciesOperations
:ivar managed_backup_short_term_retention_policies: ManagedBackupShortTermRetentionPolicies operations
:vartype managed_backup_short_term_retention_policies: azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations
:ivar managed_databases: ManagedDatabases operations
:vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations
:ivar managed_restorable_dropped_database_backup_short_term_retention_policies: ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies operations
:vartype managed_restorable_dropped_database_backup_short_term_retention_policies: azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations
:ivar server_automatic_tuning: ServerAutomaticTuning operations
Expand Down Expand Up @@ -273,6 +272,10 @@ class SqlManagementClient(SDKClient):
:vartype usages: azure.mgmt.sql.operations.UsagesOperations
:ivar managed_instances: ManagedInstances operations
:vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations
:ivar managed_database_restore_details: ManagedDatabaseRestoreDetails operations
:vartype managed_database_restore_details: azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations
:ivar managed_databases: ManagedDatabases operations
:vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations
:ivar private_endpoint_connections: PrivateEndpointConnections operations
:vartype private_endpoint_connections: azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations
:ivar private_link_resources: PrivateLinkResources operations
Expand Down Expand Up @@ -401,8 +404,6 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.managed_backup_short_term_retention_policies = ManagedBackupShortTermRetentionPoliciesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.managed_databases = ManagedDatabasesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.managed_restorable_dropped_database_backup_short_term_retention_policies = ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.server_automatic_tuning = ServerAutomaticTuningOperations(
Expand Down Expand Up @@ -463,6 +464,10 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.managed_instances = ManagedInstancesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.managed_databases = ManagedDatabasesOperations(
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(
Expand Down
17 changes: 10 additions & 7 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
from ._models_py3 import LongTermRetentionBackup
from ._models_py3 import ManagedBackupShortTermRetentionPolicy
from ._models_py3 import ManagedDatabase
from ._models_py3 import ManagedDatabaseRestoreDetailsResult
from ._models_py3 import ManagedDatabaseSecurityAlertPolicy
from ._models_py3 import ManagedDatabaseUpdate
from ._models_py3 import ManagedInstance
Expand Down Expand Up @@ -242,6 +243,7 @@
from ._models import LongTermRetentionBackup
from ._models import ManagedBackupShortTermRetentionPolicy
from ._models import ManagedDatabase
from ._models import ManagedDatabaseRestoreDetailsResult
from ._models import ManagedDatabaseSecurityAlertPolicy
from ._models import ManagedDatabaseUpdate
from ._models import ManagedInstance
Expand Down Expand Up @@ -456,9 +458,6 @@
JobStepActionSource,
JobStepOutputType,
JobTargetGroupMembershipType,
ManagedDatabaseStatus,
CatalogCollationType,
ManagedDatabaseCreateMode,
AutomaticTuningServerMode,
AutomaticTuningServerReason,
RestorePointType,
Expand All @@ -470,6 +469,7 @@
CreateMode,
SampleName,
DatabaseStatus,
CatalogCollationType,
DatabaseLicenseType,
DatabaseReadScale,
ElasticPoolState,
Expand All @@ -481,6 +481,8 @@
ManagedServerCreateMode,
ManagedInstanceLicenseType,
ManagedInstanceProxyOverride,
ManagedDatabaseStatus,
ManagedDatabaseCreateMode,
LongTermRetentionDatabaseState,
VulnerabilityAssessmentPolicyBaselineName,
SensitivityLabelSource,
Expand Down Expand Up @@ -558,6 +560,7 @@
'LongTermRetentionBackup',
'ManagedBackupShortTermRetentionPolicy',
'ManagedDatabase',
'ManagedDatabaseRestoreDetailsResult',
'ManagedDatabaseSecurityAlertPolicy',
'ManagedDatabaseUpdate',
'ManagedInstance',
Expand Down Expand Up @@ -695,7 +698,6 @@
'JobVersionPaged',
'LongTermRetentionBackupPaged',
'ManagedBackupShortTermRetentionPolicyPaged',
'ManagedDatabasePaged',
'ServerDnsAliasPaged',
'ServerSecurityAlertPolicyPaged',
'RestorableDroppedManagedDatabasePaged',
Expand All @@ -717,6 +719,7 @@
'InstancePoolPaged',
'UsagePaged',
'ManagedInstancePaged',
'ManagedDatabasePaged',
'PrivateEndpointConnectionPaged',
'PrivateLinkResourcePaged',
'CheckNameAvailabilityReason',
Expand Down Expand Up @@ -771,9 +774,6 @@
'JobStepActionSource',
'JobStepOutputType',
'JobTargetGroupMembershipType',
'ManagedDatabaseStatus',
'CatalogCollationType',
'ManagedDatabaseCreateMode',
'AutomaticTuningServerMode',
'AutomaticTuningServerReason',
'RestorePointType',
Expand All @@ -785,6 +785,7 @@
'CreateMode',
'SampleName',
'DatabaseStatus',
'CatalogCollationType',
'DatabaseLicenseType',
'DatabaseReadScale',
'ElasticPoolState',
Expand All @@ -796,6 +797,8 @@
'ManagedServerCreateMode',
'ManagedInstanceLicenseType',
'ManagedInstanceProxyOverride',
'ManagedDatabaseStatus',
'ManagedDatabaseCreateMode',
'LongTermRetentionDatabaseState',
'VulnerabilityAssessmentPolicyBaselineName',
'SensitivityLabelSource',
Expand Down
84 changes: 82 additions & 2 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4440,7 +4440,7 @@ class ManagedDatabase(TrackedResource):
:param collation: Collation of the managed database.
:type collation: str
:ivar status: Status of the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Updating'
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Restoring', 'Updating'
:vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus
:ivar creation_date: Creation date of the database.
:vartype creation_date: datetime
Expand Down Expand Up @@ -4543,6 +4543,86 @@ def __init__(self, **kwargs):
self.recoverable_database_id = kwargs.get('recoverable_database_id', None)


class ManagedDatabaseRestoreDetailsResult(ProxyResource):
"""A managed database restore details.

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 status: Restore status.
:vartype status: str
:ivar current_restoring_file_name: Current restoring file name.
:vartype current_restoring_file_name: str
:ivar last_restored_file_name: Last restored file name.
:vartype last_restored_file_name: str
:ivar last_restored_file_time: Last restored file time.
:vartype last_restored_file_time: datetime
:ivar percent_completed: Percent completed.
:vartype percent_completed: float
:ivar unrestorable_files: List of unrestorable files.
:vartype unrestorable_files: list[str]
:ivar number_of_files_detected: Number of files detected.
:vartype number_of_files_detected: long
:ivar last_uploaded_file_name: Last uploaded file name.
:vartype last_uploaded_file_name: str
:ivar last_uploaded_file_time: Last uploaded file time.
:vartype last_uploaded_file_time: datetime
:ivar block_reason: The reason why restore is in Blocked state.
:vartype block_reason: str
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'status': {'readonly': True},
'current_restoring_file_name': {'readonly': True},
'last_restored_file_name': {'readonly': True},
'last_restored_file_time': {'readonly': True},
'percent_completed': {'readonly': True},
'unrestorable_files': {'readonly': True},
'number_of_files_detected': {'readonly': True},
'last_uploaded_file_name': {'readonly': True},
'last_uploaded_file_time': {'readonly': True},
'block_reason': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'status': {'key': 'properties.status', 'type': 'str'},
'current_restoring_file_name': {'key': 'properties.currentRestoringFileName', 'type': 'str'},
'last_restored_file_name': {'key': 'properties.lastRestoredFileName', 'type': 'str'},
'last_restored_file_time': {'key': 'properties.lastRestoredFileTime', 'type': 'iso-8601'},
'percent_completed': {'key': 'properties.percentCompleted', 'type': 'float'},
'unrestorable_files': {'key': 'properties.unrestorableFiles', 'type': '[str]'},
'number_of_files_detected': {'key': 'properties.numberOfFilesDetected', 'type': 'long'},
'last_uploaded_file_name': {'key': 'properties.lastUploadedFileName', 'type': 'str'},
'last_uploaded_file_time': {'key': 'properties.lastUploadedFileTime', 'type': 'iso-8601'},
'block_reason': {'key': 'properties.blockReason', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ManagedDatabaseRestoreDetailsResult, self).__init__(**kwargs)
self.status = None
self.current_restoring_file_name = None
self.last_restored_file_name = None
self.last_restored_file_time = None
self.percent_completed = None
self.unrestorable_files = None
self.number_of_files_detected = None
self.last_uploaded_file_name = None
self.last_uploaded_file_time = None
self.block_reason = None


class ManagedDatabaseSecurityAlertPolicy(ProxyResource):
"""A managed database security alert policy.

Expand Down Expand Up @@ -4628,7 +4708,7 @@ class ManagedDatabaseUpdate(Model):
:param collation: Collation of the managed database.
:type collation: str
:ivar status: Status of the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Updating'
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Restoring', 'Updating'
:vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus
:ivar creation_date: Creation date of the database.
:vartype creation_date: datetime
Expand Down
84 changes: 82 additions & 2 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4440,7 +4440,7 @@ class ManagedDatabase(TrackedResource):
:param collation: Collation of the managed database.
:type collation: str
:ivar status: Status of the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Updating'
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Restoring', 'Updating'
:vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus
:ivar creation_date: Creation date of the database.
:vartype creation_date: datetime
Expand Down Expand Up @@ -4543,6 +4543,86 @@ def __init__(self, *, location: str, tags=None, collation: str=None, restore_poi
self.recoverable_database_id = recoverable_database_id


class ManagedDatabaseRestoreDetailsResult(ProxyResource):
"""A managed database restore details.

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 status: Restore status.
:vartype status: str
:ivar current_restoring_file_name: Current restoring file name.
:vartype current_restoring_file_name: str
:ivar last_restored_file_name: Last restored file name.
:vartype last_restored_file_name: str
:ivar last_restored_file_time: Last restored file time.
:vartype last_restored_file_time: datetime
:ivar percent_completed: Percent completed.
:vartype percent_completed: float
:ivar unrestorable_files: List of unrestorable files.
:vartype unrestorable_files: list[str]
:ivar number_of_files_detected: Number of files detected.
:vartype number_of_files_detected: long
:ivar last_uploaded_file_name: Last uploaded file name.
:vartype last_uploaded_file_name: str
:ivar last_uploaded_file_time: Last uploaded file time.
:vartype last_uploaded_file_time: datetime
:ivar block_reason: The reason why restore is in Blocked state.
:vartype block_reason: str
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'status': {'readonly': True},
'current_restoring_file_name': {'readonly': True},
'last_restored_file_name': {'readonly': True},
'last_restored_file_time': {'readonly': True},
'percent_completed': {'readonly': True},
'unrestorable_files': {'readonly': True},
'number_of_files_detected': {'readonly': True},
'last_uploaded_file_name': {'readonly': True},
'last_uploaded_file_time': {'readonly': True},
'block_reason': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'status': {'key': 'properties.status', 'type': 'str'},
'current_restoring_file_name': {'key': 'properties.currentRestoringFileName', 'type': 'str'},
'last_restored_file_name': {'key': 'properties.lastRestoredFileName', 'type': 'str'},
'last_restored_file_time': {'key': 'properties.lastRestoredFileTime', 'type': 'iso-8601'},
'percent_completed': {'key': 'properties.percentCompleted', 'type': 'float'},
'unrestorable_files': {'key': 'properties.unrestorableFiles', 'type': '[str]'},
'number_of_files_detected': {'key': 'properties.numberOfFilesDetected', 'type': 'long'},
'last_uploaded_file_name': {'key': 'properties.lastUploadedFileName', 'type': 'str'},
'last_uploaded_file_time': {'key': 'properties.lastUploadedFileTime', 'type': 'iso-8601'},
'block_reason': {'key': 'properties.blockReason', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(ManagedDatabaseRestoreDetailsResult, self).__init__(**kwargs)
self.status = None
self.current_restoring_file_name = None
self.last_restored_file_name = None
self.last_restored_file_time = None
self.percent_completed = None
self.unrestorable_files = None
self.number_of_files_detected = None
self.last_uploaded_file_name = None
self.last_uploaded_file_time = None
self.block_reason = None


class ManagedDatabaseSecurityAlertPolicy(ProxyResource):
"""A managed database security alert policy.

Expand Down Expand Up @@ -4628,7 +4708,7 @@ class ManagedDatabaseUpdate(Model):
:param collation: Collation of the managed database.
:type collation: str
:ivar status: Status of the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Updating'
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Restoring', 'Updating'
:vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus
:ivar creation_date: Creation date of the database.
:vartype creation_date: datetime
Expand Down
Loading