update-tunnel (Update channel throttling)
The mgwutil update-tunnel command updates the throttling parameters for a specified channel, including the maximum queries per second (QPS), bandwidth limit, and tags. The command returns the status of the operation.
Command format
mgwutil update-tunnel <tunnel-id> [--max-qps <value>] [--max-bandwidth <value>] [--tags <value>]Parameters
Parameter | Required | Description |
tunnel-id | Yes | The channel ID. Obtain this ID from the result returned when you create the channel. |
--max-qps | No | The maximum queries per second (QPS) limit for the channel. |
--max-bandwidth | No | The maximum bandwidth limit for the channel, in Byte/s. |
--tags | No | The channel tags. |
Example
Set the maximum QPS of the channel tun-g6q2oota7182 to 1000 and the maximum bandwidth to 100 MB/s.
# 104857600 Byte/s is equal to 100 MB/s
mgwutil update-tunnel tun-g6q2oota7182 --max-qps 1000 --max-bandwidth 104857600Response
Successful response
{
"Code": "success" ,
"StatusCode": 200,
"LogTime": "2025-12-25 17:51:37",
"Data": {}
}Failed response
{
"Code": "fail",
"StatusCode": 404,
"LogTime": "2026-01-16 10:10:33",
"ErrorMsg": "SDKError: StatusCode: 404 Code: NoSuchImportTunnel Message: The specified import tunnel does not exist Data: {'AccessDeniedDetail':null,'Recommend':null,'ecCode':null,'hostId':'11***963876***55.cn-hangzhou.mgw.aliyuncs.com','requestId':'69699E196683E5383727FAAA','statusCode':404} ",
"ErrorCode": "NoSuchImportTunnel",
"RequestId": "69699E196683E5383727FAAA"
}Error codes
The error code indicates the category of the error. For more information, see the error message (ErrorMsg).
This error code is listed in common error codes.
ErrorCode | Description |
NoSuchImportTunnel | The channel does not exist. |
ImportTunnelNotBelongTo | The channel belongs to another user. |