Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Bucket.requester_pays' property. #3488

Merged
merged 5 commits into from
Jun 9, 2017
Merged

Add 'Bucket.requester_pays' property. #3488

merged 5 commits into from
Jun 9, 2017

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Jun 8, 2017

Toward #3474.

Note that the new system test is skipped, because Buckets.insert fails with the billing/requesterPays field set, both in our system tests and in the 'Try It!' form in the docs.

Toward #3474.

Note that the new system test is skipped, because 'Buckets.insert' fails
with the 'billing/requesterPays' field set, both in our system tests and
in the 'Try It!' form in the docs.
@tseaver tseaver added api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jun 8, 2017
@tseaver tseaver requested review from lukesneeringer and dhermes June 8, 2017 18:55
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 8, 2017
tseaver added 2 commits June 8, 2017 15:07
Use it in the (still skipped) system test.
If we can figure out how to determing that the feature is availalbe
programatically later, we can adjust the 'REQUESTER_PAYS_ENABLED' flag,
which will also be available to guard other system tests using it.

[ci skip]
def requester_pays(self):
"""Does the requester pay for API requests for this bucket?

See https://cloud.google.com/storage/docs/<DOCS-MISSING> for

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -211,10 +211,16 @@ def create_bucket(self, bucket_name):
:type bucket_name: str
:param bucket_name: The bucket name to create.

:type requester_pays: bool
:param requester_pays: (Optional) Whether requester pays for
API requests for this bucket and its blobs.

This comment was marked as spam.

This comment was marked as spam.

@@ -194,7 +194,7 @@ def lookup_bucket(self, bucket_name):
except NotFound:
return None

def create_bucket(self, bucket_name):
def create_bucket(self, bucket_name, requester_pays=None):

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -99,6 +99,15 @@ def test_create_bucket(self):
self.case_buckets_to_delete.append(new_bucket_name)
self.assertEqual(created.name, new_bucket_name)

@unittest.skipIf(True, "requesterPays needs whitelisting?")

This comment was marked as spam.

@tseaver
Copy link
Contributor Author

tseaver commented Jun 9, 2017

@dhermes Good to merge when CI is green?

@dhermes
Copy link
Contributor

dhermes commented Jun 9, 2017

Kinda yes, kinda no. I still feel "uneasy" about the signature delta among:

  • Client.bucket
  • Client.create_bucket
  • Bucket

@tseaver
Copy link
Contributor Author

tseaver commented Jun 9, 2017

@dhermes I'm actually opposed on principle to the Client.{get,lookup,create}_bucket "convenience" methods: they violate the Zen, "There should be one-- and preferably only one --obvious way to do it.".

@dhermes
Copy link
Contributor

dhermes commented Jun 9, 2017

they violate the Zen

I (mostly) agree with you here.

@tseaver tseaver merged commit 62598f4 into googleapis:master Jun 9, 2017
@tseaver tseaver deleted the 3474-storage-bucket-requester_pays-property branch June 9, 2017 19:35
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 21, 2017
Also, add 'requester_pays' argument to 'Client.create_bucket'.

Add a system test which exercises the feature.

Note that the new system test is skipped, because 'Buckets.insert' fails
with the 'billing/requesterPays' field set, both in our system tests and
in the 'Try It!' form in the docs.


Toward googleapis#3474.
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 22, 2017
Also, add 'requester_pays' argument to 'Client.create_bucket'.

Add a system test which exercises the feature.

Note that the new system test is skipped, because 'Buckets.insert' fails
with the 'billing/requesterPays' field set, both in our system tests and
in the 'Try It!' form in the docs.


Toward googleapis#3474.
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 22, 2017
Also, add 'requester_pays' argument to 'Client.create_bucket'.

Add a system test which exercises the feature.

Note that the new system test is skipped, because 'Buckets.insert' fails
with the 'billing/requesterPays' field set, both in our system tests and
in the 'Try It!' form in the docs.


Toward googleapis#3474.
tseaver added a commit that referenced this pull request Sep 22, 2017
Also, add 'requester_pays' argument to 'Client.create_bucket'.

Add a system test which exercises the feature.

Note that the new system test is skipped, because 'Buckets.insert' fails
with the 'billing/requesterPays' field set, both in our system tests and
in the 'Try It!' form in the docs.

Toward #3474.
tseaver added a commit that referenced this pull request Oct 2, 2017
Also, add 'requester_pays' argument to 'Client.create_bucket'.

Add a system test which exercises the feature.

Note that the new system test is skipped, because 'Buckets.insert' fails
with the 'billing/requesterPays' field set, both in our system tests and
in the 'Try It!' form in the docs.

Toward #3474.
tseaver added a commit that referenced this pull request Oct 5, 2017
Also, add 'requester_pays' argument to 'Client.create_bucket'.

Add a system test which exercises the feature.

Note that the new system test is skipped, because 'Buckets.insert' fails
with the 'billing/requesterPays' field set, both in our system tests and
in the 'Try It!' form in the docs.

Toward #3474.
tseaver added a commit that referenced this pull request Oct 10, 2017
Also, add 'requester_pays' argument to 'Client.create_bucket'.

Add a system test which exercises the feature.

Note that the new system test is skipped, because 'Buckets.insert' fails
with the 'billing/requesterPays' field set, both in our system tests and
in the 'Try It!' form in the docs.

Toward #3474.
tseaver added a commit that referenced this pull request Oct 10, 2017
Also, add 'requester_pays' argument to 'Client.create_bucket'.

Add a system test which exercises the feature.

Note that the new system test is skipped, because 'Buckets.insert' fails
with the 'billing/requesterPays' field set, both in our system tests and
in the 'Try It!' form in the docs.

Toward #3474.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants