レプリケーション リンクの種類を更新します。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}?api-version=2023-05-01-preview
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
databaseName
|
path |
True
|
string
|
データベースの名前。
|
linkId
|
path |
True
|
string
|
|
resourceGroupName
|
path |
True
|
string
|
リソースが含まれているリソース グループの名前。 この値は、Azure リソース マネージャー API またはポータルから取得できます。
|
serverName
|
path |
True
|
string
|
サーバーの名前。
|
subscriptionId
|
path |
True
|
string
|
Azure サブスクリプションを識別するサブスクリプション ID。
|
api-version
|
query |
True
|
string
|
要求で使用する API のバージョン。
|
要求本文
名前 |
型 |
説明 |
properties.linkType
|
ReplicationLinkType
|
リンクの種類 (GEO、名前付き、スタンバイ)。 更新操作では NAMED はサポートされていません。
|
応答
名前 |
型 |
説明 |
200 OK
|
ReplicationLink
|
レプリケーション リンクが正常に更新されました。
|
202 Accepted
|
|
更新操作が進行中です。
|
Other Status Codes
|
ErrorResponse
|
エラー応答: ***
400 ReplicationLinksReplicationLinkNameIsInvalid - レプリケーション リンク名は有効な guid である必要があります。
400 GeoReplicationDatabaseNotSecondary - この操作では、データベースがレプリケーション ターゲットであることが想定されます。
400 ReplicationLinksReplicationLinkTypeIsInvalid - LinkType が無効です。 有効な値は STANDBY と GEO です。
400 ReplicationLinksCreateIsNotSupported - レプリケーション リンクの作成はサポートされていません。
400 LedgerNoDropLink - データベースで台帳ダイジェストアップロードが有効になっているため、geo レプリケーションを停止できません。 台帳ダイジェストのアップロードを無効にして、操作を再試行します。
400 CannotUseTrailingWhitespacesInDatabaseName - データベース名の検証に失敗しました。
400 GeoReplicationDatabaseNotSecondary - この操作では、データベースがレプリケーション ターゲットであることが想定されます。
400 VBSEnclaveNotSupportedForGeoReplicationWithDefaultEnclave - geo レプリケーションの構成は、preferredEnclaveType プロパティの異なる値を使用するデータベースではサポートされていません。 サーバー上のプライマリ {0} データベースでは preferredEnclaveType が使用{2}されますが、サーバー上{4}のセカンダリ {3} データベースに対して指定された preferredEnclaveType は です{5}{1}。
400 VBSEnclaveNotSupportedForPlannedFailoverBetweenDatabasesWithDifferentPreferredEnclaveTypes - preferredEnclaveType が異なるプライマリ データベースとセカンダリ データベース間の計画フェールオーバーは、仮想化ベースのセキュリティ (VBS) エンクレーブではサポートされていません。
400 CannotUseReservedDatabaseName - この操作で予約済みデータベース名を使用できません。
400 InvalidServerName - 無効なサーバー名が指定されています。
400 PlannedFailoverTimedOut - ユーザーが計画フェールオーバー呼び出し、パートナー管理サービスに問い合わせようとしているときにタイムアウトしました。
400 InvalidIdentifier - 識別子に NULL または無効な Unicode 文字が含まれています。
400 IncorrectReplicationLinkState - この操作では、データベースがレプリケーション リンクで予期された状態であることが想定されます。
404 OperationIdNotFound - Id を持つ操作が存在しません。
404 ResourceNotFound - 要求されたリソースが見つかりませんでした。
404 OperationIdNotFound - Id を持つ操作が存在しません。
404 DatabaseDoesNotExist - ユーザーがこのサーバー インスタンスに存在しないデータベース名を指定しました。
409 CannotCancelOperation - 管理操作が取り消すことができない状態です。
409 OperationCancelled - 操作がユーザーによって取り消されました。
409 OperationInterrupted - 同じリソースに対する別の操作によって中断されたため、リソースに対する操作を完了できませんでした。
409 InvalidOperationForDatabaseNotInReplicationRelationship - レプリケーション関係にないデータベースに対してレプリケーション操作が実行されました。
409 GeoReplicationCannotBecomePrimaryDuringUndo - セカンダリが物理的に一貫していない可能性があり、プライマリ ロールを入力できない状態にある間に、ユーザーが geo リンクをフェールオーバーまたは強制終了しようとしました。
409 DuplicateGeoDrRelation - データベースは既にレプリケーション関係にあります。 これは重複する要求です。
409 UpdateSloInProgress - SLO 更新の進行中に、ユーザーが互換性のない操作を開始しようとしました。
409 ManagementServiceDatabaseBusy - データベース '{0}' は別の操作でビジー状態です。 後で操作を試してください。
409 ConflictingSystemOperationInProgress - データベースでシステム メンテナンス操作が進行中であり、それ以上の操作が完了するまで待機する必要があります。
409 FailoverGroupAlreadySetup - geo レプリケーション リンクがフェールオーバー グループの一部であるため、操作を実行できません。 個別に終了またはフェールオーバーするには、グループからデータベースを削除する必要があります。
429 SubscriptionTooManyCreateUpdateRequests - 使用可能なリソースで処理できる最大要求を超える要求。
429 SubscriptionTooManyRequests - 使用可能なリソースで処理できる最大要求を超える要求。
500 OperationTimedOut - 操作がタイムアウトし、自動的にロールバックされました。 操作をやり直してください。
503 TooManyRequests - 使用可能なリソースで処理できる最大要求を超える要求。
|
例
Updates Replication Link
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sourcesvr/databases/gamma-db/replicationLinks/00000000-1111-2222-3333-666666666666?api-version=2023-05-01-preview
{
"properties": {
"linkType": "STANDBY"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.sql import SqlManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-sql
# USAGE
python replication_link_create_or_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SqlManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-1111-2222-3333-444444444444",
)
response = client.replication_links.begin_create_or_update(
resource_group_name="Default",
server_name="sourcesvr",
database_name="gamma-db",
link_id="00000000-1111-2222-3333-666666666666",
parameters={"properties": {"linkType": "STANDBY"}},
).result()
print(response)
# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkCreateOrUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql.Models;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkCreateOrUpdate.json
// this example is just showing the usage of "ReplicationLinks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://video2.skills-academy.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlDatabaseResource created on azure
// for more information of creating SqlDatabaseResource, please refer to the document of SqlDatabaseResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "Default";
string serverName = "sourcesvr";
string databaseName = "gamma-db";
ResourceIdentifier sqlDatabaseResourceId = SqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, databaseName);
SqlDatabaseResource sqlDatabase = client.GetSqlDatabaseResource(sqlDatabaseResourceId);
// get the collection of this SqlServerDatabaseReplicationLinkResource
SqlServerDatabaseReplicationLinkCollection collection = sqlDatabase.GetSqlServerDatabaseReplicationLinks();
// invoke the operation
string linkId = "00000000-1111-2222-3333-666666666666";
SqlServerDatabaseReplicationLinkData data = new SqlServerDatabaseReplicationLinkData()
{
LinkType = ReplicationLinkType.Standby,
};
ArmOperation<SqlServerDatabaseReplicationLinkResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, linkId, data);
SqlServerDatabaseReplicationLinkResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SqlServerDatabaseReplicationLinkData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"properties": {
"partnerServer": "testsvr",
"partnerDatabase": "gamma-db",
"partnerDatabaseId": "/subscriptions/00000000-1111-2222-3333-555555555555/resourceGroups/Second-Default/providers/Microsoft.Sql/servers/testsvr/databases/gamma-db",
"partnerLocation": "Japan East",
"role": "Primary",
"partnerRole": "Secondary",
"replicationMode": "ASYNC",
"startTime": "2018-06-21T08:12:43.783Z",
"percentComplete": 100,
"replicationState": "CATCH_UP",
"isTerminationAllowed": true,
"linkType": "STANDBY"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sourcesvr/databases/gamma-db/replicationLinks/4891ca10-ebd0-47d7-9182-c722651780fb",
"name": "00000000-1111-2222-3333-666666666666"
}
Location: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/japaneast/replicationLinksOperationResults/11111111-1111-1111-1111-111111111111
定義
ErrorAdditionalInfo
リソース管理エラーの追加情報。
名前 |
型 |
説明 |
info
|
object
|
追加情報。
|
type
|
string
|
追加情報の種類。
|
ErrorDetail
エラーの詳細。
名前 |
型 |
説明 |
additionalInfo
|
ErrorAdditionalInfo[]
|
エラーの追加情報。
|
code
|
string
|
エラー コード。
|
details
|
ErrorDetail[]
|
エラーの詳細です。
|
message
|
string
|
エラー メッセージ。
|
target
|
string
|
エラーのターゲット。
|
ErrorResponse
エラー応答
ReplicationLink
レプリケーション リンク。
名前 |
型 |
説明 |
id
|
string
|
リソースの ID
|
name
|
string
|
リソース名。
|
properties.isTerminationAllowed
|
boolean
|
ユーザーが現在リンクの終了を許可されているかどうか。
|
properties.linkType
|
ReplicationLinkType
|
リンクの種類 (GEO、名前付き、スタンバイ)。 更新操作では NAMED はサポートされていません。
|
properties.partnerDatabase
|
string
|
リソース パートナー データベース。
|
properties.partnerDatabaseId
|
string
|
リソース パートナー データベース ID。
|
properties.partnerLocation
|
string
|
リソース パートナーの場所。
|
properties.partnerRole
|
ReplicationRole
|
パートナー レプリケーション ロール。
|
properties.partnerServer
|
string
|
リソース パートナー サーバー。
|
properties.percentComplete
|
integer
|
リンクのシード処理完了率。
|
properties.replicationMode
|
string
|
レプリケーション モード。
|
properties.replicationState
|
ReplicationState
|
レプリケーションの状態 (保留中、シード処理、キャッチアップ、中断)。
|
properties.role
|
ReplicationRole
|
ローカル レプリケーション ロール。
|
properties.startTime
|
string
|
リンクが作成された時刻。
|
type
|
string
|
リソースの種類。
|
ReplicationLinkType
リンクの種類 (GEO、名前付き、スタンバイ)。 更新操作では NAMED はサポートされていません。
名前 |
型 |
説明 |
GEO
|
string
|
|
NAMED
|
string
|
|
STANDBY
|
string
|
|
ReplicationRole
ローカル レプリケーション ロール。
名前 |
型 |
説明 |
Copy
|
string
|
|
NonReadableSecondary
|
string
|
|
Primary
|
string
|
|
Secondary
|
string
|
|
Source
|
string
|
|
ReplicationState
レプリケーションの状態 (保留中、シード処理、キャッチアップ、中断)。
名前 |
型 |
説明 |
CATCH_UP
|
string
|
|
PENDING
|
string
|
|
SEEDING
|
string
|
|
SUSPENDED
|
string
|
|