Skip to content
New issue

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

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

Already on GitHub? # to your account

Using create-bucket and --lifecycleRules correctly #432

Closed
anjos opened this issue Mar 29, 2018 · 3 comments
Closed

Using create-bucket and --lifecycleRules correctly #432

anjos opened this issue Mar 29, 2018 · 3 comments

Comments

@anjos
Copy link
Contributor

anjos commented Mar 29, 2018

I'm trying to use this flag on my system to create a bucket in which only the last version of the files are kept, but I have found no way to pass the correct set of parameters that can be accepted or documentation with examples. Here is what I'm trying:

$ b2 create-bucket --lifecycleRules '{"daysFromHidingToDeleting": 1, "daysFromUploadingToHiding": null, "fileNamePrefix": ""}' my-very-own-test-bucket allPrivate
ERROR: Bad request: array should start with bracket but found: {

I'm confused as it is stated here it should be a dictionary: https://www.backblaze.com/b2/docs/lifecycle_rules.html

Could somebody show a working example of this flag?

@anjos
Copy link
Contributor Author

anjos commented Mar 29, 2018

There can be many rules per bucket - the command expects:

$ b2 create-bucket --lifecycleRules '[{"daysFromHidingToDeleting": 1, "daysFromUploadingToHiding": null, "fileNamePrefix": ""}]' my-very-own-test-bucket allPrivate

It would be interesting to add this to the documentation though.

@mlech-reef
Copy link
Contributor

The error message should be improved by Backblaze/b2-sdk-python#188

@mjurbanski-reef
Copy link
Contributor

resolved with 4.0.2

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants