更新二层连接 - UpdateConnection
功能介绍
当您的二层连接创建成功后,您可以通过调用此接口更新一个二层连接的名称。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备如下身份策略权限,更多的权限说明请参见权限和授权项。
授权项 | 访问级别 | 资源类型(*为必须) | 条件键 | 别名 | 依赖的授权项 |
|---|---|---|---|---|---|
esw:connection:update | Write | - | - | - | - |
URI
PUT /v3/{project_id}/l2cg/instances/{instance_id}/connections/{connection_id}
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
connection_id | 是 | String |
|
instance_id | 是 | String |
|
project_id | 是 | String |
|
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
connection | 是 | UpdateConnectionOption object |
|
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
request_id | String |
|
connection | Connection object |
|
参数 | 参数类型 | 描述 |
|---|---|---|
fixed_ips | Array of strings |
|
id | String |
|
instance_id | String |
|
name | String |
|
project_id | String |
|
remote_infos | Array of RemoteInfosResult objects |
|
status | String |
|
virsubnet_id | String |
|
vpc_id | String |
|
created_at | String |
|
updated_at | String |
|
参数 | 参数类型 | 描述 |
|---|---|---|
segmentation_id | Integer |
|
tunnel_ip | String |
|
tunnel_port | Integer |
|
tunnel_type | String |
|
请求示例
PUT https://{endpoint}/v3/dd9e484e058b48e18b820948dcbd480e/l2cg/instances/87fea8df-3e0d-473a-a1bd-e6a76157f4ce/connections/b6eb65d0-0079-4432-86b9-60a066fe21d4
{
"connection" : {
"name" : "test"
}
} 响应示例
状态码:200
PUT操作正常返回,更多状态码请参见状态码。
{
"request_id" : "861c233f7fa7ace487a565ac1e2a6f19",
"connection" : {
"name" : "l2conn-update",
"id" : "b6eb65d0-0079-4432-86b9-60a066fe21d4",
"status" : "disconnect",
"created_at" : "2025-07-28T08:22:21Z",
"updated_at" : "2025-07-28T08:25:59Z",
"project_id" : "dd9e484e058b48e18b820948dcbd480e",
"instance_id" : "87fea8df-3e0d-473a-a1bd-e6a76157f4ce",
"vpc_id" : "6ae030de-f630-476e-8284-7bcfbd94929d",
"virsubnet_id" : "2c649856-0d44-400c-8194-f6d67603e0eb",
"fixed_ips" : [ "192.168.0.116", "192.168.0.96" ],
"remote_infos" : [ {
"segmentation_id" : 7127,
"tunnel_ip" : "192.168.111.111",
"tunnel_port" : 4789,
"tunnel_type" : "vxlan"
} ]
}
} 状态码
状态码 | 描述 |
|---|---|
200 | PUT操作正常返回,更多状态码请参见状态码。 |
错误码
请参见错误码。

