1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-18 06:47:12 +00:00

gcloud: Thu Mar 26 12:11:21 UTC 2026

This commit is contained in:
Automated 2026-03-26 12:11:21 +00:00
parent c0febd2be1
commit 89a3bc9276
1093 changed files with 69108 additions and 2686 deletions

View file

@ -8,6 +8,10 @@ SYNOPSIS
| --manifest-location=MANIFEST_LOCATION)
(--put-metadata=KEY=VALUE,[KEY=VALUE,...]
| --rewrite-object=KEY=VALUE,[KEY=VALUE,...]
| --clear-all-object-custom-contexts
| --clear-object-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
--update-object-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
| --update-object-custom-contexts-file=CUSTOM_CONTEXTS_FILE
| [--delete-object : --enable-permanent-object-deletion]
| --[no-]put-object-event-based-hold
--[no-]put-object-temporary-hold) [--description=DESCRIPTION]
@ -47,6 +51,15 @@ EXAMPLES
--put-metadata=Content-Disposition=inline,Content-Language=en,\
Retain-Until=2025-01-01T00:00:00Z,Retention-Mode=locked
The following example command creates a batch job, named my-job, that
removes the object custom context key1 and updates key2 to val2 and key3 to
val3 on bucket my-bucket for objects with prefixes prefix1 or prefix2:
$ gcloud storage batch-operations jobs create my-job \
--bucket=my-bucket --included-object-prefixes=prefix1,prefix2 \
--clear-object-custom-contexts=key1 \
--update-object-custom-contexts=key2=val2,key3=val3
The following example command creates a batch job, named my-job, that puts
object event based hold on objects in bucket my-bucket with logging config
enabled for corresponding transform action and succeeded and failed action
@ -131,10 +144,71 @@ REQUIRED FLAGS
--rewrite-object=KEY=VALUE,[KEY=VALUE,...]
Rewrites object and the specified metadata. Currently only supports
rewriting kms-key. A metadata field MUST be specified. For example,
--rewrite-object=kms-key=projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/CRYPTO_KEY
will rewrite the Cloud KMS key that will be used to encrypt the
object.
rewriting kms-key and storage-class. To rewrite the Cloud KMS key
that will be used to encrypt the object, specify the key-value pair
kms-key={KEY}. To rewrite the object storage classes, specify the
key-value pair storage-class={STORAGE_CLASS} where storage-class can
be one of STANDARD, NEARLINE, COLDLINE, or ARCHIVE. If an object's
storage class is set to a different value than it currently has, a
full byte copy of the object will be made. If Autoclass is enabled on
the bucket, storage class changes will be ignored by Cloud Storage. A
metadata field MUST be specified, and multiple key-value pairs can be
specified by separating them with commas. For example:
▸ --rewrite-object=kms-key=projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/CRYPTO_KEY,storage-class=STANDARD
Or at most one of these can be specified:
Describes options to update object custom contexts.
--clear-all-object-custom-contexts
Clears all object custom contexts.
Or at least one of these can be specified:
Flags for updating or clearing individual custom contexts. A key
cannot be present in both --update-object-custom-contexts and
--clear-object-custom-contexts.
--clear-object-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
Removes object custom contexts by key. If an entry is not found,
it will be ignored. e.g. --clear-object-custom-contexts=key1,key2
Flags for specifying custom context updates in key-value pairs or
from a file.
At most one of these can be specified:
--update-object-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Inserts or updates object custom contexts. If an existing entry
is found, the value will be updated, otherwise the entry would
be added. e.g.
--update-object-custom-contexts=key1=val1,key2=val2
--update-object-custom-contexts-file=CUSTOM_CONTEXTS_FILE
Path to a local JSON or YAML file containing custom contexts
one wants to update on an object. If an entry is found, any
fields set in the payload will be updated, otherwise the entry
would be added. For example:
1. The following JSON document shows two key value pairs, i.e.
(key1, value1) and (key2, value2):
{
"key1": {"value": "value1"},
"key2": {"value": "value2"}
}
2. The following YAML document shows two key value pairs, i.e.
(key1, value1) and (key2, value2):
key1:
value: value1
key2:
value: value2
Note: Currently object contexts only supports string format for
values.
Or at least one of these can be specified:

