Skip to content
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
22 changes: 10 additions & 12 deletions azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
# --------------------------------------------------------------------------

from .resource import Resource
from .proxy_resource import ProxyResource
from .backup_long_term_retention_policy import BackupLongTermRetentionPolicy
from .backup_long_term_retention_vault import BackupLongTermRetentionVault
from .tracked_resource import TrackedResource
from .proxy_resource import ProxyResource
from .recoverable_database import RecoverableDatabase
from .restorable_dropped_database import RestorableDroppedDatabase
from .max_size_capability import MaxSizeCapability
Expand Down Expand Up @@ -92,6 +90,8 @@
from .sync_member import SyncMember
from .subscription_usage import SubscriptionUsage
from .virtual_network_rule import VirtualNetworkRule
from .long_term_retention_backup import LongTermRetentionBackup
from .backup_long_term_retention_policy import BackupLongTermRetentionPolicy
from .resource_move_definition import ResourceMoveDefinition
from .automatic_tuning_server_options import AutomaticTuningServerOptions
from .server_automatic_tuning import ServerAutomaticTuning
Expand All @@ -101,8 +101,6 @@
from .create_database_restore_point_definition import CreateDatabaseRestorePointDefinition
from .database_operation import DatabaseOperation
from .elastic_pool_operation import ElasticPoolOperation
from .backup_long_term_retention_policy_paged import BackupLongTermRetentionPolicyPaged
from .backup_long_term_retention_vault_paged import BackupLongTermRetentionVaultPaged
from .recoverable_database_paged import RecoverableDatabasePaged
from .restorable_dropped_database_paged import RestorableDroppedDatabasePaged
from .server_paged import ServerPaged
Expand Down Expand Up @@ -138,12 +136,12 @@
from .sync_member_paged import SyncMemberPaged
from .subscription_usage_paged import SubscriptionUsagePaged
from .virtual_network_rule_paged import VirtualNetworkRulePaged
from .long_term_retention_backup_paged import LongTermRetentionBackupPaged
from .server_dns_alias_paged import ServerDnsAliasPaged
from .restore_point_paged import RestorePointPaged
from .database_operation_paged import DatabaseOperationPaged
from .elastic_pool_operation_paged import ElasticPoolOperationPaged
from .sql_management_client_enums import (
BackupLongTermRetentionPolicyState,
CapabilityStatus,
MaxSizeUnits,
PerformanceLevelUnit,
Expand Down Expand Up @@ -198,14 +196,13 @@
AutomaticTuningServerReason,
RestorePointType,
ManagementOperationState,
LongTermRetentionDatabaseState,
)

__all__ = [
'Resource',
'ProxyResource',
'BackupLongTermRetentionPolicy',
'BackupLongTermRetentionVault',
'TrackedResource',
'ProxyResource',
'RecoverableDatabase',
'RestorableDroppedDatabase',
'MaxSizeCapability',
Expand Down Expand Up @@ -284,6 +281,8 @@
'SyncMember',
'SubscriptionUsage',
'VirtualNetworkRule',
'LongTermRetentionBackup',
'BackupLongTermRetentionPolicy',
'ResourceMoveDefinition',
'AutomaticTuningServerOptions',
'ServerAutomaticTuning',
Expand All @@ -293,8 +292,6 @@
'CreateDatabaseRestorePointDefinition',
'DatabaseOperation',
'ElasticPoolOperation',
'BackupLongTermRetentionPolicyPaged',
'BackupLongTermRetentionVaultPaged',
'RecoverableDatabasePaged',
'RestorableDroppedDatabasePaged',
'ServerPaged',
Expand Down Expand Up @@ -330,11 +327,11 @@
'SyncMemberPaged',
'SubscriptionUsagePaged',
'VirtualNetworkRulePaged',
'LongTermRetentionBackupPaged',
'ServerDnsAliasPaged',
'RestorePointPaged',
'DatabaseOperationPaged',
'ElasticPoolOperationPaged',
'BackupLongTermRetentionPolicyState',
'CapabilityStatus',
'MaxSizeUnits',
'PerformanceLevelUnit',
Expand Down Expand Up @@ -389,4 +386,5 @@
'AutomaticTuningServerReason',
'RestorePointType',
'ManagementOperationState',
'LongTermRetentionDatabaseState',
]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class BackupLongTermRetentionPolicy(ProxyResource):
"""A backup long term retention policy.
"""A long term retention policy.

