Creates a flow log.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateFlowLog |
The operation that you want to perform. Set the value to CreateFlowLog. |
RegionId | String | Yes | cn-qingdao |
The ID of the region where you want to create 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 2 to 128 characters in length and can contain letters, digits, periods
(.), underscores (_), and hyphens (-). The name must start with a letter but cannot
start with |
Description | String | No | This is my Flowlog. |
The description of the flow log. The description must be 2 to 256 characters in length. It must start with a letter
but cannot start with |
ResourceType | String | Yes | NetworkInterface |
The type of the resource whose traffic you want to capture. Valid values:
|
ResourceId | String | Yes | eni-askldfas**** |
The ID of the resource whose traffic you want to capture. |
TrafficType | String | Yes | All |
The type of traffic that you want to capture. Valid values:
|
ProjectName | String | Yes | FlowLogProject |
The name of the project that stores the captured traffic data.
|
LogStoreName | String | Yes | FlowLogStore |
The name of the Logstore that stores the captured traffic data.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 54B48E3D-DF70-471B-AA93-08E683A1B457 |
The ID of the request. |
Success | String | true |
Indicates whether the call was successful. Valid values:
|
FlowLogId | String | fl-m5e8vhz2t21sel1nq**** |
The ID of the flow log. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CreateFlowLog
&ResourceOwnerId=253460731706911258
&RegionId=cn-qingdao
&FlowLogName=myFlowlog
&Description=This is my Flowlog.
&ResourceType=NetworkInterface
&ResourceId=eni-askldfas****
&TrafficType=All
&ProjectName=FlowLogProject
&LogStoreName=FlowLogStore
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateFlowLogResponse>
<RequestId>54B48E3D-DF70-471B-AA93-08E683A1B457</RequestId>
<Success>true</Success>
<FlowLogId>fl-m5e8vhz2t21sel1nq****</FlowLogId>
</CreateFlowLogResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B457",
"Success" : "true",
"FlowLogId" : "fl-m5e8vhz2t21sel1nq****"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | OperationUnsupported.AdvancedFeature | Advanced features of the vpc is unsupported. | The error message returned because the advanced feature is not supported. |
400 | INVALID_PARAMETER | The parameter invalid. | The error message returned because the parameter is set to an invalid value. |
400 | MissingParameter | Missing mandatory parameter | The error message returned because required parameters are not set. Check whether you have set all required parameters before you call this operation. |
For a list of error codes, visit the API Error Center.