View file

@ -9,6 +9,7 @@ SYNOPSIS
[--default-storage-class=DEFAULT_STORAGE_CLASS,
-c DEFAULT_STORAGE_CLASS, -s DEFAULT_STORAGE_CLASS]
[--enable-hierarchical-namespace] [--enable-per-object-retention]
[--encryption-enforcement-file=ENCRYPTION_ENFORCEMENT_FILE]
[--ip-filter-file=IP_FILTER_FILE] [--lifecycle-file=LIFECYCLE_FILE]
[--location=LOCATION, -l LOCATION]
[--[no-]pap, --[no-]public-access-prevention]
@ -66,6 +67,43 @@ FLAGS
Enables each object in the bucket to have its own retention settings,
which prevents deletion until stored for a specific length of time.
--encryption-enforcement-file=ENCRYPTION_ENFORCEMENT_FILE
Sets the encryption enforcement configuration for the bucket from a
JSON file. This configuration determines restrictions on the types of
encryption (GMEK, CMEK, CSEK) allowed for new objects created in the
bucket.
The JSON file should contain an object with keys among
"gmekEnforcement", "cmekEnforcement", and "csekEnforcement". Each of
these keys, if present, should have a "restrictionMode" key,
determining whether the corresponding encryption type should be allowed
or restricted for new objects.
Valid values for "restrictionMode" are:
◆ "NotRestricted": The encryption type is allowed for new objects.
◆ "FullyRestricted": The encryption type is not allowed for new
objects.
Example JSON file content, to enforce only CMEK for new objects:
{
"gmekEnforcement": {
"restrictionMode": "FullyRestricted"
},
"cmekEnforcement": {
"restrictionMode": "NotRestricted"
},
"csekEnforcement": {
"restrictionMode": "FullyRestricted"
}
}
Omitted keys will not be sent in the API request. To clear restrictions
for a specific encryption-type during an update, set its
"restrictionMode" to "NotRestricted". For example, to clear any
restrictions on GMEK: { "gmekEnforcement": { "restrictionMode":
"NotRestricted" } }
--ip-filter-file=IP_FILTER_FILE
Sets the IP filter for the bucket. The IP filter is a list of ip ranges
that are allowed to access the bucket. For example, The following JSON

View file

@ -6,6 +6,7 @@ SYNOPSIS
[--clear-soft-delete] [--continue-on-error, -c]
[--[no-]default-event-based-hold]
[--default-storage-class=DEFAULT_STORAGE_CLASS]
[--encryption-enforcement-file=ENCRYPTION_ENFORCEMENT_FILE]
[--lock-retention-period] [--read-paths-from-stdin, -I]
[--recovery-point-objective=SETTING, --rpo=SETTING]
[--[no-]requester-pays] [--soft-delete-duration=SOFT_DELETE_DURATION]
@ -88,6 +89,43 @@ FLAGS
--default-storage-class=DEFAULT_STORAGE_CLASS
Sets the default storage class for the bucket.
--encryption-enforcement-file=ENCRYPTION_ENFORCEMENT_FILE
Sets the encryption enforcement configuration for the bucket from a
JSON file. This configuration determines restrictions on the types of
encryption (GMEK, CMEK, CSEK) allowed for new objects created in the
bucket.
The JSON file should contain an object with keys among
"gmekEnforcement", "cmekEnforcement", and "csekEnforcement". Each of
these keys, if present, should have a "restrictionMode" key,
determining whether the corresponding encryption type should be allowed
or restricted for new objects.
Valid values for "restrictionMode" are:
◆ "NotRestricted": The encryption type is allowed for new objects.
◆ "FullyRestricted": The encryption type is not allowed for new
objects.
Example JSON file content, to enforce only CMEK for new objects:
{
"gmekEnforcement": {
"restrictionMode": "FullyRestricted"
},
"cmekEnforcement": {
"restrictionMode": "NotRestricted"
},
"csekEnforcement": {
"restrictionMode": "FullyRestricted"
}
}
Omitted keys will not be sent in the API request. To clear restrictions
for a specific encryption-type during an update, set its
"restrictionMode" to "NotRestricted". For example, to clear any
restrictions on GMEK: { "gmekEnforcement": { "restrictionMode":
"NotRestricted" } }
--lock-retention-period
Locks an unlocked retention policy on the buckets. Caution: A locked
retention policy cannot be removed from a bucket or reduced in

