All Products
Search
Document Center

Virtual Private Cloud:DescribeFlowLogs

Last Updated:Jul 28, 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 DescribeRegions 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: network interface controller (NIC).

  • VSwitch: all network interface controllers (NICs) in a vSwitch.

  • VPC: all network interface controllers (NICs) 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 collect. Valid values:

  • All: all traffic.

  • Allow: traffic allowed by access control.

  • Drop: traffic deny by access control.

All

ProjectName

string

No

The name of the project that manages the captured traffic.

FlowLogProject

LogStoreName

string

No

The name of 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 in paging query. Maximum value: 50. Default value: 20.

20

VpcId

string

No

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

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. The tag key cannot be 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. The tag value can be an empty string.

The 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 in paging query.

20

PageNumber

string

The page number.

1

RequestId

string

The request ID.

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

TotalCount

string

The total number of entries returned.

1

Success

string

Indicates whether the call is successful. Valid values:

  • true: The call is 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.

2022-01-21T03:08:50Z

FlowLogName

string

The name of the flow log.

myFlowlog

TrafficType

string

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

  • All: all traffic.

  • Allow: traffic allowed by access control.

  • Drop: traffic denied by access control.

All

ResourceType

string

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

  • NetworkInterface: network interface controller (NIC).

  • VSwitch: all network interface controllers (NICs) in a vSwitch.

  • VPC: all network interface controllers (NICs) in a virtual private cloud (VPC).

NetworkInterface

Description

string

The description of the flow log.

Description

ProjectName

string

The name of the project that manages the captured traffic.

FlowLogProject

LogStoreName

string

The name of 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 business 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 from which traffic is captured. Valid values:

  • all: all traffic is captured.

  • internetGateway: Internet traffic is captured.

string

The traffic path from which traffic is captured. Valid values:

  • all (default): all traffic is captured.

  • internetGateway: Internet traffic is captured.

Note

The traffic path feature is not enabled by default. To use this feature, submit a ticket to apply for access.

all

ServiceType

string

The managed type of the cloud service.

  • Empty: The flow log was created by the user.

  • sls: The flow log was created from the Simple Log Service console.

Note

Flow log instances created from the Simple Log Service console are displayed in the VPC list, but you cannot modify, start, stop, or delete them in VPC. To perform related operations, logon to the Simple Log Service console.

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 is successful.

  • FAILED: The delivery failed.

FAILED

FlowLogDeliverErrorMessage

string

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

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

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

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

UnavaliableTarget

IpVersion

string

The IP address version 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.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.