Skip to content

Commit

Permalink
Add ReplicationLinks for older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
subhrob committed Apr 27, 2022
1 parent d60c193 commit 1bc2b74
Show file tree
Hide file tree
Showing 11 changed files with 2,976 additions and 211 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
{
"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}/databases/{databaseName}/replicationLinks/{linkId}/failover": {
"post": {
"tags": [
"ReplicationLinks"
],
"description": "Fails over from the current primary server to this server.",
"operationId": "ReplicationLinks_Failover",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
},
{
"$ref": "#/parameters/DatabaseNameParameter"
},
{
"name": "linkId",
"in": "path",
"description": "The name of the replication link.",
"required": true,
"type": "string"
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully failed over.",
"schema": {
"$ref": "#/definitions/ReplicationLink"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 ReplicationLinksReplicationLinkNameIsInvalid - Replication link name should be a valid guid.\n\n * 400 GeoReplicationDatabaseNotSecondary - The operation expects the database to be a replication target.\n\n * 400 LedgerNoDropLink - Geo-replication cannot be stopped because the database has Ledger Digest Uploads enabled. Disable Ledger Digest Uploads and retry the operation.\n\n * 400 CannotUseTrailingWhitespacesInDatabaseName - The database name validation failed.\n\n * 400 GeoReplicationDatabaseNotSecondary - The operation expects the database to be a replication target.\n\n * 400 CannotUseReservedDatabaseName - Cannot use reserved database name in this operation.\n\n * 400 InvalidServerName - Invalid server name specified.\n\n * 400 PlannedFailoverTimedOut - User invoked planned failover, and it timed out while trying to contact the partner management service.\n\n * 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.\n\n * 400 IncorrectReplicationLinkState - The operation expects the database to be in an expected state on the replication link.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\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 * 409 InvalidOperationForDatabaseNotInReplicationRelationship - A replication seeding operation was performed on a database that is already in a replication relationship.\n\n * 409 GeoReplicationCannotBecomePrimaryDuringUndo - User attempted to failover or force-terminate a geo-link while the secondary is in a state where it may not be physically consistent and so cannot enter the primary role.\n\n * 409 DuplicateGeoDrRelation - The databases are already in a replication relation. This is a duplicate request.\n\n * 409 UpdateSloInProgress - User tried to initiate an incompatible operation while a SLO update was in progress.\n\n * 409 ManagementServiceDatabaseBusy - Database '{0}' is busy with another operation. Please try your operation later.\n\n * 409 ConflictingSystemOperationInProgress - A system maintenance operation is in progress on the database and further operations need to wait until it is completed.\n\n * 409 FailoverGroupAlreadySetup - The operation cannot be performed because the geo-replication link is part of a Failover Group. You must remove the database from the group in order to individually terminate or failover.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation."
},
"202": {
"description": "Failover operation is in progress."
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"Planned failover of a replication link": {
"$ref": "./examples/ReplicationLinkFailover.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss": {
"post": {
"tags": [
"ReplicationLinks"
],
"description": "Fails over from the current primary server to this server allowing data loss.",
"operationId": "ReplicationLinks_FailoverAllowDataLoss",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
},
{
"$ref": "#/parameters/DatabaseNameParameter"
},
{
"name": "linkId",
"in": "path",
"description": "The name of the replication link.",
"required": true,
"type": "string"
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully failed over.",
"schema": {
"$ref": "#/definitions/ReplicationLink"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 ReplicationLinksReplicationLinkNameIsInvalid - Replication link name should be a valid guid.\n\n * 400 GeoReplicationDatabaseNotSecondary - The operation expects the database to be a replication target.\n\n * 400 LedgerNoDropLink - Geo-replication cannot be stopped because the database has Ledger Digest Uploads enabled. Disable Ledger Digest Uploads and retry the operation.\n\n * 400 CannotUseTrailingWhitespacesInDatabaseName - The database name validation failed.\n\n * 400 GeoReplicationDatabaseNotSecondary - The operation expects the database to be a replication target.\n\n * 400 CannotUseReservedDatabaseName - Cannot use reserved database name in this operation.\n\n * 400 InvalidServerName - Invalid server name specified.\n\n * 400 PlannedFailoverTimedOut - User invoked planned failover, and it timed out while trying to contact the partner management service.\n\n * 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.\n\n * 400 IncorrectReplicationLinkState - The operation expects the database to be in an expected state on the replication link.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\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 * 409 InvalidOperationForDatabaseNotInReplicationRelationship - A replication seeding operation was performed on a database that is already in a replication relationship.\n\n * 409 GeoReplicationCannotBecomePrimaryDuringUndo - User attempted to failover or force-terminate a geo-link while the secondary is in a state where it may not be physically consistent and so cannot enter the primary role.\n\n * 409 DuplicateGeoDrRelation - The databases are already in a replication relation. This is a duplicate request.\n\n * 409 UpdateSloInProgress - User tried to initiate an incompatible operation while a SLO update was in progress.\n\n * 409 ManagementServiceDatabaseBusy - Database '{0}' is busy with another operation. Please try your operation later.\n\n * 409 ConflictingSystemOperationInProgress - A system maintenance operation is in progress on the database and further operations need to wait until it is completed.\n\n * 409 FailoverGroupAlreadySetup - The operation cannot be performed because the geo-replication link is part of a Failover Group. You must remove the database from the group in order to individually terminate or failover.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation."
},
"202": {
"description": "Failover operation is in progress."
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"Forced failover of a replication link": {
"$ref": "./examples/ReplicationLinkFailoverAllowDataLoss.json"
}
}
}
}
},
"definitions": {
"ReplicationLink": {
"description": "A replication link.",
"type": "object",
"allOf": [
{
"$ref": "../../../common/v1/types.json#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/ReplicationLinkProperties",
"description": "Resource properties.",
"x-ms-client-flatten": true
}
}
},
"ReplicationLinkProperties": {
"description": "Properties of a replication link.",
"type": "object",
"properties": {
"partnerServer": {
"description": "Resource partner server.",
"type": "string",
"readOnly": true
},
"partnerDatabase": {
"description": "Resource partner database.",
"type": "string",
"readOnly": true
},
"partnerLocation": {
"description": "Resource partner location.",
"type": "string",
"readOnly": true
},
"role": {
"description": "Local replication role.",
"enum": [
"Primary",
"Secondary",
"NonReadableSecondary",
"Source",
"Copy"
],
"type": "string",
"readOnly": true,
"x-ms-enum": {
"name": "ReplicationRole",
"modelAsString": false
}
},
"partnerRole": {
"description": "Partner replication role.",
"enum": [
"Primary",
"Secondary",
"NonReadableSecondary",
"Source",
"Copy"
],
"type": "string",
"readOnly": true,
"x-ms-enum": {
"name": "ReplicationRole",
"modelAsString": false
}
},
"replicationMode": {
"description": "Replication mode.",
"type": "string",
"readOnly": true
},
"startTime": {
"format": "date-time",
"description": "Time at which the link was created.",
"type": "string",
"readOnly": true
},
"percentComplete": {
"format": "int32",
"description": "Seeding completion percentage for the link.",
"type": "integer",
"readOnly": true
},
"replicationState": {
"description": "Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED).",
"enum": [
"PENDING",
"SEEDING",
"CATCH_UP",
"SUSPENDED"
],
"type": "string",
"readOnly": true,
"x-ms-enum": {
"name": "ReplicationState",
"modelAsString": true
}
},
"isTerminationAllowed": {
"description": "Whether the user is currently allowed to terminate the link.",
"type": "boolean",
"readOnly": true
},
"linkType": {
"description": "Link type (GEO, NAMED, STANDBY).",
"enum": [
"GEO",
"NAMED",
"STANDBY"
],
"type": "string",
"readOnly": true,
"x-ms-enum": {
"name": "ReplicationLinkType",
"modelAsString": true
}
}
}
}
},
"parameters": {
"DatabaseNameParameter": {
"name": "databaseName",
"in": "path",
"description": "The name of the database.",
"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"
}
},
"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"
}
}
}
}
Loading

0 comments on commit 1bc2b74

Please sign in to comment.