View file

@ -23,7 +23,12 @@ SYNOPSIS
--content-disposition=CONTENT_DISPOSITION
--content-encoding=CONTENT_ENCODING
--content-language=CONTENT_LANGUAGE --content-type=CONTENT_TYPE
--custom-time=CUSTOM_TIME --clear-custom-metadata
--custom-time=CUSTOM_TIME --clear-custom-contexts
| --custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
| --custom-contexts-file=CUSTOM_CONTEXTS_FILE
| --remove-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
--update-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
--clear-custom-metadata
| --custom-metadata=[CUSTOM_METADATA_KEYS_AND_VALUES,...]
| --remove-custom-metadata=[METADATA_KEYS,...]
--update-custom-metadata=[CUSTOM_METADATA_KEYS_AND_VALUES,...]]
@ -73,6 +78,14 @@ EXAMPLES
$ gcloud storage cp ~/Downloads/**/dir gs://my-bucket
The contexts are preserved when copying to Google Cloud Storage. To
overwrite contexts on the destination object, use --custom-contexts or
--custom-contexts-file. For example:
$ gcloud storage cp gs://my-bucket/object \
gs://destination-bucket/object \
--custom-contexts=key1=value1,key2=value2
POSITIONAL ARGUMENTS
[SOURCE ...]
The source path(s) to copy.
@ -321,6 +334,57 @@ OBJECT METADATA FLAGS
--custom-time=CUSTOM_TIME
Custom time for Cloud Storage objects in RFC 3339 format.
Group that allow users to handle object contexts.
At most one of these can be specified:
--clear-custom-contexts
Clears all custom contexts on objects.
--custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Sets custom contexts on objects. The existing custom contexts (if
any) would be overwritten.
--custom-contexts-file=CUSTOM_CONTEXTS_FILE
Path to a local JSON or YAML file containing custom contexts one
wants to set on an object. For example:
1. The following JSON document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
{
"key1": {"value": "value1"},
"key2": {"value": "value2"}
}
2. The following YAML document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
key1:
value: value1
key2:
value: value2
Note: Currently object contexts only supports string format for
values.
Or at least one of these can be specified:
Flags that preserve the existing contexts on the object, and can be
specified together. However they cannot be specified with
--clear-custom-contexts, --custom-contexts or --custom-contexts-file.
If --update-custom-contexts and --remove-custom-contexts are specified
together, the --remove-custom-contexts would be applied first on
object.
--remove-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
Removes the custom contexts on the object, if an entry is not
found, it would be ignored.
--update-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Updates the custom contexts on the object, if an entry is found, it
would be overwritten, otherwise the entry would be added.
At most one of these can be specified:
--clear-custom-metadata

View file