Variables are only populated by the server, and will be ignored when
sending a request.
Expand All @@ -24,37 +24,39 @@ class BackupLongTermRetentionPolicy(ProxyResource):
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar location: The geo-location where the resource lives
:vartype location: str
:param state: The status of the backup long term retention policy.
Possible values include: 'Disabled', 'Enabled'
:type state: str or
~azure.mgmt.sql.models.BackupLongTermRetentionPolicyState
:param recovery_services_backup_policy_resource_id: The azure recovery
services backup protection policy resource id
:type recovery_services_backup_policy_resource_id: str
:param weekly_retention: The weekly retention policy for an LTR backup in
an ISO 8601 format.
:type weekly_retention: str
:param monthly_retention: The montly retention policy for an LTR backup in
an ISO 8601 format.
:type monthly_retention: str
:param yearly_retention: The yearly retention policy for an LTR backup in
an ISO 8601 format.
:type yearly_retention: str
:param week_of_year: The week of year to take the yearly backup in an ISO
8601 format.
:type week_of_year: int
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'readonly': True},
'state': {'required': True},
'recovery_services_backup_policy_resource_id': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'BackupLongTermRetentionPolicyState'},
'recovery_services_backup_policy_resource_id': {'key': 'properties.recoveryServicesBackupPolicyResourceId', 'type': 'str'},
'weekly_retention': {'key': 'properties.weeklyRetention', 'type': 'str'},
'monthly_retention': {'key': 'properties.monthlyRetention', 'type': 'str'},
'yearly_retention': {'key': 'properties.yearlyRetention', 'type': 'str'},
'week_of_year': {'key': 'properties.weekOfYear', 'type': 'int'},
}

def __init__(self, state, recovery_services_backup_policy_resource_id):
def __init__(self, weekly_retention=None, monthly_retention=None, yearly_retention=None, week_of_year=None):
super(BackupLongTermRetentionPolicy, self).__init__()
self.location = None
self.state = state
self.recovery_services_backup_policy_resource_id = recovery_services_backup_policy_resource_id
self.weekly_retention = weekly_retention
self.monthly_retention = monthly_retention
self.yearly_retention = yearly_retention
self.week_of_year = week_of_year

This file was deleted.

This file was deleted.

73 changes: 73 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/long_term_retention_backup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# 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 .proxy_resource import ProxyResource


class LongTermRetentionBackup(ProxyResource):
"""A long term retention backup.

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 server_name: The server name that the backup database belong to.
:vartype server_name: str
:ivar server_create_time: The create time of the server.
:vartype server_create_time: datetime
:ivar database_name: The name of the database the backup belong to
:vartype database_name: str
:ivar database_deletion_time: The delete time of the database
:vartype database_deletion_time: datetime
:ivar backup_time: The time the backup was taken
:vartype backup_time: datetime
:ivar backup_expiration_time: The time the long term retention backup will
expire.
:vartype backup_expiration_time: datetime
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'server_name': {'readonly': True},
'server_create_time': {'readonly': True},
'database_name': {'readonly': True},
'database_deletion_time': {'readonly': True},
'backup_time': {'readonly': True},
'backup_expiration_time': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'server_name': {'key': 'properties.serverName', 'type': 'str'},
'server_create_time': {'key': 'properties.serverCreateTime', 'type': 'iso-8601'},
'database_name': {'key': 'properties.databaseName', 'type': 'str'},
'database_deletion_time': {'key': 'properties.databaseDeletionTime', 'type': 'iso-8601'},
'backup_time': {'key': 'properties.backupTime', 'type': 'iso-8601'},
'backup_expiration_time': {'key': 'properties.backupExpirationTime', 'type': 'iso-8601'},
}

def __init__(self):
super(LongTermRetentionBackup, self).__init__()
self.server_name = None
self.server_create_time = None
self.database_name = None
self.database_deletion_time = None
self.backup_time = None
self.backup_expiration_time = None
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
from msrest.paging import Paged


class BackupLongTermRetentionVaultPaged(Paged):
class LongTermRetentionBackupPaged(Paged):
"""
A paging container for iterating over a list of :class:`BackupLongTermRetentionVault <azure.mgmt.sql.models.BackupLongTermRetentionVault>` object
A paging container for iterating over a list of :class:`LongTermRetentionBackup <azure.mgmt.sql.models.LongTermRetentionBackup>` object
"""

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

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

super(BackupLongTermRetentionVaultPaged, self).__init__(*args, **kwargs)
super(LongTermRetentionBackupPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
from enum import Enum


class BackupLongTermRetentionPolicyState(Enum):

disabled = "Disabled"
enabled = "Enabled"


class CapabilityStatus(Enum):

visible = "Visible"
Expand Down Expand Up @@ -496,3 +490,10 @@ class ManagementOperationState(Enum):
failed = "Failed"
cancel_in_progress = "CancelInProgress"
cancelled = "Cancelled"


class LongTermRetentionDatabaseState(Enum):

all = "All"
live = "Live"
deleted = "Deleted"
Loading