Skip to content

Commit

Permalink
[T1] sql 2020 11 04 (Azure#14996)
Browse files Browse the repository at this point in the history
* Generated from d7216ae183c55f5117ed2417449f62635c834253

* test,version,changelog

Co-authored-by: SDK Automation <sdkautomation@microsoft.com>
  • Loading branch information
msyyc and SDK Automation authored Nov 4, 2020
1 parent 44614c3 commit 755bff5
Show file tree
Hide file tree
Showing 11 changed files with 669 additions and 192 deletions.
546 changes: 546 additions & 0 deletions sdk/sql/azure-mgmt-sql/CHANGELOG.md

Large diffs are not rendered by default.

10 changes: 5 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 @@ -83,6 +83,7 @@
from .operations import ManagedInstanceKeysOperations
from .operations import ManagedInstanceEncryptionProtectorsOperations
from .operations import RecoverableManagedDatabasesOperations
from .operations import BackupShortTermRetentionPoliciesOperations
from .operations import ManagedInstanceVulnerabilityAssessmentsOperations
from .operations import ServerVulnerabilityAssessmentsOperations
from .operations import ManagedDatabaseSensitivityLabelsOperations
Expand All @@ -101,7 +102,6 @@
from .operations import SyncGroupsOperations
from .operations import SyncMembersOperations
from .operations import ManagedInstancesOperations
from .operations import BackupShortTermRetentionPoliciesOperations
from .operations import ManagedDatabaseRestoreDetailsOperations
from .operations import ManagedDatabasesOperations
from .operations import ServerAzureADOnlyAuthenticationsOperations
Expand Down Expand Up @@ -257,6 +257,8 @@ class SqlManagementClient(SDKClient):
:vartype managed_instance_encryption_protectors: azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations
:ivar recoverable_managed_databases: RecoverableManagedDatabases operations
:vartype recoverable_managed_databases: azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations
:ivar backup_short_term_retention_policies: BackupShortTermRetentionPolicies operations
:vartype backup_short_term_retention_policies: azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations
:ivar managed_instance_vulnerability_assessments: ManagedInstanceVulnerabilityAssessments operations
:vartype managed_instance_vulnerability_assessments: azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations
:ivar server_vulnerability_assessments: ServerVulnerabilityAssessments operations
Expand Down Expand Up @@ -293,8 +295,6 @@ class SqlManagementClient(SDKClient):
:vartype sync_members: azure.mgmt.sql.operations.SyncMembersOperations
:ivar managed_instances: ManagedInstances operations
:vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations
:ivar backup_short_term_retention_policies: BackupShortTermRetentionPolicies operations
:vartype backup_short_term_retention_policies: azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations
:ivar managed_database_restore_details: ManagedDatabaseRestoreDetails operations
:vartype managed_database_restore_details: azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations
:ivar managed_databases: ManagedDatabases operations
Expand Down Expand Up @@ -467,6 +467,8 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.recoverable_managed_databases = RecoverableManagedDatabasesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.managed_instance_vulnerability_assessments = ManagedInstanceVulnerabilityAssessmentsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations(
Expand Down Expand Up @@ -503,8 +505,6 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.managed_instances = ManagedInstancesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations(
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(
Expand Down
2 changes: 1 addition & 1 deletion sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@
'ManagedInstanceKeyPaged',
'ManagedInstanceEncryptionProtectorPaged',
'RecoverableManagedDatabasePaged',
'BackupShortTermRetentionPolicyPaged',
'ManagedInstanceVulnerabilityAssessmentPaged',
'ServerVulnerabilityAssessmentPaged',
'InstancePoolPaged',
Expand All @@ -832,7 +833,6 @@
'SyncGroupPaged',
'SyncMemberPaged',
'ManagedInstancePaged',
'BackupShortTermRetentionPolicyPaged',
'ManagedDatabasePaged',
'ServerAzureADOnlyAuthenticationPaged',
'ManagedInstanceAzureADOnlyAuthenticationPaged',
Expand Down
7 changes: 0 additions & 7 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,6 @@ class BackupShortTermRetentionPolicy(ProxyResource):
:param retention_days: The backup retention period in days. This is how
many days Point-in-Time Restore will be supported.
:type retention_days: int
:param diff_backup_interval_in_hours: The differential backup interval in
hours. This is how many interval hours between each differential backup
will be supported. This is only applicable to live databases but not
dropped databases.
:type diff_backup_interval_in_hours: int
"""

_validation = {
Expand All @@ -298,13 +293,11 @@ class BackupShortTermRetentionPolicy(ProxyResource):
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'retention_days': {'key': 'properties.retentionDays', 'type': 'int'},
'diff_backup_interval_in_hours': {'key': 'properties.diffBackupIntervalInHours', 'type': 'int'},
}

def __init__(self, **kwargs):
super(BackupShortTermRetentionPolicy, self).__init__(**kwargs)
self.retention_days = kwargs.get('retention_days', None)
self.diff_backup_interval_in_hours = kwargs.get('diff_backup_interval_in_hours', None)


class CheckNameAvailabilityRequest(Model):
Expand Down
9 changes: 1 addition & 8 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 @@ -280,11 +280,6 @@ class BackupShortTermRetentionPolicy(ProxyResource):
:param retention_days: The backup retention period in days. This is how
many days Point-in-Time Restore will be supported.
:type retention_days: int
:param diff_backup_interval_in_hours: The differential backup interval in
hours. This is how many interval hours between each differential backup
will be supported. This is only applicable to live databases but not
dropped databases.
:type diff_backup_interval_in_hours: int
"""

_validation = {
Expand All @@ -298,13 +293,11 @@ class BackupShortTermRetentionPolicy(ProxyResource):
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'retention_days': {'key': 'properties.retentionDays', 'type': 'int'},
'diff_backup_interval_in_hours': {'key': 'properties.diffBackupIntervalInHours', 'type': 'int'},
}

def __init__(self, *, retention_days: int=None, diff_backup_interval_in_hours: int=None, **kwargs) -> None:
def __init__(self, *, retention_days: int=None, **kwargs) -> None:
super(BackupShortTermRetentionPolicy, self).__init__(**kwargs)
self.retention_days = retention_days
self.diff_backup_interval_in_hours = diff_backup_interval_in_hours


class CheckNameAvailabilityRequest(Model):
Expand Down
26 changes: 13 additions & 13 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,19 @@ class RecoverableManagedDatabasePaged(Paged):
def __init__(self, *args, **kwargs):

super(RecoverableManagedDatabasePaged, self).__init__(*args, **kwargs)
class BackupShortTermRetentionPolicyPaged(Paged):
"""
A paging container for iterating over a list of :class:`BackupShortTermRetentionPolicy <azure.mgmt.sql.models.BackupShortTermRetentionPolicy>` object
"""

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

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

super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs)
class ManagedInstanceVulnerabilityAssessmentPaged(Paged):
"""
A paging container for iterating over a list of :class:`ManagedInstanceVulnerabilityAssessment <azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment>` object
Expand Down Expand Up @@ -1013,19 +1026,6 @@ class ManagedInstancePaged(Paged):
def __init__(self, *args, **kwargs):

super(ManagedInstancePaged, self).__init__(*args, **kwargs)
class BackupShortTermRetentionPolicyPaged(Paged):
"""
A paging container for iterating over a list of :class:`BackupShortTermRetentionPolicy <azure.mgmt.sql.models.BackupShortTermRetentionPolicy>` object
"""

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

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

super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs)
class ManagedDatabasePaged(Paged):
"""
A paging container for iterating over a list of :class:`ManagedDatabase <azure.mgmt.sql.models.ManagedDatabase>` object
Expand Down
4 changes: 2 additions & 2 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
from ._managed_instance_keys_operations import ManagedInstanceKeysOperations
from ._managed_instance_encryption_protectors_operations import ManagedInstanceEncryptionProtectorsOperations
from ._recoverable_managed_databases_operations import RecoverableManagedDatabasesOperations
from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations
from ._managed_instance_vulnerability_assessments_operations import ManagedInstanceVulnerabilityAssessmentsOperations
from ._server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations
from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations
Expand All @@ -97,7 +98,6 @@
from ._sync_groups_operations import SyncGroupsOperations
from ._sync_members_operations import SyncMembersOperations
from ._managed_instances_operations import ManagedInstancesOperations
from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations
from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations
from ._managed_databases_operations import ManagedDatabasesOperations
from ._server_azure_ad_only_authentications_operations import ServerAzureADOnlyAuthenticationsOperations
Expand Down Expand Up @@ -176,6 +176,7 @@
'ManagedInstanceKeysOperations',
'ManagedInstanceEncryptionProtectorsOperations',
'RecoverableManagedDatabasesOperations',
'BackupShortTermRetentionPoliciesOperations',
'ManagedInstanceVulnerabilityAssessmentsOperations',
'ServerVulnerabilityAssessmentsOperations',
'ManagedDatabaseSensitivityLabelsOperations',
Expand All @@ -194,7 +195,6 @@
'SyncGroupsOperations',
'SyncMembersOperations',
'ManagedInstancesOperations',
'BackupShortTermRetentionPoliciesOperations',
'ManagedDatabaseRestoreDetailsOperations',
'ManagedDatabasesOperations',
'ServerAzureADOnlyAuthenticationsOperations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class BackupShortTermRetentionPoliciesOperations(object):
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar policy_name: The policy name. Should always be "default". Constant value: "default".
:ivar api_version: The API version to use for the request. Constant value: "2020-02-02-preview".
:ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview".
"""

models = models
Expand All @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer):
self._serialize = serializer
self._deserialize = deserializer
self.policy_name = "default"
self.api_version = "2020-02-02-preview"
self.api_version = "2017-10-01-preview"

self.config = config

Expand Down Expand Up @@ -113,8 +113,8 @@ def get(


def _create_or_update_initial(
self, resource_group_name, server_name, database_name, retention_days=None, diff_backup_interval_in_hours=None, custom_headers=None, raw=False, **operation_config):
parameters = models.BackupShortTermRetentionPolicy(retention_days=retention_days, diff_backup_interval_in_hours=diff_backup_interval_in_hours)
self, resource_group_name, server_name, database_name, retention_days=None, custom_headers=None, raw=False, **operation_config):
parameters = models.BackupShortTermRetentionPolicy(retention_days=retention_days)

# Construct URL
url = self.create_or_update.metadata['url']
Expand Down Expand Up @@ -166,7 +166,7 @@ def _create_or_update_initial(
return deserialized

def create_or_update(
self, resource_group_name, server_name, database_name, retention_days=None, diff_backup_interval_in_hours=None, custom_headers=None, raw=False, polling=True, **operation_config):
self, resource_group_name, server_name, database_name, retention_days=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Updates a database's short term retention policy.
:param resource_group_name: The name of the resource group that
Expand All @@ -180,11 +180,6 @@ def create_or_update(
:param retention_days: The backup retention period in days. This is
how many days Point-in-Time Restore will be supported.
:type retention_days: int
:param diff_backup_interval_in_hours: The differential backup interval
in hours. This is how many interval hours between each differential
backup will be supported. This is only applicable to live databases
but not dropped databases.
:type diff_backup_interval_in_hours: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
Expand All @@ -204,7 +199,6 @@ def create_or_update(
server_name=server_name,
database_name=database_name,
retention_days=retention_days,
diff_backup_interval_in_hours=diff_backup_interval_in_hours,
custom_headers=custom_headers,
raw=True,
**operation_config
Expand All @@ -230,8 +224,8 @@ def get_long_running_output(response):


def _update_initial(
self, resource_group_name, server_name, database_name, retention_days=None, diff_backup_interval_in_hours=None, custom_headers=None, raw=False, **operation_config):
parameters = models.BackupShortTermRetentionPolicy(retention_days=retention_days, diff_backup_interval_in_hours=diff_backup_interval_in_hours)
self, resource_group_name, server_name, database_name, retention_days=None, custom_headers=None, raw=False, **operation_config):
parameters = models.BackupShortTermRetentionPolicy(retention_days=retention_days)

# Construct URL
url = self.update.metadata['url']
Expand Down Expand Up @@ -283,7 +277,7 @@ def _update_initial(
return deserialized

def update(
self, resource_group_name, server_name, database_name, retention_days=None, diff_backup_interval_in_hours=None, custom_headers=None, raw=False, polling=True, **operation_config):
self, resource_group_name, server_name, database_name, retention_days=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Updates a database's short term retention policy.
:param resource_group_name: The name of the resource group that
Expand All @@ -297,11 +291,6 @@ def update(
:param retention_days: The backup retention period in days. This is
how many days Point-in-Time Restore will be supported.
:type retention_days: int
:param diff_backup_interval_in_hours: The differential backup interval
in hours. This is how many interval hours between each differential
backup will be supported. This is only applicable to live databases
but not dropped databases.
:type diff_backup_interval_in_hours: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
Expand All @@ -321,7 +310,6 @@ def update(
server_name=server_name,
database_name=database_name,
retention_days=retention_days,
diff_backup_interval_in_hours=diff_backup_interval_in_hours,
custom_headers=custom_headers,
raw=True,
**operation_config
Expand Down
2 changes: 1 addition & 1 deletion sdk/sql/azure-mgmt-sql/azure/mgmt/sql/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.23.0"
VERSION = "0.24.0"
Loading

0 comments on commit 755bff5

Please sign in to comment.