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 ID of the region where the flow log is deployed. You can call the DescribeRegions operation to query the region IDs.

FlowLogName String No myFlowlog

The name of the flow log. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name cannot start with http:// or https://.

FlowLogId String No fl-bp1f6qqhsrc2c12ta****

The ID of the flow log.

Description String No test flowlog

The description of the flow log.

ResourceType String No NetworkInterface

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

  • NetworkInterface: Traffic data is captured from elastic network interfaces (ENIs).
  • VSwitch: Traffic data is captured from all ENIs attached to a specified vSwitch.
  • VPC: Traffic data is captured from all ENIs in a specified 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 stores 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: indicates that the flow log is active.
  • Inactive: indicates that the flow log is inactive.
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.

Response parameters

Parameter Type Example Description
FlowLogs Array of FlowLog

The returned flow logs.

FlowLog
CreationTime String 2021-01-21T03:08:50Z

The time when the flow log was created.

Description String test flowlog

The description of the flow log.

FlowLogId String fl-bp1f6qqhsrc2c12ta****

The ID of the flow log.

FlowLogName String myFlowlog

The name of the flow log.

LogStoreName String FlowLogStore

The Logstore that stores the captured traffic data.

ProjectName String FlowLogProject

The project that stores the captured traffic data.

RegionId String cn-hangzhou

The ID of the region where the flow log is deployed.

ResourceId String eni-askldfas****

The ID of the resource from which traffic is captured.

ResourceType String NetworkInterface

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

  • NetworkInterface: Traffic data is captured from ENIs.
  • VSwitch: Traffic data is captured from all ENIs attached to a specified vSwitch.
  • VPC: Traffic data is captured from all ENIs in a specified VPC.
Status String Active

The status of the flow log. Valid values:

  • Active: indicates that the flow log is active.
  • Inactive: indicates that the flow log is inactive.
TrafficType String 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.
PageNumber String 1

The number of the returned page.

PageSize String 20

The number of entries returned on each page.

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

The ID of the request.

Success String true

Indicates whether the call is successful. Valid values:

  • true: The call is successful.
  • false: The call is failed.
TotalCount String 1

The number of log entries that are queried.

Examples

Sample requests

http(s)://[Endpoint]/? Action=DescribeFlowLogs
&RegionId=cn-hangzhou
&<Common request parameters>|

Sample success responses

XML format

<DescribeFlowLogsResponse>
  <TotalCount>1</TotalCount>
  <FlowLogs>
        <FlowLog>
              <Status>Active</Status>
              <FlowLogName>myFlowlog</FlowLogName>
              <LogStoreName>FlowLogStore</LogStoreName>
              <Description>test flowlog</Description>
              <ProjectName>FlowLogProject</ProjectName>
              <ResourceId>eni-askldfas****</ResourceId>
              <CreationTime>2021-01-21T03:08:50Z</CreationTime>
              <ResourceType>NetworkInterface</ResourceType>
              <RegionId>cn-hangzhou</RegionId>
              <FlowLogId>fl-bp1f6qqhsrc2c12ta****</FlowLogId>
              <TrafficType>All</TrafficType>
        </FlowLog>
  </FlowLogs>
  <PageSize>20</PageSize>
  <RequestId>F7DDDC17-FA06-4AC2-8F35-59D2470FCFC1</RequestId>
  <PageNumber>1</PageNumber>
  <Success>true</Success>
</DescribeFlowLogsResponse>

JSON format

{
    "TotalCount": 1,
    "FlowLogs": {
        "FlowLog": {
            "Status": "Active",
            "FlowLogName": "myFlowlog",
            "LogStoreName": "FlowLogStore",
            "Description": "test flowlog",
            "ProjectName": "FlowLogProject",
            "ResourceId": "eni-askldfas****",
            "CreationTime": "2021-01-21T03:08:50Z",
            "ResourceType": "NetworkInterface",
            "RegionId": "cn-hangzhou",
            "FlowLogId": "fl-bp1f6qqhsrc2c12ta****",
            "TrafficType": "All"
        }
    },
    "PageSize": 20,
    "RequestId": "F7DDDC17-FA06-4AC2-8F35-59D2470FCFC1",
    "PageNumber": 1,
    "Success": true
}

Error code

For a list of error codes, visit the API Error Center.