Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Archive option to LTR Policy and LTR Backup for SQL DB #25799

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 LtrConfigPolicyUnsupportedIfAutoPauseEnabled - Enabling long-term backup retention for a serverless database is not supported if auto-pause is enabled.\n\n * 400 LtrConfigPolicyDuringVldbMigration - Enabling long-term backup retention for a database during migration to the Hyperscale service tier is not supported.\n\n * 400 LtrConfigPolicyDuringVldbReverseMigration - Enabling long-term backup retention for a database during a reverse migration from Hyperscale is not supported.\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 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 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 LtrConfigPolicyUnsupportedIfAutoPauseEnabled - Enabling long-term backup retention for a serverless database is not supported if auto-pause is enabled.\n\n * 400 LtrConfigPolicyDuringVldbMigration - Enabling long-term backup retention for a database during migration to the Hyperscale service tier is not supported.\n\n * 400 LtrConfigPolicyDuringVldbReverseMigration - Enabling long-term backup retention for a database during a reverse migration from Hyperscale is not supported.\n\n * 400 DatabaseNamedReplicaBackupRetentionConfigurationNotSupported - User attempted configuring backup retention policy on a Named Replica.\n\n * 400 LTRHyperscaleSetPolicyError - An error has occurred while enabling Long-term backup retention for this database. Please reach out to Microsoft support to enable long-term backup 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 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionNotFound - The requested subscription was not found.\n\n * 409 ConflictingServerOperation - Server '{0}' is busy with another operation. Please try your operation later.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources."
}
},
"x-ms-pageable": {
Expand Down Expand Up @@ -107,7 +107,7 @@
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 LtrConfigPolicyUnsupportedIfAutoPauseEnabled - Enabling long-term backup retention for a serverless database is not supported if auto-pause is enabled.\n\n * 400 LtrConfigPolicyDuringVldbMigration - Enabling long-term backup retention for a database during migration to the Hyperscale service tier is not supported.\n\n * 400 LtrConfigPolicyDuringVldbReverseMigration - Enabling long-term backup retention for a database during a reverse migration from Hyperscale is not supported.\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 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 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 LtrConfigPolicyUnsupportedIfAutoPauseEnabled - Enabling long-term backup retention for a serverless database is not supported if auto-pause is enabled.\n\n * 400 LtrConfigPolicyDuringVldbMigration - Enabling long-term backup retention for a database during migration to the Hyperscale service tier is not supported.\n\n * 400 LtrConfigPolicyDuringVldbReverseMigration - Enabling long-term backup retention for a database during a reverse migration from Hyperscale is not supported.\n\n * 400 DatabaseNamedReplicaBackupRetentionConfigurationNotSupported - User attempted configuring backup retention policy on a Named Replica.\n\n * 400 LTRHyperscaleSetPolicyError - An error has occurred while enabling Long-term backup retention for this database. Please reach out to Microsoft support to enable long-term backup 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 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionNotFound - The requested subscription was not found.\n\n * 409 ConflictingServerOperation - Server '{0}' is busy with another operation. Please try your operation later.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources."
}
},
"x-ms-examples": {
Expand All @@ -120,7 +120,7 @@
"tags": [
"LongTermRetentionPolicies"
],
"description": "Set or update a database's long term retention policy.",
"description": "Sets a database's long term retention policy.",
"operationId": "LongTermRetentionPolicies_CreateOrUpdate",
"parameters": [
{
Expand Down Expand Up @@ -164,13 +164,13 @@
],
"responses": {
"200": {
"description": "Successfully updated the policy.",
"description": "Successfully set the policy.",
"schema": {
"$ref": "#/definitions/LongTermRetentionPolicy"
}
},
"default": {
"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 LtrConfigPolicyUnsupportedIfAutoPauseEnabled - Enabling long-term backup retention for a serverless database is not supported if auto-pause is enabled.\n\n * 400 LtrConfigPolicyDuringVldbMigration - Enabling long-term backup retention for a database during migration to the Hyperscale service tier is not supported.\n\n * 400 LtrConfigPolicyDuringVldbReverseMigration - Enabling long-term backup retention for a database during a reverse migration from Hyperscale is not supported.\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 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 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 LtrConfigPolicyUnsupportedIfAutoPauseEnabled - Enabling long-term backup retention for a serverless database is not supported if auto-pause is enabled.\n\n * 400 LtrConfigPolicyDuringVldbMigration - Enabling long-term backup retention for a database during migration to the Hyperscale service tier is not supported.\n\n * 400 LtrConfigPolicyDuringVldbReverseMigration - Enabling long-term backup retention for a database during a reverse migration from Hyperscale is not supported.\n\n * 400 DatabaseNamedReplicaBackupRetentionConfigurationNotSupported - User attempted configuring backup retention policy on a Named Replica.\n\n * 400 LTRHyperscaleSetPolicyError - An error has occurred while enabling Long-term backup retention for this database. Please reach out to Microsoft support to enable long-term backup 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 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\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 CannotCancelOperation - The management operation is in a state that cannot be cancelled.\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"
Expand All @@ -186,6 +186,29 @@
}
},
"definitions": {
"BaseLongTermRetentionPolicyProperties": {
"description": "Properties of a long term retention policy",
"type": "object",
"properties": {
"weeklyRetention": {
"description": "The weekly retention policy for an LTR backup in an ISO 8601 format.",
"type": "string"
},
"monthlyRetention": {
"description": "The monthly retention policy for an LTR backup in an ISO 8601 format.",
"type": "string"
},
"yearlyRetention": {
"description": "The yearly retention policy for an LTR backup in an ISO 8601 format.",
"type": "string"
},
"weekOfYear": {
"format": "int32",
"description": "The week of year to take the yearly backup in an ISO 8601 format.",
"type": "integer"
}
}
},
"LongTermRetentionPolicy": {
"description": "A long term retention policy.",
"type": "object",
Expand All @@ -196,7 +219,7 @@
],
"properties": {
"properties": {
"$ref": "#/definitions/LongTermRetentionPolicyProperties",
"$ref": "#/definitions/BaseLongTermRetentionPolicyProperties",
"description": "Resource properties.",
"x-ms-client-flatten": true
}
Expand All @@ -220,33 +243,6 @@
"readOnly": true
}
}
},
"LongTermRetentionPolicyProperties": {
"description": "Properties of a long term retention policy",
"type": "object",
"properties": {
"makeBackupsImmutable": {
"description": "The setting whether to make LTR backups immutable",
"type": "boolean"
},
"weeklyRetention": {
"description": "The weekly retention policy for an LTR backup in an ISO 8601 format.",
"type": "string"
},
"monthlyRetention": {
"description": "The monthly retention policy for an LTR backup in an ISO 8601 format.",
"type": "string"
},
"yearlyRetention": {
"description": "The yearly retention policy for an LTR backup in an ISO 8601 format.",
"type": "string"
},
"weekOfYear": {
"format": "int32",
"description": "The week of year to take the yearly backup in an ISO 8601 format.",
"type": "integer"
}
}
}
},
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"locationName": "japaneast",
"longTermRetentionServerName": "serverName",
"longTermRetentionDatabaseName": "databaseName",
"backupName": "55555555-6666-7777-8888-999999999999;131637960820000000;Archive",
"api-version": "2023-05-01-preview",
"parameters": {
"backupStorageAccessTier": "Hot",
"operationMode": "Copy"
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/serverName/longTermRetentionDatabases/databaseName/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000;Archive",
"name": "55555555-6666-7777-8888-999999999999;131637960820000000;Archive",
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
"properties": {
"serverName": "serverName",
"serverCreateTime": "2017-09-06T08:00:00Z",
"databaseName": "databaseName",
"databaseDeletionTime": "2022-10-06T08:00:00Z",
"backupTime": "2022-09-06T08:00:00Z",
"backupExpirationTime": null,
"backupStorageRedundancy": "Geo"
}
}
},
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/serverName/longTermRetentionDatabases/databaseName/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000;Archive/operations/55555555-6666-7777-8888-999999999999?api-version=2023-05-01-preview"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"locationName": "japaneast",
"longTermRetentionServerName": "testserver",
"longTermRetentionDatabaseName": "testDatabase",
"backupName": "55555555-6666-7777-8888-999999999999;131637960820000000",
"backupName": "55555555-6666-7777-8888-999999999999;131637960820000000;Hot",
"api-version": "2023-05-01-preview"
},
"responses": {
"200": {},
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000/operations/55555555-6666-7777-8888-999999999999?api-version=2021-05-01"
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000;Hot/operations/55555555-6666-7777-8888-999999999999?api-version=2021-05-01"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"locationName": "japaneast",
"longTermRetentionServerName": "testserver",
"longTermRetentionDatabaseName": "testDatabase",
"backupName": "55555555-6666-7777-8888-999999999999;131637960820000000",
"backupName": "55555555-6666-7777-8888-999999999999;131637960820000000;Archive",
"api-version": "2023-05-01-preview"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z",
"name": "2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;131637960820000000",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000;Archive",
"name": "55555555-6666-7777-8888-999999999999;131637960820000000;Archive",
"type": "Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups",
"properties": {
"serverName": "testserver",
Expand All @@ -20,7 +20,8 @@
"databaseDeletionTime": null,
"backupTime": "2017-09-06T08:00:00Z",
"backupStorageRedundancy": "Geo",
"isBackupImmutable": false
"isBackupImmutable": false,
"backupStorageAccessTier": "Archive"
}
}
}
Expand Down
Loading