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

Cloud Storage: Removing lifecyclerules from bucket is not working #20

Closed
rmunna opened this issue Dec 25, 2019 · 2 comments
Closed

Cloud Storage: Removing lifecyclerules from bucket is not working #20

rmunna opened this issue Dec 25, 2019 · 2 comments
Assignees
Labels
api: storage Issues related to the googleapis/java-storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@rmunna
Copy link

rmunna commented Dec 25, 2019

I was successfully able to add the lifecycle rules to a bucket.

Storage storage=/* connection*/;
Builder builder = BucketInfo.newBuilder(name);
builder.setStorageClass(COLDLINE);
builder.setLifecycleRules( lifecycleRules);
storage.create(builder.build());

But seems there is no way to remove the lifecycle rules from bucket

Storage storage=/* connection*/;
Builder builder = BucketInfo.newBuilder(name);
builder.setLifecycleRules(null);
storage.update(builder.build());

Looks like there is no support in SDK for PATCH update where as Rest API for lifecycle configuration is available .

https://cloud.google.com/storage/docs/managing-lifecycles

curl -X PATCH --data-binary @[LIFECYCLE_CONFIG_FILE].json \
  -H "Authorization: Bearer [OAUTH2_TOKEN]" \
  -H "Content-Type: application/json" \
  "https://storage.googleapis.com/storage/v1/b/[BUCKET_NAME]?fields=lifecycle"

Environment details
OS type and version: Windows 10
Java version: JDK 11
sdk version: google-cloud-storage-1.7.8.0.jar

@athakor athakor self-assigned this Dec 26, 2019
@athakor athakor transferred this issue from googleapis/google-cloud-java Dec 27, 2019
@athakor athakor added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Dec 27, 2019
@rmunna
Copy link
Author

rmunna commented Dec 27, 2019

is there any work around available to delete lifecycle rules through sdk?

@athakor
Copy link
Contributor

athakor commented Jun 16, 2020

Closed via #352

@athakor athakor closed this as completed Jun 16, 2020
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 googleapis/java-storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
2 participants