華為云計(jì)算 云知識(shí) 執(zhí)行虛擬接口倒換測試SwitchoverTest
執(zhí)行虛擬接口倒換測試SwitchoverTest

 

接口說明

客戶雙專線接入,需要支持雙線自動(dòng)倒換,方便進(jìn)行功能測試。 虛擬接口進(jìn)行倒換測試會(huì)導(dǎo)致接口關(guān)閉,業(yè)務(wù)流量中斷。 對于虛擬接口,支持“關(guān)閉接口”和“開放接口”兩種操作。 1、關(guān)閉接口:下發(fā)shutdown命令,關(guān)閉接口; 2、開放接口:下發(fā)undo_shutdown命令,使能接口。 倒換測試選擇shutdown時(shí),虛擬接口的狀態(tài)為ADMIN_SHUTDOWN,此狀態(tài)不允許虛擬接口的其他操作。 倒換測試選擇undo_shutdown時(shí),虛擬接口的狀態(tài)為ACTIVE。

URL
POST  https://dcaas.cn-north-4.myhuaweicloud.com/v3/{project_id}/dcaas/switchover-test 
請求參數(shù)
名稱 類型 IN 必選 描述
X-Auth-Token
 
string header

用戶Token。 獲取Token ,請參考《 統(tǒng)一身份認(rèn)證 服務(wù)API參考》的“獲取用戶Token”章節(jié)。請求響應(yīng)成功后在響應(yīng)消息頭中包含的“X-Subject-Token”的值即為Token值。

project_id
 
string path

租戶項(xiàng)目ID

Body參數(shù)
名稱 類型 必選 描述
switchover_test_record
 
CreateSwitchoverTest object

創(chuàng)建倒換測試記錄對象參數(shù)

參數(shù):
switchover_test_record
名稱 類型 必選 描述
resource_id
 
string

倒換測試的資源對象ID

resource_type
 
string

倒換測試的資源對象類型

operation
 
string

shutdown, undo_shutdown表示倒換測試操作類型

返回參數(shù)
返回碼: 201

CREATED

名稱 類型 必選 描述
request_id
 
string

操作請求ID

switchover_test_record
 
SwitchoverTestRecord object

倒換測試記錄信息

201 switchover_test_record
名稱 類型 必選 描述
id
 
string

倒換測試記錄的唯一標(biāo)識(shí)

tenant_id
 
string

租戶ID

resource_id
 
string

倒換測試的資源對象ID

resource_type
 
string

倒換測試的資源對象類型

operation
 
string

shutdown, undo_shutdown表示倒換測試操作類型

start_time
 
string

倒換測試操作的開始時(shí)間

end_time
 
string

倒換測試操作的結(jié)束時(shí)間

operate_status
 
string

倒換測試狀態(tài)記錄 STARTING: 初始狀態(tài) INPROGRESS: 配置下發(fā)中 COMPLETE: 配置下發(fā)完成 ERROR: 配置下發(fā)失敗

請求示例
示例 1

對虛擬接口下發(fā)shutdown命令,關(guān)閉接口。

 
"POST https://{dc_endpoint}/v3/de58f033eb664102ba85e4a5db473ca5/dcaas/switchover-test"
 
{ "switchover_test_record": { "resource_type": "virtual_interface", "resource_id": "d0b3329c-0063-470c-b1dc-657656b2e540", "operation": "shutdown" } }
返回示例
返回碼:201

CREATED

示例 1
 
{
"switchover_test_record": {
"id": "862d61f1-d9ea-4093-ba0e-2b8d415e3ab3",
"tenant_id": "de58f033eb664102ba85e4a5db473ca5",
"resource_type": "virtual_interface",
"resource_id": "d0b3329c-0063-470c-b1dc-657656b2e540",
"operation": "shutdown",
"start_time": "2023-10-09T18:41:23.000Z",
"end_time": "2023-10-09T18:41:23.000Z",
"operate_status": "STARTING"
},
"request_id": "f91634a12b116b6f946d7871f5b4de18"
}
SDK
點(diǎn)擊  云專線  (DC) SDK, 下載SDK或查看SDK文檔。SDK的安裝、認(rèn)證方式等在SDK文檔中對應(yīng)語言類型的【使用】目錄下。
錯(cuò)誤碼
請參考 錯(cuò)誤碼說明。