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] Added support for dropped databases on Managed Instance #4103

Merged
merged 2 commits into from
Jan 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
5 changes: 5 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
from .server_dns_alias_py3 import ServerDnsAlias
from .server_dns_alias_acquisition_py3 import ServerDnsAliasAcquisition
from .server_security_alert_policy_py3 import ServerSecurityAlertPolicy
from .restorable_dropped_managed_database_py3 import RestorableDroppedManagedDatabase
from .restore_point_py3 import RestorePoint
from .create_database_restore_point_definition_py3 import CreateDatabaseRestorePointDefinition
from .managed_database_security_alert_policy_py3 import ManagedDatabaseSecurityAlertPolicy
Expand Down Expand Up @@ -260,6 +261,7 @@
from .server_dns_alias import ServerDnsAlias
from .server_dns_alias_acquisition import ServerDnsAliasAcquisition
from .server_security_alert_policy import ServerSecurityAlertPolicy
from .restorable_dropped_managed_database import RestorableDroppedManagedDatabase
from .restore_point import RestorePoint
from .create_database_restore_point_definition import CreateDatabaseRestorePointDefinition
from .managed_database_security_alert_policy import ManagedDatabaseSecurityAlertPolicy
Expand Down Expand Up @@ -351,6 +353,7 @@
from .managed_backup_short_term_retention_policy_paged import ManagedBackupShortTermRetentionPolicyPaged
from .managed_database_paged import ManagedDatabasePaged
from .server_dns_alias_paged import ServerDnsAliasPaged
from .restorable_dropped_managed_database_paged import RestorableDroppedManagedDatabasePaged
from .restore_point_paged import RestorePointPaged
from .database_operation_paged import DatabaseOperationPaged
from .elastic_pool_operation_paged import ElasticPoolOperationPaged
Expand Down Expand Up @@ -544,6 +547,7 @@
'ServerDnsAlias',
'ServerDnsAliasAcquisition',
'ServerSecurityAlertPolicy',
'RestorableDroppedManagedDatabase',
'RestorePoint',
'CreateDatabaseRestorePointDefinition',
'ManagedDatabaseSecurityAlertPolicy',
Expand Down Expand Up @@ -635,6 +639,7 @@
'ManagedBackupShortTermRetentionPolicyPaged',
'ManagedDatabasePaged',
'ServerDnsAliasPaged',
'RestorableDroppedManagedDatabasePaged',
'RestorePointPaged',
'DatabaseOperationPaged',
'ElasticPoolOperationPaged',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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 .tracked_resource import TrackedResource


class RestorableDroppedManagedDatabase(TrackedResource):
"""A restorable dropped managed database resource.

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

All required parameters must be populated in order to send to Azure.

:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. Resource location.
:type location: str
:param tags: Resource tags.
:type tags: dict[str, str]
:ivar database_name: The name of the database.
:vartype database_name: str
:ivar creation_date: The creation date of the database (ISO8601 format).
:vartype creation_date: datetime
:ivar deletion_date: The deletion date of the database (ISO8601 format).
:vartype deletion_date: datetime
:ivar earliest_restore_date: The earliest restore date of the database
(ISO8601 format).
:vartype earliest_restore_date: datetime
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'database_name': {'readonly': True},
'creation_date': {'readonly': True},
'deletion_date': {'readonly': True},
'earliest_restore_date': {'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}'},
'database_name': {'key': 'properties.databaseName', 'type': 'str'},
'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'},
'deletion_date': {'key': 'properties.deletionDate', 'type': 'iso-8601'},
'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'},
}

def __init__(self, **kwargs):
super(RestorableDroppedManagedDatabase, self).__init__(**kwargs)
self.database_name = None
self.creation_date = None
self.deletion_date = None
self.earliest_restore_date = None
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 RestorableDroppedManagedDatabasePaged(Paged):
"""
A paging container for iterating over a list of :class:`RestorableDroppedManagedDatabase <azure.mgmt.sql.models.RestorableDroppedManagedDatabase>` object
"""

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

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

super(RestorableDroppedManagedDatabasePaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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 .tracked_resource_py3 import TrackedResource


class RestorableDroppedManagedDatabase(TrackedResource):
"""A restorable dropped managed database resource.

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

