更新路由表 - UpdateRouteTable
功能介绍
更新路由表。
调试
您可以在API Explorer中调试该接口。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,需具备如下身份策略权限。
授权项
访问级别
资源类型(*为必须)
条件键
别名
依赖的授权项
vpc:routeTables:update
Write
routeTable *
- vpc:RouteTableId
- vpc:VpcId
- g:EnterpriseProjectId
-
-
请求参数
| 名称 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| routetable | 是 | routetable object | 路由表对象,参见表3。 |
| 名称 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| name | 否 | String |
|
| description | 否 | String |
|
| routes | 否 | RouteTableRouteAction object |
|
| 参数 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| add | 否 | Array of AddRouteTableRoute objects | 新增路由条目,参见表5 新增route字段说明。 type,destination,nexthop必选。 |
| mod | 否 | Array of ModRouteTableRoute objects | 修改路由条目,参见表6 修改route字段说明。 type,destination,nexthop必选。 |
| del | 否 | Array of DelRouteTableRoute objects | 删除路由条目,参见表7 删除route字段说明。 destination必选。 |
| 名称 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| type | 是 | String |
|
| destination | 是 | String |
|
| nexthop | 是 | String |
|
| description | 否 | String |
|
| 参数 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| type | 是 | String |
|
| destination | 是 | String |
|
| nexthop | 是 | String |
|
| description | 否 | String |
|
| 参数 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| type | 否 | String |
|
| destination | 是 | String |
|
| nexthop | 否 | String |
|
| description | 否 | String |
|
请求示例
- 更新id为3d42a0d4-a980-4613-ae76-a2cddecff054的路由表,新增一条ecs类型的路由,修改一条ecs类型的路由,删除一条目的网段为20.20.10.0/24的路由。
PUT https://{Endpoint}/v1/6fbe9263116a4b68818cf1edce16bc4f/routetables/3d42a0d4-a980-4613-ae76-a2cddecff054 { "routetable": { "name": "routertable-789", "description": "abc", "routes": { "add": [ { "type": "ecs", "destination": "10.10.10.0/24", "nexthop": "7c50463d-d36c-4417-aa85-cc11fa10f341", "description": "abc" } ], "mod": [ { "type": "ecs", "destination": "20.10.10.0/24", "nexthop": "7c50463d-d36c-4417-aa85-cc11fa10f341", "description": "abc" } ], "del": [ { "destination": "20.20.10.0/24" } ] } } }
响应参数
| 名称 | 参数类型 | 说明 |
|---|---|---|
| routetable | routetable object | 路由表对象,参见表9。 |
| 名称 | 参数类型 | 说明 |
|---|---|---|
| id | String |
|
| name | String |
|
| default | Boolean |
|
| routes | Array of route objects |
|
| subnets | Array of subnet objects |
|
| tenant_id | String |
|
| vpc_id | String |
|
| description | String |
|
| created_at | String |
|
| updated_at | String |
|
| 名称 | 参数类型 | 说明 |
|---|---|---|
| type | String |
|
| destination | String |
|
| nexthop | String |
|
| description | String |
|
响应示例
{
"routetable": {
"id": "3d42a0d4-a980-4613-ae76-a2cddecff054",
"vpc_id": "ab78be2d-782f-42a5-aa72-35879f6890ff",
"description": "abc",
"default": false,
"routes": [
{
"type": "ecs",
"destination": "10.10.10.0/24",
"nexthop": "7c50463d-d36c-4417-aa85-cc11fa10f341",
"description": "abc"
}
],
"subnets": [
{
"id": "8d4ce32f-d68a-4c4c-9f18-c68d8a5c7f2f"
}
],
"tenant_id": "6fbe9263116a4b68818cf1edce16bc4f",
"created_at": "2022-12-15T02:56:40",
"updated_at": "2022-12-15T03:03:42"
}
} 状态码
请参见状态码。
错误码
请参考错误码。