@ -7,9 +7,9 @@ SYNOPSIS
[--all-versions, -a]
[--exclude-name-pattern=EXCLUDE_NAME_PATTERN, -e EXCLUDE_NAME_PATTERN]
[--exclude-name-pattern-file=EXCLUDE_NAME_PATTERN_FILE,
-X EXCLUDE_NAME_PATTERN_FILE] [--readable-sizes, -r]
[--summarize, -s] [--total, -c] [--zero-terminator, -0]
[GCLOUD_WIDE_FLAG ...]
-X EXCLUDE_NAME_PATTERN_FILE] [--metadata-filter=METADATA_FILTER]
[--readable-sizes, -r] [--summarize, -s] [--total, -c]
[--zero-terminator, -0] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
Displays the amount of space in bytes used by the objects in a bucket,
@ -76,6 +76,15 @@ FLAGS
Similar to -e, but excludes patterns from the given file. The patterns
to exclude should be listed one per line.
--metadata-filter=METADATA_FILTER
Server side filtering for objects. Works only for Google Cloud Storage
URLs. The filter only works for objects, and not directories or
buckets, which means commands like storage ls and storage du will still
list directories or buckets even if they do not contain any objects
matching the filter. See
https://cloud.google.com/storage/docs/listing-objects#filter-by-object-contexts-syntax
for more details.
--readable-sizes, -r
Prints object sizes in human-readable format. For example, 1 KiB, 234
MiB, or 2GiB.

View file

@ -5,9 +5,9 @@ SYNOPSIS
gcloud storage ls [PATH ...] [--additional-headers=HEADER=VALUE]
[--all-versions, -a] [--buckets, -b] [--etag, -e] [--exhaustive]
[--fetch-encrypted-object-hashes] [--format=FORMAT]
[--next-page-token=NEXT_PAGE_TOKEN] [--read-paths-from-stdin, -I]
[--readable-sizes] [--recursive, -R, -r] [--soft-deleted]
[--full, -L | --json, -j | --long, -l]
[--metadata-filter=METADATA_FILTER] [--next-page-token=NEXT_PAGE_TOKEN]
[--read-paths-from-stdin, -I] [--readable-sizes] [--recursive, -R, -r]
[--soft-deleted] [--full, -L | --json, -j | --long, -l]
[--decryption-keys=[DECRYPTION_KEY,...]] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
@ -63,6 +63,14 @@ EXAMPLES
Recursive listings are similar to ** except recursive listings include line
breaks and header formatting for each subdirectory.
The following command filters objects based on specified filter while
listing. Note that the flag is only supported for Google Cloud Storage URLs
and only applies to objects. This means that directories or buckets will
still be listed even if they do not contain objects that match the filter.
$ gcloud storage ls gs://my-bucket \
--metadata-filter='contexts."foo"="bar"'
POSITIONAL ARGUMENTS
[PATH ...]
The path of objects and directories to list. The path must begin with
@ -107,6 +115,15 @@ FLAGS
"--format=gsutil"). Other format values (e.g. "json") do not work. See
different ls flags and commands for alternative formatting.
--metadata-filter=METADATA_FILTER
Server side filtering for objects. Works only for Google Cloud Storage
URLs. The filter only works for objects, and not directories or
buckets, which means commands like storage ls and storage du will still
list directories or buckets even if they do not contain any objects
matching the filter. See
https://cloud.google.com/storage/docs/listing-objects#filter-by-object-contexts-syntax
for more details.
--next-page-token=NEXT_PAGE_TOKEN
Page token for resuming LIST calls.

View file

