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] Updating managed database swagger #4059

Merged
merged 1 commit into from
Dec 13, 2018
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
21 changes: 17 additions & 4 deletions azure-mgmt-sql/azure/mgmt/sql/models/managed_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class ManagedDatabase(TrackedResource):
:type tags: dict[str, str]
:param collation: Collation of the managed database.
:type collation: str
:ivar status: Status for the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible'
:ivar status: Status of the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Updating'
:vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus
:ivar creation_date: Creation date of the database.
:vartype creation_date: datetime
Expand All @@ -56,8 +56,11 @@ class ManagedDatabase(TrackedResource):
database. SourceDatabaseName, SourceManagedInstanceName and PointInTime
must be specified. RestoreExternalBackup: Create a database by restoring
from external backup files. Collation, StorageContainerUri and
StorageContainerSasToken must be specified. Possible values include:
'Default', 'RestoreExternalBackup', 'PointInTimeRestore'
StorageContainerSasToken must be specified. Recovery: Creates a database
by restoring a geo-replicated backup. RecoverableDatabaseId must be
specified as the recoverable database resource ID to restore. Possible
values include: 'Default', 'RestoreExternalBackup', 'PointInTimeRestore',
'Recovery'
:type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode
:param storage_container_uri: Conditional. If createMode is
RestoreExternalBackup, this value is required. Specifies the uri of the
Expand All @@ -66,13 +69,19 @@ class ManagedDatabase(TrackedResource):
:param source_database_id: The resource identifier of the source database
associated with create operation of this database.
:type source_database_id: str
:param restorable_dropped_database_id: The restorable dropped database
resource id to restore when creating this database.
:type restorable_dropped_database_id: str
:param storage_container_sas_token: Conditional. If createMode is
RestoreExternalBackup, this value is required. Specifies the storage
container sas token.
:type storage_container_sas_token: str
:ivar failover_group_id: Instance Failover Group resource identifier that
this managed database belongs to.
:vartype failover_group_id: str
:param recoverable_database_id: The resource identifier of the recoverable
database associated with create operation of this database.
:type recoverable_database_id: str
"""

_validation = {
Expand Down Expand Up @@ -103,8 +112,10 @@ class ManagedDatabase(TrackedResource):
'create_mode': {'key': 'properties.createMode', 'type': 'str'},
'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'},
'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'},
'restorable_dropped_database_id': {'key': 'properties.restorableDroppedDatabaseId', 'type': 'str'},
'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'},
'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'},
'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'},
}

def __init__(self, **kwargs):
Expand All @@ -119,5 +130,7 @@ def __init__(self, **kwargs):
self.create_mode = kwargs.get('create_mode', None)
self.storage_container_uri = kwargs.get('storage_container_uri', None)
self.source_database_id = kwargs.get('source_database_id', None)
self.restorable_dropped_database_id = kwargs.get('restorable_dropped_database_id', None)
self.storage_container_sas_token = kwargs.get('storage_container_sas_token', None)
self.failover_group_id = None
self.recoverable_database_id = kwargs.get('recoverable_database_id', None)
23 changes: 18 additions & 5 deletions azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class ManagedDatabase(TrackedResource):
:type tags: dict[str, str]
:param collation: Collation of the managed database.
:type collation: str
:ivar status: Status for the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible'
:ivar status: Status of the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Updating'
:vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus
:ivar creation_date: Creation date of the database.
:vartype creation_date: datetime
Expand All @@ -56,8 +56,11 @@ class ManagedDatabase(TrackedResource):
database. SourceDatabaseName, SourceManagedInstanceName and PointInTime
must be specified. RestoreExternalBackup: Create a database by restoring
from external backup files. Collation, StorageContainerUri and
StorageContainerSasToken must be specified. Possible values include:
'Default', 'RestoreExternalBackup', 'PointInTimeRestore'
StorageContainerSasToken must be specified. Recovery: Creates a database
by restoring a geo-replicated backup. RecoverableDatabaseId must be
specified as the recoverable database resource ID to restore. Possible
values include: 'Default', 'RestoreExternalBackup', 'PointInTimeRestore',
'Recovery'
:type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode
:param storage_container_uri: Conditional. If createMode is
RestoreExternalBackup, this value is required. Specifies the uri of the
Expand All @@ -66,13 +69,19 @@ class ManagedDatabase(TrackedResource):
:param source_database_id: The resource identifier of the source database
associated with create operation of this database.
:type source_database_id: str
:param restorable_dropped_database_id: The restorable dropped database
resource id to restore when creating this database.
:type restorable_dropped_database_id: str
:param storage_container_sas_token: Conditional. If createMode is
RestoreExternalBackup, this value is required. Specifies the storage
container sas token.
:type storage_container_sas_token: str
:ivar failover_group_id: Instance Failover Group resource identifier that
this managed database belongs to.
:vartype failover_group_id: str
:param recoverable_database_id: The resource identifier of the recoverable
database associated with create operation of this database.
:type recoverable_database_id: str
"""

