Skip to content

Managed database cross subscription restore #20735

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

Merged
merged 9 commits into from
Jan 31, 2023
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
20 changes: 10 additions & 10 deletions src/Sql/Sql.Sdk/Generated/ISqlManagementClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,16 +438,6 @@ public partial interface ISqlManagementClient : System.IDisposable
/// </summary>
IIPv6FirewallRulesOperations IPv6FirewallRules { get; }

/// <summary>
/// Gets the IManagedDatabaseRestoreDetailsOperations.
/// </summary>
IManagedDatabaseRestoreDetailsOperations ManagedDatabaseRestoreDetails { get; }

/// <summary>
/// Gets the IManagedDatabasesOperations.
/// </summary>
IManagedDatabasesOperations ManagedDatabases { get; }

/// <summary>
/// Gets the IReplicationLinksOperations.
/// </summary>
Expand Down Expand Up @@ -483,5 +473,15 @@ public partial interface ISqlManagementClient : System.IDisposable
/// </summary>
IManagedServerDnsAliasesOperations ManagedServerDnsAliases { get; }

/// <summary>
/// Gets the IManagedDatabasesOperations.
/// </summary>
IManagedDatabasesOperations ManagedDatabases { get; }

/// <summary>
/// Gets the IManagedDatabaseRestoreDetailsOperations.
/// </summary>
IManagedDatabaseRestoreDetailsOperations ManagedDatabaseRestoreDetails { get; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ internal ManagedDatabaseRestoreDetailsOperations(SqlManagementClient client)
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string restoreDetailsName = "Default";
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down
20 changes: 10 additions & 10 deletions src/Sql/Sql.Sdk/Generated/ManagedDatabasesOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -297,7 +297,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -694,7 +694,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -907,7 +907,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -1133,7 +1133,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -1326,7 +1326,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -1545,7 +1545,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -1746,7 +1746,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -1947,7 +1947,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down Expand Up @@ -2148,7 +2148,7 @@ internal ManagedDatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2022-02-01-preview";
string apiVersion = "2022-05-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand Down
40 changes: 37 additions & 3 deletions src/Sql/Sql.Sdk/Generated/Models/ManagedDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public ManagedDatabase()
/// <param name="collation">Collation of the managed database.</param>
/// <param name="status">Status of the database. Possible values
/// include: 'Online', 'Offline', 'Shutdown', 'Creating',
/// 'Inaccessible', 'Restoring', 'Updating'</param>
/// 'Inaccessible', 'Restoring', 'Updating', 'Stopping', 'Stopped',
/// 'Starting', 'DbMoving', 'DbCopying'</param>
/// <param name="creationDate">Creation date of the database.</param>
/// <param name="earliestRestorePoint">Earliest restore point in time
/// for point in time restore.</param>
Expand Down Expand Up @@ -75,9 +76,15 @@ public ManagedDatabase()
/// <param name="sourceDatabaseId">The resource identifier of the
/// source database associated with create operation of this
/// database.</param>
/// <param name="crossSubscriptionSourceDatabaseId">The resource
/// identifier of the cross-subscription source database associated
/// with create operation of this database.</param>
/// <param name="restorableDroppedDatabaseId">The restorable dropped
/// database resource id to restore when creating this
/// database.</param>
/// <param name="crossSubscriptionRestorableDroppedDatabaseId">The
/// restorable cross-subscription dropped database resource id to
/// restore when creating this database.</param>
/// <param name="storageContainerIdentity">Conditional. If createMode
/// is RestoreExternalBackup, this value is used. Specifies the
/// identity used for storage container authentication. Can be
Expand All @@ -99,7 +106,9 @@ public ManagedDatabase()
/// of this managed database.</param>
/// <param name="lastBackupName">Last backup file name for restore of
/// this managed database.</param>
public ManagedDatabase(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), string collation = default(string), string status = default(string), System.DateTime? creationDate = default(System.DateTime?), System.DateTime? earliestRestorePoint = default(System.DateTime?), System.DateTime? restorePointInTime = default(System.DateTime?), string defaultSecondaryLocation = default(string), string catalogCollation = default(string), string createMode = default(string), string storageContainerUri = default(string), string sourceDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string storageContainerIdentity = default(string), string storageContainerSasToken = default(string), string failoverGroupId = default(string), string recoverableDatabaseId = default(string), string longTermRetentionBackupResourceId = default(string), bool? autoCompleteRestore = default(bool?), string lastBackupName = default(string))
/// <param name="crossSubscriptionTargetManagedInstanceId">Target
/// managed instance id used in cross-subscription restore.</param>
public ManagedDatabase(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), string collation = default(string), string status = default(string), System.DateTime? creationDate = default(System.DateTime?), System.DateTime? earliestRestorePoint = default(System.DateTime?), System.DateTime? restorePointInTime = default(System.DateTime?), string defaultSecondaryLocation = default(string), string catalogCollation = default(string), string createMode = default(string), string storageContainerUri = default(string), string sourceDatabaseId = default(string), string crossSubscriptionSourceDatabaseId = default(string), string restorableDroppedDatabaseId = default(string), string crossSubscriptionRestorableDroppedDatabaseId = default(string), string storageContainerIdentity = default(string), string storageContainerSasToken = default(string), string failoverGroupId = default(string), string recoverableDatabaseId = default(string), string longTermRetentionBackupResourceId = default(string), bool? autoCompleteRestore = default(bool?), string lastBackupName = default(string), string crossSubscriptionTargetManagedInstanceId = default(string))
: base(location, id, name, type, tags)
{
Collation = collation;
Expand All @@ -112,14 +121,17 @@ public ManagedDatabase()
CreateMode = createMode;
StorageContainerUri = storageContainerUri;
SourceDatabaseId = sourceDatabaseId;
CrossSubscriptionSourceDatabaseId = crossSubscriptionSourceDatabaseId;
RestorableDroppedDatabaseId = restorableDroppedDatabaseId;
CrossSubscriptionRestorableDroppedDatabaseId = crossSubscriptionRestorableDroppedDatabaseId;
StorageContainerIdentity = storageContainerIdentity;
StorageContainerSasToken = storageContainerSasToken;
FailoverGroupId = failoverGroupId;
RecoverableDatabaseId = recoverableDatabaseId;
LongTermRetentionBackupResourceId = longTermRetentionBackupResourceId;
AutoCompleteRestore = autoCompleteRestore;
LastBackupName = lastBackupName;
CrossSubscriptionTargetManagedInstanceId = crossSubscriptionTargetManagedInstanceId;
CustomInit();
}

