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

[DO NOT MERGE] Add Archive option to LTR Policy for SQL DB #22697

Merged
merged 4 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"operationId": "LongTermRetentionPolicies_ListByDatabase",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
Expand All @@ -34,10 +34,10 @@
"$ref": "#/parameters/DatabaseNameParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will we use the specific resource Group/subscription/API version def?

"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
Expand All @@ -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": {
Expand All @@ -70,7 +70,7 @@
"operationId": "LongTermRetentionPolicies_Get",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
Expand All @@ -93,10 +93,10 @@
}
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
Expand All @@ -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": {
Expand All @@ -120,11 +120,11 @@
"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": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
Expand Down Expand Up @@ -156,21 +156,21 @@
}
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
"$ref": "#/parameters/ApiVersionParameter"
}
],
"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"
Expand All @@ -186,10 +186,57 @@
}
},
"definitions": {
"BaseLongTermRetentionPolicyProperties": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaking change for the property is expected? It has triggered the breaking change pipeline failed.

"LongTermRetentionPolicy": {
"description": "A long term retention policy.",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/LongTermRetentionPolicyProperties",
"description": "Resource properties.",
"x-ms-client-flatten": true
}
}
},
"LongTermRetentionPolicyListResult": {
"description": "A list of long term retention policies.",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/LongTermRetentionPolicy"
},
"readOnly": true
},
"nextLink": {
"description": "Link to retrieve next page of results.",
"type": "string",
"readOnly": true
}
}
},
"LongTermRetentionPolicyProperties": {
"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"
Expand All @@ -209,43 +256,63 @@
}
}
},
"LongTermRetentionPolicy": {
"description": "A long term retention policy.",
"ProxyResource": {
"description": "ARM proxy resource.",
"type": "object",
"allOf": [
{
"$ref": "../../../common/v1/types.json#/definitions/ProxyResource"
"$ref": "#/definitions/Resource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/BaseLongTermRetentionPolicyProperties",
"description": "Resource properties.",
"x-ms-client-flatten": true
}
}
"properties": {}
},
"LongTermRetentionPolicyListResult": {
"description": "A list of long term retention policies.",
"Resource": {
"description": "ARM resource.",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/LongTermRetentionPolicy"
},
"id": {
"description": "Resource ID.",
"type": "string",
"readOnly": true
},
"nextLink": {
"description": "Link to retrieve next page of results.",
"name": {
"description": "Resource name.",
"type": "string",
"readOnly": true
},
"type": {
"description": "Resource type.",
"type": "string",
"readOnly": true
}
}
},
"x-ms-azure-resource": true
}
},
"parameters": {
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"description": "The API version to use for the request.",
"required": true,
"type": "string",
"x-ms-parameter-location": "client"
},
"BlobAuditingPolicyNameParameter": {
"name": "blobAuditingPolicyName",
"in": "path",
"description": "The name of the blob auditing policy.",
"required": true,
"type": "string",
"enum": [
"default"
],
"x-ms-parameter-location": "method",
"x-ms-enum": {
"name": "blobAuditingPolicyName",
"modelAsString": false
}
},
"DatabaseNameParameter": {
"name": "databaseName",
"in": "path",
Expand All @@ -254,13 +321,85 @@
"type": "string",
"x-ms-parameter-location": "method"
},
"ManagedInstanceNameParameter": {
"name": "managedInstanceName",
"in": "path",
"description": "The name of the managed instance.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"ResourceGroupParameter": {
"name": "resourceGroupName",
"in": "path",
"description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"ServerNameParameter": {
"name": "serverName",
"in": "path",
"description": "The name of the server.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"SqlDatabaseNameParameter": {
"name": "sqlDatabaseName",
"in": "path",
"description": "The name of the sql database.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"SqlPoolNameParameter": {
"name": "sqlPoolName",
"in": "path",
"description": "The name of the sql pool.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"SqlVirtualMachineContainerNameParameter": {
"name": "sqlVirtualMachineContainerName",
"in": "path",
"description": "The name of the SqlVirtualMachineContainer.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"SqlVirtualMachineInstanceNameParameter": {
"name": "sqlVirtualMachineInstanceName",
"in": "path",
"description": "The name of the SqlVirtualMachineInstance.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"description": "The subscription ID that identifies an Azure subscription.",
"required": true,
"type": "string",
"x-ms-parameter-location": "client"
},
"VirtualClusterNameParameter": {
"name": "virtualClusterName",
"in": "path",
"description": "The name of the virtual cluster.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"WorkspaceNameParameter": {
"name": "workspaceName",
"in": "path",
"description": "The name of the workspace.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
}
},
"securityDefinitions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"weeklyRetention": "P1M",
"monthlyRetention": "P1Y",
"yearlyRetention": "P5Y",
"weekOfYear": 5
"weekOfYear": 5,
"backupStorageAccessTier": "Hot"
}
}
},
Expand All @@ -25,7 +26,8 @@
"weeklyRetention": "P1M",
"monthlyRetention": "P1Y",
"yearlyRetention": "P5Y",
"weekOfYear": 5
"weekOfYear": 5,
"backupStorageAccessTier": "Hot"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"weeklyRetention": "P1M",
"monthlyRetention": "P1Y",
"yearlyRetention": "P5Y",
"weekOfYear": 5
"weekOfYear": 5,
"backupStorageAccessTier": "Archive"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"weeklyRetention": "P1M",
"monthlyRetention": "P1Y",
"yearlyRetention": "P5Y",
"weekOfYear": 5
"weekOfYear": 5,
"backupStorageAccessTier": "Archive"
}
}
]
Expand Down