{ "swagger": "2.0", "info": { "version": "2017-10-01-preview", "title": "SqlManagementClient", "description": "The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities." }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}": { "get": { "tags": [ "BackupShortTermRetentionPolicies" ], "description": "Gets a database's short term retention policy.", "operationId": "BackupShortTermRetentionPolicies_Get", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/DatabaseNameParameter" }, { "name": "policyName", "in": "path", "description": "The policy name. Should always be \"default\".", "required": true, "type": "string", "enum": [ "default" ], "x-ms-enum": { "name": "ShortTermRetentionPolicyName", "modelAsString": true } }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved the policy.", "schema": { "$ref": "#/definitions/BackupShortTermRetentionPolicy" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidBackupRetentionDays - The retention days of {0} is not a valid configuration. Valid backup retention must be in 7-day increments (7, 14, 21, etc.)\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found." } }, "x-ms-examples": { "Get the short term retention policy for the database.": { "$ref": "./examples/GetShortTermRetentionPolicy.json" } } }, "put": { "tags": [ "BackupShortTermRetentionPolicies" ], "description": "Updates a database's short term retention policy.", "operationId": "BackupShortTermRetentionPolicies_CreateOrUpdate", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/DatabaseNameParameter" }, { "name": "policyName", "in": "path", "description": "The policy name. Should always be \"default\".", "required": true, "type": "string", "enum": [ "default" ], "x-ms-enum": { "name": "ShortTermRetentionPolicyName", "modelAsString": true } }, { "name": "parameters", "in": "body", "description": "The short term retention policy info.", "required": true, "schema": { "$ref": "#/definitions/BackupShortTermRetentionPolicy" } }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully updated the policy.", "schema": { "$ref": "#/definitions/BackupShortTermRetentionPolicy" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidBackupRetentionDays - The retention days of {0} is not a valid configuration. Valid backup retention must be in 7-day increments (7, 14, 21, etc.)\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 InvalidBackupRetentionPeriod - The retention days of {0} is not a valid configuration. Valid backup retention in days must be between {1} and {2}\n\n * 400 UpdateShortTermRetentionFeatureNotSupportedForEdition - This feature is not available for the selected database's edition {0}.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\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 * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 504 RequestTimeout - Service request exceeded the allowed timeout." }, "202": { "description": "Accepted" } }, "x-ms-long-running-operation": true, "x-ms-examples": { "Update the short term retention policy for the database.": { "$ref": "./examples/UpdateShortTermRetentionPolicy.json" } } }, "patch": { "tags": [ "BackupShortTermRetentionPolicies" ], "description": "Updates a database's short term retention policy.", "operationId": "BackupShortTermRetentionPolicies_Update", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/DatabaseNameParameter" }, { "name": "policyName", "in": "path", "description": "The policy name. Should always be \"default\".", "required": true, "type": "string", "enum": [ "default" ], "x-ms-enum": { "name": "ShortTermRetentionPolicyName", "modelAsString": true } }, { "name": "parameters", "in": "body", "description": "The short term retention policy info.", "required": true, "schema": { "$ref": "#/definitions/BackupShortTermRetentionPolicy" } }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully updated the policy.", "schema": { "$ref": "#/definitions/BackupShortTermRetentionPolicy" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidBackupRetentionDays - The retention days of {0} is not a valid configuration. Valid backup retention must be in 7-day increments (7, 14, 21, etc.)\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 InvalidBackupRetentionPeriod - The retention days of {0} is not a valid configuration. Valid backup retention in days must be between {1} and {2}\n\n * 400 UpdateShortTermRetentionFeatureNotSupportedForEdition - This feature is not available for the selected database's edition {0}.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\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 * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 504 RequestTimeout - Service request exceeded the allowed timeout." }, "202": { "description": "Accepted" } }, "x-ms-long-running-operation": true, "x-ms-examples": { "Update the short term retention policy for the database.": { "$ref": "./examples/UpdateShortTermRetentionPolicy.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies": { "get": { "tags": [ "BackupShortTermRetentionPolicies" ], "description": "Gets a database's short term retention policy.", "operationId": "BackupShortTermRetentionPolicies_ListByDatabase", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/DatabaseNameParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved the policy.", "schema": { "$ref": "#/definitions/BackupShortTermRetentionPolicyListResult" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidBackupRetentionDays - The retention days of {0} is not a valid configuration. Valid backup retention must be in 7-day increments (7, 14, 21, etc.)\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found." } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "Get the short term retention policy for the database.": { "$ref": "./examples/ListShortTermRetentionPoliciesByDatabase.json" } } } } }, "definitions": { "BackupShortTermRetentionPolicyProperties": { "description": "Properties of a short term retention policy", "type": "object", "properties": { "retentionDays": { "format": "int32", "description": "The backup retention period in days. This is how many days Point-in-Time Restore will be supported.", "type": "integer" } } }, "BackupShortTermRetentionPolicy": { "description": "A short term retention policy.", "type": "object", "allOf": [ { "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" } ], "properties": { "properties": { "$ref": "#/definitions/BackupShortTermRetentionPolicyProperties", "description": "Resource properties.", "x-ms-client-flatten": true } } }, "BackupShortTermRetentionPolicyListResult": { "description": "A list of short term retention policies.", "type": "object", "properties": { "value": { "description": "Array of results.", "type": "array", "items": { "$ref": "#/definitions/BackupShortTermRetentionPolicy" }, "readOnly": true }, "nextLink": { "description": "Link to retrieve next page of results.", "type": "string", "readOnly": true } } } }, "parameters": { "SubscriptionIdParameter": { "name": "subscriptionId", "in": "path", "description": "The subscription ID that identifies an Azure subscription.", "required": true, "type": "string", "x-ms-parameter-location": "client" }, "ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for the request.", "required": true, "type": "string", "x-ms-parameter-location": "client" }, "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" }, "ManagedInstanceNameParameter": { "name": "managedInstanceName", "in": "path", "description": "The name of the managed instance.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "DatabaseNameParameter": { "name": "databaseName", "in": "path", "description": "The name of the database.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "BlobAuditingPolicyNameParameter": { "name": "blobAuditingPolicyName", "in": "path", "description": "The name of the blob auditing policy.", "required": true, "type": "string", "enum": [ "default" ], "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" }, "SqlVirtualMachineContainerNameParameter": { "name": "sqlVirtualMachineContainerName", "in": "path", "description": "The name of the SqlVirtualMachineContainer.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "VirtualClusterNameParameter": { "name": "virtualClusterName", "in": "path", "description": "The name of the virtual cluster.", "required": true, "type": "string", "x-ms-parameter-location": "method" } }, "securityDefinitions": { "azure_auth": { "type": "oauth2", "description": "Azure Active Directory OAuth2 Flow", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } } }