From 559f7f474d944a92f6cb108eb433a05f3c53cd8e Mon Sep 17 00:00:00 2001 From: CelinaJiangJXY <124339390+CelinaJiangJXY@users.noreply.github.com> Date: Thu, 9 Mar 2023 18:54:25 -0800 Subject: [PATCH] [DO NOT MERGE] Add Archive option to LTR Policy for SQL DB (#22697) * add archival changes to LTRPolicy * fix LongTermRetentionPolicies swagger file * fix check failures * redo swagger --- .../LongTermRetentionPolicies.json | 22 ++++++++++++++----- ...LongTermRetentionPolicyCreateOrUpdate.json | 6 +++-- .../examples/LongTermRetentionPolicyGet.json | 3 ++- ...LongTermRetentionPolicyListByDatabase.json | 3 ++- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/LongTermRetentionPolicies.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/LongTermRetentionPolicies.json index 90d0b4970f47..7e1d444ee0bf 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/LongTermRetentionPolicies.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/LongTermRetentionPolicies.json @@ -48,7 +48,7 @@ } }, "default": { - "description": "*** Error Responses: ***\n\n * 400 ManagedInstanceStoppingOrStopped - Conflicting operation submitted while instance is in stopping/stopped state\n\n * 400 ManagedInstanceStarting - Conflicting operation submitted while instance is in starting state\n\n * 400 DatabaseNamedReplicaBackupRetentionConfigurationNotSupported - User attempted configuring backup retention policy on a Named Replica.\n\n * 400 LTRNotSupportedForPerDBCMK - Long-term Backup Retention is not supported when Database-level CMK is configured in preview.\n\n * 400 LongTermRetentionPolicyNotSupported - Long Term Retention is not supported on this database.\n\n * 400 LongTermRetentionPolicyInvalid - Long Term Retention policy is invalid.\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 409 ConflictingServerOperation - Server '{0}' is busy with another operation. Please try your operation later." + "description": "*** Error Responses: ***\n\n * 400 LTRNotSupportedForPerDBCMK - Long-term Backup Retention is not supported when Database-level CMK is configured in preview.\n\n * 400 LongTermRetentionPolicyNotSupported - Long Term Retention is not supported on this database.\n\n * 400 LongTermRetentionPolicyInvalid - Long Term Retention policy is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 409 ConflictingServerOperation - Server '{0}' is busy with another operation. Please try your operation later." } }, "x-ms-pageable": { @@ -107,7 +107,7 @@ } }, "default": { - "description": "*** Error Responses: ***\n\n * 400 ManagedInstanceStoppingOrStopped - Conflicting operation submitted while instance is in stopping/stopped state\n\n * 400 ManagedInstanceStarting - Conflicting operation submitted while instance is in starting state\n\n * 400 DatabaseNamedReplicaBackupRetentionConfigurationNotSupported - User attempted configuring backup retention policy on a Named Replica.\n\n * 400 LTRNotSupportedForPerDBCMK - Long-term Backup Retention is not supported when Database-level CMK is configured in preview.\n\n * 400 LongTermRetentionPolicyNotSupported - Long Term Retention is not supported on this database.\n\n * 400 LongTermRetentionPolicyInvalid - Long Term Retention policy is invalid.\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 409 ConflictingServerOperation - Server '{0}' is busy with another operation. Please try your operation later." + "description": "*** Error Responses: ***\n\n * 400 LTRNotSupportedForPerDBCMK - Long-term Backup Retention is not supported when Database-level CMK is configured in preview.\n\n * 400 LongTermRetentionPolicyNotSupported - Long Term Retention is not supported on this database.\n\n * 400 LongTermRetentionPolicyInvalid - Long Term Retention policy is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 409 ConflictingServerOperation - Server '{0}' is busy with another operation. Please try your operation later." } }, "x-ms-examples": { @@ -120,7 +120,7 @@ "tags": [ "LongTermRetentionPolicies" ], - "description": "Sets a database's long term retention policy.", + "description": "Set or update a database's long term retention policy.", "operationId": "LongTermRetentionPolicies_CreateOrUpdate", "parameters": [ { @@ -164,13 +164,13 @@ ], "responses": { "200": { - "description": "Successfully set the policy.", + "description": "Successfully updated the policy.", "schema": { "$ref": "#/definitions/LongTermRetentionPolicy" } }, "default": { - "description": "*** Error Responses: ***\n\n * 400 ManagedInstanceStoppingOrStopped - Conflicting operation submitted while instance is in stopping/stopped state\n\n * 400 ManagedInstanceStarting - Conflicting operation submitted while instance is in starting state\n\n * 400 InvalidResourceRequestBody - The resource or resource properties in the request body is empty or invalid.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 LongTermRetentionMissingWeekOfYear - WeekOfYear is required to be set between 1 and 52 in order to set yearly retention.\n\n * 400 DatabaseNamedReplicaBackupRetentionConfigurationNotSupported - User attempted configuring backup retention policy on a Named Replica.\n\n * 400 LTRNotSupportedForPerDBCMK - Long-term Backup Retention is not supported when Database-level CMK is configured in preview.\n\n * 400 LongTermRetentionPolicyNotSupported - Long Term Retention is not supported on this database.\n\n * 400 LongTermRetentionPolicyInvalid - Long Term Retention policy is invalid.\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 ConflictingServerOperation - Server '{0}' is busy with another operation. Please try your operation later.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources." + "description": "*** Error Responses: ***\n\n * 400 InvalidResourceRequestBody - The resource or resource properties in the request body is empty or invalid.\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 LongTermRetentionMissingWeekOfYear - WeekOfYear is required to be set between 1 and 52 in order to set yearly retention.\n\n * 400 LTRNotSupportedForPerDBCMK - Long-term Backup Retention is not supported when Database-level CMK is configured in preview.\n\n * 400 LongTermRetentionPolicyNotSupported - Long Term Retention is not supported on this database.\n\n * 400 LongTermRetentionPolicyInvalid - Long Term Retention policy is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 ConflictingServerOperation - Server '{0}' is busy with another operation. Please try your operation later.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources." }, "202": { "description": "Accepted" @@ -190,6 +190,18 @@ "description": "Properties of a long term retention policy", "type": "object", "properties": { + "backupStorageAccessTier": { + "description": "The BackupStorageAccessTier for the LTR backups", + "enum": [ + "Hot", + "Archive" + ], + "type": "string", + "x-ms-enum": { + "name": "BackupStorageAccessTier", + "modelAsString": true + } + }, "weeklyRetention": { "description": "The weekly retention policy for an LTR backup in an ISO 8601 format.", "type": "string" diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json index 582d1ff7ad04..fa369acfcef3 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json @@ -11,7 +11,8 @@ "weeklyRetention": "P1M", "monthlyRetention": "P1Y", "yearlyRetention": "P5Y", - "weekOfYear": 5 + "weekOfYear": 5, + "backupStorageAccessTier": "Hot" } } }, @@ -25,7 +26,8 @@ "weeklyRetention": "P1M", "monthlyRetention": "P1Y", "yearlyRetention": "P5Y", - "weekOfYear": 5 + "weekOfYear": 5, + "backupStorageAccessTier": "Hot" } } }, diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyGet.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyGet.json index 987ab0f479eb..d074eac5fa6f 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyGet.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyGet.json @@ -17,7 +17,8 @@ "weeklyRetention": "P1M", "monthlyRetention": "P1Y", "yearlyRetention": "P5Y", - "weekOfYear": 5 + "weekOfYear": 5, + "backupStorageAccessTier": "Archive" } } } diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json index 24d7c78e191d..27c5e77cb129 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json @@ -18,7 +18,8 @@ "weeklyRetention": "P1M", "monthlyRetention": "P1Y", "yearlyRetention": "P5Y", - "weekOfYear": 5 + "weekOfYear": 5, + "backupStorageAccessTier": "Archive" } } ]