Method: projects.locations.vpcFlowLogsConfigs.showEffectiveFlowLogsConfigs

vpcFlowLogsConfigs.showEffectiveFlowLogsConfigs 會傳回適用於指定資源的所有虛擬私有雲流量記錄設定清單。

HTTP 要求

GET https://networkmanagement.googleapis.com/v1/{parent=projects/*/locations/*}/vpcFlowLogsConfigs:showEffectiveFlowLogsConfigs

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
parent

string

這是必要旗標,VpcFlowLogsConfig 的父項資源,格式如下:projects/{projectId}/locations/global

授權需要指定資源 parent 的下列 IAM 權限:

  • networkmanagement.vpcflowlogsconfigs.list

查詢參數

參數
resource

string

這是必要旗標,要取得有效虛擬私有雲流量記錄設定的資源。資源必須與父項位於相同專案。資源必須是網路、子網路、互連網路連結、VPN 通道或專案。

pageSize

integer

(選用步驟) 要傳回的 EffectiveVpcFlowLogsConfigs 數量。預設值為 30。

pageToken

string

(選用步驟) 先前查詢的頁面權杖,如 nextPageToken 中所傳回。

filter

string

(選用步驟) 列出符合篩選器運算式的 EffectiveVpcFlowLogsConfigs。篩選器運算式必須使用支援的 CEL 邏輯運算子

要求主體

要求主體必須為空白。

回應主體

vpcFlowLogsConfigs.showEffectiveFlowLogsConfigs 方法的回應。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "effectiveFlowLogsConfigs": [
    {
      object (EffectiveVpcFlowLogsConfig)
    }
  ],
  "nextPageToken": string,
  "unreachable": [
    string
  ]
}
欄位
effectiveFlowLogsConfigs[]

object (EffectiveVpcFlowLogsConfig)

有效虛擬私有雲流量記錄設定的清單。

nextPageToken

string

用於擷取下一組設定的頁面符記。

unreachable[]

string

無法連線的地點 (使用 - 查詢所有地點時)。

授權範圍

需要下列 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱Authentication Overview

EffectiveVpcFlowLogsConfig

設定,用於為 GetEffectiveVpcFlowLogsConfig 要求產生回應。

JSON 表示法
{
  "name": string,
  "metadataFields": [
    string
  ],
  "state": enum (State),
  "aggregationInterval": enum (AggregationInterval),
  "flowSampling": number,
  "metadata": enum (Metadata),
  "filterExpr": string,
  "crossProjectMetadata": enum (CrossProjectMetadata),

  // 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.
  "scope": enum (Scope)
}
欄位
name

string

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

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

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

  • 如果是 Compute 設定,名稱會是子網路的路徑:projects/{projectId}/regions/{region}/subnetworks/{subnet_id}

metadataFields[]

string

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

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。

聯集欄位 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}

scope

enum (Scope)

指定設定的範圍 (例如 SUBNET、NETWORK、ORGANIZATION 等)。

範圍

這項流量記錄設定的範圍。

列舉
SCOPE_UNSPECIFIED 未指定範圍。
SUBNET 目標資源是子網路 (Network Management API)。
COMPUTE_API_SUBNET 目標資源是子網路,且設定來自 Compute API。
NETWORK 目標資源是網路。
VPN_TUNNEL 目標資源為 VPN 通道。
INTERCONNECT_ATTACHMENT 目標資源是互連網路連結。
ORGANIZATION 設定會套用到整個機構。