REST Resource: projects.locations.vpcFlowLogsConfigs

資源:VpcFlowLogsConfig

產生虛擬私有雲流量記錄的設定。

JSON 表示法
{
  "name": string,
  "metadataFields": [
    string
  ],
  "labels": {
    string: string,
    ...
  },
  "createTime": string,
  "updateTime": string,
  "description": string,
  "state": enum (State),
  "aggregationInterval": enum (AggregationInterval),
  "flowSampling": number,
  "metadata": enum (Metadata),
  "filterExpr": string,
  "crossProjectMetadata": enum (CrossProjectMetadata),
  "targetResourceState": enum (TargetResourceState),

  // Union field target_resource can be only one of the following:
  "network": string,
  "subnet": string,
  "interconnectAttachment": string,
  "vpnTunnel": string
  // End of list of possible types for union field target_resource.
}
欄位
name

string

ID。設定的專屬名稱。名稱可為下列任一形式:

  • 如要進行專案層級設定,請按照下列步驟操作:projects/{projectId}/locations/global/vpcFlowLogsConfigs/{vpcFlowLogsConfigId}

  • 如要進行機構層級設定:organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpcFlowLogsConfigId}

metadataFields[]

string

(選用步驟) 要納入所回報 VPC 流量記錄的自訂中繼資料欄位。只有在「metadata」設為 CUSTOM_METADATA 時,才能指定此項目。

labels

map (key: string, value: string)

(選用步驟) 代表使用者提供中繼資料的資源標籤。

包含 "key": value 組合清單的物件。範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

createTime

string (Timestamp format)

僅供輸出。設定的建立時間。

使用 RFC 3339,產生的輸出內容一律會經過 Z 標準化,並使用 0、3、6 或 9 個小數位數。系統也接受「Z」以外的偏移量。例如:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

updateTime

string (Timestamp format)

僅供輸出。設定的更新時間。

使用 RFC 3339,產生的輸出內容一律會經過 Z 標準化,並使用 0、3、6 或 9 個小數位數。系統也接受「Z」以外的偏移量。例如:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

description

string

(選用步驟) 使用者提供的虛擬私有雲流量記錄設定說明。長度上限為 512 個半形字元。

state

enum (State)

(選用步驟) 虛擬私有雲流量記錄設定的狀態。預設值為 ENABLED。建立新設定時,必須啟用這項功能。將 state 設為 DISABLED 會暫停產生這項設定的記錄。

aggregationInterval

enum (AggregationInterval)

(選用步驟) 記錄的匯總間隔。預設值為 INTERVAL_5_SEC。

flowSampling

number

(選用步驟) 欄位的值必須介於 (0, 1] 之間。虛擬私有雲流量記錄檔的取樣率,其中 1.0 代表系統會回報所有收集到的記錄。取樣率不得設為 0.0。如要停用虛擬私有雲端流程記錄檔,請改用狀態欄位。預設值為 1.0。

metadata

enum (Metadata)

(選用步驟) 設定是否要將所有、部分或不將任何中繼資料欄位新增至回報的 VPC 流量記錄。預設值為 INCLUDE_ALL_METADATA。

filterExpr

string

(選用步驟) 匯出篩選器,用於定義應記錄哪些虛擬私有雲流程記錄。

crossProjectMetadata

enum (CrossProjectMetadata)

(選用步驟) 決定是否要在記錄中加入跨專案註解。這個欄位僅適用於機構設定。如果未在機構設定中指定,則會設為 CROSS_PROJECT_METADATA_ENABLED。

targetResourceState

enum (TargetResourceState)

僅供輸出。說明設定的目標資源狀態,以利診斷。

聯集欄位 target_resource。設定範圍的資源參照。也就是記錄流量的範圍。目標資源必須與設定檔屬於相同專案。這個欄位不支援機構層級設定。target_resource 只能是下列其中一項:
network

string

系統會記錄網路中 VM、VPN 通道和互連網路連結的流量。格式:projects/{projectId}/global/networks/{name}

subnet

string

系統會記錄子網路中 VM 的流量。格式:projects/{projectId}/regions/{region}/subnetworks/{name}

interconnectAttachment

string

系統會記錄互連網路附件的流量。格式:projects/{projectId}/regions/{region}/interconnectAttachments/{name}

vpnTunnel

string

系統會記錄 VPN 通道的流量。格式:projects/{projectId}/regions/{region}/vpnTunnels/{name}

方法

create

建立新的 VpcFlowLogsConfig

delete

刪除特定 VpcFlowLogsConfig

get

取得特定 VpcFlowLogsConfig 的詳細資料。

list

列出指定專案中的所有 VpcFlowLogsConfigs

patch

更新現有的 VpcFlowLogsConfig

queryOrgVpcFlowLogsConfigs

QueryOrgVpcFlowLogsConfigs 會傳回適用於指定專案的所有機構層級虛擬私有雲流量記錄設定清單。