创建流日志。
接口说明
CreateFlowLog 接口属于异步接口,即系统会返回一个实例 ID,但该流日志尚未创建完成,系统后台的创建任务仍在进行。您可以调用 DescribeFlowLogs 查询流日志的创建状态:
当流日志处于 Activating 状态时,表示流日志正在创建中。
当流日志处于 Active 状态时,表示流日志创建并启动完成。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:CreateFlowLog |
create |
VSwitch
*FlowLog
VPC
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
流日志所属的地域 ID。您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-qingdao |
| FlowLogName |
string |
否 |
流日志名称。 名称长度为 1~128 个字符,不能以 |
myFlowlog |
| Description |
string |
否 |
流日志描述。 描述长度为 1~256 个字符,不能以 |
This is my Flowlog. |
| ResourceType |
string |
是 |
要捕获流量的资源类型。取值:
|
NetworkInterface |
| ResourceId |
string |
是 |
要捕获流量的资源 ID。 |
eni-askldfas**** |
| TrafficType |
string |
是 |
采集的流量类型。取值:
|
All |
| ProjectName |
string |
否 |
管理捕获到的流量的 Project 名称。
|
FlowLogProject |
| LogStoreName |
string |
否 |
存储捕获到的流量的 LogStore 名称。
|
FlowLogStore |
| AggregationInterval |
integer |
否 |
流日志的采样间隔。单位:分钟。取值:1、5、10(默认值)。 |
10 |
| TrafficPath |
array |
否 |
采集的流量路径。取值:
|
|
|
string |
否 |
采集的流量路径。取值:
说明
流量路径功能默认不开放,如需使用,请提交工单申请。 |
all |
|
| ResourceGroupId |
string |
否 |
资源组 ID。 |
rg-acfmxazdjdhd**** |
| Tag |
array<object> |
否 |
资源的标签。 |
|
|
object |
否 |
标签。 |
||
| Key |
string |
否 |
资源的标签键。最多支持输入 20 个标签键。如需传入该值,请勿输入空字符串。 一个标签键最多支持 128 个字符,不能以 |
FinanceDept |
| Value |
string |
否 |
资源的标签值。最多支持输入 20 个标签值。如果传入该值,可以输入空字符串。 最多支持 128 个字符,不能以 |
FinanceJoshua |
| IpVersion |
string |
否 |
流日志采集流量的 IP 地址类型。 |
IPv4 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
请求 ID。 |
||
| RequestId |
string |
请求 ID。 |
54B48E3D-DF70-471B-AA93-08E683A1B457 |
| Success |
string |
是否调用成功。取值:
|
true |
| FlowLogId |
string |
流日志 ID。 |
fl-m5e8vhz2t21sel1nq**** |
| ResourceGroupId |
string |
资源组 ID。 |
rg-acfmxazdjdhd**** |
示例
正常返回示例
JSON格式
{
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B457",
"Success": "true",
"FlowLogId": "fl-m5e8vhz2t21sel1nq****",
"ResourceGroupId": "rg-acfmxazdjdhd****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | IncorrectBusinessStatus.FlowLog | The business status of flowLog is incorrect. | 当前业务状态不支持创建流日志实例 |
| 400 | OptInRequired.FlowLog | You are not authorized to use the requested service of flowLog. Ensure that you have subscribed to the service you are trying to use. | 您无权使用请求的 flowLog 服务。 确保您已经订阅了您尝试使用的服务。 |
| 400 | OperationUnsupported.AdvancedFeature | Advanced features of the vpc is unsupported. | 不支持该高级特性。 |
| 400 | InvalidInstanceId | vswitch does not exist. | vSwitch实例不存在。 |
| 400 | ProjectOrLogstoreNotExist | The specified project or logstore does not exist. | 指定的项目或logstore不存在。 |
| 400 | SourceProjectNotExist | The Source Project or logstore does not exist. | SLS源项目或日志库不存在。 |
| 400 | Unauthorized | This api does not support sub user or role. | 此API不支持子用户或角色。 |
| 400 | OperationUnsupported.action | This action is not support. | 此操作不支持。 |
| 400 | ParameterInvalid | Invalid parameter. | 入参非法 |
| 400 | RuleExist | The rule has already existed. | |
| 400 | InvalidHdMonitorStatus | Current instance status is not valid for this action. | |
| 400 | QuotaExceeded.FlowlogCount | This user has reached the maximum instance number of flowlog. | 已达到流日志的最大实例数。 |
| 400 | InvalidResourceId.NotFound | This resourceId already has flowlog instance existed. | 要指定的资源已经存在flowlog实例 |
| 400 | INVALID_PARAMETER | The parameter invalid. | |
| 400 | MissingParameter | Missing mandatory parameter | |
| 400 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | |
| 400 | InvalidResourceType.NotFound | Resource type no the same. | |
| 400 | OperationUnsupported.ResourceType | This resource type is not supported. | |
| 400 | IllegalParam.AggregationInterval | The param of aggregationInterval is illegal. | 采样间隔参数输入不合法 |
| 400 | UnsupportedFeature.UserDefinedTrafficPath | The feature of UserDefinedTrafficPath is not supported. | 本用户暂不支持自定义流日志trafficPath功能。 |
| 400 | IllegalParam.TrafficPath | The param of trafficPath is illegal. | 传入的trafficPath参数非法。 |
| 400 | DuplicatedParam.TrafficPath | The param of trafficPath is duplicated. | 传入的trafficPath参数中存在重复的数值。 |
| 400 | IllegalParam.ResourceGroupId | Invalid ResourceGroupld value. | 指定的资源组非法或不存在 |
| 400 | OperationDenied.OperateShareResource | The operation is not allowed because of OperateShareResource. | 操作共享资源导致操作失败 |
| 400 | UnsupportedFeature.IpVersion | The ipversion type is not supported. | 输入的ipVersion不支持 |
| 400 | UnsupportedFeature.VpcAdvancedFeature | The VPC does not support some advanced features. | 该VPC不支持某些高级功能,请提交工单处理。 |
| 400 | OperationFailed.EniTypeNotSupport | Operation failed because the ENI type is not supported. | 弹性辅助网卡的类型不支持当前操作 |
| 400 | IllegalParam.IpVersion | The parameter of IpVersion is illegal. | 参数IpVersion非法。 |
| 400 | OperationDenied.NisTrafficAnalyzerAggregationIntervalMismatch | The sampling interval of the FlowLog is greater than the sampling interval of the NIS Traffic Analyzer. | FlowLog的采样间隔大于NIS流量分析器的采样间隔。 |
| 400 | OperationDenied.NisTrafficAnalyzerNotFound | The specified NIS Traffic Analyzer does not exist. | 指定的NIS流量分析器不存在。 |
| 400 | OperationDenied.NisTrafficAnalyzerNotActive | The specified NIS Traffic Analyzer is not enabled. | 指定的NIS流量分析器处于非开启状态。 |
| 400 | OperationFailed.InternalError | The request processing has failed due to some unknown error. | 未知错误,请重试操作,错误仍存在请提交工单处理。 |
| 400 | MissingParam.TrafficAnalyzerIdOrLogProjectOrLogStore | TrafficAnalyzerId and ProjectName and LogStoreName parameters are not passed in. | TrafficAnalyzerId与ProjectName和LogStoreName 参数都未传入。 |
| 400 | OperationDenied.AllTrafficPathOfManagedExist | The resource you specified has created a flow log instance that collects the traffic of all scenarios. You cannot create a flow log instance that collects only some scenarios. | 您指定的资源已经创建了采集全部场景的流量的流日志实例,不能再创建仅采集部分场景的流日志实例。 |
| 400 | UnsupportedFeature.UserDefinedTrafficPathIpv6 | Dual-stack flow log instances do not support custom trafficPath. | 双栈流日志实例暂不支持自定义trafficPath功能。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。