_validation = {
Expand Down Expand Up @@ -103,11 +112,13 @@ class ManagedDatabase(TrackedResource):
'create_mode': {'key': 'properties.createMode', 'type': 'str'},
'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'},
'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'},
'restorable_dropped_database_id': {'key': 'properties.restorableDroppedDatabaseId', 'type': 'str'},
'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'},
'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'},
'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'},
}

def __init__(self, *, location: str, tags=None, collation: str=None, restore_point_in_time=None, catalog_collation=None, create_mode=None, storage_container_uri: str=None, source_database_id: str=None, storage_container_sas_token: str=None, **kwargs) -> None:
def __init__(self, *, location: str, tags=None, collation: str=None, restore_point_in_time=None, catalog_collation=None, create_mode=None, storage_container_uri: str=None, source_database_id: str=None, restorable_dropped_database_id: str=None, storage_container_sas_token: str=None, recoverable_database_id: str=None, **kwargs) -> None:
super(ManagedDatabase, self).__init__(location=location, tags=tags, **kwargs)
self.collation = collation
self.status = None
Expand All @@ -119,5 +130,7 @@ def __init__(self, *, location: str, tags=None, collation: str=None, restore_poi
self.create_mode = create_mode
self.storage_container_uri = storage_container_uri
self.source_database_id = source_database_id
self.restorable_dropped_database_id = restorable_dropped_database_id
self.storage_container_sas_token = storage_container_sas_token
self.failover_group_id = None
self.recoverable_database_id = recoverable_database_id
21 changes: 17 additions & 4 deletions azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class ManagedDatabaseUpdate(Model):

:param collation: Collation of the managed database.
:type collation: str
:ivar status: Status for the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible'
:ivar status: Status of the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Updating'
:vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus
:ivar creation_date: Creation date of the database.
:vartype creation_date: datetime
Expand All @@ -44,8 +44,11 @@ class ManagedDatabaseUpdate(Model):
database. SourceDatabaseName, SourceManagedInstanceName and PointInTime
must be specified. RestoreExternalBackup: Create a database by restoring
from external backup files. Collation, StorageContainerUri and
StorageContainerSasToken must be specified. Possible values include:
'Default', 'RestoreExternalBackup', 'PointInTimeRestore'
StorageContainerSasToken must be specified. Recovery: Creates a database
by restoring a geo-replicated backup. RecoverableDatabaseId must be
specified as the recoverable database resource ID to restore. Possible
values include: 'Default', 'RestoreExternalBackup', 'PointInTimeRestore',
'Recovery'
:type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode
:param storage_container_uri: Conditional. If createMode is
RestoreExternalBackup, this value is required. Specifies the uri of the
Expand All @@ -54,13 +57,19 @@ class ManagedDatabaseUpdate(Model):
:param source_database_id: The resource identifier of the source database
associated with create operation of this database.
:type source_database_id: str
:param restorable_dropped_database_id: The restorable dropped database
resource id to restore when creating this database.
:type restorable_dropped_database_id: str
:param storage_container_sas_token: Conditional. If createMode is
RestoreExternalBackup, this value is required. Specifies the storage
container sas token.
:type storage_container_sas_token: str
:ivar failover_group_id: Instance Failover Group resource identifier that
this managed database belongs to.
:vartype failover_group_id: str
:param recoverable_database_id: The resource identifier of the recoverable
database associated with create operation of this database.
:type recoverable_database_id: str
:param tags: Resource tags.
:type tags: dict[str, str]
"""
Expand All @@ -84,8 +93,10 @@ class ManagedDatabaseUpdate(Model):
'create_mode': {'key': 'properties.createMode', 'type': 'str'},
'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'},
'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'},
'restorable_dropped_database_id': {'key': 'properties.restorableDroppedDatabaseId', 'type': 'str'},
'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'},
'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'},
'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}

Expand All @@ -101,6 +112,8 @@ def __init__(self, **kwargs):
self.create_mode = kwargs.get('create_mode', None)
self.storage_container_uri = kwargs.get('storage_container_uri', None)
self.source_database_id = kwargs.get('source_database_id', None)
self.restorable_dropped_database_id = kwargs.get('restorable_dropped_database_id', None)
self.storage_container_sas_token = kwargs.get('storage_container_sas_token', None)
self.failover_group_id = None
self.recoverable_database_id = kwargs.get('recoverable_database_id', None)
self.tags = kwargs.get('tags', None)
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class ManagedDatabaseUpdate(Model):

:param collation: Collation of the managed database.
:type collation: str
:ivar status: Status for the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible'
:ivar status: Status of the database. Possible values include: 'Online',
'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Updating'
:vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus
:ivar creation_date: Creation date of the database.
:vartype creation_date: datetime
Expand All @@ -44,8 +44,11 @@ class ManagedDatabaseUpdate(Model):
database. SourceDatabaseName, SourceManagedInstanceName and PointInTime
must be specified. RestoreExternalBackup: Create a database by restoring
from external backup files. Collation, StorageContainerUri and
StorageContainerSasToken must be specified. Possible values include:
'Default', 'RestoreExternalBackup', 'PointInTimeRestore'
StorageContainerSasToken must be specified. Recovery: Creates a database
by restoring a geo-replicated backup. RecoverableDatabaseId must be
specified as the recoverable database resource ID to restore. Possible
values include: 'Default', 'RestoreExternalBackup', 'PointInTimeRestore',
'Recovery'
:type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode
:param storage_container_uri: Conditional. If createMode is
RestoreExternalBackup, this value is required. Specifies the uri of the
Expand All @@ -54,13 +57,19 @@ class ManagedDatabaseUpdate(Model):
:param source_database_id: The resource identifier of the source database
associated with create operation of this database.
:type source_database_id: str
:param restorable_dropped_database_id: The restorable dropped database
resource id to restore when creating this database.
:type restorable_dropped_database_id: str
:param storage_container_sas_token: Conditional. If createMode is
RestoreExternalBackup, this value is required. Specifies the storage
container sas token.
:type storage_container_sas_token: str
:ivar failover_group_id: Instance Failover Group resource identifier that
this managed database belongs to.
:vartype failover_group_id: str
:param recoverable_database_id: The resource identifier of the recoverable
database associated with create operation of this database.
:type recoverable_database_id: str
:param tags: Resource tags.
:type tags: dict[str, str]
"""
Expand All @@ -84,12 +93,14 @@ class ManagedDatabaseUpdate(Model):
'create_mode': {'key': 'properties.createMode', 'type': 'str'},
'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'},
'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'},
'restorable_dropped_database_id': {'key': 'properties.restorableDroppedDatabaseId', 'type': 'str'},
'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'},
'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'},
'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}

