华为云计算 云知识 执行虚拟接口倒换测试SwitchoverTest
执行虚拟接口倒换测试SwitchoverTest

 

接口说明

客户双专线接入,需要支持双线自动倒换,方便进行功能测试。 虚拟接口进行倒换测试会导致接口关闭,业务流量中断。 对于虚拟接口,支持“关闭接口”和“开放接口”两种操作。 1、关闭接口:下发shutdown命令,关闭接口; 2、开放接口:下发undo_shutdown命令,使能接口。 倒换测试选择shutdown时,虚拟接口的状态为ADMIN_SHUTDOWN,此状态不允许虚拟接口的其他操作。 倒换测试选择undo_shutdown时,虚拟接口的状态为ACTIVE。

URL
POST  https://dcaas.cn-north-4.myhuaweicloud.com/v3/{project_id}/dcaas/switchover-test 
请求参数
名称 类型 IN 必选 描述
X-Auth-Token
 
string header

用户Token。 获取Token ,请参考《 统一身份认证 服务API参考》的“获取用户Token”章节。请求响应成功后在响应消息头中包含的“X-Subject-Token”的值即为Token值。

project_id
 
string path

租户项目ID

Body参数
名称 类型 必选 描述
switchover_test_record
 
CreateSwitchoverTest object

创建倒换测试记录对象参数

参数:
switchover_test_record
名称 类型 必选 描述
resource_id
 
string

倒换测试的资源对象ID

resource_type
 
string

倒换测试的资源对象类型

operation
 
string

shutdown, undo_shutdown表示倒换测试操作类型

返回参数
返回码: 201

CREATED

名称 类型 必选 描述
request_id
 
string

操作请求ID

switchover_test_record
 
SwitchoverTestRecord object

倒换测试记录信息

201 switchover_test_record
名称 类型 必选 描述
id
 
string

倒换测试记录的唯一标识

tenant_id
 
string

租户ID

resource_id
 
string

倒换测试的资源对象ID

resource_type
 
string

倒换测试的资源对象类型

operation
 
string

shutdown, undo_shutdown表示倒换测试操作类型

start_time
 
string

倒换测试操作的开始时间

end_time
 
string

倒换测试操作的结束时间

operate_status
 
string

倒换测试状态记录 STARTING: 初始状态 INPROGRESS: 配置下发中 COMPLETE: 配置下发完成 ERROR: 配置下发失败

请求示例
示例 1

对虚拟接口下发shutdown命令,关闭接口。

 
"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
点击  云专线  (DC) SDK, 下载SDK或查看SDK文档。SDK的安装、认证方式等在SDK文档中对应语言类型的【使用】目录下。
错误码
请参考 错误码说明

 

上一篇:创建目录CreateFsDir 下一篇:共享带宽介绍