You need to enable JavaScript to run this app.
导航
DescribeTransitRouterFlowLogs
最近更新时间:2025.05.13 08:43:10首次发布时间:2025.05.13 08:43:10
我的收藏
有用
有用
无用
无用

调用DescribeTransitRouterFlowLogs接口,查询满足指定条件的TR流日志列表。

调试

请求参数

名称类型是否必选示例值描述
ActionStringDescribeTransitRouterFlowLogs要执行的操作,取值为DescribeTransitRouterFlowLogs。
VersionString2020-04-01API版本信息,当前版本为2020-04-01。
TransitRouterIdStringtr-7qthudw0ll6jmc****中转路由器实例的ID。您可以调用DescribeTransitRouters接口获取中转路由器实例的ID。

TransitRouterFlowLogIds.N

String

TransitRouterFlowLogIds.1=tr-fl-372whz43lbwnb28twj****&TransitRouterFlowLogIds.2=tr-fl-w2h5z43b9nb8rwh****

TR流日志的ID。

  • N:表示TR流日志ID的序号,取值范围为1~100。

  • 多个TR流日志ID之间使用&分隔。

TransitRouterFlowLogName

String

tr-flowlog

TR流日志的名称。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文和以下特殊字符:点号(.)、下划线(_)和短横线(-)。

  • 长度限制为1 ~ 128个字符。

ResourceType

String

PeerAttachment

TR流日志绑定的资源类型。

  • PeerAttachment:跨地域连接。
ResourceIdStringtr-attach-12w7hruhlhlrd****TR流日志绑定资源的ID。

Status

String

Active

TR流日志的状态。

  • Active:已启用。

  • Inactive:已停止。

  • Creating:创建中。

  • Pending:配置中。

  • Deleting:删除中。

TlsProjectIdstringfc69****日志项目的ID。
TlsTopicIdstringb***********日志主题的ID。
PageNumberInteger1列表的页码,默认值为1。
PageSizeInteger20分页查询时每页的行数,取值范围为1 ~ 100**,** 默认值为20。

TagFilters.N.Key

String

TagFilters.1.Key=k1&TagFilters.2.Key=k2

标签的标签键。

  • N:表示标签键的序号,取值范围 1~10。多个标签键之间使用&分隔。

  • 指定多个标签键时,表示查询同时包含所有指定标签键的TR流日志。

TagFilters.N.Values.N

String

TagFilters.1.Values.1=v1&TagFilters.1.Values.2=v2&TagFilters.2.Values.1=v3

标签的标签值。

  • 第一个N:表示标签键的序号,取值范围 1~10。

  • 第二个N:表示标签值的序号,取值范围 1~3。同一标签键多个标签值之间的关系为逻辑“或(OR)”,即查询同一标签键下添加其中一个标签值的资源。

  • 多个标签值之间使用&分隔。

  • 如果传入该参数,则必须先传入TagFilters.N.Key

  • 该参数传入空值时,表示查询指定标签键下标签值为空的资源。

返回参数

名称类型示例值描述
PageSizeInteger20当前分页的行数。
PageNumberInteger1当前页码。
TotalCountInteger2符合条件的TR流日志总数。

TransitRouterFlowlogs

Array of Struct

-

符合条件的TR流日志的详细信息。具体请参见下表“ TransitRouterFlowlogs ”。

TransitRouterFlowlogs

名称类型示例值描述
AccountIdString200100****TR流日志所属的账号ID。
AggregationIntervalInteger10TR流日志的采集周期,也是TR聚合日志数据并上报给TLS的周期,单位为分钟。
CreatedAtString2021-08-05T21:46:55+08:00TR流日志的创建时间。
DescriptionStringThis is test flow log.TR流日志的描述。

LogFormatString

String

${srcaddr}${dstaddr}${srcport}${dstport}${protocol}${bytes}${tr-id}${src-region-id}${dst-region-id}${attachment-id}${packets}${start}${end}${packets-lost-no-route}${packets-lost-blackhole}${direction}

TR流日志记录的日志字段。

ResourceType

String

PeerAttachment

TR流日志绑定的资源类型。

  • PeerAttachment:跨地域连接。
ResourceIdStringtr-attach-12w7hruhlhlrd****TR流日志绑定资源的ID,即跨地域连接的ID。

