diff --git a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt
index 7db8cbbd1128..cd1afefb3768 100644
--- a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt
+++ b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt
@@ -3,12 +3,12 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
-cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=.
-2021-01-26 04:14:56 UTC
+cmd.exe /c autorest.cmd https://github.com/xaliciayang/azure-rest-api-specs/blob/20201101swagger/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\src\azure\azure-sdk-for-net\src\Sdks
+2021-02-26 22:54:25 UTC
Azure-rest-api-specs repository information
-GitHub fork: Azure
-Branch: master
-Commit: 4d91da06bf655dc1d61a420e7510778eab1609d8
+GitHub fork: xaliciayang
+Branch: 20201101swagger
+Commit: 472b1de1c7cd7ac841afc0f90d8d3da5f1490e77
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperations.cs
index 4c10ea314e72..c127e57aeb8a 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabasesOperations.cs
@@ -544,7 +544,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -746,7 +746,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1034,7 +1034,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1313,7 +1313,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1549,7 +1549,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1975,7 +1975,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2201,7 +2201,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2394,7 +2394,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2605,7 +2605,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2809,7 +2809,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -3014,7 +3014,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -3202,7 +3202,7 @@ internal DatabasesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-08-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ILongTermRetentionBackupsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ILongTermRetentionBackupsOperations.cs
index 8a567523d58e..87eada5fc9bc 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ILongTermRetentionBackupsOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ILongTermRetentionBackupsOperations.cs
@@ -24,13 +24,42 @@ namespace Microsoft.Azure.Management.Sql
public partial interface ILongTermRetentionBackupsOperations
{
///
- /// Gets a long term retention backup.
+ /// Copy an existing long term retention backup.
///
- ///
- /// The name of the resource group that contains the resource. You can
- /// obtain this value from the Azure Resource Manager API or the
- /// portal.
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CopyWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates an existing long term retention backup.
+ ///
///
/// The location of the database.
///
@@ -43,6 +72,9 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// The backup name.
///
+ ///
+ /// The requested backup resource state
+ ///
///
/// The headers that will be added to request.
///
@@ -58,15 +90,41 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task> GetByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> UpdateWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Deletes a long term retention backup.
+ /// Gets a long term retention backup.
///
- ///
- /// The name of the resource group that contains the resource. You can
- /// obtain this value from the Azure Resource Manager API or the
- /// portal.
+ ///
+ /// The location of the database.
///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes a long term retention backup.
+ ///
///
/// The location of the database
///
@@ -91,15 +149,10 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task DeleteByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task DeleteWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists all long term retention backups for a database.
///
- ///
- /// The name of the resource group that contains the resource. You can
- /// obtain this value from the Azure Resource Manager API or the
- /// portal.
- ///
///
/// The location of the database
///
@@ -132,15 +185,10 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByResourceGroupDatabaseWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByDatabaseWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists the long term retention backups for a given location.
///
- ///
- /// The name of the resource group that contains the resource. You can
- /// obtain this value from the Azure Resource Manager API or the
- /// portal.
- ///
///
/// The location of the database
///
@@ -167,15 +215,10 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByResourceGroupLocationWithHttpMessagesAsync(string resourceGroupName, string locationName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByLocationWithHttpMessagesAsync(string locationName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists the long term retention backups for a given server.
///
- ///
- /// The name of the resource group that contains the resource. You can
- /// obtain this value from the Azure Resource Manager API or the
- /// portal.
- ///
///
/// The location of the database
///
@@ -205,10 +248,93 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByResourceGroupServerWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByServerWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Copy an existing long term retention backup to a different server.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CopyByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates an existing long term retention backup.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The requested backup resource state
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Gets a long term retention backup.
///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
///
/// The location of the database.
///
@@ -236,10 +362,15 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Deletes a long term retention backup.
///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
///
/// The location of the database
///
@@ -264,10 +395,15 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task DeleteWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task DeleteByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists all long term retention backups for a database.
///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
///
/// The location of the database
///
@@ -300,10 +436,15 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByDatabaseWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByResourceGroupDatabaseWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists the long term retention backups for a given location.
///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
///
/// The location of the database
///
@@ -330,10 +471,15 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByLocationWithHttpMessagesAsync(string locationName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByResourceGroupLocationWithHttpMessagesAsync(string resourceGroupName, string locationName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists the long term retention backups for a given server.
///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
///
/// The location of the database
///
@@ -363,17 +509,113 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByServerWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByResourceGroupServerWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Copy an existing long term retention backup.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginCopyWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates an existing long term retention backup.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The requested backup resource state
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginUpdateWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Deletes a long term retention backup.
///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginDeleteWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Copy an existing long term retention backup to a different server.
+ ///
///
/// The name of the resource group that contains the resource. You can
/// obtain this value from the Azure Resource Manager API or the
/// portal.
///
///
- /// The location of the database
+ /// The location of the database.
///
///
/// The name of the server
@@ -384,6 +626,9 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// The backup name.
///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
///
/// The headers that will be added to request.
///
@@ -393,13 +638,60 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
- Task BeginDeleteByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> BeginCopyByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates an existing long term retention backup.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The requested backup resource state
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginUpdateByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Deletes a long term retention backup.
///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
///
/// The location of the database
///
@@ -424,7 +716,7 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task BeginDeleteWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task BeginDeleteByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists all long term retention backups for a database.
///
@@ -446,7 +738,7 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByResourceGroupDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists the long term retention backups for a given location.
///
@@ -468,7 +760,7 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByResourceGroupLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists the long term retention backups for a given server.
///
@@ -490,7 +782,7 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByResourceGroupServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists all long term retention backups for a database.
///
@@ -512,7 +804,7 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByResourceGroupDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists the long term retention backups for a given location.
///
@@ -534,7 +826,7 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByResourceGroupLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists the long term retention backups for a given server.
///
@@ -556,6 +848,6 @@ public partial interface ILongTermRetentionBackupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByResourceGroupServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ILongTermRetentionPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ILongTermRetentionPoliciesOperations.cs
new file mode 100644
index 000000000000..714cf6b811ee
--- /dev/null
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ILongTermRetentionPoliciesOperations.cs
@@ -0,0 +1,175 @@
+//
+// 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.
+//
+
+namespace Microsoft.Azure.Management.Sql
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// LongTermRetentionPoliciesOperations operations.
+ ///
+ public partial interface ILongTermRetentionPoliciesOperations
+ {
+ ///
+ /// Gets a database's long term retention policy.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Sets a database's long term retention policy.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// The long term retention policy info.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, LongTermRetentionPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a database's long term retention policy.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Sets a database's long term retention policy.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// The name of the database.
+ ///
+ ///
+ /// The long term retention policy info.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, LongTermRetentionPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a database's long term retention policy.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs
index 4696e739b40a..93fff8a2d714 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ISqlManagementClient.cs
@@ -292,16 +292,6 @@ public partial interface ISqlManagementClient : System.IDisposable
///
IJobVersionsOperations JobVersions { get; }
- ///
- /// Gets the ILongTermRetentionBackupsOperations.
- ///
- ILongTermRetentionBackupsOperations LongTermRetentionBackups { get; }
-
- ///
- /// Gets the IBackupLongTermRetentionPoliciesOperations.
- ///
- IBackupLongTermRetentionPoliciesOperations BackupLongTermRetentionPolicies { get; }
-
///
/// Gets the IManagedBackupShortTermRetentionPoliciesOperations.
///
@@ -547,5 +537,15 @@ public partial interface ISqlManagementClient : System.IDisposable
///
IServerDevOpsAuditSettingsOperations ServerDevOpsAuditSettings { get; }
+ ///
+ /// Gets the ILongTermRetentionBackupsOperations.
+ ///
+ ILongTermRetentionBackupsOperations LongTermRetentionBackups { get; }
+
+ ///
+ /// Gets the ILongTermRetentionPoliciesOperations.
+ ///
+ ILongTermRetentionPoliciesOperations LongTermRetentionPolicies { get; }
+
}
}
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/LongTermRetentionBackupsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/LongTermRetentionBackupsOperations.cs
index d96ccd6e161b..37c396a655b1 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/LongTermRetentionBackupsOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/LongTermRetentionBackupsOperations.cs
@@ -50,6 +50,1011 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
public SqlManagementClient Client { get; private set; }
+ ///
+ /// Copy an existing long term retention backup.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CopyWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginCopyWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Updates an existing long term retention backup.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The requested backup resource state
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets a long term retention backup.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (locationName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "locationName");
+ }
+ if (longTermRetentionServerName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionServerName");
+ }
+ if (longTermRetentionDatabaseName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionDatabaseName");
+ }
+ if (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2020-11-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("locationName", locationName);
+ tracingParameters.Add("longTermRetentionServerName", longTermRetentionServerName);
+ tracingParameters.Add("longTermRetentionDatabaseName", longTermRetentionDatabaseName);
+ tracingParameters.Add("backupName", backupName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}").ToString();
+ _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
+ _url = _url.Replace("{longTermRetentionServerName}", System.Uri.EscapeDataString(longTermRetentionServerName));
+ _url = _url.Replace("{longTermRetentionDatabaseName}", System.Uri.EscapeDataString(longTermRetentionDatabaseName));
+ _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Deletes a long term retention backup.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Lists all long term retention backups for a database.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// Whether or not to only get the latest backup for each database.
+ ///
+ ///
+ /// Whether to query against just live databases, just deleted databases, or
+ /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByDatabaseWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (locationName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "locationName");
+ }
+ if (longTermRetentionServerName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionServerName");
+ }
+ if (longTermRetentionDatabaseName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionDatabaseName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2020-11-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("locationName", locationName);
+ tracingParameters.Add("longTermRetentionServerName", longTermRetentionServerName);
+ tracingParameters.Add("longTermRetentionDatabaseName", longTermRetentionDatabaseName);
+ tracingParameters.Add("onlyLatestPerDatabase", onlyLatestPerDatabase);
+ tracingParameters.Add("databaseState", databaseState);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups").ToString();
+ _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
+ _url = _url.Replace("{longTermRetentionServerName}", System.Uri.EscapeDataString(longTermRetentionServerName));
+ _url = _url.Replace("{longTermRetentionDatabaseName}", System.Uri.EscapeDataString(longTermRetentionDatabaseName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (onlyLatestPerDatabase != null)
+ {
+ _queryParameters.Add(string.Format("onlyLatestPerDatabase={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(onlyLatestPerDatabase, Client.SerializationSettings).Trim('"'))));
+ }
+ if (databaseState != null)
+ {
+ _queryParameters.Add(string.Format("databaseState={0}", System.Uri.EscapeDataString(databaseState)));
+ }
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists the long term retention backups for a given location.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// Whether or not to only get the latest backup for each database.
+ ///
+ ///
+ /// Whether to query against just live databases, just deleted databases, or
+ /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByLocationWithHttpMessagesAsync(string locationName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (locationName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "locationName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2020-11-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("locationName", locationName);
+ tracingParameters.Add("onlyLatestPerDatabase", onlyLatestPerDatabase);
+ tracingParameters.Add("databaseState", databaseState);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByLocation", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups").ToString();
+ _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (onlyLatestPerDatabase != null)
+ {
+ _queryParameters.Add(string.Format("onlyLatestPerDatabase={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(onlyLatestPerDatabase, Client.SerializationSettings).Trim('"'))));
+ }
+ if (databaseState != null)
+ {
+ _queryParameters.Add(string.Format("databaseState={0}", System.Uri.EscapeDataString(databaseState)));
+ }
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists the long term retention backups for a given server.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// Whether or not to only get the latest backup for each database.
+ ///
+ ///
+ /// Whether to query against just live databases, just deleted databases, or
+ /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByServerWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (locationName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "locationName");
+ }
+ if (longTermRetentionServerName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionServerName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2020-11-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("locationName", locationName);
+ tracingParameters.Add("longTermRetentionServerName", longTermRetentionServerName);
+ tracingParameters.Add("onlyLatestPerDatabase", onlyLatestPerDatabase);
+ tracingParameters.Add("databaseState", databaseState);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups").ToString();
+ _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
+ _url = _url.Replace("{longTermRetentionServerName}", System.Uri.EscapeDataString(longTermRetentionServerName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (onlyLatestPerDatabase != null)
+ {
+ _queryParameters.Add(string.Format("onlyLatestPerDatabase={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(onlyLatestPerDatabase, Client.SerializationSettings).Trim('"'))));
+ }
+ if (databaseState != null)
+ {
+ _queryParameters.Add(string.Format("databaseState={0}", System.Uri.EscapeDataString(databaseState)));
+ }
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Copy an existing long term retention backup to a different server.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CopyByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginCopyByResourceGroupWithHttpMessagesAsync(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Updates an existing long term retention backup.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The requested backup resource state
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> UpdateByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginUpdateByResourceGroupWithHttpMessagesAsync(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
///
/// Gets a long term retention backup.
///
@@ -116,7 +1121,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -370,7 +1375,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -586,7 +1591,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -805,7 +1810,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -968,7 +1973,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
}
///
- /// Gets a long term retention backup.
+ /// Copy an existing long term retention backup.
///
///
/// The location of the database.
@@ -982,6 +1987,9 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// The backup name.
///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
///
/// Headers that will be added to request.
///
@@ -1003,7 +2011,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginCopyWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (locationName == null)
{
@@ -1021,11 +2029,15 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
}
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1037,13 +2049,14 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
tracingParameters.Add("longTermRetentionServerName", longTermRetentionServerName);
tracingParameters.Add("longTermRetentionDatabaseName", longTermRetentionDatabaseName);
tracingParameters.Add("backupName", backupName);
+ tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCopy", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy").ToString();
_url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
_url = _url.Replace("{longTermRetentionServerName}", System.Uri.EscapeDataString(longTermRetentionServerName));
_url = _url.Replace("{longTermRetentionDatabaseName}", System.Uri.EscapeDataString(longTermRetentionDatabaseName));
@@ -1061,7 +2074,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -1092,6 +2105,12 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
// Serialize Request
string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1112,7 +2131,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1147,7 +2166,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1160,58 +2179,30 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
- if (_shouldTrace)
- {
- ServiceClientTracing.Exit(_invocationId, _result);
- }
- return _result;
- }
-
- ///
- /// Deletes a long term retention backup.
- ///
- ///
- /// The location of the database
- ///
- ///
- /// The name of the server
- ///
- ///
- /// The name of the database
- ///
- ///
- /// The backup name.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- public async Task DeleteWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- // Send request
- AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
}
///
- /// Lists all long term retention backups for a database.
+ /// Updates an existing long term retention backup.
///
///
- /// The location of the database
+ /// The location of the database.
///
///
/// The name of the server
@@ -1219,12 +2210,11 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// The name of the database
///
- ///
- /// Whether or not to only get the latest backup for each database.
+ ///
+ /// The backup name.
///
- ///
- /// Whether to query against just live databases, just deleted databases, or
- /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ /// The requested backup resource state
///
///
/// Headers that will be added to request.
@@ -1247,7 +2237,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByDatabaseWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginUpdateWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (locationName == null)
{
@@ -1261,11 +2251,19 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionDatabaseName");
}
+ if (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1276,28 +2274,21 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
tracingParameters.Add("locationName", locationName);
tracingParameters.Add("longTermRetentionServerName", longTermRetentionServerName);
tracingParameters.Add("longTermRetentionDatabaseName", longTermRetentionDatabaseName);
- tracingParameters.Add("onlyLatestPerDatabase", onlyLatestPerDatabase);
- tracingParameters.Add("databaseState", databaseState);
+ tracingParameters.Add("backupName", backupName);
+ tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update").ToString();
_url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
_url = _url.Replace("{longTermRetentionServerName}", System.Uri.EscapeDataString(longTermRetentionServerName));
_url = _url.Replace("{longTermRetentionDatabaseName}", System.Uri.EscapeDataString(longTermRetentionDatabaseName));
+ _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (onlyLatestPerDatabase != null)
- {
- _queryParameters.Add(string.Format("onlyLatestPerDatabase={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(onlyLatestPerDatabase, Client.SerializationSettings).Trim('"'))));
- }
- if (databaseState != null)
- {
- _queryParameters.Add(string.Format("databaseState={0}", System.Uri.EscapeDataString(databaseState)));
- }
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
@@ -1309,7 +2300,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -1340,6 +2331,12 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
// Serialize Request
string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1360,7 +2357,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1395,7 +2392,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1408,7 +2405,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1428,17 +2425,19 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
}
///
- /// Lists the long term retention backups for a given location.
+ /// Deletes a long term retention backup.
///
///
/// The location of the database
///
- ///
- /// Whether or not to only get the latest backup for each database.
+ ///
+ /// The name of the server
///
- ///
- /// Whether to query against just live databases, just deleted databases, or
- /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
///
///
/// Headers that will be added to request.
@@ -1449,9 +2448,6 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
- ///
- /// Thrown when unable to deserialize the response
- ///
///
/// Thrown when a required parameter is null
///
@@ -1461,17 +2457,29 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByLocationWithHttpMessagesAsync(string locationName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task BeginDeleteWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (locationName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "locationName");
}
+ if (longTermRetentionServerName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionServerName");
+ }
+ if (longTermRetentionDatabaseName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionDatabaseName");
+ }
+ if (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1480,26 +2488,22 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("locationName", locationName);
- tracingParameters.Add("onlyLatestPerDatabase", onlyLatestPerDatabase);
- tracingParameters.Add("databaseState", databaseState);
+ tracingParameters.Add("longTermRetentionServerName", longTermRetentionServerName);
+ tracingParameters.Add("longTermRetentionDatabaseName", longTermRetentionDatabaseName);
+ tracingParameters.Add("backupName", backupName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByLocation", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}").ToString();
_url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
+ _url = _url.Replace("{longTermRetentionServerName}", System.Uri.EscapeDataString(longTermRetentionServerName));
+ _url = _url.Replace("{longTermRetentionDatabaseName}", System.Uri.EscapeDataString(longTermRetentionDatabaseName));
+ _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (onlyLatestPerDatabase != null)
- {
- _queryParameters.Add(string.Format("onlyLatestPerDatabase={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(onlyLatestPerDatabase, Client.SerializationSettings).Trim('"'))));
- }
- if (databaseState != null)
- {
- _queryParameters.Add(string.Format("databaseState={0}", System.Uri.EscapeDataString(databaseState)));
- }
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
@@ -1511,7 +2515,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -1562,7 +2566,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1597,31 +2601,13 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
- // Deserialize Response
- if ((int)_statusCode == 200)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -1630,20 +2616,26 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
}
///
- /// Lists the long term retention backups for a given server.
+ /// Copy an existing long term retention backup to a different server.
///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
///
- /// The location of the database
+ /// The location of the database.
///
///
/// The name of the server
///
- ///
- /// Whether or not to only get the latest backup for each database.
+ ///
+ /// The name of the database
///
- ///
- /// Whether to query against just live databases, just deleted databases, or
- /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
///
///
/// Headers that will be added to request.
@@ -1666,8 +2658,12 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByServerWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginCopyByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
if (locationName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "locationName");
@@ -1676,11 +2672,23 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionServerName");
}
+ if (longTermRetentionDatabaseName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "longTermRetentionDatabaseName");
+ }
+ if (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1688,29 +2696,26 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("locationName", locationName);
tracingParameters.Add("longTermRetentionServerName", longTermRetentionServerName);
- tracingParameters.Add("onlyLatestPerDatabase", onlyLatestPerDatabase);
- tracingParameters.Add("databaseState", databaseState);
+ tracingParameters.Add("longTermRetentionDatabaseName", longTermRetentionDatabaseName);
+ tracingParameters.Add("backupName", backupName);
+ tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCopyByResourceGroup", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
_url = _url.Replace("{longTermRetentionServerName}", System.Uri.EscapeDataString(longTermRetentionServerName));
+ _url = _url.Replace("{longTermRetentionDatabaseName}", System.Uri.EscapeDataString(longTermRetentionDatabaseName));
+ _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
- if (onlyLatestPerDatabase != null)
- {
- _queryParameters.Add(string.Format("onlyLatestPerDatabase={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(onlyLatestPerDatabase, Client.SerializationSettings).Trim('"'))));
- }
- if (databaseState != null)
- {
- _queryParameters.Add(string.Format("databaseState={0}", System.Uri.EscapeDataString(databaseState)));
- }
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
@@ -1722,7 +2727,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -1753,6 +2758,12 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
// Serialize Request
string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1773,7 +2784,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1808,7 +2819,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1821,7 +2832,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1841,14 +2852,14 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
}
///
- /// Deletes a long term retention backup.
+ /// Updates an existing long term retention backup.
///
///
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
///
///
- /// The location of the database
+ /// The location of the database.
///
///
/// The name of the server
@@ -1859,6 +2870,9 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// The backup name.
///
+ ///
+ /// The requested backup resource state
+ ///
///
/// Headers that will be added to request.
///
@@ -1868,6 +2882,9 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -1877,7 +2894,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task BeginDeleteByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginUpdateByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -1899,11 +2916,15 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
}
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1916,13 +2937,14 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
tracingParameters.Add("longTermRetentionServerName", longTermRetentionServerName);
tracingParameters.Add("longTermRetentionDatabaseName", longTermRetentionDatabaseName);
tracingParameters.Add("backupName", backupName);
+ tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteByResourceGroup", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateByResourceGroup", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
_url = _url.Replace("{longTermRetentionServerName}", System.Uri.EscapeDataString(longTermRetentionServerName));
@@ -1941,7 +2963,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -1972,6 +2994,12 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
// Serialize Request
string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -2027,13 +3055,31 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -2044,6 +3090,10 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// Deletes a long term retention backup.
///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
///
/// The location of the database
///
@@ -2074,8 +3124,12 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task BeginDeleteWithHttpMessagesAsync(string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task BeginDeleteByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
if (locationName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "locationName");
@@ -2096,7 +3150,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2017-03-01-preview";
+ string apiVersion = "2020-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2104,17 +3158,19 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("locationName", locationName);
tracingParameters.Add("longTermRetentionServerName", longTermRetentionServerName);
tracingParameters.Add("longTermRetentionDatabaseName", longTermRetentionDatabaseName);
tracingParameters.Add("backupName", backupName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteByResourceGroup", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName));
_url = _url.Replace("{longTermRetentionServerName}", System.Uri.EscapeDataString(longTermRetentionServerName));
_url = _url.Replace("{longTermRetentionDatabaseName}", System.Uri.EscapeDataString(longTermRetentionDatabaseName));
@@ -2259,7 +3315,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByResourceGroupDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2274,7 +3330,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupDatabaseNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -2432,7 +3488,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByResourceGroupLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2447,7 +3503,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupLocationNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByLocationNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -2605,7 +3661,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByResourceGroupServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2620,7 +3676,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupServerNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByServerNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -2778,7 +3834,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByResourceGroupDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2793,7 +3849,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupDatabaseNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -2951,7 +4007,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByResourceGroupLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2966,7 +4022,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByLocationNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupLocationNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -3124,7 +4180,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByResourceGroupServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -3139,7 +4195,7 @@ internal LongTermRetentionBackupsOperations(SqlManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByServerNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupServerNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/LongTermRetentionBackupsOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/LongTermRetentionBackupsOperationsExtensions.cs
index 5e6f4a0dda2b..2cd514b86c70 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/LongTermRetentionBackupsOperationsExtensions.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/LongTermRetentionBackupsOperationsExtensions.cs
@@ -21,6 +21,517 @@ namespace Microsoft.Azure.Management.Sql
///
public static partial class LongTermRetentionBackupsOperationsExtensions
{
+ ///
+ /// Copy an existing long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ public static LongTermRetentionBackupOperationResult Copy(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters)
+ {
+ return operations.CopyAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Copy an existing long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CopyAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CopyWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Updates an existing long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The requested backup resource state
+ ///
+ public static LongTermRetentionBackupOperationResult Update(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters)
+ {
+ return operations.UpdateAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Updates an existing long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The requested backup resource state
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets a long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ public static LongTermRetentionBackup Get(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName)
+ {
+ return operations.GetAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets a long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Deletes a long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ public static void Delete(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName)
+ {
+ operations.DeleteAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Deletes a long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Lists all long term retention backups for a database.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// Whether or not to only get the latest backup for each database.
+ ///
+ ///
+ /// Whether to query against just live databases, just deleted databases, or
+ /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ public static IPage ListByDatabase(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string))
+ {
+ return operations.ListByDatabaseAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all long term retention backups for a database.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// Whether or not to only get the latest backup for each database.
+ ///
+ ///
+ /// Whether to query against just live databases, just deleted databases, or
+ /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByDatabaseAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists the long term retention backups for a given location.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// Whether or not to only get the latest backup for each database.
+ ///
+ ///
+ /// Whether to query against just live databases, just deleted databases, or
+ /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ public static IPage ListByLocation(this ILongTermRetentionBackupsOperations operations, string locationName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string))
+ {
+ return operations.ListByLocationAsync(locationName, onlyLatestPerDatabase, databaseState).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists the long term retention backups for a given location.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// Whether or not to only get the latest backup for each database.
+ ///
+ ///
+ /// Whether to query against just live databases, just deleted databases, or
+ /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByLocationAsync(this ILongTermRetentionBackupsOperations operations, string locationName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByLocationWithHttpMessagesAsync(locationName, onlyLatestPerDatabase, databaseState, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists the long term retention backups for a given server.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// Whether or not to only get the latest backup for each database.
+ ///
+ ///
+ /// Whether to query against just live databases, just deleted databases, or
+ /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ public static IPage ListByServer(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string))
+ {
+ return operations.ListByServerAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists the long term retention backups for a given server.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location of the database
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// Whether or not to only get the latest backup for each database.
+ ///
+ ///
+ /// Whether to query against just live databases, just deleted databases, or
+ /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByServerAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByServerWithHttpMessagesAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Copy an existing long term retention backup to a different server.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ public static LongTermRetentionBackupOperationResult CopyByResourceGroup(this ILongTermRetentionBackupsOperations operations, string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters)
+ {
+ return operations.CopyByResourceGroupAsync(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Copy an existing long term retention backup to a different server.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CopyByResourceGroupAsync(this ILongTermRetentionBackupsOperations operations, string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CopyByResourceGroupWithHttpMessagesAsync(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Updates an existing long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The requested backup resource state
+ ///
+ public static LongTermRetentionBackupOperationResult UpdateByResourceGroup(this ILongTermRetentionBackupsOperations operations, string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters)
+ {
+ return operations.UpdateByResourceGroupAsync(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Updates an existing long term retention backup.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The location of the database.
+ ///
+ ///
+ /// The name of the server
+ ///
+ ///
+ /// The name of the database
+ ///
+ ///
+ /// The backup name.
+ ///
+ ///
+ /// The requested backup resource state
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateByResourceGroupAsync(this ILongTermRetentionBackupsOperations operations, string resourceGroupName, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateByResourceGroupWithHttpMessagesAsync(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Gets a long term retention backup.
///
@@ -325,7 +836,7 @@ public static void DeleteByResourceGroup(this ILongTermRetentionBackupsOperation
}
///
- /// Gets a long term retention backup.
+ /// Copy an existing long term retention backup.
///
///
/// The operations group for this extension method.
@@ -342,13 +853,16 @@ public static void DeleteByResourceGroup(this ILongTermRetentionBackupsOperation
///
/// The backup name.
///
- public static LongTermRetentionBackup Get(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName)
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
+ public static LongTermRetentionBackupOperationResult BeginCopy(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters)
{
- return operations.GetAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).GetAwaiter().GetResult();
+ return operations.BeginCopyAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters).GetAwaiter().GetResult();
}
///
- /// Gets a long term retention backup.
+ /// Copy an existing long term retention backup.
///
///
/// The operations group for this extension method.
@@ -365,25 +879,28 @@ public static LongTermRetentionBackup Get(this ILongTermRetentionBackupsOperatio
///
/// The backup name.
///
+ ///
+ /// The parameters needed for long term retention copy request
+ ///
///
/// The cancellation token.
///
- public static async Task GetAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginCopyAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CopyLongTermRetentionBackupParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.BeginCopyWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Deletes a long term retention backup.
+ /// Updates an existing long term retention backup.
///
///
/// The operations group for this extension method.
///
///
- /// The location of the database
+ /// The location of the database.
///
///
/// The name of the server
@@ -394,19 +911,22 @@ public static LongTermRetentionBackup Get(this ILongTermRetentionBackupsOperatio
///
/// The backup name.
///
- public static void Delete(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName)
+ ///
+ /// The requested backup resource state
+ ///
+ public static LongTermRetentionBackupOperationResult BeginUpdate(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters)
{
- operations.DeleteAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).GetAwaiter().GetResult();
+ return operations.BeginUpdateAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters).GetAwaiter().GetResult();
}
///
- /// Deletes a long term retention backup.
+ /// Updates an existing long term retention backup.
///
///
/// The operations group for this extension method.
///
///
- /// The location of the database
+ /// The location of the database.
///
///
/// The name of the server
@@ -417,16 +937,22 @@ public static void Delete(this ILongTermRetentionBackupsOperations operations, s
///
/// The backup name.
///
+ ///
+ /// The requested backup resource state
+ ///
///
/// The cancellation token.
///
- public static async Task DeleteAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginUpdateAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, UpdateLongTermRetentionBackupParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.DeleteWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
- /// Lists all long term retention backups for a database.
+ /// Deletes a long term retention backup.
///
///
/// The operations group for this extension method.
@@ -440,20 +966,16 @@ public static void Delete(this ILongTermRetentionBackupsOperations operations, s
///
/// The name of the database
///
- ///
- /// Whether or not to only get the latest backup for each database.
- ///
- ///
- /// Whether to query against just live databases, just deleted databases, or
- /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ /// The backup name.
///
- public static IPage ListByDatabase(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string))
+ public static void BeginDelete(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName)
{
- return operations.ListByDatabaseAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState).GetAwaiter().GetResult();
+ operations.BeginDeleteAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).GetAwaiter().GetResult();
}
///
- /// Lists all long term retention backups for a database.
+ /// Deletes a long term retention backup.
///
///
/// The operations group for this extension method.
@@ -467,128 +989,85 @@ public static void Delete(this ILongTermRetentionBackupsOperations operations, s
///
/// The name of the database
///
- ///
- /// Whether or not to only get the latest backup for each database.
- ///
- ///
- /// Whether to query against just live databases, just deleted databases, or
- /// all databases. Possible values include: 'All', 'Live', 'Deleted'
+ ///
+ /// The backup name.
///
///
/// The cancellation token.
///
- public static async Task> ListByDatabaseAsync(this ILongTermRetentionBackupsOperations operations, string locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, bool? onlyLatestPerDatabase = default(bool?), string databaseState = default(string), CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///