调用DescribeFlowLogs接口查询流日志。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String DescribeFlowLogs

系统规定参数。取值:DescribeFlowLogs

RegionId String cn-hangzhou

流日志所属的地域ID。

您可以通过调用DescribeRegions接口获取地域ID。

FlowLogName String myFlowlog

流日志名称。

名称长度为1~128个字符,不能以http://https://开头。

FlowLogId String fl-bp1f6qqhsrc2c12ta****

流日志ID。

Description String This is my Flowlog.

流日志描述信息。

描述长度为1~256个字符,不能以http://https://开头。

ResourceType String NetworkInterface

要捕获的流量的资源类型。取值:

  • NetworkInterface:弹性网卡。
  • VSwitch:交换机内的所有弹性网卡。
  • VPC:专有网络内的所有弹性网卡。
ResourceId String eni-askldfas****

要捕获的流量的资源ID。

TrafficType String All

采集的流量类型。取值:

  • All:全部流量。
  • Allow:访问控制允许的流量。
  • Drop:访问控制拒绝的流量。
ProjectName String FlowLogProject

管理捕获到的流量的Project。

LogStoreName String FlowLogStore

存储捕获到的流量的Logstore。

Status String Active

流日志的状态。取值:

  • Active:流日志为启动状态。
  • Activating:流日志正在创建中。
  • Inactive:流日志为未启动状态。
PageNumber Integer 1

列表的页码,默认值为1

PageSize Integer 20

分页查询时每页的行数,最大值为50,默认值为20

VpcId String vpc-bp1nwd16gvo1wgs****

所要查看流日志的VPC的ID。

ResourceGroupId String rg-bp67acfmxazb4ph****

流日志所属的资源组ID。

Tags.N.Key String FinanceDept

标签键。最多支持输入20个标签键。一旦传入该值,则不允许为空字符串。

一个标签键最多支持64个字符,必须以字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-),不能以aliyunacs:开头,不能包含http://或者https://

Tags.N.Value String FinanceJoshua

标签值。最多支持输入20个标签值。一旦传入该值,可以为空字符串。

一个标签值最多支持128个字符,必须以字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-),不能以aliyunacs:开头,不能包含http://或者https://

返回数据

名称 类型 示例值 描述
PageSize String 20

分页查询时每页的行数。

PageNumber String 1

列表的页码。

RequestId String F7DDDC17-FA06-4AC2-8F35-59D2470FCFC1

请求ID。

TotalCount String 1

查询到的流日志列表条目数。

Success String true

是否调用成功。取值:

  • true:调用成功。
  • false:调用失败。
FlowLogs Array of FlowLog

流日志列表。

FlowLog
Status String Active

流日志的状态。取值:

  • Active:流日志为启动状态。
  • Activating:流日志正在创建中。
  • Inactive:流日志为未启动状态。
CreationTime String 2022-01-21T03:08:50Z

流日志的创建时间。

FlowLogName String myFlowlog

流日志名称。

TrafficType String All

流日志捕获的流量类型。取值:

  • All:全部流量。
  • Allow:访问控制允许的流量。
  • Drop:访问控制拒绝的流量。
ResourceType String NetworkInterface

流日志捕获的流量的资源类型:

  • NetworkInterface:弹性网卡。
  • VSwitch:交换机内的所有弹性网卡。
  • VPC:专有网络内的所有弹性网卡。
Description String Description

流日志描述信息。

ProjectName String FlowLogProject

管理捕获到的流量的Project。

LogStoreName String FlowLogStore

存储捕获到的流量的Logstore。

ResourceId String eni-askldfas****

流日志捕获的流量的资源ID。

RegionId String cn-hangzhou

流日志所属地域ID。

FlowLogId String fl-bp1f6qqhsrc2c12ta****

流日志ID。

BusinessStatus String Normal

业务状态。取值:

  • Normal:正常状态。
  • FinancialLocked:欠费锁定。
AggregationInterval Integer 10

流日志的采样间隔。单位:分钟。

TrafficPath Array of String all

采集的流量路径。取值:

  • all(默认值):表示全量采集。
  • internetGateway:表示公网流量采集。
说明 流量路径功能默认不开放,如需使用,请提交工单申请。
ServiceType String sls

云服务的托管类型。

  • 可以为空,表示该流日志为用户自己创建。
  • 非空时只支持取值为:sls,表示该流日志为通过日志服务控制台创建。
说明 通过日志服务控制台创建的流日志实例可以展示在VPC列表中,但在VPC中无法对该流日志实例进行修改、启动、停止、删除操作,如果您需要对该流日志进行相关操作,您可以登录日志服务控制台对其进行修改、启动、停止、删除操作。
ResourceGroupId String rg-bp67acfmxazb4ph****

流日志所属的资源组ID。

Tags Array of Tag

标签列表。

Tag
Key String FinanceDept

标签键。

Value String FinanceJoshua

标签值。

示例

请求示例

http(s)://[Endpoint]/?Action=DescribeFlowLogs
&RegionId=cn-hangzhou
&FlowLogName=myFlowlog
&FlowLogId=fl-bp1f6qqhsrc2c12ta****
&Description=This is my Flowlog.
&ResourceType=NetworkInterface
&ResourceId=eni-askldfas****
&TrafficType=All
&ProjectName=FlowLogProject
&LogStoreName=FlowLogStore
&Status=Active
&PageNumber=1
&PageSize=20
&VpcId=vpc-bp1nwd16gvo1wgs****
&ResourceGroupId=rg-bp67acfmxazb4ph****
&Tags=[{"Key":"FinanceDept","Value":"FinanceJoshua"}]
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeFlowLogsResponse>
    <PageSize>20</PageSize>
    <PageNumber>1</PageNumber>
    <RequestId>F7DDDC17-FA06-4AC2-8F35-59D2470FCFC1</RequestId>
    <TotalCount>1</TotalCount>
    <Success>true</Success>
    <FlowLogs>
        <Status>Active</Status>
        <CreationTime>2022-01-21T03:08:50Z</CreationTime>
        <FlowLogName>myFlowlog</FlowLogName>
        <TrafficType>All</TrafficType>
        <ResourceType>NetworkInterface</ResourceType>
        <Description>Description</Description>
        <ProjectName>FlowLogProject</ProjectName>
        <LogStoreName>FlowLogStore</LogStoreName>
        <ResourceId>eni-askldfas****</ResourceId>
        <RegionId>cn-hangzhou</RegionId>
        <FlowLogId>fl-bp1f6qqhsrc2c12ta****</FlowLogId>
        <BusinessStatus>Normal</BusinessStatus>
        <AggregationInterval>10</AggregationInterval>
        <TrafficPath>all</TrafficPath>
        <ServiceType>sls</ServiceType>
        <ResourceGroupId>rg-bp67acfmxazb4ph****</ResourceGroupId>
        <Tags>
            <Key>FinanceDept</Key>
            <Value>FinanceJoshua</Value>
        </Tags>
    </FlowLogs>
</DescribeFlowLogsResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "PageSize" : "20",
  "PageNumber" : "1",
  "RequestId" : "F7DDDC17-FA06-4AC2-8F35-59D2470FCFC1",
  "TotalCount" : "1",
  "Success" : "true",
  "FlowLogs" : [ {
    "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" : [ "all" ],
    "ServiceType" : "sls",
    "ResourceGroupId" : "rg-bp67acfmxazb4ph****",
    "Tags" : [ {
      "Key" : "FinanceDept",
      "Value" : "FinanceJoshua"
    } ]
  } ]
}

错误码

HttpCode 错误码 错误信息 描述
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. 入参非法

访问错误中心查看更多错误码。