Query flow logs.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| vpc:DescribeFlowLogs | get | *FlowLog acs:vpc:{#regionId}:{#accountId}:flowlog/* |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| RegionId | string | Yes | The region ID of the flow log. You can obtain the region ID by calling the DescribeRegions interface. | cn-hangzhou |
| FlowLogName | string | No | The name of the flow log. The name must be 1 to 128 characters long and cannot start with | 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 long and cannot start with | This is my Flowlog. |
| ResourceType | string | No | The resource type of the traffic to capture. Values:
| NetworkInterface |
| ResourceId | string | No | The resource ID of the traffic to capture. | eni-askldfas**** |
| TrafficType | string | No | The type of traffic to collect. Values:
| All |
| ProjectName | string | No | The 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. Values:
| Active |
| PageNumber | integer | No | The page number, with a default value of 1. | 1 |
| PageSize | integer | No | The number of items per page in a paginated query, with a maximum value of 50 and a default value of 20. | 20 |
| VpcId | string | No | The ID of the VPC for which you want to view the flow log. | vpc-bp1nwd16gvo1wgs**** |
| ResourceGroupId | string | No | The resource group ID of the flow log. | rg-bp67acfmxazb4ph**** |
| Tags | array<object> | No | The list of tags. | |
| object | No | The list of tags. | ||
| Key | string | No | The key of the tag. Up to 20 tag keys are supported. If you need to pass this value, it cannot be an empty string. A tag key can have up to 128 characters and cannot start with | FinanceDept |
| Value | string | No | The value of the tag. Up to 20 tag values are supported. If you need to pass this value, it can be an empty string. A tag value can have up to 128 characters and cannot start with | FinanceJoshua |
Response parameters
Examples
Sample success responses
JSONformat
{
"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"
}
]
}
}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 RegionId parameter is set to an invalid value. Specify a valid value and try again. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-02-26 | The Error code has changed. The response structure of the API has changed | View Change Details |
| 2025-02-21 | The Error code has changed. The response structure of the API has changed | View Change Details |
| 2024-09-25 | The Error code has changed. The response structure of the API has changed | View Change Details |
| 2023-07-06 | The Error code has changed. The response structure of the API has changed | View Change Details |
| 2022-03-14 | The Error code has changed. The response structure of the API has changed | View Change Details |
