建立流日誌。
介面說明
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 |
| LogFormat |
string |
否 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
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. | 指定的 RegionId 不存在,請您檢查此產品在該地域是否可用。 |
| 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. | 您指定的 VSwitch 所在的 VPC 未支援進階功能,請更換其他 VSwitch 重試。 |
| 400 | OperationFailed.EniTypeNotSupport | Operation failed because the ENI type is not supported. | 彈性輔助網卡的類型不支援目前操作。 |
| 400 | IllegalParam.IpVersion | The parameter of IpVersion is illegal. | |
| 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 功能。 |
| 400 | IllegalParam.LogFormat | The specified parameter of LogFormat is invalid. | 指定的 LogFormat 參數無效。 |
| 400 | OperationDenied.UnsupportedField | LogFormat contains unsupported fields. | LogFormat 包含了不支援的欄位。 |
| 400 | UnsupportedFeature.LogFormat | The ability to customize subscription fields for flow logs is not yet available, so stay tuned. | 流日誌自訂訂閱欄位的功能尚未開放,敬請期待。 |
| 400 | UnsupportedFeature.LogFormatNisTrafficAnalyze | The flow log for which NIS traffic analysis is enabled does not support custom subscription fields. | 已開啟 NIS 流量分析的流日誌,暫不支援自訂訂閱欄位。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。