mirror of
https://github.com/imjasonh/gcloud-help
synced 2026-07-18 14:56:05 +00:00
gcloud: Thu Jul 20 11:47:24 UTC 2023
This commit is contained in:
parent
b4c2508b12
commit
64e67b443c
325 changed files with 10090 additions and 1806 deletions
|
|
@ -3,7 +3,7 @@ NAME
|
|||
|
||||
SYNOPSIS
|
||||
gcloud storage buckets describe URL [--additional-headers=HEADER=VALUE]
|
||||
[GCLOUD_WIDE_FLAG ...]
|
||||
[--raw] [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
Describe a Cloud Storage bucket.
|
||||
|
|
@ -29,6 +29,10 @@ FLAGS
|
|||
Overrides the default storage/additional_headers property value for
|
||||
this command invocation.
|
||||
|
||||
--raw
|
||||
Shows metadata in the format returned by the API instead of
|
||||
standardizing it.
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --access-token-file, --account,
|
||||
--billing-project, --configuration, --flags-file, --flatten, --format,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ NAME
|
|||
|
||||
SYNOPSIS
|
||||
gcloud storage buckets list [URLS ...] [--additional-headers=HEADER=VALUE]
|
||||
[--filter=EXPRESSION] [--limit=LIMIT] [--page-size=PAGE_SIZE]
|
||||
[--raw] [--filter=EXPRESSION] [--limit=LIMIT] [--page-size=PAGE_SIZE]
|
||||
[--sort-by=[FIELD,...]] [--uri] [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
|
|
@ -33,6 +33,10 @@ FLAGS
|
|||
Overrides the default storage/additional_headers property value for
|
||||
this command invocation.
|
||||
|
||||
--raw
|
||||
Shows metadata in the format returned by the API instead of
|
||||
standardizing it.
|
||||
|
||||
LIST COMMAND FLAGS
|
||||
--filter=EXPRESSION
|
||||
Apply a Boolean filter EXPRESSION to each resource item to be listed.
|
||||
|
|
|
|||
|
|
@ -226,7 +226,8 @@ FLAGS
|
|||
At most one of these can be specified:
|
||||
|
||||
--clear-log-bucket
|
||||
Clears logging bucket receiving the usage current bucket's data.
|
||||
Clears logging bucket receiving the usage current bucket's data and
|
||||
disables usage logging.
|
||||
|
||||
--log-bucket=LOG_BUCKET
|
||||
Enables usage logging of the bucket, outputting log files to the
|
||||
|
|
@ -245,6 +246,7 @@ FLAGS
|
|||
Specifies the object prefix for logging activity to the log bucket.
|
||||
The default prefix is the bucket name. All read and write activity to
|
||||
objects in the bucket will be logged for objects matching the prefix.
|
||||
If usage logging is not enabled this flag will have no effect.
|
||||
|
||||
At most one of these can be specified:
|
||||
|
||||
|
|
|
|||
100
gcloud/storage/du
Normal file
100
gcloud/storage/du
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
NAME
|
||||
gcloud storage du - displays the amount of space in bytes used up storage
|
||||
resources
|
||||
|
||||
SYNOPSIS
|
||||
gcloud storage du [URL ...] [--additional-headers=HEADER=VALUE]
|
||||
[--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 ...]
|
||||
|
||||
DESCRIPTION
|
||||
Displays the amount of space in bytes used up by the objects in a bucket,
|
||||
subdirectory, or project.
|
||||
|
||||
EXAMPLES
|
||||
To list the size of each object in a bucket:
|
||||
|
||||
$ gcloud storage du gs://bucketname
|
||||
|
||||
To list the size of each object in the prefix subdirectory:
|
||||
|
||||
$ gcloud storage du gs://bucketname/prefix/*
|
||||
|
||||
To print the total number of bytes in a bucket in human-readable form:
|
||||
|
||||
$ gcloud storage du -ch gs://bucketname
|
||||
|
||||
To see a summary of the total number of bytes in two given buckets:
|
||||
|
||||
$ gcloud storage du -s gs://bucket1 gs://bucket2
|
||||
|
||||
To list the size of each object in a bucket with Object Versioning enabled,
|
||||
including noncurrent objects:
|
||||
|
||||
$ gcloud storage du -a gs://bucketname
|
||||
|
||||
To list the size of each object in a bucket, except objects that end in
|
||||
".bak", with each object printed ending in a null byte:
|
||||
|
||||
$ gcloud storage du -e "*.bak" -0 gs://bucketname
|
||||
|
||||
To list the size of each bucket in a project and the total size of the
|
||||
project:
|
||||
|
||||
$ gcloud storage du --summarize --readable-sizes --total
|
||||
|
||||
POSITIONAL ARGUMENTS
|
||||
[URL ...]
|
||||
The url of objects to list.
|
||||
|
||||
FLAGS
|
||||
--additional-headers=HEADER=VALUE
|
||||
Includes arbitrary headers in storage API calls. Accepts a comma
|
||||
separated list of key=value pairs, e.g. header1=value1,header2=value2.
|
||||
Overrides the default storage/additional_headers property value for
|
||||
this command invocation.
|
||||
|
||||
--all-versions, -a
|
||||
Includes noncurrent object versions for a bucket with Object Versioning
|
||||
enabled. Also prints the generation and metageneration number for each
|
||||
listed object.
|
||||
|
||||
--exclude-name-pattern=EXCLUDE_NAME_PATTERN, -e EXCLUDE_NAME_PATTERN
|
||||
Exclude a pattern from the report. Example: -e ".o" excludes any object
|
||||
that ends in ".o". Can be specified multiple times.
|
||||
|
||||
--exclude-name-pattern-file=EXCLUDE_NAME_PATTERN_FILE, -X EXCLUDE_NAME_PATTERN_FILE
|
||||
Similar to -e, but excludes patterns from the given file. The patterns
|
||||
to exclude should be listed one per line.
|
||||
|
||||
--readable-sizes, -r
|
||||
Prints object sizes in human-readable format. For example, 1 KiB, 234
|
||||
MiB, or 2GiB.
|
||||
|
||||
--summarize, -s
|
||||
Displays only the summary for each argument.
|
||||
|
||||
--total, -c
|
||||
Includes a total size of all input sources.
|
||||
|
||||
--zero-terminator, -0
|
||||
Ends each output line with a 0 byte rather than a newline. You can use
|
||||
this to make the output machine-readable.
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --access-token-file, --account,
|
||||
--billing-project, --configuration, --flags-file, --flatten, --format,
|
||||
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
||||
--trace-token, --user-output-enabled, --verbosity.
|
||||
|
||||
Run $ gcloud help for details.
|
||||
|
||||
NOTES
|
||||
This variant is also available:
|
||||
|
||||
$ gcloud alpha storage du
|
||||
|
||||
|
|
@ -23,6 +23,9 @@ GROUPS
|
|||
buckets
|
||||
Manage Cloud Storage buckets.
|
||||
|
||||
hmac
|
||||
Manage Cloud Storage service account HMAC keys.
|
||||
|
||||
insights
|
||||
Manage Cloud Storage inventory reports.
|
||||
|
||||
|
|
@ -38,6 +41,9 @@ COMMANDS
|
|||
cp
|
||||
Upload, download, and copy Cloud Storage objects.
|
||||
|
||||
du
|
||||
Displays the amount of space in bytes used up storage resources.
|
||||
|
||||
hash
|
||||
Calculates hashes on local or cloud files.
|
||||
|
||||
|
|
@ -57,6 +63,9 @@ COMMANDS
|
|||
Manage a project's Cloud Storage service agent, which is used to
|
||||
perform Cloud KMS operations.
|
||||
|
||||
sign-url
|
||||
Generate a URL with embedded authentication that can be used by anyone.
|
||||
|
||||
NOTES
|
||||
This variant is also available:
|
||||
|
||||
|
|
|
|||
35
gcloud/storage/hmac/create
Normal file
35
gcloud/storage/hmac/create
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
NAME
|
||||
gcloud storage hmac create - add a service account HMAC
|
||||
|
||||
SYNOPSIS
|
||||
gcloud storage hmac create SERVICE_ACCOUNT [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
gcloud storage hmac create command creates an HMAC key for the specified
|
||||
service account. The secret key material is only available upon creation,
|
||||
so be sure to store the returned secret along with the access_id.
|
||||
|
||||
EXAMPLES
|
||||
To create an HMAC key for
|
||||
test.service.account@test_project.iam.gserviceaccount.com:
|
||||
|
||||
$ gcloud storage hmac create \
|
||||
test.service.account@test_project.iam.gserviceaccount.com
|
||||
|
||||
POSITIONAL ARGUMENTS
|
||||
SERVICE_ACCOUNT
|
||||
The service account email.
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --access-token-file, --account,
|
||||
--billing-project, --configuration, --flags-file, --flatten, --format,
|
||||
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
||||
--trace-token, --user-output-enabled, --verbosity.
|
||||
|
||||
Run $ gcloud help for details.
|
||||
|
||||
NOTES
|
||||
This variant is also available:
|
||||
|
||||
$ gcloud alpha storage hmac create
|
||||
|
||||
37
gcloud/storage/hmac/delete
Normal file
37
gcloud/storage/hmac/delete
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
NAME
|
||||
gcloud storage hmac delete - remove a service account HMAC
|
||||
|
||||
SYNOPSIS
|
||||
gcloud storage hmac delete ACCESS_ID [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
gcloud storage hmac delete permanently deletes the specified HMAC key. Note
|
||||
that keys must be updated to be in the INACTIVE state before they can be
|
||||
deleted.
|
||||
|
||||
EXAMPLES
|
||||
To delete a specific HMAC key:
|
||||
|
||||
$ gcloud storage hmac delete GOOG56JBMFZX6PMPTQ62VD2
|
||||
|
||||
To be prompted for HMAC keys to delete:
|
||||
|
||||
$ gcloud storage hmac delete
|
||||
|
||||
POSITIONAL ARGUMENTS
|
||||
ACCESS_ID
|
||||
Access ID for HMAC key to delete.
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --access-token-file, --account,
|
||||
--billing-project, --configuration, --flags-file, --flatten, --format,
|
||||
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
||||
--trace-token, --user-output-enabled, --verbosity.
|
||||
|
||||
Run $ gcloud help for details.
|
||||
|
||||
NOTES
|
||||
This variant is also available:
|
||||
|
||||
$ gcloud alpha storage hmac delete
|
||||
|
||||
37
gcloud/storage/hmac/describe
Normal file
37
gcloud/storage/hmac/describe
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
NAME
|
||||
gcloud storage hmac describe - describes a service account HMAC key
|
||||
|
||||
SYNOPSIS
|
||||
gcloud storage hmac describe ACCESS_ID [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
gcloud storage hmac describe retrieves the specified HMAC key's metadata.
|
||||
Note that there is no option to retrieve a key's secret material after it
|
||||
has been created.
|
||||
|
||||
EXAMPLES
|
||||
The following command retrieves the HMAC key's metadata:
|
||||
|
||||
$ gcloud storage hmac describe GOOG56JBMFZX6PMPTQ62VD2
|
||||
|
||||
Note GOOG56JBMFZX6PMPTQ62VD2 is the ACCESS_ID of the HMAC key.
|
||||
|
||||
POSITIONAL ARGUMENTS
|
||||
ACCESS_ID
|
||||
The Access ID
|
||||
(https://cloud.google.com/storage/docs/authentication/hmackeys#overview)
|
||||
of the HMAC key
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --access-token-file, --account,
|
||||
--billing-project, --configuration, --flags-file, --flatten, --format,
|
||||
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
||||
--trace-token, --user-output-enabled, --verbosity.
|
||||
|
||||
Run $ gcloud help for details.
|
||||
|
||||
NOTES
|
||||
This variant is also available:
|
||||
|
||||
$ gcloud alpha storage hmac describe
|
||||
|
||||
37
gcloud/storage/hmac/help
Normal file
37
gcloud/storage/hmac/help
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
NAME
|
||||
gcloud storage hmac - manage Cloud Storage service account HMAC keys
|
||||
|
||||
SYNOPSIS
|
||||
gcloud storage hmac COMMAND [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
Manage Cloud Storage service account HMAC keys.
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --help.
|
||||
|
||||
Run $ gcloud help for details.
|
||||
|
||||
COMMANDS
|
||||
COMMAND is one of the following:
|
||||
|
||||
create
|
||||
Add a service account HMAC.
|
||||
|
||||
delete
|
||||
Remove a service account HMAC.
|
||||
|
||||
describe
|
||||
Describes a service account HMAC key.
|
||||
|
||||
list
|
||||
List service account HMAC keys.
|
||||
|
||||
update
|
||||
Change the status of a service account HMAC.
|
||||
|
||||
NOTES
|
||||
This variant is also available:
|
||||
|
||||
$ gcloud alpha storage hmac
|
||||
|
||||
80
gcloud/storage/hmac/list
Normal file
80
gcloud/storage/hmac/list
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
NAME
|
||||
gcloud storage hmac list - list service account HMAC keys
|
||||
|
||||
SYNOPSIS
|
||||
gcloud storage hmac list [--all, -a] [--long, -l]
|
||||
[--service-account=SERVICE_ACCOUNT, -u SERVICE_ACCOUNT]
|
||||
[--filter=EXPRESSION] [--limit=LIMIT] [--page-size=PAGE_SIZE]
|
||||
[--sort-by=[FIELD,...]] [--uri] [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
gcloud storage hmac list lists the HMAC key metadata for keys in the
|
||||
current project.
|
||||
|
||||
EXAMPLES
|
||||
To show metadata for all keys, including recently deleted keys:
|
||||
|
||||
$ gcloud storage hmac list --all --long
|
||||
|
||||
To list only HMAC keys belonging to the service account
|
||||
test.sa@test.iam.gserviceaccount.com:
|
||||
|
||||
$ gcloud storage hmac list \
|
||||
--service-account=test.sa@test.iam.gserviceaccount.com
|
||||
|
||||
FLAGS
|
||||
--all, -a
|
||||
Shows all keys, including recently deleted keys.
|
||||
|
||||
--long, -l
|
||||
Use long listing format, showing the full metadata for each key
|
||||
excluding the secret.
|
||||
|
||||
--service-account=SERVICE_ACCOUNT, -u SERVICE_ACCOUNT
|
||||
Filter keys for the provided service account email.
|
||||
|
||||
LIST COMMAND FLAGS
|
||||
--filter=EXPRESSION
|
||||
Apply a Boolean filter EXPRESSION to each resource item to be listed.
|
||||
If the expression evaluates True, then that item is listed. For more
|
||||
details and examples of filter expressions, run $ gcloud topic filters.
|
||||
This flag interacts with other flags that are applied in this order:
|
||||
--flatten, --sort-by, --filter, --limit.
|
||||
|
||||
--limit=LIMIT
|
||||
Maximum number of resources to list. The default is unlimited. This
|
||||
flag interacts with other flags that are applied in this order:
|
||||
--flatten, --sort-by, --filter, --limit.
|
||||
|
||||
--page-size=PAGE_SIZE
|
||||
Some services group resource list output into pages. This flag
|
||||
specifies the maximum number of resources per page. The default is
|
||||
determined by the service if it supports paging, otherwise it is
|
||||
unlimited (no paging). Paging may be applied before or after --filter
|
||||
and --limit depending on the service.
|
||||
|
||||
--sort-by=[FIELD,...]
|
||||
Comma-separated list of resource field key names to sort by. The
|
||||
default order is ascending. Prefix a field with ``~'' for descending
|
||||
order on that field. This flag interacts with other flags that are
|
||||
applied in this order: --flatten, --sort-by, --filter, --limit.
|
||||
|
||||
--uri
|
||||
Print a list of resource URIs instead of the default output, and change
|
||||
the command output to a list of URIs. If this flag is used with
|
||||
--format, the formatting is applied on this URI list. To display URIs
|
||||
alongside other keys instead, use the uri() transform.
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --access-token-file, --account,
|
||||
--billing-project, --configuration, --flags-file, --flatten, --format,
|
||||
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
||||
--trace-token, --user-output-enabled, --verbosity.
|
||||
|
||||
Run $ gcloud help for details.
|
||||
|
||||
NOTES
|
||||
This variant is also available:
|
||||
|
||||
$ gcloud alpha storage hmac list
|
||||
|
||||
55
gcloud/storage/hmac/update
Normal file
55
gcloud/storage/hmac/update
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
NAME
|
||||
gcloud storage hmac update - change the status of a service account HMAC
|
||||
|
||||
SYNOPSIS
|
||||
gcloud storage hmac update ACCESS_ID (--activate | --deactivate)
|
||||
[--etag=ETAG, -e ETAG] [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
gcloud storage hmac update sets the state of the specified key. Valid state
|
||||
arguments are ACTIVE and INACTIVE. To set a key to state DELETED, use
|
||||
gcloud storage hmac delete on an INACTIVE key. If an etag is set in the
|
||||
command, it will only succeed if the provided etag matches the etag of the
|
||||
stored key.
|
||||
|
||||
EXAMPLES
|
||||
To activate an HMAC key:
|
||||
|
||||
$ gcloud storage hmac update GOOG56JBMFZX6PMPTQ62VD2 --activate
|
||||
|
||||
To set the state of an HMAC key to INACTIVE provided its etag is M42da=:
|
||||
|
||||
$ gcloud storage hmac update GOOG56JBMFZX6PMPTQ62VD2 --deactivate \
|
||||
--etag=M42da=
|
||||
|
||||
POSITIONAL ARGUMENTS
|
||||
ACCESS_ID
|
||||
Access ID for HMAC key to update.
|
||||
|
||||
REQUIRED FLAGS
|
||||
Exactly one of these must be specified:
|
||||
|
||||
--activate
|
||||
Sets the state of the specified key to ACTIVE.
|
||||
|
||||
--deactivate
|
||||
Sets the state of the specified key to INACTIVE.
|
||||
|
||||
OPTIONAL FLAGS
|
||||
--etag=ETAG, -e ETAG
|
||||
If provided, the update will only be performed if the specified etag
|
||||
matches the etag of the stored key.
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --access-token-file, --account,
|
||||
--billing-project, --configuration, --flags-file, --flatten, --format,
|
||||
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
||||
--trace-token, --user-output-enabled, --verbosity.
|
||||
|
||||
Run $ gcloud help for details.
|
||||
|
||||
NOTES
|
||||
This variant is also available:
|
||||
|
||||
$ gcloud alpha storage hmac update
|
||||
|
||||
|
|
@ -3,7 +3,7 @@ NAME
|
|||
|
||||
SYNOPSIS
|
||||
gcloud storage objects describe URL [--additional-headers=HEADER=VALUE]
|
||||
[--fetch-encrypted-object-hashes]
|
||||
[--fetch-encrypted-object-hashes] [--raw]
|
||||
[--decryption-keys=[DECRYPTION_KEY,...]] [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
|
|
@ -37,6 +37,10 @@ FLAGS
|
|||
matching decryption key is present on the system, this flag retries the
|
||||
GET request with the key.
|
||||
|
||||
--raw
|
||||
Shows metadata in the format returned by the API instead of
|
||||
standardizing it.
|
||||
|
||||
ENCRYPTION FLAGS
|
||||
--decryption-keys=[DECRYPTION_KEY,...]
|
||||
A comma-separated list of customer-supplied encryption keys (RFC 4648
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ NAME
|
|||
SYNOPSIS
|
||||
gcloud storage objects list URLS [URLS ...]
|
||||
[--additional-headers=HEADER=VALUE] [--fetch-encrypted-object-hashes]
|
||||
[--stat] [--decryption-keys=[DECRYPTION_KEY,...]] [--filter=EXPRESSION]
|
||||
[--limit=LIMIT] [--page-size=PAGE_SIZE] [--sort-by=[FIELD,...]] [--uri]
|
||||
[GCLOUD_WIDE_FLAG ...]
|
||||
[--raw] [--stat] [--decryption-keys=[DECRYPTION_KEY,...]]
|
||||
[--filter=EXPRESSION] [--limit=LIMIT] [--page-size=PAGE_SIZE]
|
||||
[--sort-by=[FIELD,...]] [--uri] [GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
List Cloud Storage objects.
|
||||
|
|
@ -45,6 +45,10 @@ FLAGS
|
|||
encrypted object in order to fetch hashes. This can significantly
|
||||
increase the cost of the command.
|
||||
|
||||
--raw
|
||||
Shows metadata in the format returned by the API instead of
|
||||
standardizing it.
|
||||
|
||||
--stat
|
||||
Emulates gsutil stat-style behavior. Does not show past object versions
|
||||
and changes output format.
|
||||
|
|
|
|||
111
gcloud/storage/sign-url
Normal file
111
gcloud/storage/sign-url
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
NAME
|
||||
gcloud storage sign-url - generate a URL with embedded authentication that
|
||||
can be used by anyone
|
||||
|
||||
SYNOPSIS
|
||||
gcloud storage sign-url URL [URL ...] --private-key-file=PRIVATE_KEY_FILE
|
||||
[--duration=DURATION, -d DURATION; default=3600]
|
||||
[--headers=[KEY=VALUE,...]]
|
||||
[--http-verb=HTTP_VERB, -m HTTP_VERB; default="GET"]
|
||||
[--private-key-password=PRIVATE_KEY_PASSWORD, -p PRIVATE_KEY_PASSWORD]
|
||||
[--query-params=[KEY=VALUE,...]] [--region=REGION, -r REGION]
|
||||
[GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
gcloud storage sign-url will generate a signed URL that embeds
|
||||
authentication data so the URL can be used by someone who does not have a
|
||||
Google account. Please see the Signed URLs documentation
|
||||
(https://cloud.google.com/storage/docs/access-control/signed-urls) for
|
||||
background about signed URLs.
|
||||
|
||||
Note, gcloud storage sign-url does not support operations on
|
||||
sub-directories. For example, unless you have an object named
|
||||
some-directory/ stored inside the bucket some-bucket, the following command
|
||||
returns an error: gcloud storage sign-url gs://some-bucket/some-directory/.
|
||||
|
||||
EXAMPLES
|
||||
To create a signed url for downloading an object valid for 10 minutes:
|
||||
|
||||
$ gcloud storage sign-url gs://my-bucket/file.txt --duration=10m \
|
||||
--private-key-file=key.json
|
||||
|
||||
To create a signed url that will bill to my-billing-project:
|
||||
|
||||
$ gcloud storage sign-url gs://my-bucket/file.txt \
|
||||
--query-params=userProject=my-billing-project \
|
||||
--private-key-file=key.json
|
||||
|
||||
To create a signed url, valid for one hour, for uploading a plain text file
|
||||
via HTTP PUT:
|
||||
|
||||
$ gcloud storage sign-url gs://my-bucket/file.txt --http-verb=PUT \
|
||||
--duration=1h --headers=content-type=text/plain \
|
||||
--private-key-file=key.json
|
||||
|
||||
To create a signed URL that initiates a resumable upload for a plain text
|
||||
file:
|
||||
|
||||
$ gcloud storage sign-url gs://my-bucket/file.txt --http-verb=POST \
|
||||
--headers=x-goog-resumable=start,content-type=text/plain \
|
||||
--private-key-file=key.json
|
||||
|
||||
POSITIONAL ARGUMENTS
|
||||
URL [URL ...]
|
||||
The URLs to be signed. May contain wildcards.
|
||||
|
||||
REQUIRED FLAGS
|
||||
--private-key-file=PRIVATE_KEY_FILE
|
||||
The service account private key used to generate the cryptographic
|
||||
signature for the generated URL. Must be in PKCS12 or JSON format. If
|
||||
encrypted, will prompt for the passphrase used to protect the private
|
||||
key file (default notasecret).
|
||||
|
||||
OPTIONAL FLAGS
|
||||
--duration=DURATION, -d DURATION; default=3600
|
||||
Specifies the duration that the signed url should be valid for, default
|
||||
duration is 1 hour. For example 10s for 10 seconds. See $ gcloud topic
|
||||
datetimes for information on duration formats.
|
||||
|
||||
The max duration allowed is 7 days when PRIVATE_KEY_FILE is used.
|
||||
|
||||
--headers=[KEY=VALUE,...]
|
||||
Specifies the headers to be used in the signed request. Possible
|
||||
headers are listed in the XML API's documentation:
|
||||
https://cloud.google.com/storage/docs/xml-api/reference-headers#headers
|
||||
|
||||
--http-verb=HTTP_VERB, -m HTTP_VERB; default="GET"
|
||||
Specifies the HTTP verb to be authorized for use with the signed URL,
|
||||
default is GET. When using a signed URL to start a resumable upload
|
||||
session, you will need to specify the x-goog-resumable:start header in
|
||||
the request or else signature validation will fail.
|
||||
|
||||
--private-key-password=PRIVATE_KEY_PASSWORD, -p PRIVATE_KEY_PASSWORD
|
||||
Specifies the private key password instead of prompting.
|
||||
|
||||
--query-params=[KEY=VALUE,...]
|
||||
Specifies the query parameters to be used in the signed request.
|
||||
Possible query parameters are listed in the XML API's documentation:
|
||||
https://cloud.google.com/storage/docs/xml-api/reference-headers#query
|
||||
|
||||
--region=REGION, -r REGION
|
||||
Specifies the region in which the resources for which you are creating
|
||||
signed URLs are stored.
|
||||
|
||||
Default value is auto which will cause gcloud storage sign-url to fetch
|
||||
the region for the resource. When auto-detecting the region, the
|
||||
current user's credentials, not the credentials from PRIVATE_KEY_FILE,
|
||||
are used to fetch the bucket's metadata.
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --access-token-file, --account,
|
||||
--billing-project, --configuration, --flags-file, --flatten, --format,
|
||||
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
||||
--trace-token, --user-output-enabled, --verbosity.
|
||||
|
||||
Run $ gcloud help for details.
|
||||
|
||||
NOTES
|
||||
This variant is also available:
|
||||
|
||||
$ gcloud alpha storage sign-url
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue