Skip to content

Commit

Permalink
[AutoPR sql/resource-manager] Added support for dropped databases on …
Browse files Browse the repository at this point in the history
…Managed Instance (#4103)

* Generated from b69193acc6a531e053151c7ba4aaffb07cb218a0

Added support for dropped databases on Managed Instance

* Generated from 676178334abdb40ac47516783d789272008e8488

Adding support for dropped databases on Managed Instance
  • Loading branch information
AutorestCI authored Jan 18, 2019
1 parent 565455e commit 202afff
Show file tree
Hide file tree
Showing 8 changed files with 777 additions and 0 deletions.
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
Loading

0 comments on commit 202afff

Please sign in to comment.