@ -22,7 +22,12 @@ SYNOPSIS
--content-disposition=CONTENT_DISPOSITION
--content-encoding=CONTENT_ENCODING
--content-language=CONTENT_LANGUAGE --content-type=CONTENT_TYPE
--custom-time=CUSTOM_TIME --clear-custom-metadata
--custom-time=CUSTOM_TIME --clear-custom-contexts
| --custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
| --custom-contexts-file=CUSTOM_CONTEXTS_FILE
| --remove-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
--update-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
--clear-custom-metadata
| --custom-metadata=[CUSTOM_METADATA_KEYS_AND_VALUES,...]
| --remove-custom-metadata=[METADATA_KEYS,...]
--update-custom-metadata=[CUSTOM_METADATA_KEYS_AND_VALUES,...]]
@ -78,6 +83,12 @@ EXAMPLES
$ gcloud storage mv gs://my_bucket/oldprefix gs://my_bucket/newprefix
The following command would clear all custom contexts from the destination
object while moving the object to the destination bucket.
$ gcloud storage mv gs://my-bucket/object \
gs://destination-bucket/object --clear-custom-contexts
POSITIONAL ARGUMENTS
[SOURCE ...]
The source path(s) to copy.
@ -322,6 +333,57 @@ OBJECT METADATA FLAGS
--custom-time=CUSTOM_TIME
Custom time for Cloud Storage objects in RFC 3339 format.
Group that allow users to handle object contexts.
At most one of these can be specified:
--clear-custom-contexts
Clears all custom contexts on objects.
--custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Sets custom contexts on objects. The existing custom contexts (if
any) would be overwritten.
--custom-contexts-file=CUSTOM_CONTEXTS_FILE
Path to a local JSON or YAML file containing custom contexts one
wants to set on an object. For example:
1. The following JSON document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
{
"key1": {"value": "value1"},
"key2": {"value": "value2"}
}
2. The following YAML document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
key1:
value: value1
key2:
value: value2
Note: Currently object contexts only supports string format for
values.
Or at least one of these can be specified:
Flags that preserve the existing contexts on the object, and can be
specified together. However they cannot be specified with
--clear-custom-contexts, --custom-contexts or --custom-contexts-file.
If --update-custom-contexts and --remove-custom-contexts are specified
together, the --remove-custom-contexts would be applied first on
object.
--remove-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
Removes the custom contexts on the object, if an entry is not
found, it would be ignored.
--update-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Updates the custom contexts on the object, if an entry is found, it
would be overwritten, otherwise the entry would be added.
At most one of these can be specified:
--clear-custom-metadata

View file

@ -5,6 +5,9 @@ NAME
SYNOPSIS
gcloud storage objects compose SOURCE [SOURCE ...] DESTINATION
[--additional-headers=HEADER=VALUE]
[--clear-custom-contexts
| --custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
| --custom-contexts-file=CUSTOM_CONTEXTS_FILE]
[--if-generation-match=GENERATION
--if-metageneration-match=METAGENERATION]
[--retain-until=DATETIME --retention-mode=RETENTION_MODE]
@ -26,6 +29,14 @@ EXAMPLES
$ gcloud storage objects compose gs://bucket/a.txt \
gs://bucket/b.txt gs://bucket/target.txt
Contexts are merged from source objects on the composed object by default.
However, the following command overwrites custom contexts on composed
object:
$ gcloud storage objects compose gs://bucket/a.txt \
gs://bucket/b.txt gs://bucket/target.txt \
--custom-contexts=key1=value1,key2=value2
POSITIONAL ARGUMENTS
SOURCE [SOURCE ...]
The list of source objects that will be concatenated into a single
@ -41,6 +52,41 @@ FLAGS
Overrides the default storage/additional_headers property value for
this command invocation.
OBJECT CONTEXTS FLAGS
Group that allow users to handle object contexts.
At most one of these can be specified:
--clear-custom-contexts
Clears all custom contexts on objects.
--custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Sets custom contexts on objects. The existing custom contexts (if
any) would be overwritten.
--custom-contexts-file=CUSTOM_CONTEXTS_FILE
Path to a local JSON or YAML file containing custom contexts one
wants to set on an object. For example:
1. The following JSON document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
{
"key1": {"value": "value1"},
"key2": {"value": "value2"}
}
2. The following YAML document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
key1:
value: value1
key2:
value: value2
Note: Currently object contexts only supports string format for
values.
PRECONDITION FLAGS
--if-generation-match=GENERATION
Execute only if the generation matches the generation of the requested

View file

