CreateFlowLog
建立流日誌。
介面說明
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. | |
| 400 | OperationUnsupported.AdvancedFeature | Advanced features of the vpc is unsupported. | |
| 400 | InvalidInstanceId | vswitch does not exist. | |
| 400 | ProjectOrLogstoreNotExist | The specified project or logstore does not exist. | |
| 400 | SourceProjectNotExist | The Source Project or logstore does not exist. | |
| 400 | Unauthorized | This api does not support sub user or role. | |
| 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. | |
| 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. | |
| 400 | IllegalParam.TrafficPath | The param of trafficPath is illegal. | |
| 400 | DuplicatedParam.TrafficPath | The param of trafficPath is duplicated. | |
| 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. | |
| 400 | UnsupportedFeature.VpcAdvancedFeature | The VPC does not support some advanced features. | |
| 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. | |
| 400 | OperationDenied.NisTrafficAnalyzerNotFound | The specified NIS Traffic Analyzer does not exist. | |
| 400 | OperationDenied.NisTrafficAnalyzerNotActive | The specified NIS Traffic Analyzer is not enabled. | |
| 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. | |
| 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. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。