Status

String

Active

TR流日志的状态。

  • Active:已启用。

  • Inactive:已停止。

  • Creating:创建中。

  • Pending:配置中。

  • Deleting:删除中。

TlsProjectIdStringfc69****日志项目的ID。
TlsProjectNameStringtr-project日志项目的名称。
TlsTopicIdStringb***********日志主题的ID。
TlsTopicNameStringtr-topic日志主题的名称。
TransitRouterFlowLogIdStringtr-fl-12rf4ert4****TR流日志的ID。
TransitRouterFlowLogNameStringtestFlowLogTR流日志的名称。
TransitRouterIdStringtr-1hr3ty5rst****TR流日志所属TR实例的ID。
UpdatedAtString2021-08-05T21:46:55+08:00TR流日志的最近更新时间。
TagsArray of Struct-标签信息。具体请参见下表“Tags”。

Tags

名称类型示例值描述
KeyStringk1标签的标签键。
ValueStringv1标签的标签值。

请求示例

GET /?Action=DescribeTransitRouterFlowLogs&Version=2020-04-01&ResourceType=transitrouter&ResourceIds.1=tr-273sdsdsxtgh5p8u2j****&ResourceIds.2=tr-2fe6fszjgeznk5oxruv0u****&Tags.1.Key=k1&Tags.2.Key=k2&Tags.1.Value=v1&Tags.2.Value=v2 HTTP/1.1
Host: open.volcengineapi.com
ServiceName: transitrouter
Region: cn-guangzhou

返回示例

{
    "ResponseMetadata": {
        "RequestId": "2021062415303301022514515207C4****",
        "Action": "DescribeTransitRouterFlowLogs",
        "Version": "2020-04-01",
        "Service": "transitrouter",
        "Region": "cn-guangzhou"
    },
    "Result": {
        "PageNumber": 1,
        "PageSize": 20,
        "TotalCount": 1,
        "TransitRouterFlowLogs": [
            {
                "CreatedAt": "2025-04-25T16:34:48+08:00",
                "UpdatedAt": "2025-04-25T16:34:48+08:00",
                "AccountId": "2100052272",
                "TransitRouterFlowLogName": "FlowLog-x2Pi",
                "TransitRouterFlowLogId": "tr-fl-12aw4dw4e232817q7y2fmus1w",
                "Description": "",
                "ResourceType": "PeerAttachment",
                "ResourceId": "tr-attach-12aw4du5cy13417q7y23a54pj",
                "LogFormatString": "${srcaddr}${dstaddr}${srcport}${dstport}${protocol}${bytes}${tr-id}${src-region-id}${dst-region-id}${tr-attachment-id}${packets}${packets-lost-no-route}${packets-lost-blackhole}${direction}${start}${end}",
                "TlsProjectId": "40274f65-0a16-445e-af5d-f7b5ddf05990",
                "TlsProjectName": "1234",
                "TlsTopicId": "05825e6f-9400-45e9-9678-2f0c7e3c23a6",
                "TlsTopicName": "1234",
                "Status": "Active",
                "TransitRouterId": "tr-2fet2m084tfy859gp67sevtv5",
                "AggregationInterval": 1,
                "Tags": []
            }
        ]
    }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

HttpCode错误码错误信息描述
400InvalidPage.MalformedThe specified page is malformed.指定的分页参数不合法。
400InvalidTagFilter.DisorderThe specified index order of tag filter is malformed.指定标签过滤项的索引顺序参数格式不合法。
400InvalidTagFilterKey.MalformedThe specified parameter tag filter key is invalid.过滤标签键不合法。
400InvalidTagFilterValue.MalformedThe specified parameter tag filter value is invalid.过滤标签值不合法。
400LimitExceeded.ResourceIdsYou've reached the limit of 100 resource IDs that can be specified in this request.该请求传入了非法或不支持的参数。资源查询数目最大限制100。
400LimitExceeded.TagFilterKeyYou've reached the limit on the number of tag keys that you can filter.已达到单次可指定过滤标签键数量的上限。
400LimitExceeded.TagFilterValueYou've reached the limit on the number of tag values that you can filter.已达到单次可指定过滤标签值数量的上限。