@ -20,6 +20,11 @@ EXAMPLES
$ gcloud storage objects describe gs://bucket/my-object \
--format="json(name)"
Describe only contexts attached to objects as key value pairs.
$ gcloud storage objects describe gs://my-bucket/object \
--format=contextsonly
POSITIONAL ARGUMENTS
URL
Specifies URL of object to describe.

View file

@ -4,8 +4,8 @@ NAME
SYNOPSIS
gcloud storage objects list URLS [URLS ...]
[--additional-headers=HEADER=VALUE] [--exhaustive]
[--fetch-encrypted-object-hashes] [--next-page-token=NEXT_PAGE_TOKEN]
[--raw] [--soft-deleted] [--stat]
[--fetch-encrypted-object-hashes] [--metadata-filter=METADATA_FILTER]
[--next-page-token=NEXT_PAGE_TOKEN] [--raw] [--soft-deleted] [--stat]
[--decryption-keys=[DECRYPTION_KEY,...]] [--filter=EXPRESSION]
[--limit=LIMIT] [--page-size=PAGE_SIZE] [--sort-by=[FIELD,...]] [--uri]
[GCLOUD_WIDE_FLAG ...]
@ -36,6 +36,10 @@ EXAMPLES
$ gcloud storage objects list gs://my-bucket --format="json(name)"
List only contexts attached to objects as key value pairs.
$ gcloud storage objects list gs://my-bucket --format=contextsonly
POSITIONAL ARGUMENTS
URLS [URLS ...]
Specifies URL of objects to list.
@ -58,6 +62,15 @@ FLAGS
encrypted object in order to fetch hashes. This can significantly
increase the cost of the command.
--metadata-filter=METADATA_FILTER
Server side filtering for objects. Works only for Google Cloud Storage
URLs. The filter only works for objects, and not directories or
buckets, which means commands like storage ls and storage du will still
list directories or buckets even if they do not contain any objects
matching the filter. See
https://cloud.google.com/storage/docs/listing-objects#filter-by-object-contexts-syntax
for more details.
--next-page-token=NEXT_PAGE_TOKEN
Page token for resuming LIST calls.

View file

@ -19,7 +19,12 @@ SYNOPSIS
--content-disposition=CONTENT_DISPOSITION
--content-encoding=CONTENT_ENCODING
--content-language=CONTENT_LANGUAGE --content-type=CONTENT_TYPE
--custom-time=CUSTOM_TIME --clear-custom-metadata
--custom-time=CUSTOM_TIME --clear-custom-contexts
| --custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
| --custom-contexts-file=CUSTOM_CONTEXTS_FILE
| --remove-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
--update-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
--clear-custom-metadata
| --custom-metadata=[CUSTOM_METADATA_KEYS_AND_VALUES,...]
| --remove-custom-metadata=[METADATA_KEYS,...]
--update-custom-metadata=[CUSTOM_METADATA_KEYS_AND_VALUES,...]]
@ -57,6 +62,18 @@ EXAMPLES
$ gcloud storage objects update gs://bucket/*.jpg \
--storage-class=NEARLINE --if-metageneration-match=123456789
The following command overwrites the custom contexts of an object:
$ gcloud storage objects update gs://bucket/my-object \
--custom-contexts=key1=value1,key2=value2
The following example simultaneously updates and removes custom contexts,
with remove being applied first:
$ gcloud storage objects update gs://bucket/my-object \
--update-custom-contexts=key2=value3 \
--remove-custom-contexts=key2,key3
POSITIONAL ARGUMENTS
[URL ...]
Specifies URLs of objects to update.
@ -191,6 +208,57 @@ OBJECT METADATA FLAGS
--custom-time=CUSTOM_TIME
Custom time for Cloud Storage objects in RFC 3339 format.
Group that allow users to handle object contexts.
At most one of these can be specified:
--clear-custom-contexts
Clears all custom contexts on objects.
--custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Sets custom contexts on objects. The existing custom contexts (if
any) would be overwritten.
--custom-contexts-file=CUSTOM_CONTEXTS_FILE
Path to a local JSON or YAML file containing custom contexts one
wants to set on an object. For example:
1. The following JSON document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
{
"key1": {"value": "value1"},
"key2": {"value": "value2"}
}
2. The following YAML document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
key1:
value: value1
key2:
value: value2
Note: Currently object contexts only supports string format for
values.
Or at least one of these can be specified:
Flags that preserve the existing contexts on the object, and can be
specified together. However they cannot be specified with
--clear-custom-contexts, --custom-contexts or --custom-contexts-file.
If --update-custom-contexts and --remove-custom-contexts are specified
together, the --remove-custom-contexts would be applied first on
object.
--remove-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
Removes the custom contexts on the object, if an entry is not
found, it would be ignored.
--update-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Updates the custom contexts on the object, if an entry is found, it
would be overwritten, otherwise the entry would be added.
At most one of these can be specified:
--clear-custom-metadata