All required parameters must be populated in order to send to Azure.

:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. Resource location.
:type location: str
:param tags: Resource tags.
:type tags: dict[str, str]
:ivar database_name: The name of the database.
:vartype database_name: str
:ivar creation_date: The creation date of the database (ISO8601 format).
:vartype creation_date: datetime
:ivar deletion_date: The deletion date of the database (ISO8601 format).
:vartype deletion_date: datetime
:ivar earliest_restore_date: The earliest restore date of the database
(ISO8601 format).
:vartype earliest_restore_date: datetime
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'database_name': {'readonly': True},
'creation_date': {'readonly': True},
'deletion_date': {'readonly': True},
'earliest_restore_date': {'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}'},
'database_name': {'key': 'properties.databaseName', 'type': 'str'},
'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'},
'deletion_date': {'key': 'properties.deletionDate', 'type': 'iso-8601'},
'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'},
}

def __init__(self, *, location: str, tags=None, **kwargs) -> None:
super(RestorableDroppedManagedDatabase, self).__init__(location=location, tags=tags, **kwargs)
self.database_name = None
self.creation_date = None
self.deletion_date = None
self.earliest_restore_date = None
4 changes: 4 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@
from .backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations
from .managed_backup_short_term_retention_policies_operations import ManagedBackupShortTermRetentionPoliciesOperations
from .managed_databases_operations import ManagedDatabasesOperations
from .managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations
from .server_automatic_tuning_operations import ServerAutomaticTuningOperations
from .server_dns_aliases_operations import ServerDnsAliasesOperations
from .server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations
from .restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations
from .restore_points_operations import RestorePointsOperations
from .managed_database_security_alert_policies_operations import ManagedDatabaseSecurityAlertPoliciesOperations
from .managed_server_security_alert_policies_operations import ManagedServerSecurityAlertPoliciesOperations
Expand Down Expand Up @@ -138,9 +140,11 @@
'BackupLongTermRetentionPoliciesOperations',
'ManagedBackupShortTermRetentionPoliciesOperations',
'ManagedDatabasesOperations',
'ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations',
'ServerAutomaticTuningOperations',
'ServerDnsAliasesOperations',
'ServerSecurityAlertPoliciesOperations',
'RestorableDroppedManagedDatabasesOperations',
'RestorePointsOperations',
'ManagedDatabaseSecurityAlertPoliciesOperations',
'ManagedServerSecurityAlertPoliciesOperations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def get(

:param location_name: The location of the database.
:type location_name: str
:param long_term_retention_server_name:
:param long_term_retention_server_name: The name of the server
:type long_term_retention_server_name: str
:param long_term_retention_database_name:
:param long_term_retention_database_name: The name of the database
:type long_term_retention_database_name: str
:param backup_name: The backup name.
:type backup_name: str
Expand Down Expand Up @@ -153,9 +153,9 @@ def delete(

:param location_name: The location of the database
:type location_name: str
:param long_term_retention_server_name:
:param long_term_retention_server_name: The name of the server
:type long_term_retention_server_name: str
:param long_term_retention_database_name:
:param long_term_retention_database_name: The name of the database
:type long_term_retention_database_name: str
:param backup_name: The backup name.
:type backup_name: str
Expand Down Expand Up @@ -200,9 +200,9 @@ def list_by_database(

:param location_name: The location of the database
:type location_name: str
:param long_term_retention_server_name:
:param long_term_retention_server_name: The name of the server
:type long_term_retention_server_name: str
:param long_term_retention_database_name:
:param long_term_retention_database_name: The name of the database
:type long_term_retention_database_name: str
:param only_latest_per_database: Whether or not to only get the latest
backup for each database.
Expand Down Expand Up @@ -364,7 +364,7 @@ def list_by_server(

:param location_name: The location of the database
:type location_name: str
:param long_term_retention_server_name:
:param long_term_retention_server_name: The name of the server
:type long_term_retention_server_name: str
:param only_latest_per_database: Whether or not to only get the latest
backup for each database.
Expand Down
Loading