调用CreateFlowlog接口创建流日志实例。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
 - 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
 - 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
 - 对于不支持资源级授权的操作,用
全部资源表示。 
 - 条件关键字:是指云产品自身定义的条件关键字。
 - 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
 
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 | 
|---|---|---|---|---|
| smartag:CreateFlowLog | create | *FlowLog acs:smartag:{#regionId}:{#accountId}:flowlog/* | 
  | 无 | 
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| RegionId | string | 是 | 流日志实例的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。  | cn-shanghai | 
| Description | string | 否 | 流日志实例的描述。  | test | 
| Name | string | 否 | 流日志实例的名称。  | sag-flowlog-1 | 
| ActiveAging | integer | 否 | 活跃流输出间隔。取值范围:60~6000,单位:秒。默认值为 300 秒。  | 300 | 
| InactiveAging | integer | 否 | 非活跃流输出间隔。取值范围:10~600,单位:秒。默认值为 15 秒。  | 15 | 
| OutputType | string | 是 | 流日志输出类型,取值: 
  | all | 
| SlsRegionId | string | 否 | 日志服务的地域 ID。 流日志输出类型为 sls 或 all 时需填写该项。  | cn-shanghai | 
| ProjectName | string | 否 | 日志服务的 Project。 流日志输出类型为 sls 或 all 时需填写该项。  | sag-flowlog-shanghai | 
| LogstoreName | string | 否 | 日志服务的 Logstore。 流日志输出类型为 sls 或者 all 时需填写该项。  | config-operation-log | 
| NetflowServerIp | string | 否 | 存储流日志的 Netflow 服务器地址。 流日志输出类型为 netflow 或 all 时需填写该项。  | 192.168.0.2 | 
| NetflowServerPort | integer | 否 | 存储流日志的 Netflow 服务器端口,默认值为 9995。 流日志输出类型为 netflow 或 all 时需填写该项。  | 9995 | 
| NetflowVersion | string | 否 | 存储流日志时使用的 Netflow 协议版本号,取值:V5、V9 和 V10,默认值为 V9。 流日志输出类型为 netflow 或 all 时需填写该项。  | V9 | 
返回参数
示例
正常返回示例
JSON格式
{
  "RequestId": "650CB9E8-20F3-4538-A4FC-1DA1B36E42D9",
  "FlowLogId": "fl-7a56mar1kfw9vj****",
  "ResourceGroupId": "rg-acfm2iu4f****"
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 400 | DependencyViolation.FlowLog | This FlowLog instance is bound to an SAG instance. | FlowLog存在资源依赖。 | 
| 400 | IncorrectStatus.FlowLog | The current FlowLog instance status does not support this operation. | FlowLog状态非法。 | 
| 400 | InvalidFlowLogId.NotFound | The specified FlowLogId does not exist. | 根据FlowLogId未找到对应实例。 | 
| 400 | MissingParam.FlowLogId | Specify the FlowLogId parameter. | 缺少参数FlowLogId。 | 
| 400 | OperationFailed.AssociateFlowLog | The operation failed. The specified SAG instance has already been associated with another FlowLog instance. | 由于智能接入网关实例已经关联其他FlowLog实例,操作失败。 | 
| 400 | OperationUnsupported.AssociateFlowLog | You cannot bind the SAG device of the current version or model to a FlowLog instance. | 设备版本或者款型不支持关联FlowLog操作。 | 
| 400 | QuotaExceeded.Flowlog | The maximum number of FlowLog instances is exceeded. | flowlog数量超过配额。 | 
| 400 | MissingParam.LogstoreName | Specify the LogstoreName parameter. | 缺少参数LogstoreName。 | 
| 400 | MissingParam.NetflowServerIp | Specify the NetflowServerIp parameter. | 缺少参数NetflowServerIp。 | 
| 400 | MissingParam.NetflowServerPort | Specify the NetflowServerPort parameter. | 缺少参数NetflowServerPort。 | 
| 400 | MissingParam.NetflowVersion | Specify the NetflowVersion parameter. | 缺少参数NetflowVersion。 | 
| 400 | MissingParam.ProjectName | Specify the ProjectName parameter. | 缺少参数ProjectName。 | 
| 400 | MissingParam.SlsRegionId | Specify the SlsRegionId parameter. | 缺少参数SlsRegionId。 | 
| 400 | IllegalParam.ActiveAging | The specified ActiveAging is invalid. | 参数ActiveAging不合法。 | 
| 400 | IllegalParam.InactiveAging | The specified InactiveAging is invalid. | 参数InactiveAging不合法。 | 
| 400 | IllegalParam.NetflowServerIp | The specified NetflowServerIp is invalid. | 参数NetflowServerIp不合法。 | 
| 400 | IllegalParam.NetflowServerPort | The specified NetflowServerPort is invalid. | 参数NetflowServerPort不合法。 | 
| 400 | IllegalParam.NetflowVersion | The specified NetflowVersion is invalid. | 参数NetflowVersion不合法。 | 
| 400 | IllegalParam.OutputType | The specified OutputType is invalid. | 参数OutputType不合法。 | 
| 400 | IllegalParam.RegionId | The specified RegionId is invalid. | 参数RegionId不合法。 | 
| 400 | IllegalParam.SlsRegionId | The specified SlsRegionId is invalid. | 参数SlsRegionId不合法。 | 
| 400 | IllegalParam.Status | The specified Status parameter is invalid. | 参数Status不合法。 | 
| 403 | FeatureNotSupport | The current edition of the smart access gateway does not support this feature. | 智能接入网关当前版本不支持该功能特性。 | 
访问错误中心查看更多错误码。