View file

@ -19,7 +19,12 @@ SYNOPSIS
--content-disposition=CONTENT_DISPOSITION
--content-encoding=CONTENT_ENCODING
--content-language=CONTENT_LANGUAGE --content-type=CONTENT_TYPE
--custom-time=CUSTOM_TIME --clear-custom-metadata
--custom-time=CUSTOM_TIME --clear-custom-contexts
| --custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
| --custom-contexts-file=CUSTOM_CONTEXTS_FILE
| --remove-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
--update-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
--clear-custom-metadata
| --custom-metadata=[CUSTOM_METADATA_KEYS_AND_VALUES,...]
| --remove-custom-metadata=[METADATA_KEYS,...]
--update-custom-metadata=[CUSTOM_METADATA_KEYS_AND_VALUES,...]]
@ -91,6 +96,13 @@ EXAMPLES
$ gcloud storage rsync dir gs://my-bucket \
--exclude=".*\.txt$|.*\.jpg$"
The contexts are preserved when using rsync to sync to Google Cloud
Storage. However, the following command would clear all custom contexts
from the destination object while syncing to the destination bucket.
$ gcloud storage rsync gs://my-bucket/ gs://destination-bucket/ \
--clear-custom-contexts
POSITIONAL ARGUMENTS
SOURCE
The source container path.
@ -248,6 +260,57 @@ OBJECT METADATA FLAGS
--custom-time=CUSTOM_TIME
Custom time for Cloud Storage objects in RFC 3339 format.
Group that allow users to handle object contexts.
At most one of these can be specified:
--clear-custom-contexts
Clears all custom contexts on objects.
--custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Sets custom contexts on objects. The existing custom contexts (if
any) would be overwritten.
--custom-contexts-file=CUSTOM_CONTEXTS_FILE
Path to a local JSON or YAML file containing custom contexts one
wants to set on an object. For example:
1. The following JSON document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
{
"key1": {"value": "value1"},
"key2": {"value": "value2"}
}
2. The following YAML document shows two key value pairs, i.e. (key1,
value1) and (key2, value2):
key1:
value: value1
key2:
value: value2
Note: Currently object contexts only supports string format for
values.
Or at least one of these can be specified:
Flags that preserve the existing contexts on the object, and can be
specified together. However they cannot be specified with
--clear-custom-contexts, --custom-contexts or --custom-contexts-file.
If --update-custom-contexts and --remove-custom-contexts are specified
together, the --remove-custom-contexts would be applied first on
object.
--remove-custom-contexts=[CUSTOM_CONTEXTS_KEYS,...]
Removes the custom contexts on the object, if an entry is not
found, it would be ignored.
--update-custom-contexts=[CUSTOM_CONTEXTS_KEYS_AND_VALUES,...]
Updates the custom contexts on the object, if an entry is found, it
would be overwritten, otherwise the entry would be added.
At most one of these can be specified:
--clear-custom-metadata