Queries flow logs.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeFlowLogs

The operation that you want to perform. Set the value to DescribeFlowLogs.

RegionId String Yes cn-hangzhou

The region ID of the flow log.

You can call the DescribeRegions operation to query the most recent region list.

FlowLogName String No myFlowlog

The name of the flow log.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

FlowLogId String No fl-bp1f6qqhsrc2c12ta****

The ID of the flow log.

Description String No This is my Flowlog.

The description of the flow log.

The description must be 1 to 256 characters in length and cannot start with http:// or https://.

ResourceType String No NetworkInterface

The type of the resource from which traffic is captured. Valid values:

  • NetworkInterface: elastic network interface (ENI)
  • VSwitch: all ENIs in a vSwitch
  • VPC: all ENIs in a virtual private cloud (VPC)
ResourceId String No eni-askldfas****

The ID of the resource from which traffic is captured.

TrafficType String No All

The type of traffic that is captured. Valid values:

  • All: all traffic
  • Allow: traffic that is allowed by access control
  • Drop: traffic that is denied by access control
ProjectName String No FlowLogProject

The project that manages the captured traffic data.

LogStoreName String No FlowLogStore

The Logstore that stores the captured traffic data.

Status String No Active

The status of the flow log. Valid values:

  • Active: enabled
  • Activating: being enabled
  • Inactive: disabled
PageNumber Integer No 1

The number of the page to return. Default value: 1.

PageSize Integer No 20

The number of entries to return on each page. Maximum value: 50. Default value: 20.

VpcId String No vpc-bp1nwd16gvo1wgs****

The ID of the VPC to which the flow log belongs.

ResourceGroupId String No rg-bp67acfmxazb4ph****

The ID of the resource group to which the flow log belongs.

Tags.N.Key String No FinanceDept

The tag key. You can specify at most 20 tag keys. The tag key cannot be an empty string.

The key cannot exceed 64 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). The key must start with a letter but cannot start with aliyun or acs:. The key cannot contain http:// or https://.

Tags.N.Value String No FinanceJoshua

The tag value. You can specify at most 20 tag values. The tag value can be an empty string.

The tag value cannot exceed 128 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter but cannot start with aliyun or acs:. It cannot contain http:// or https://.

Response parameters

Parameter Type Example Description
PageSize String 20

The number of entries returned per page.

PageNumber String 1

The number of the returned page.

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

The ID of the request.

TotalCount String 1

The number of flow logs that are queried.

Success String true

Indicates whether the operation is successful. Valid values:

  • true: yes
  • false: no
FlowLogs Array of FlowLog

The information about the flow logs.

FlowLog
Status String Active

The status of the flow log. Valid values:

  • Active: enabled
  • Activating: being enabled
  • Inactive: disabled
CreationTime String 2022-01-21T03:08:50Z

The time when the flow log was created.

FlowLogName String myFlowlog

The name of the flow log.

TrafficType String All

The type of traffic that is captured by the flow log. Valid values:

  • All: all traffic
  • Allow: traffic that is allowed by access control
  • Drop: traffic that is denied by access control
ResourceType String NetworkInterface

The type of the resource from which traffic is captured. Valid values:

  • NetworkInterface: an ENI
  • VSwitch: all ENIs in a vSwitch
  • VPC: all ENIs in a VPC
Description String Description

The description of the flow log.

ProjectName String FlowLogProject

The project that manages the captured traffic data.

LogStoreName String FlowLogStore

The Logstore that stores the captured traffic data.

ResourceId String eni-askldfas****

The ID of the resource from which traffic is captured.

RegionId String cn-hangzhou

The region ID of the flow log.

FlowLogId String fl-bp1f6qqhsrc2c12ta****

The ID of the flow log.

BusinessStatus String Normal

The business status of the flow log. Valid values:

  • Normal: active
  • FinancialLocked: locked due to overdue payments
AggregationInterval Integer 10

The sampling interval of the flow log. Unit: seconds.

TrafficPath Array of String all

The scope of the traffic that you want to capture. Valid values:

  • all (default value): all traffic
  • internetGateway: Internet traffic
Note By default, the traffic path feature is unavailable. To use this feature, submit a ticket.
ServiceType String sls

The hosting type of the cloud service.

  • This parameter can be empty, which indicates that the flow log is created by the user.
  • If this parameter is not empty, the value is fixed as sls. The value sls indicates that the flow log is created in the Log Service console.
Note A flow log that is created in the Log Service console can be displayed in the VPC list. However, you cannot modify, start, stop, or delete the flow log in the VPC console. If you want to manage the flow log, you can log on to the Log Service console and perform required operations.
ResourceGroupId String rg-bp67acfmxazb4ph****

The ID of the resource group to which the flow log belongs.

Tags Array of Tag

An array that consists of the details of the returned tags.

Tag
Key String FinanceDept

The tag key.

Value String FinanceJoshua

The tag value.

Examples

Sample requests

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"}]
&Common request parameters

Sample success responses

XML format

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 format

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"
    } ]
  } ]
}

Error codes

HttpCode Error code Error message Description
400 InvalidInstanceId Instance does not exist. The error message returned because the instance does not exist.
400 ProjectOrLogstoreNotExist The specified project or logstore does not exist. The error message returned because the specified project or Logstore does not exist.
400 SourceProjectNotExist The Source Project or logstore does not exist. The error message returned because the source project or Logstore does not exist.
400 Unauthorized This api does not support sub user or role. The error message returned because you cannot call this operation as a RAM user.
400 ParameterInvalid Invalid parameter. The error message returned because a parameter is invalid.

For a list of error codes, see Service error codes.