DescribeFlowLogs - 查询流日志
调用DescribeFlowLogs接口查询流日志。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:DescribeFlowLogs |
get |
*FlowLog
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
流日志所属的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-hangzhou |
| FlowLogName |
string |
否 |
流日志名称。 名称长度为 1~128 个字符,不能以 |
myFlowlog |
| FlowLogId |
string |
否 |
流日志 ID。 |
fl-bp1f6qqhsrc2c12ta**** |
| Description |
string |
否 |
流日志描述信息。 描述长度为 1~256 个字符,不能以 |
This is my Flowlog. |
| ResourceType |
string |
否 |
要捕获的流量的资源类型。取值:
|
NetworkInterface |
| ResourceId |
string |
否 |
要捕获的流量的资源 ID。 |
eni-askldfas**** |
| TrafficType |
string |
否 |
采集的流量类型。取值:
|
All |
| ProjectName |
string |
否 |
管理捕获到的流量的 Project。 |
FlowLogProject |
| LogStoreName |
string |
否 |
存储捕获到的流量的 Logstore。 |
FlowLogStore |
| Status |
string |
否 |
流日志的状态。取值:
|
Active |
| PageNumber |
integer |
否 |
列表的页码,默认值为 1。 |
1 |
| PageSize |
integer |
否 |
分页查询时每页的行数,最大值为 50,默认值为 20。 |
20 |
| VpcId |
string |
否 |
所要查看流日志的 VPC 的 ID。 |
vpc-bp1nwd16gvo1wgs**** |
| ResourceGroupId |
string |
否 |
流日志所属的资源组 ID。 |
rg-bp67acfmxazb4ph**** |
| Tags |
array<object> |
否 |
标签列表。 |
|
|
object |
否 |
标签列表。 |
||
| Key |
string |
否 |
资源的标签键。最多支持输入 20 个标签键。如需传入该值,则不能输入空字符串。 一个标签键最多支持 128 个字符,不能以 |
FinanceDept |
| Value |
string |
否 |
资源的标签值。最多支持输入 20 个标签值。如需传入该值,可以输入空字符串。 最多支持 128 个字符,不能以 |
FinanceJoshua |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
流日志详细信息。 |
||
| PageSize |
string |
分页查询时每页的行数。 |
20 |
| PageNumber |
string |
列表的页码。 |
1 |
| RequestId |
string |
请求 ID。 |
F7DDDC17-FA06-4AC2-8F35-59D2470FCFC1 |
| TotalCount |
string |
查询到的流日志列表条目数。 |
1 |
| Success |
string |
是否调用成功。取值:
|
true |
| FlowLogs |
object |
||
| FlowLog |
array<object> |
流日志列表。 |
|
|
array<object> |
流日志列表。 |
||
| Status |
string |
流日志的状态。取值:
|
Active |
| CreationTime |
string |
流日志的创建时间。 |
2022-01-21T03:08:50Z |
| FlowLogName |
string |
流日志名称。 |
myFlowlog |
| TrafficType |
string |
流日志捕获的流量类型。取值:
|
All |
| ResourceType |
string |
流日志捕获的流量的资源类型:
|
NetworkInterface |
| Description |
string |
流日志描述信息。 |
Description |
| ProjectName |
string |
管理捕获到的流量的 Project。 |
FlowLogProject |
| LogStoreName |
string |
存储捕获到的流量的 Logstore。 |
FlowLogStore |
| ResourceId |
string |
流日志捕获的流量的资源 ID。 |
eni-askldfas**** |
| RegionId |
string |
流日志所属地域 ID。 |
cn-hangzhou |
| FlowLogId |
string |
流日志 ID。 |
fl-bp1f6qqhsrc2c12ta**** |
| BusinessStatus |
string |
业务状态。取值:
|
Normal |
| AggregationInterval |
integer |
流日志的采样间隔。单位:分钟。 |
10 |
| TrafficPath |
object |
||
| TrafficPathList |
array |
采集的流量路径。取值:
|
|
|
string |
采集的流量路径。取值:
说明
流量路径功能默认不开放,如需使用,请提交工单申请。 |
all |
|
| ServiceType |
string |
云服务的托管类型。
说明
通过日志服务控制台创建的流日志实例可以展示在 VPC 列表中,但在 VPC 中无法对该流日志实例进行修改、启动、停止、删除操作,如果您需要对该流日志进行相关操作,您可以登录日志服务控制台对其进行修改、启动、停止、删除操作。 |
sls |
| ResourceGroupId |
string |
流日志所属的资源组 ID。 |
rg-bp67acfmxazb4ph**** |
| Tags |
object |
||
| Tag |
array<object> |
标签列表。 |
|
|
object |
标签列表。 |
||
| Key |
string |
标签键。 |
FinanceDept |
| Value |
string |
标签值。 |
FinanceJoshua |
| FlowLogDeliverStatus |
string |
流日志的投递状态,取值:
|
FAILED |
| FlowLogDeliverErrorMessage |
string |
当流日志投递失败时,可以根据报错信息排查问题,可能的报错信息有:
|
UnavaliableTarget |
| IpVersion |
string |
流日志采集流量的 IP 地址类型。 |
IPv4 |
| LogFormat |
string |
示例
正常返回示例
JSON格式
{
"PageSize": "20",
"PageNumber": "1",
"RequestId": "F7DDDC17-FA06-4AC2-8F35-59D2470FCFC1",
"TotalCount": "1",
"Success": "true",
"FlowLogs": {
"FlowLog": [
{
"Status": "Active",
"CreationTime": "2022-01-21T03:08:50Z",
"FlowLogName": "myFlowlog",
"TrafficType": "All",
"ResourceType": "NetworkInterface",
"Description": "Description",
"ProjectName": "FlowLogProject",
"LogStoreName": "FlowLogStore",
"ResourceId": "eni-askldfas****",
"RegionId": "cn-hangzhou",
"FlowLogId": "fl-bp1f6qqhsrc2c12ta****",
"BusinessStatus": "Normal",
"AggregationInterval": 10,
"TrafficPath": {
"TrafficPathList": [
"all"
]
},
"ServiceType": "sls",
"ResourceGroupId": "rg-bp67acfmxazb4ph****",
"Tags": {
"Tag": [
{
"Key": "FinanceDept",
"Value": "FinanceJoshua"
}
]
},
"FlowLogDeliverStatus": "FAILED",
"FlowLogDeliverErrorMessage": "UnavaliableTarget",
"IpVersion": "IPv4",
"LogFormat": ""
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidInstanceId | Instance does not exist. | 实例不存在。 |
| 400 | ProjectOrLogstoreNotExist | The specified project or logstore does not exist. | 指定的项目或logstore不存在。 |
| 400 | SourceProjectNotExist | The Source Project or logstore does not exist. | SLS源项目或日志库不存在。 |
| 400 | Unauthorized | This api does not support sub user or role. | 此API不支持子用户或角色。 |
| 400 | ParameterInvalid | Invalid parameter. | 入参非法 |
| 400 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。