Expand All @@ -137,7 +149,8 @@ public ManagedDatabase()
/// <summary>
/// Gets status of the database. Possible values include: 'Online',
/// 'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Restoring',
/// 'Updating'
/// 'Updating', 'Stopping', 'Stopped', 'Starting', 'DbMoving',
/// 'DbCopying'
/// </summary>
[JsonProperty(PropertyName = "properties.status")]
public string Status { get; private set; }
Expand Down Expand Up @@ -209,13 +222,27 @@ public ManagedDatabase()
[JsonProperty(PropertyName = "properties.sourceDatabaseId")]
public string SourceDatabaseId { get; set; }

/// <summary>
/// Gets or sets the resource identifier of the cross-subscription
/// source database associated with create operation of this database.
/// </summary>
[JsonProperty(PropertyName = "properties.crossSubscriptionSourceDatabaseId")]
public string CrossSubscriptionSourceDatabaseId { get; set; }

/// <summary>
/// Gets or sets the restorable dropped database resource id to restore
/// when creating this database.
/// </summary>
[JsonProperty(PropertyName = "properties.restorableDroppedDatabaseId")]
public string RestorableDroppedDatabaseId { get; set; }

/// <summary>
/// Gets or sets the restorable cross-subscription dropped database
/// resource id to restore when creating this database.
/// </summary>
[JsonProperty(PropertyName = "properties.crossSubscriptionRestorableDroppedDatabaseId")]
public string CrossSubscriptionRestorableDroppedDatabaseId { get; set; }

/// <summary>
/// Gets or sets conditional. If createMode is RestoreExternalBackup,
/// this value is used. Specifies the identity used for storage
Expand Down Expand Up @@ -269,6 +296,13 @@ public ManagedDatabase()
[JsonProperty(PropertyName = "properties.lastBackupName")]
public string LastBackupName { get; set; }

/// <summary>
/// Gets or sets target managed instance id used in cross-subscription
/// restore.
/// </summary>
[JsonProperty(PropertyName = "properties.crossSubscriptionTargetManagedInstanceId")]
public string CrossSubscriptionTargetManagedInstanceId { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Sql/Sql.Sdk/Generated/Models/ManagedDatabaseStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@ public static class ManagedDatabaseStatus
public const string Inaccessible = "Inaccessible";
public const string Restoring = "Restoring";
public const string Updating = "Updating";
public const string Stopping = "Stopping";
public const string Stopped = "Stopped";
public const string Starting = "Starting";
public const string DbMoving = "DbMoving";
public const string DbCopying = "DbCopying";
}
}
Loading