v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-132690159.9 KB
organizations

Creates a new VpcFlowLogsConfig. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes: 1. Creating a configuration with state=DISABLED will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

post/v1/{+parent}/vpcFlowLogsConfigs

Path parameters

parentstring required

Required. The parent resource of the VpcFlowLogsConfig to create, in one of the following formats: - For project-level resources: projects/{project_id}/locations/global - For organization-level resources: organizations/{organization_id}/locations/global

Query parameters

vpcFlowLogsConfigIdstring

Required. ID of the VpcFlowLogsConfig.

Request body

crossProjectMetadata'CROSS_PROJECT_METADATA_UNSPECIFIED' | 'CROSS_PROJECT_METADATA_ENABLED' | 'CROSS_PROJECT_METADATA_DISABLED'

Optional. Determines whether to include cross project annotations in the logs. This field is available only for organization configurations. If not specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.

updateTimestring google-datetime

Output only. The time the config was updated.

flowSamplingnumber float

Optional. The value of the field must be in (0, 1]. The sampling rate of VPC Flow Logs where 1.0 means all collected logs are reported. Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs, use the state field instead. Default value is 1.0.

subnetstring

Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name}

metadataFieldsstring[]

Optional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if "metadata" was set to CUSTOM_METADATA.

aggregationInterval'AGGREGATION_INTERVAL_UNSPECIFIED' | 'INTERVAL_5_SEC' | 'INTERVAL_30_SEC' | 'INTERVAL_1_MIN' | 'INTERVAL_5_MIN' | 'INTERVAL_10_MIN' | 'INTERVAL_15_MIN'

Optional. The aggregation interval for the logs. Default value is INTERVAL_5_SEC.

labelsobject

Optional. Resource labels to represent user-provided metadata.

interconnectAttachmentstring

Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}

namestring

Identifier. Unique name of the configuration. The name can have one of the following forms: - For project-level configurations: projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id} - For organization-level configurations: organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}

filterExprstring

Optional. Export filter used to define which VPC Flow Logs should be logged.

createTimestring google-datetime

Output only. The time the config was created.

networkstring

Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name}

descriptionstring

Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters.

metadata'METADATA_UNSPECIFIED' | 'INCLUDE_ALL_METADATA' | 'EXCLUDE_ALL_METADATA' | 'CUSTOM_METADATA'

Optional. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA.

targetResourceState'TARGET_RESOURCE_STATE_UNSPECIFIED' | 'TARGET_RESOURCE_EXISTS' | 'TARGET_RESOURCE_DOES_NOT_EXIST'

Output only. Describes the state of the configured target resource for diagnostic purposes.

vpnTunnelstring

Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}

state'STATE_UNSPECIFIED' | 'ENABLED' | 'DISABLED'

Optional. The state of the VPC Flow Log configuration. Default value is ENABLED. When creating a new configuration, it must be enabled. Setting state=DISABLED will pause the log generation for this config.

Response

Successful response