---
title: "PATCH /v1/projects/{projectsId}/locations/{locationsId}/vpcFlowLogsConfigs/{vpcFlowLogsConfigsId}"
method: PATCH
path: "/v1/projects/{projectsId}/locations/{locationsId}/vpcFlowLogsConfigs/{vpcFlowLogsConfigsId}"
tags: ["projects"]
---

# PATCH /v1/projects/{projectsId}/locations/{locationsId}/vpcFlowLogsConfigs/{vpcFlowLogsConfigsId}

`PATCH /v1/projects/{projectsId}/locations/{locationsId}/vpcFlowLogsConfigs/{vpcFlowLogsConfigsId}`

## Request

- Base URL: `https://networkmanagement.googleapis.com`
- URL: `https://networkmanagement.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/vpcFlowLogsConfigs/{vpcFlowLogsConfigsId}`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Updates an existing `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes: 1. Updating 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 - updating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `vpcFlowLogsConfigsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string
- `updateMask` string, google-fieldmask

## Request body

- VpcFlowLogsConfig: A configuration to generate VPC Flow Logs.
  - `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.
  - `connectionLogging` 'CONNECTION_LOGGING_UNSPECIFIED' | 'CONNECTION_LOGGING_ENABLED' | 'CONNECTION_LOGGING_DISABLED': Optional. Configures whether connection logging is enabled for VPC Flow Logs.
  - `createTime` string, google-datetime: Output only. The time the config was created.
  - `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.
  - `description` string: Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters.
  - `filterExpr` string: Optional. Export filter used to define which VPC Flow Logs should be logged.
  - `flowSampling` number, 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.
  - `interconnectAttachment` string: Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}
  - `labels` object: Optional. Resource labels to represent user-provided metadata.
  - `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.
  - `metadataFields` string[]: Optional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if "metadata" was set to CUSTOM_METADATA.
  - `name` string: 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}`
  - `network` string: Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{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.
  - `subnet` string: Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name}
  - `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.
  - `updateTime` string, google-datetime: Output only. The time the config was updated.
  - `vpnTunnel` string: Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}

## Response `200`

Successful response

- Operation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  - `error` Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.

---

[API](https://skmtc.dev/google/apis/networkmanagement.md) - [All operations](https://skmtc.dev/google/apis/networkmanagement/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/networkmanagement/revisions/246efc89b4ee?raw)
