All Products
Search
Document Center

Virtual Private Cloud:DescribeFlowLogs

Last Updated:Oct 19, 2026

Queries flow logs.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:DescribeFlowLogs

get

*FlowLog

acs:vpc:{#regionId}:{#accountId}:flowlog/*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the flow log.

You can call the DescribeRegions operation to query the region ID.

cn-hangzhou

FlowLogName

string

No

The name of the flow log.

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

myFlowlog

FlowLogId

string

No

The ID of the flow log.

fl-bp1f6qqhsrc2c12ta****

Description

string

No

The description of the flow log.

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

This is my Flowlog.

ResourceType

string

No

The resource type of the traffic to catch. Valid values:

  • NetworkInterface: elastic network interface controller (NIC).

  • VSwitch: all elastic network interface controller (NIC) in a vSwitch.

  • VPC: all elastic network interface controller (NIC) in a virtual private cloud (VPC).

NetworkInterface

ResourceId

string

No

The ID of the resource whose traffic you want to capture.

eni-askldfas****

TrafficType

string

No

The traffic type to catch. Valid values:

  • All: all traffic.

  • Allow: traffic that access control allows.

  • Drop: traffic that access control policies deny.

All

ProjectName

string

No

The Log Service project that manages the captured traffic.

FlowLogProject

LogStoreName

string

No

The Logstore that stores the captured traffic.

FlowLogStore

Status

string

No

The status of the flow log. Valid values:

  • Active: The flow log is active.

  • Activating: The flow log is being created.

  • Inactive: The flow log is inactive.

Active

PageNumber

integer

No

The page number. Default value: 1.

1

PageSize

integer

No

The number of entries per page for paging in a paged query. Maximum value: 50. Default value: 20.

20

VpcId

string

No

The ID of the VPC for which you want to query flow logs.

vpc-bp1nwd16gvo1wgs****

ResourceGroupId

string

No

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

rg-bp67acfmxazb4ph****

Tags

array<object>

No

The list of tags.

object

No

The list of tags.

Key

string

No

The tag key of the resource. You can specify up to 20 tag keys. If you specify this parameter, you cannot specify an empty string.

A tag key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

FinanceDept

Value

string

No

The tag value of the resource. You can specify up to 20 tag values. If you specify this parameter, you can specify an empty string.

A tag value can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

FinanceJoshua

Response elements

Element

Type

Description

Example

object

The details of the flow logs.

PageSize

string

The number of entries per page for paging in a paged query.

20

PageNumber

string

The page number.

1

RequestId

string

The request ID.

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

TotalCount

string

The total number of flow logs returned.

1

Success

string

Indicates whether the call was successful. Valid values:

  • true: The call was successful.

  • false: The call failed.

true

FlowLogs

object

FlowLog

array<object>

The list of flow logs.

array<object>

The list of flow logs.

Status

string

The status of the flow log. Valid values:

  • Active: The flow log is active.

  • Activating: The flow log is being created.

  • Inactive: The flow log is inactive.

Active

CreationTime

string

The time when the flow log was created. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format.

2022-01-21T03:08:50Z

FlowLogName

string

The name of the flow log.

myFlowlog

TrafficType

string

The traffic type that flow logs catch. Valid values:

  • All: all traffic.

  • Allow: traffic that access control allows.

  • Drop: traffic that access control policies deny.

All

ResourceType

string

The resource type of the traffic that flow logs catch. Valid values:

  • NetworkInterface: elastic network interface controller (NIC).

  • VSwitch: all elastic network interface controller (NIC) in a vSwitch.

  • VPC: all elastic network interface controller (NIC) in a virtual private cloud (VPC).

NetworkInterface

Description

string

The description of the flow log.

Description

ProjectName

string

The Log Service project that manages the captured traffic.

FlowLogProject

LogStoreName

string

The Logstore that stores the captured traffic.

FlowLogStore

ResourceId

string

The ID of the resource whose traffic is captured by the flow log.

eni-askldfas****

RegionId

string

The region ID of the flow log.

cn-hangzhou

FlowLogId

string

The ID of the flow log.

fl-bp1f6qqhsrc2c12ta****

BusinessStatus

string

The service status. Valid values:

  • Normal: normal.

  • FinancialLocked: locked due to overdue payment.

Normal

AggregationInterval

integer

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

10

TrafficPath

object

TrafficPathList

array

The traffic path to be captured. Valid values:

  • all: captures all traffic.

  • internetGateway: captures Internet traffic.

string

The traffic path to be captured. Valid values:

  • all (default): captures all traffic.

  • internetGateway: captures Internet traffic.

Note

The traffic path feature is disabled by default. To use this feature, submit a ticket.

all

ServiceType

string

The hosting type of the cloud service.

  • If this parameter is empty, it indicates that the flow log was created by the user.

  • If this parameter is not empty, the only valid value is sls, which indicates that the flow log was created in the Simple Log Service console.

Note

Flow log instances created in the Simple Log Service console are displayed in the VPC list. However, you cannot modify, start, stop, or delete these flow log instances in the VPC console. To perform Related operations on the flow log, you can logon to the Simple Log Service console to modify, start, stop, or delete it.

sls

ResourceGroupId

string

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

rg-bp67acfmxazb4ph****

Tags

object

Tag

array<object>

The list of tags.

object

The list of tags.

Key

string

The tag key.

FinanceDept

Value

string

The tag value.

FinanceJoshua

FlowLogDeliverStatus

string

The delivery status of the flow log. Valid values:

  • SUCCESS: The delivery was successful.

  • FAILED: The delivery failed.

FAILED

FlowLogDeliverErrorMessage

string

The error message returned when the flow log delivery fails. You can troubleshoot the issue based on the error message. Possible error messages:

  • UnavaliableTarget: The Logstore in Simple Log Service is unavailable and cannot receive logs. Check whether the Logstore exists and is accessible.

  • ProjectNotExist: The project in Simple Log Service does not exist. Delete the original flow log and create a new one that points to an existing project.

  • UnknownError: An internal error occurred. Try again later.

UnavaliableTarget

IpVersion

string

The IP address type of the traffic captured by the flow log.

IPv4

LogFormat

string

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidInstanceId Instance does not exist. The error message returned because the specified 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.
400 InvalidRegionId.NotFound The RegionId provided does not exist in our records. The specified RegionId does not exist. Check whether the service is available in the region.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.