def __init__(self, *, collation: str=None, restore_point_in_time=None, catalog_collation=None, create_mode=None, storage_container_uri: str=None, source_database_id: str=None, storage_container_sas_token: str=None, tags=None, **kwargs) -> None:
def __init__(self, *, collation: str=None, restore_point_in_time=None, catalog_collation=None, create_mode=None, storage_container_uri: str=None, source_database_id: str=None, restorable_dropped_database_id: str=None, storage_container_sas_token: str=None, recoverable_database_id: str=None, tags=None, **kwargs) -> None:
super(ManagedDatabaseUpdate, self).__init__(**kwargs)
self.collation = collation
self.status = None
Expand All @@ -101,6 +112,8 @@ def __init__(self, *, collation: str=None, restore_point_in_time=None, catalog_c
self.create_mode = create_mode
self.storage_container_uri = storage_container_uri
self.source_database_id = source_database_id
self.restorable_dropped_database_id = restorable_dropped_database_id
self.storage_container_sas_token = storage_container_sas_token
self.failover_group_id = None
self.recoverable_database_id = recoverable_database_id
self.tags = tags
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ class ManagedDatabaseStatus(str, Enum):
shutdown = "Shutdown"
creating = "Creating"
inaccessible = "Inaccessible"
updating = "Updating"


class CatalogCollationType(str, Enum):
Expand All @@ -499,6 +500,7 @@ class ManagedDatabaseCreateMode(str, Enum):
default = "Default"
restore_external_backup = "RestoreExternalBackup"
point_in_time_restore = "PointInTimeRestore"
recovery = "Recovery"


class AutomaticTuningServerMode(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def _delete_initial(

def delete(
self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes the managed database.
"""Deletes a managed 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