{ "swagger": "2.0", "info": { "version": "2015-05-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}/keys": { "get": { "tags": [ "ServerKeys" ], "description": "Gets a list of server keys.", "operationId": "ServerKeys_ListByServer", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved the list of server keys.", "schema": { "$ref": "#/definitions/ServerKeyListResult" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidKeyName - An invalid value was given for the server key name.\n\n * 400 InvalidKeyType - The create server key type is not supported.\n\n * 400 InvalidKeyUpsertRequest - The create server key request does not exist or has no properties object.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found" } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "List the server keys by server": { "$ref": "./examples/ServerKeyList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}": { "get": { "tags": [ "ServerKeys" ], "description": "Gets a server key.", "operationId": "ServerKeys_Get", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "keyName", "in": "path", "description": "The name of the server key to be retrieved.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved the specified server key.", "schema": { "$ref": "#/definitions/ServerKey" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidKeyName - An invalid value was given for the server key name.\n\n * 400 InvalidKeyType - The create server key type is not supported.\n\n * 400 InvalidKeyUpsertRequest - The create server key request does not exist or has no properties object.\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 server key": { "$ref": "./examples/ServerKeyGet.json" } } }, "put": { "tags": [ "ServerKeys" ], "description": "Creates or updates a server key.", "operationId": "ServerKeys_CreateOrUpdate", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "keyName", "in": "path", "description": "The name of the server key to be operated on (updated or created). The key name is required to be in the format of 'vault_key_version'. For example, if the keyId is https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, then the server key name should be formatted as: YourVaultName_YourKeyName_01234567890123456789012345678901", "required": true, "type": "string" }, { "name": "parameters", "in": "body", "description": "The requested server key resource state.", "required": true, "schema": { "$ref": "#/definitions/ServerKey" } }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully updated the server key.", "schema": { "$ref": "#/definitions/ServerKey" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidKeyName - An invalid value was given for the server key name.\n\n * 400 InvalidKeyType - The create server key type is not supported.\n\n * 400 InvalidKeyUpsertRequest - The create server key request does not exist or has no properties object.\n\n * 400 AzureKeyVaultInvalidExpirationDate - The operation could not be completed because the Azure Key Vault key expiration date is invalid.\n\n * 400 AzureKeyVaultInvalidUri - An invalid response from Azure Key Vault. Please use a valid Azure Key Vault URI.\n\n * 400 AzureKeyVaultMalformedVaultUri - The provided Key Vault uri is not valid.\n\n * 400 AzureKeyVaultInvalidExpirationDate - The operation could not be completed because the Azure Key Vault key expiration date is invalid.\n\n * 400 AzureKeyVaultInvalidUri - An invalid response from Azure Key Vault. Please use a valid Azure Key Vault URI.\n\n * 400 AzureKeyVaultMalformedVaultUri - The provided Key Vault uri is not valid.\n\n * 401 AzureKeyVaultKeyDisabled - The operation could not be completed on the server because the Azure Key Vault key is disabled.\n\n * 401 AzureKeyVaultNoServerIdentity - The server identity is not correctly configured on server. Please contact support.\n\n * 401 AzureKeyVaultMissingPermissions - The server is missing required permissions on the Azure Key Vault. \n\n * 401 AdalGenericError - The operation could not be completed because an Azure Active Directory error was encountered.\n\n * 401 AdalServicePrincipalNotFound - The operation could not be completed because an Azure Active Directory library Service Principal not found error was encountered.\n\n * 401 AzureKeyVaultKeyDisabled - The operation could not be completed on the server because the Azure Key Vault key is disabled.\n\n * 401 AzureKeyVaultNoServerIdentity - The server identity is not correctly configured on server. Please contact support.\n\n * 401 AzureKeyVaultMissingPermissions - The server is missing required permissions on the Azure Key Vault. \n\n * 401 AdalGenericError - The operation could not be completed because an Azure Active Directory error was encountered.\n\n * 401 AdalServicePrincipalNotFound - The operation could not be completed because an Azure Active Directory library Service Principal not found error was encountered.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 409 ServerKeyUriAlreadyExists - The server key URI already exists on the server.\n\n * 409 ServerKeyDoesNotExists - The server key does not exist.\n\n * 409 AzureKeyVaultKeyNameNotFound - The operation could not be completed because the Azure Key Vault Key name does not exist.\n\n * 409 AzureKeyVaultKeyInUse - The key is currently being used by the server.\n\n * 409 ServerKeyNameAlreadyExists - The server key already exists on the server.\n\n * 409 ServerKeyUriAlreadyExists - The server key URI already exists on the server.\n\n * 409 ServerKeyDoesNotExists - The server key does not exist.\n\n * 409 AzureKeyVaultKeyNameNotFound - The operation could not be completed because the Azure Key Vault Key name does not exist.\n\n * 409 AzureKeyVaultKeyInUse - The key is currently being used by the server.\n\n * 409 ServerKeyNameAlreadyExists - The server key already exists on the server.\n\n * 503 AzureKeyVaultConnectionFailed - The operation could not be completed on the server because attempts to connect to Azure Key Vault have failed\n\n * 503 AzureKeyVaultGenericConnectionError - The operation could not be completed because an error was encountered when attempting to retrieve Key Vault information .\n\n * 503 AzureKeyVaultConnectionFailed - The operation could not be completed on the server because attempts to connect to Azure Key Vault have failed\n\n * 503 AzureKeyVaultGenericConnectionError - The operation could not be completed because an error was encountered when attempting to retrieve Key Vault information ." }, "202": { "description": "Accepted" }, "201": { "description": "Successfully created the server key.", "schema": { "$ref": "#/definitions/ServerKey" } } }, "x-ms-long-running-operation": true, "x-ms-examples": { "Creates or updates a server key": { "$ref": "./examples/ServerKeyCreateOrUpdate.json" } } }, "delete": { "tags": [ "ServerKeys" ], "description": "Deletes the server key with the given name.", "operationId": "ServerKeys_Delete", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "$ref": "#/parameters/ServerNameParameter" }, { "name": "keyName", "in": "path", "description": "The name of the server key to be deleted.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully deleted the server key." }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidKeyName - An invalid value was given for the server key name.\n\n * 400 InvalidKeyType - The create server key type is not supported.\n\n * 400 InvalidKeyUpsertRequest - The create server key request does not exist or has no properties object.\n\n * 400 AzureKeyVaultInvalidExpirationDate - The operation could not be completed because the Azure Key Vault key expiration date is invalid.\n\n * 400 AzureKeyVaultInvalidUri - An invalid response from Azure Key Vault. Please use a valid Azure Key Vault URI.\n\n * 400 AzureKeyVaultMalformedVaultUri - The provided Key Vault uri is not valid.\n\n * 401 AzureKeyVaultKeyDisabled - The operation could not be completed on the server because the Azure Key Vault key is disabled.\n\n * 401 AzureKeyVaultNoServerIdentity - The server identity is not correctly configured on server. Please contact support.\n\n * 401 AzureKeyVaultMissingPermissions - The server is missing required permissions on the Azure Key Vault. \n\n * 401 AdalGenericError - The operation could not be completed because an Azure Active Directory error was encountered.\n\n * 401 AdalServicePrincipalNotFound - The operation could not be completed because an Azure Active Directory library Service Principal not found error was encountered.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 409 ServerKeyUriAlreadyExists - The server key URI already exists on the server.\n\n * 409 ServerKeyDoesNotExists - The server key does not exist.\n\n * 409 AzureKeyVaultKeyNameNotFound - The operation could not be completed because the Azure Key Vault Key name does not exist.\n\n * 409 AzureKeyVaultKeyInUse - The key is currently being used by the server.\n\n * 409 ServerKeyNameAlreadyExists - The server key already exists on the server.\n\n * 503 AzureKeyVaultConnectionFailed - The operation could not be completed on the server because attempts to connect to Azure Key Vault have failed\n\n * 503 AzureKeyVaultGenericConnectionError - The operation could not be completed because an error was encountered when attempting to retrieve Key Vault information ." }, "202": { "description": "Accepted" }, "204": { "description": "The specified server key does not exist." } }, "x-ms-long-running-operation": true, "x-ms-examples": { "Delete the server key": { "$ref": "./examples/ServerKeyDelete.json" } } } } }, "definitions": { "ServerKeyListResult": { "description": "A list of server keys.", "type": "object", "properties": { "value": { "description": "Array of results.", "type": "array", "items": { "$ref": "#/definitions/ServerKey" }, "readOnly": true }, "nextLink": { "description": "Link to retrieve next page of results.", "type": "string", "readOnly": true } } }, "ServerKeyProperties": { "description": "Properties for a server key execution.", "required": [ "serverKeyType" ], "type": "object", "properties": { "subregion": { "description": "Subregion of the server key.", "type": "string", "readOnly": true }, "serverKeyType": { "description": "The server key type like 'ServiceManaged', 'AzureKeyVault'.", "enum": [ "ServiceManaged", "AzureKeyVault" ], "type": "string", "x-ms-enum": { "name": "ServerKeyType", "modelAsString": true } }, "uri": { "description": "The URI of the server key.", "type": "string" }, "thumbprint": { "description": "Thumbprint of the server key.", "type": "string" }, "creationDate": { "format": "date-time", "description": "The server key creation date.", "type": "string" } } }, "ServerKey": { "description": "A server key.", "type": "object", "allOf": [ { "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" } ], "properties": { "kind": { "description": "Kind of encryption protector. This is metadata used for the Azure portal experience.", "type": "string" }, "location": { "description": "Resource location.", "type": "string", "readOnly": true }, "properties": { "$ref": "#/definitions/ServerKeyProperties", "description": "Resource properties.", "x-ms-client-flatten": 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" }, "DatabaseNameParameter": { "name": "databaseName", "in": "path", "description": "The name of the database.", "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" } } } }