Queries flow logs.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:DescribeFlowLogs |
get |
*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 |
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 |
This is my Flowlog. |
| ResourceType |
string |
No |
The resource type of the traffic to catch. Valid values:
|
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 |
| 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 |
| 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 |
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 |
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 |
| 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 |
| 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 |
| ResourceType |
string |
The resource type of the traffic captured by the flow log. Valid values:
|
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 |
| 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:
|
|
|
string |
The traffic path from which traffic is captured. Valid values:
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.
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:
|
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 |
| 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.