Method: locations.buckets.patch

Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retentionPeriod

If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.

If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.

A buckets region may not be modified after it is created. This method is in Beta.

HTTP request

PATCH https://logging.googleapis.com/v2/{name=*/*/locations/*/buckets/*}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The full resource name of the bucket to update.

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"

Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property

Authorization requires the following IAM permission on the specified resource name:

  • logging.buckets.update

Query parameters

Parameters
updateMask

string (FieldMask format)

Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

Example: updateMask=retentionDays.

A comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

Request body

The request body contains an instance of LogBucket.

Response body

If successful, the response body contains an instance of LogBucket.

Authorization Scopes

Requires one of the following OAuth scopes:

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

For more information, see the Authentication Overview.