B2_Command_Line_Tool
B2_Command_Line_Tool copied to clipboard
Using `create-bucket` and `--lifecycleRules` correctly
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?
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.
The error message should be improved by Backblaze/b2-sdk-python#188
resolved with 4.0.2