Distributed Availability Groups - Set Role
設定分散式可用性群組中受控實例的角色。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/setRole?api-version=2025-01-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
distributed
|
path | True |
string |
分散式可用性組名。 |
|
managed
|
path | True |
string |
受控實例的名稱。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
|
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
要求本文
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| instanceRole | True |
分散式可用性群組中受控實例的新角色可以是「主要」或「次要」。 |
|
| roleChangeType | True |
角色變更的類型可以是計劃或強制。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
Azure 運作順利完成。 |
|
| 202 Accepted |
已接受資源作業。 標題
|
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow.
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| user_impersonation | 模擬您的用戶帳戶 |
範例
Set distributed availability group primary replica to managed instance.
範例要求
範例回覆
{
"name": "dag",
"type": "Microsoft.Sql/managedInstances/distributedAvailabilityGroups",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag",
"properties": {
"distributedAvailabilityGroupName": "dag",
"instanceLinkRole": "Primary"
}
}
Location: https://management.azure.com/subscriptions/f2669dff-5f08-45dd-b857-b2a60b72cdc9/providers/Microsoft.Sql/locations/westus/distributedAvailabilityGroupsOperationResults/00000000-1111-2222-3333-444444444444?api-version=2021-05-01-preview
定義
| 名稱 | Description |
|---|---|
|
Certificate |
憑證資訊 |
|
created |
建立資源的身分識別類型。 |
|
Distributed |
Box 與 SQL 受控執行個體 之間的分散式可用性群組。 |
|
Distributed |
資料庫特定資訊 |
|
Distributed |
分散式可用性群組故障轉移要求。 |
|
Error |
資源管理錯誤附加資訊。 |
|
Error |
錯誤詳細資料。 |
|
Error |
錯誤回應 |
|
Failover |
連結故障轉移模式——如果設計用於支援的 SQL Server 雙向故障轉移,則可為手動模式;若用於單向故障轉移至 Azure,則可為非 Able。 |
|
Instance |
分散式可用性群組中受控實例的新角色可以是「主要」或「次要」。 |
|
Link |
SQL 伺服器端連結角色 |
|
Replica |
連結連線狀態 |
|
Replica |
連結健全狀態 |
|
Replication |
連結的復寫模式 |
|
Role |
角色變更的類型可以是計劃或強制。 |
|
Seeding |
資料庫植入模式 – 可以是 [自動] (預設值),或支援案例的 [手動]。 |
|
system |
與建立和上次修改資源相關的元數據。 |
CertificateInfo
憑證資訊
| 名稱 | 類型 | Description |
|---|---|---|
| certificateName |
string |
憑證名稱 |
| expiryDate |
string (date-time) |
憑證到期日 |
createdByType
建立資源的身分識別類型。
| 值 | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DistributedAvailabilityGroup
Box 與 SQL 受控執行個體 之間的分散式可用性群組。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string (arm-id) |
資源的完整資源標識碼。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| name |
string |
資源的名稱 |
| properties.databases |
分散式可用性群組中的資料庫 |
|
| properties.distributedAvailabilityGroupId |
string (uuid) |
分散式可用性群組的標識碼 |
| properties.distributedAvailabilityGroupName |
string |
分散式可用性群組的名稱 |
| properties.failoverMode |
連結故障轉移模式——如果設計用於支援的 SQL Server 雙向故障轉移,則可為手動模式;若用於單向故障轉移至 Azure,則可為非 Able。 |
|
| properties.instanceAvailabilityGroupName |
string |
受控實例端可用性組名 |
| properties.instanceLinkRole |
受控實例端連結角色 |
|
| properties.partnerAvailabilityGroupName |
string |
SQL 伺服器端可用性組名 |
| properties.partnerEndpoint |
string |
SQL 伺服器端端點 - IP 或 DNS 可解析的名稱 |
| properties.partnerLinkRole |
SQL 伺服器端連結角色 |
|
| properties.replicationMode |
連結的復寫模式 |
|
| properties.seedingMode |
資料庫植入模式 – 可以是 [自動] (預設值),或支援案例的 [手動]。 |
|
| systemData |
Azure Resource Manager 包含 createdBy 與 modifiedBy 資訊的元資料。 |
|
| type |
string |
資源的類型。 例如:「Microsoft。運算/虛擬機器」或「Microsoft」。儲存/儲存帳號」 |
DistributedAvailabilityGroupDatabase
資料庫特定資訊
| 名稱 | 類型 | Description |
|---|---|---|
| connectedState |
連結連線狀態 |
|
| databaseName |
string |
連結中資料庫的名稱 |
| instanceRedoReplicationLagSeconds |
integer (int32) |
當 受控執行個體 連結端是主要時,重做延遲 |
| instanceReplicaId |
string (uuid) |
受控實例複本標識碼 |
| instanceSendReplicationLagSeconds |
integer (int32) |
當 受控執行個體 連結端是主要時,複寫延遲 |
| lastBackupLsn |
string |
上次備份 LSN |
| lastBackupTime |
string (date-time) |
上次備份 LSN 時間 |
| lastCommitLsn |
string |
上次認可 LSN |
| lastCommitTime |
string (date-time) |
上次認可 LSN 時間 |
| lastHardenedLsn |
string |
上次強化的 LSN |
| lastHardenedTime |
string (date-time) |
上次強化的 LSN 時間 |
| lastReceivedLsn |
string |
上次收到 LSN |
| lastReceivedTime |
string (date-time) |
上次收到 LSN 時間 |
| lastSentLsn |
string |
上次傳送的 LSN |
| lastSentTime |
string (date-time) |
上次傳送的 LSN 時間 |
| mostRecentLinkError |
string |
最新的連結連線錯誤描述 |
| partnerAuthCertValidity |
SQL Server 憑證有效性 |
|
| partnerReplicaId |
string (uuid) |
SQL Server 複本標識碼 |
| replicaState |
string |
目前的鏈接狀態 |
| seedingProgress |
string |
植入進度 |
| synchronizationHealth |
連結健全狀態 |
DistributedAvailabilityGroupSetRole
分散式可用性群組故障轉移要求。
| 名稱 | 類型 | Description |
|---|---|---|
| instanceRole |
分散式可用性群組中受控實例的新角色可以是「主要」或「次要」。 |
|
| roleChangeType |
角色變更的類型可以是計劃或強制。 |
ErrorAdditionalInfo
資源管理錯誤附加資訊。
| 名稱 | 類型 | Description |
|---|---|---|
| info |
object |
附加資訊。 |
| type |
string |
其他資訊類型。 |
ErrorDetail
錯誤詳細資料。
| 名稱 | 類型 | Description |
|---|---|---|
| additionalInfo |
錯誤附加資訊。 |
|
| code |
string |
錯誤碼。 |
| details |
錯誤詳情 |
|
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
| 名稱 | 類型 | Description |
|---|---|---|
| error |
錯誤物件。 |
FailoverModeType
連結故障轉移模式——如果設計用於支援的 SQL Server 雙向故障轉移,則可為手動模式;若用於單向故障轉移至 Azure,則可為非 Able。
| 值 | Description |
|---|---|
| None |
沒有 |
| Manual |
說明書 |
InstanceRole
分散式可用性群組中受控實例的新角色可以是「主要」或「次要」。
| 值 | Description |
|---|---|
| Primary |
主要 |
| Secondary |
Secondary |
LinkRole
SQL 伺服器端連結角色
| 值 | Description |
|---|---|
| Primary |
主要 |
| Secondary |
Secondary |
ReplicaConnectedState
連結連線狀態
| 值 | Description |
|---|---|
| DISCONNECTED |
已斷線 |
| CONNECTED |
CONNECTED |
ReplicaSynchronizationHealth
連結健全狀態
| 值 | Description |
|---|---|
| NOT_HEALTHY |
NOT_HEALTHY |
| PARTIALLY_HEALTHY |
PARTIALLY_HEALTHY |
| HEALTHY |
健康 |
ReplicationModeType
連結的復寫模式
| 值 | Description |
|---|---|
| Async |
非同步 |
| Sync |
同步 |
RoleChangeType
角色變更的類型可以是計劃或強制。
| 值 | Description |
|---|---|
| Forced |
強迫 |
| Planned |
規劃中 |
SeedingModeType
資料庫植入模式 – 可以是 [自動] (預設值),或支援案例的 [手動]。
| 值 | Description |
|---|---|
| Automatic |
自動 |
| Manual |
說明書 |
systemData
與建立和上次修改資源相關的元數據。
| 名稱 | 類型 | Description |
|---|---|---|
| createdAt |
string (date-time) |
資源建立的時間戳(UTC)。 |
| createdBy |
string |
建立資源的身分識別。 |
| createdByType |
建立資源的身分識別類型。 |
|
| lastModifiedAt |
string (date-time) |
資源上次修改的時間戳記 (UTC) |
| lastModifiedBy |
string |
上次修改資源的身分識別。 |
| lastModifiedByType |
上次修改資源的身分識別類型。 |