Skip to content

Commit

Permalink
Backfill cl/539110318 (#1713)
Browse files Browse the repository at this point in the history
* Backfill cl/539110318

Small format and terminology improvements to cors help doc

* Backfill cl/539110318

Small format, tense, and terminology improvements to the stat help doc
  • Loading branch information
starsandskies authored Jun 13, 2023
1 parent 598d0dd commit 58a8c5f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
22 changes: 11 additions & 11 deletions gslib/commands/cors.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,29 @@
"""

_SET_SYNOPSIS = """
gsutil cors set cors-json-file gs://<bucket_name>...
gsutil cors set <cors-json-file> gs://<bucket_name>...
"""

_GET_DESCRIPTION = """
<B>GET</B>
Gets the CORS configuration for a single bucket. The output from
"cors get" can be redirected into a file, edited and then updated using
"cors set".
``cors get`` can be redirected into a file, edited and then updated using
``cors set``.
"""

_SET_DESCRIPTION = """
<B>SET</B>
Sets the CORS configuration for one or more buckets. The
cors-json-file specified on the command line should be a path to a local
file containing a JSON document as described above.
Sets the CORS configuration for one or more buckets. The ``cors-json-file``
specified on the command line should be a path to a local file containing
a JSON-formatted CORS configuration, such as the example described above.
"""

_SYNOPSIS = _SET_SYNOPSIS + _GET_SYNOPSIS.lstrip('\n') + '\n\n'

_DESCRIPTION = ("""
Gets or sets the Cross-Origin Resource Sharing (CORS) configuration on one or
more buckets. This command is supported for buckets only, not objects. An
example CORS JSON document looks like the following:
example CORS JSON file looks like the following:
[
{
Expand All @@ -74,16 +74,16 @@
}
]
The above JSON document explicitly allows cross-origin GET requests from
The above CORS configuration explicitly allows cross-origin GET requests from
http://origin1.example.com and may include the Content-Type response header.
The preflight request may be cached for 1 hour.
Note that requests to the authenticated browser download endpoint ``storage.cloud.google.com``
do not allow CORS requests. For more information about supported endpoints for CORS, see
`Cloud Storage CORS support <https://cloud.google.com/storage/docs/cross-origin#server-side-support>`_.
The following (empty) CORS JSON document removes all CORS configuration for
a bucket:
The following (empty) CORS JSON file removes any CORS configuration for a
bucket:
[]
Expand Down Expand Up @@ -133,7 +133,7 @@ class CorsCommand(Command):
],
help_type='command_help',
help_one_line_summary=(
'Get or set a CORS JSON document for one or more buckets'),
'Get or set a CORS configuration for one or more buckets'),
help_text=_DETAILED_HELP_TEXT,
subcommand_help_text={
'get': _get_help_text,
Expand Down
29 changes: 15 additions & 14 deletions gslib/commands/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,22 @@
<B>DESCRIPTION</B>
The stat command will output details about the specified object URLs.
It is similar to running:
The stat command outputs `object metadata
<https://cloud.google.com/storage/docs/metadata>`_ for the specified object
URLs. It is similar to running:
gsutil ls -L gs://some-bucket/some-object
but is more efficient because it avoids performing bucket listings and gets
the minimum necessary amount of object metadata. Moreover, because it avoids
performing bucket listings (which for some storage providers are eventually
consistent) the gsutil stat command provides a strongly consistent way to
check for the existence (and read the metadata) of an object.
but is more efficient because it avoids listing objects and gets the minimum
necessary amount of object metadata. Moreover, because it avoids listing
objects (which for some storage providers are eventually consistent) the
``gsutil stat`` command provides a strongly consistent way to check for the
existence (and read the metadata) of an object.
The gsutil stat command will, however, perform bucket listings if you specify
URLs using wildcards.
The ``gsutil stat`` command does, however, make listing object requests if
you specify URLs using wildcards.
If run with the gsutil -q option nothing will be printed, e.g.:
If run with the ``gsutil -q`` option nothing is printed, e.g.:
gsutil -q stat gs://some-bucket/some-object
Expand All @@ -77,12 +78,12 @@
gsutil -q stat gs://some-bucket/some-subdir/
gsutil will look for information about an object called "some-subdir/" (with a
gsutil looks for information about an object called "some-subdir/" (with a
trailing slash) inside the bucket "some-bucket", as opposed to operating on
objects nested under gs://some-bucket/some-subdir/. Unless you actually have
an object with that name, the operation will fail. However, you can use the
stat command on objects within subdirectories. For example, this command will
work as expected:
an object with that name, the operation fails. However, you can use the stat
command on objects within subdirectories. For example, this command works
as expected:
gsutil -q stat gs://some-bucket/some-subdir/file.txt
""")
Expand Down

0 comments on commit 58a8c5f

Please sign in to comment.