Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 59 additions & 59 deletions google/cloud/_storage_v2/services/storage/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ class StorageAsyncClient:

Resources are named as follows:

- Projects are referred to as they are defined by the Resource
Manager API, using strings like ``projects/123456`` or
``projects/my-string-id``.

- Buckets are named using string names of the form:
``projects/{project}/buckets/{bucket}`` For globally unique
buckets, ``_`` may be substituted for the project.

- Objects are uniquely identified by their name along with the name
of the bucket they belong to, as separate strings in this API.
For example:

ReadObjectRequest { bucket: 'projects/_/buckets/my-bucket'
object: 'my-object' } Note that object names can contain ``/``
characters, which are treated as any other character (no special
directory semantics).
- Projects are referred to as they are defined by the Resource
Manager API, using strings like ``projects/123456`` or
``projects/my-string-id``.

- Buckets are named using string names of the form:
``projects/{project}/buckets/{bucket}`` For globally unique
buckets, ``_`` may be substituted for the project.

- Objects are uniquely identified by their name along with the name
of the bucket they belong to, as separate strings in this API. For
example:

ReadObjectRequest { bucket: 'projects/\_/buckets/my-bucket'
object: 'my-object' } Note that object names can contain ``/``
characters, which are treated as any other character (no special
directory semantics).
"""

_client: StorageClient
Expand Down Expand Up @@ -1006,19 +1006,19 @@ async def sample_get_iam_policy():
constraints based on attributes of the request, the
resource, or both. To learn which resources support
conditions in their IAM policies, see the [IAM
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
documentation](https://cloud.google.com/iam/help/conditions/resource-policies).

**JSON example:**

:literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \`
:literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \`

**YAML example:**

:literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \`
:literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \`

For a description of IAM and its features, see the
[IAM
documentation](\ https://cloud.google.com/iam/docs/).
documentation](https://cloud.google.com/iam/docs/).

"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -1161,19 +1161,19 @@ async def sample_set_iam_policy():
constraints based on attributes of the request, the
resource, or both. To learn which resources support
conditions in their IAM policies, see the [IAM
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
documentation](https://cloud.google.com/iam/help/conditions/resource-policies).

**JSON example:**

:literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \`
:literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \`

**YAML example:**

:literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \`
:literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \`

For a description of IAM and its features, see the
[IAM
documentation](\ https://cloud.google.com/iam/docs/).
documentation](https://cloud.google.com/iam/docs/).

"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -2578,41 +2578,41 @@ async def write_object(
explicitly by the client or due to a network error or an error
response from the server), the client should do as follows:

- Check the result Status of the stream, to determine if
writing can be resumed on this stream or must be restarted
from scratch (by calling ``StartResumableWrite()``). The
resumable errors are DEADLINE_EXCEEDED, INTERNAL, and
UNAVAILABLE. For each case, the client should use binary
exponential backoff before retrying. Additionally, writes can
be resumed after RESOURCE_EXHAUSTED errors, but only after
taking appropriate measures, which may include reducing
aggregate send rate across clients and/or requesting a quota
increase for your project.
- If the call to ``WriteObject`` returns ``ABORTED``, that
indicates concurrent attempts to update the resumable write,
caused either by multiple racing clients or by a single
client where the previous request was timed out on the client
side but nonetheless reached the server. In this case the
client should take steps to prevent further concurrent writes
(e.g., increase the timeouts, stop using more than one
process to perform the upload, etc.), and then should follow
the steps below for resuming the upload.
- For resumable errors, the client should call
``QueryWriteStatus()`` and then continue writing from the
returned ``persisted_size``. This may be less than the amount
of data the client previously sent. Note also that it is
acceptable to send data starting at an offset earlier than
the returned ``persisted_size``; in this case, the service
will skip data at offsets that were already persisted
(without checking that it matches the previously written
data), and write only the data starting from the persisted
offset. Even though the data isn't written, it may still
incur a performance cost over resuming at the correct write
offset. This behavior can make client-side handling simpler
in some cases.
- Clients must only send data that is a multiple of 256 KiB per
message, unless the object is being finished with
``finish_write`` set to ``true``.
- Check the result Status of the stream, to determine if writing
can be resumed on this stream or must be restarted from
scratch (by calling ``StartResumableWrite()``). The resumable
errors are DEADLINE_EXCEEDED, INTERNAL, and UNAVAILABLE. For
each case, the client should use binary exponential backoff
before retrying. Additionally, writes can be resumed after
RESOURCE_EXHAUSTED errors, but only after taking appropriate
measures, which may include reducing aggregate send rate
across clients and/or requesting a quota increase for your
project.
- If the call to ``WriteObject`` returns ``ABORTED``, that
indicates concurrent attempts to update the resumable write,
caused either by multiple racing clients or by a single client
where the previous request was timed out on the client side
but nonetheless reached the server. In this case the client
should take steps to prevent further concurrent writes (e.g.,
increase the timeouts, stop using more than one process to
perform the upload, etc.), and then should follow the steps
below for resuming the upload.
- For resumable errors, the client should call
``QueryWriteStatus()`` and then continue writing from the
returned ``persisted_size``. This may be less than the amount
of data the client previously sent. Note also that it is
acceptable to send data starting at an offset earlier than the
returned ``persisted_size``; in this case, the service will
skip data at offsets that were already persisted (without
checking that it matches the previously written data), and
write only the data starting from the persisted offset. Even
though the data isn't written, it may still incur a
performance cost over resuming at the correct write offset.
This behavior can make client-side handling simpler in some
cases.
- Clients must only send data that is a multiple of 256 KiB per
message, unless the object is being finished with
``finish_write`` set to ``true``.

The service will not view the object as complete until the
client has sent a ``WriteObjectRequest`` with ``finish_write``
Expand Down
Loading