{ "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}/syncAgents/{syncAgentName}": { "get": { "tags": [ "SyncAgents" ], "description": "Gets a sync agent.", "operationId": "SyncAgents_Get", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server on which the sync agent is hosted.", "required": true, "type": "string" }, { "name": "syncAgentName", "in": "path", "description": "The name of the sync agent.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved the specified sync agent.", "schema": { "$ref": "#/definitions/SyncAgent" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotDeleteInUseSyncAgent - Cannot delete sync agent because it is used by sync member.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance." } }, "x-ms-examples": { "Get a sync agent": { "$ref": "./examples/SyncAgentGet.json" } } }, "put": { "tags": [ "SyncAgents" ], "description": "Creates or updates a sync agent.", "operationId": "SyncAgents_CreateOrUpdate", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server on which the sync agent is hosted.", "required": true, "type": "string" }, { "name": "syncAgentName", "in": "path", "description": "The name of the sync agent.", "required": true, "type": "string" }, { "name": "parameters", "in": "body", "description": "The requested sync agent resource state.", "required": true, "schema": { "$ref": "#/definitions/SyncAgent" } }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully updated the sync agent.", "schema": { "$ref": "#/definitions/SyncAgent" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotDeleteInUseSyncAgent - Cannot delete sync agent because it is used by sync member.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance." }, "202": { "description": "Creating or updating the sync agent is in progress." }, "201": { "description": "Successfully created the sync agent.", "schema": { "$ref": "#/definitions/SyncAgent" } } }, "x-ms-long-running-operation": true, "x-ms-examples": { "Update a sync agent": { "$ref": "./examples/SyncAgentUpdate.json" }, "Create a new sync agent": { "$ref": "./examples/SyncAgentCreate.json" } } }, "delete": { "tags": [ "SyncAgents" ], "description": "Deletes a sync agent.", "operationId": "SyncAgents_Delete", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server on which the sync agent is hosted.", "required": true, "type": "string" }, { "name": "syncAgentName", "in": "path", "description": "The name of the sync agent.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully deleted the sync agent." }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotDeleteInUseSyncAgent - Cannot delete sync agent because it is used by sync member.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance." }, "202": { "description": "Deleting the sync agent is in progress." }, "204": { "description": "The specified sync agent does not exist." } }, "x-ms-long-running-operation": true, "x-ms-examples": { "Delete a sync agent": { "$ref": "./examples/SyncAgentDelete.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents": { "get": { "tags": [ "SyncAgents" ], "description": "Lists sync agents in a server.", "operationId": "SyncAgents_ListByServer", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server on which the sync agent is hosted.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved the list of sync agents.", "schema": { "$ref": "#/definitions/SyncAgentListResult" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotDeleteInUseSyncAgent - Cannot delete sync agent because it is used by sync member.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance." } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "Get sync agents under a server": { "$ref": "./examples/SyncAgentListByServer.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey": { "post": { "tags": [ "SyncAgents" ], "description": "Generates a sync agent key.", "operationId": "SyncAgents_GenerateKey", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server on which the sync agent is hosted.", "required": true, "type": "string" }, { "name": "syncAgentName", "in": "path", "description": "The name of the sync agent.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully generate a sync agent key.", "schema": { "$ref": "#/definitions/SyncAgentKeyProperties" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotDeleteInUseSyncAgent - Cannot delete sync agent because it is used by sync member.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance." } }, "x-ms-examples": { "Generate a sync agent key": { "$ref": "./examples/SyncAgentGenerateKey.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases": { "get": { "tags": [ "SyncAgents" ], "description": "Lists databases linked to a sync agent.", "operationId": "SyncAgents_ListLinkedDatabases", "parameters": [ { "$ref": "#/parameters/ResourceGroupParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server on which the sync agent is hosted.", "required": true, "type": "string" }, { "name": "syncAgentName", "in": "path", "description": "The name of the sync agent.", "required": true, "type": "string" }, { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Successfully retrieved sync agent linked SQL server databases.", "schema": { "$ref": "#/definitions/SyncAgentLinkedDatabaseListResult" } }, "default": { "description": "*** Error Responses: ***\n\n * 400 InvalidSyncGroupCreateOrUpdateRequest - The create or update sync group request body is empty.\n\n * 400 InvalidSyncMemberCreateOrUpdateRequest - The create or update sync member request body is empty.\n\n * 400 InvalidSyncAgentCreateOrUpdateRequest - The create or update sync agent request body is empty.\n\n * 400 InvalidDatabaseResourceId - Invalid database resource identifier.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 InvalidSyncAgentResourceId - Invalid sync agent resource identifier.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 InvalidSyncAgent - Sync agent is invalid.\n\n * 400 CannotDeleteInUseSyncAgent - Cannot delete sync agent because it is used by sync member.\n\n * 400 InvalidSyncMetadataDatabase - Sync metadata database is invalid.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance." } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "Get sync agent linked databases": { "$ref": "./examples/SyncAgentGetLinkedDatabases.json" } } } } }, "definitions": { "SyncAgentProperties": { "description": "Properties of an Azure SQL Database sync agent.", "type": "object", "properties": { "name": { "description": "Name of the sync agent.", "type": "string", "readOnly": true }, "syncDatabaseId": { "description": "ARM resource id of the sync database in the sync agent.", "type": "string" }, "lastAliveTime": { "format": "date-time", "description": "Last alive time of the sync agent.", "type": "string", "readOnly": true }, "state": { "description": "State of the sync agent.", "enum": [ "Online", "Offline", "NeverConnected" ], "type": "string", "readOnly": true, "x-ms-enum": { "name": "SyncAgentState", "modelAsString": true } }, "isUpToDate": { "description": "If the sync agent version is up to date.", "type": "boolean", "readOnly": true }, "expiryTime": { "format": "date-time", "description": "Expiration time of the sync agent version.", "type": "string", "readOnly": true }, "version": { "description": "Version of the sync agent.", "type": "string", "readOnly": true } } }, "SyncAgent": { "description": "An Azure SQL Database sync agent.", "type": "object", "allOf": [ { "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" } ], "properties": { "properties": { "$ref": "#/definitions/SyncAgentProperties", "description": "Resource properties.", "x-ms-client-flatten": true } } }, "SyncAgentListResult": { "description": "A list of sync agents.", "type": "object", "properties": { "value": { "description": "Array of results.", "type": "array", "items": { "$ref": "#/definitions/SyncAgent" }, "readOnly": true }, "nextLink": { "description": "Link to retrieve next page of results.", "type": "string", "readOnly": true } } }, "SyncAgentKeyProperties": { "description": "Properties of an Azure SQL Database sync agent key.", "type": "object", "properties": { "syncAgentKey": { "description": "Key of sync agent.", "type": "string", "readOnly": true } } }, "SyncAgentLinkedDatabaseListResult": { "description": "A list of sync agent linked databases.", "type": "object", "properties": { "value": { "description": "Array of results.", "type": "array", "items": { "$ref": "#/definitions/SyncAgentLinkedDatabase" }, "readOnly": true }, "nextLink": { "description": "Link to retrieve next page of results.", "type": "string", "readOnly": true } } }, "SyncAgentLinkedDatabaseProperties": { "description": "Properties of an Azure SQL Database sync agent linked database.", "type": "object", "properties": { "databaseType": { "description": "Type of the sync agent linked database.", "enum": [ "AzureSqlDatabase", "SqlServerDatabase" ], "type": "string", "readOnly": true, "x-ms-enum": { "name": "SyncMemberDbType", "modelAsString": true } }, "databaseId": { "description": "Id of the sync agent linked database.", "type": "string", "readOnly": true }, "description": { "description": "Description of the sync agent linked database.", "type": "string", "readOnly": true }, "serverName": { "description": "Server name of the sync agent linked database.", "type": "string", "readOnly": true }, "databaseName": { "description": "Database name of the sync agent linked database.", "type": "string", "readOnly": true }, "userName": { "description": "User name of the sync agent linked database.", "type": "string", "readOnly": true } } }, "SyncAgentLinkedDatabase": { "description": "An Azure SQL Database sync agent linked database.", "type": "object", "allOf": [ { "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" } ], "properties": { "properties": { "$ref": "#/definitions/SyncAgentLinkedDatabaseProperties", "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" } } } }