Skip to content
Console
On this page

Update a bucket

Updates a bucket's `spec.deletion_protection`, `spec.cors` and `spec.lifecycle`; every other field is fixed at creation.

Updates a bucket's spec.deletion_protection, spec.cors and spec.lifecycle; every other field is fixed at creation. A mask path replaces the whole field (spec.cors replaces every rule).

  • Path PATCH https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/buckets/bucket
  • Scope data:write
  • Effect write — a successful call changes state.
  • Collection buckets
  • Query update_mask, allow_missing, validate_only
  • Operation answers with an Operation; the result is Bucket

Request

FieldTypeWhat it is
bucketBucketThe bucket to update; name identifies it. Required.
update_maskfield_maskThe fields to write; unset writes every populated field.
allow_missingboolCreate the Resource when it does not exist (declarative upsert).
validate_onlyboolValidate and return the result without writing anything.

Bucket

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/buckets/{bucket}.
metaResourceMetaResource metadata.
specBucketSpecDesired state. Required.

ResourceMeta

FieldTypeWhat it is
labelsmap<string, string>Caller-writable, indexed labels (AIP-122 label rules).
annotationsmap<string, string>Caller-writable, unindexed annotations.
display_namestringCaller-writable human-readable name.

BucketSpec

FieldTypeWhat it is
versioning_enabledboolKeep every version and write delete markers.
retentiondurationVersions are kept at least this long; unset keeps no minimum.
regionstringThe region; default the project's home region. Changing it moves the data by signed export and import.
deletion_protectionboolWhile set, Delete fails with DELETION_PROTECTED.
corsBucketCorsRule[]Browser access (CORS) rules for the bucket's S3 endpoint, in order; the first rule matching an origin and method answers. Empty answers no cross-origin request. At most 20 rules.
lifecycleBucketLifecycleRules that remove what a bucket no longer needs. Unset keeps everything.
public_accessBucketPublicAccessWho may read the bucket's objects without a key. Unset is OFF. Set at creation; the bucket serves it once its S3 endpoint does, and until then every object stays private.

BucketCorsRule

FieldTypeWhat it is
allowed_originsstring[]Origins as scheme://host[:port], for example https://app.example.com, with at most one * in the host (https://*.example.com), or a lone *. Required; at most 20. Required.
allowed_methodsstring[]Any of GET, HEAD, PUT, POST, DELETE. Required. Required.
allowed_headersstring[]Request headers the browser may send, or *. A presigned PUT needs Content-Type; a multipart part needs none.
expose_headersstring[]Response headers the page may read. Data adds ETag to a rule that allows PUT or POST, because a browser multipart upload cannot complete without each part's ETag, so a read of the rule always lists it.
max_agedurationHow long a browser may cache the preflight answer; default 3600s, at most 86400s.

BucketLifecycle

FieldTypeWhat it is
abort_incomplete_multipart_daysint32Abort a multipart upload that has not completed this many days after it started, and free its parts: 1 to 365. 0 keeps incomplete uploads until someone aborts them (and they are billed as stored bytes until then).
expiration_rulesBucketExpirationRule[]Expire current objects by key prefix, at most 50 rules with distinct prefixes. On a versioned bucket an expiry writes a delete marker.

BucketPublicAccess

FieldTypeWhat it is
modeBucketPublicAccessModeWhich objects are public. One of off, read, read_prefixes.
prefixesstring[]Key prefixes whose objects are public when mode is READ_PREFIXES, at most 50, each at most 1024 bytes.

Response

FieldTypeWhat it is
namestring{parent-of-target}/operations/{operation}.
targetstringThe name of the Resource being changed.
target_generationint64The generation this Operation waits for.
verbOperationVerbWhat the Operation does. One of create, update, delete, custom.
custom_verbstringThe custom method verb when verb is CUSTOM, for example revoke.
doneboolWhether the Operation has finished.
create_timetimestampWhen the Operation started.
end_timetimestampWhen the Operation finished.
responseanyThe settled Resource (or Empty for a delete). One of the result group.
errorProblemDetailsThe failure, as the one error body. One of the result group.
progressOperationProgressProgress while not done.

ProblemDetails

FieldTypeWhat it is
typestringhttps://sylphx.com/docs/errors/<code in kebab-case>.
titlestringA short customer-safe summary of the problem class.
statusint32The HTTP status, fixed by grpc_status.
detailstringA customer-safe explanation of this occurrence. Never contains SQL, stack traces, internal hostnames, or another tenant's data.
instancestringThe request id (Sylphx-Request-Id).
codestringThe stable UPPER_SNAKE code, one of ErrorCode without its prefix.
grpc_statusstringOne of the 16 canonical gRPC status names, for example ABORTED.
retryableboolWhether the same request may be retried.
effectErrorEffectWhat the failed call committed. One of none, applied, unknown.
retry_after_msint64How long to wait before retrying, when the server knows.
detailsany[]Typed details such as PreconditionFailure or EntitlementDenial.

OperationProgress

FieldTypeWhat it is
percentint32Percent complete, when the controller can tell.
messagestringA customer-safe progress message.
conditionsCondition[]The target's conditions when this progress was read.

Condition

FieldTypeWhat it is
typestringThe condition type, for example Ready.
statusConditionStatusWhether the condition holds. One of true, false, unknown.
observed_generationint64The generation this observation was made against.
reasonstringA machine-readable UpperCamelCase reason.
messagestringA customer-safe human-readable message.
severitySeverityHow severe a FALSE condition is. One of info, warning, error.
transition_timetimestampWhen status last changed.

Errors

Every error arrives in the body Errors describes.

Examples

curl -X PATCH "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/buckets/bucket" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"orgs/acme/projects/shop/envs/production/buckets/bucket","spec":{}}'