Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bucket lock samples #1588

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

Merged
merged 11 commits into from
Oct 5, 2018
Merged

Bucket lock samples #1588

merged 11 commits into from
Oct 5, 2018

Conversation

billyjacobson
Copy link
Member

@billyjacobson billyjacobson commented Jul 20, 2018

  • Sample review
  • Samples with test
    • Defining a retention policy
    • Remove a retention policy if not locked
    • Lock a retention policy
    • Get retention policy
    • Set temporary hold
    • Release temporary hold
    • Set event-based hold
    • Release event-based hold
    • Get default event-based hold
    • Set default event-based hold
    • Release default event-based hold
    • Get object metadata
  • Update CLI for sample
  • Updated README.md

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 20, 2018
remove retention policy
set/release temporary hold
disable event based hold
set/release event based hold

print('Retention policy for {} is now locked'.format(bucket_name))
print('Retention policy Effective as of {}'.format(
bucket.retention_policy_effective_time))
Copy link
Member Author

@billyjacobson billyjacobson Aug 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this error for this line. Any ideas?
AttributeError: 'Bucket' object has no attribute 'retention_policy_effective_time'

Copy link
Contributor

@frankyn frankyn Aug 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To lock the retention policy you should use bucket.lock_retention_policy(). Review tests in google-cloud-python PR#5534 and w.r.t to this sample please review system.py line#1268.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I updated my comment -- made a mistake 😄)

@billyjacobson billyjacobson requested a review from frankyn August 6, 2018 18:54
Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General feedback for other samples. I don't see patch operations being performed which means the metadata is only being updated locally and not in the service.

System tests Ref: https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5534/files#diff-76380c4d34ce398e5075ab86d5305f5d


print('Retention policy for {} is now locked'.format(bucket_name))
print('Retention policy Effective as of {}'.format(
bucket.retention_policy_effective_time))
Copy link
Contributor

@frankyn frankyn Aug 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To lock the retention policy you should use bucket.lock_retention_policy(). Review tests in google-cloud-python PR#5534 and w.r.t to this sample please review system.py line#1268.

@billyjacobson billyjacobson added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 22, 2018
Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @billyjacobson!

I added some minor comments to the PR, lgtm overall!

billyjacobson and others added 3 commits August 28, 2018 10:44
Removing some unnecessary tests
Generating the README
Removing dependency on github branch
upgrading storage library version
Updating readme
@billyjacobson billyjacobson removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 4, 2018
Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Samples lgtm, pending tests.

@billyjacobson billyjacobson requested a review from tswast October 4, 2018 19:54
@billyjacobson billyjacobson added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 4, 2018
@frankyn frankyn added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 4, 2018
@frankyn frankyn requested review from kurtisvg and removed request for tswast October 4, 2018 21:50
Correcting names of commands to be dashes and not underscores
Updating readme
@billyjacobson billyjacobson added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 5, 2018
@kurtisvg kurtisvg merged commit b48487d into master Oct 5, 2018
@kurtisvg kurtisvg deleted the bucketlock branch October 5, 2018 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. do not merge Indicates a pull request not ready for merge, due to either quality or timing. kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants