All Products
Search
Document Center

:DescribeFlowLogs

最終更新日:Aug 21, 2023

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 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
  • Activating
  • 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.

ResourceGroupId String No rg-bp67acfmxazb4ph****

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

Tags.N.Key String No FinanceDept

The key of tag N to add to the resource. You can specify at most 20 tag keys. The tag key cannot be an empty string.

The tag key can be at most 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

Tags.N.Value String No FinanceJoshua

The value of tag N to add to the resource. You can specify at most 20 tag values. The tag value can be an empty string.

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

Response parameters

Parameter Type Example Description
PageSize String 20

The number of entries per page.

PageNumber String 1

The number of the returned page.

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

The request ID.

TotalCount String 1

The number of flow logs that are queried.

Success String true

Indicates whether the operation is successful. Valid values:

  • true
  • false
FlowLogs Array of FlowLog

The information about the flow logs.

FlowLog
Status String Active

The status of the flow log. Valid values:

  • Active
  • Activating
  • Inactive
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: 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
  • FinancialLocked
AggregationInterval Integer 10

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

TrafficPath Array of String all

The sampling scope of the traffic that is collected. 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 set to sls. The value sls indicates that the flow log is created in the Simple Log Service (SLS) console.
Note A flow log that is created in the SLS 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 SLS 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

The list of tags.

Tag
Key String FinanceDept

The key of tag N.

Value String FinanceJoshua

The value of tag N.

FlowLogDeliverStatus String FAILED

Indicates whether the flow log is delivered. Valid values:

  • SUCCESS
  • FAILED
FlowLogDeliverErrorMessage String UnavaliableTarget

If the flow log failed to be delivered, you can troubleshoot based on the following error messages that may be returned:

  • UnavaliableTarget: The Logstore of SLS is unavailable and cannot receive logs. Check whether the Logstore is available.
  • ProjectNotExist: The project of SLS does not exist. We recommend that you delete the project and create a new one.
  • UnknownError: An internal error occurred. Try again later.

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>
        <FlowLogDeliverStatus>FAILED</FlowLogDeliverStatus>
        <FlowLogDeliverErrorMessage>UnavaliableTarget</FlowLogDeliverErrorMessage>
    </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"
    } ],
    "FlowLogDeliverStatus" : "FAILED",
    "FlowLogDeliverErrorMessage" : "UnavaliableTarget"
  } ]
}

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.