list-object-versions
Lists versions of all objects in a bucket, including delete markers.
Usage notes
To list object versions, you must have the oss:ListObjectVersions permission. For more information, see Attach a custom policy to a RAM user.
Command syntax
ossutil api list-object-versions --bucket value [flags]
|
Parameter |
Type |
Description |
|
--bucket |
string |
The name of the bucket. |
|
--delimiter |
string |
The character that you want to use to group objects by name. |
|
--encoding-type |
string |
The encoding type of the content in the response. |
|
--key-marker |
string |
Returns objects whose names are alphabetically after the value of the key-marker parameter. This parameter can be specified together with version-id-marker. |
|
--max-keys |
int |
The maximum number of objects to return. |
|
--prefix |
string |
The prefix that the names of returned objects must contain. |
|
--version-id-marker |
string |
The version ID of the object specified by key-marker after which the listing operation starts. The versions are returned from the latest version to the earliest version. |
For more information, see Command-line options.
Examples
-
List versions of all objects in a bucket named examplebucket.
ossutil api list-object-versions --bucket examplebucket -
List versions of all objects in a bucket named examplebucket and format the output in JSON.
ossutil api list-object-versions --bucket examplebucket --output-format json -
List versions of all objects in a bucket named examplebucket and format the output in YAML.
ossutil api list-object-versions --bucket examplebucket --output-format yaml -
List versions of all objects with the "dir" name prefix in a bucket named examplebucket.
ossutil api list-object-versions --bucket examplebucket --prefix dir -
List versions of the first 100 objects with the "dir" name prefix in a bucket named examplebucket.
ossutil api list-object-versions --bucket examplebucket --prefix dir --max-keys 100 -
List versions of all objects in the current directory in a bucket named examplebucket.
ossutil api list-object-versions --bucket examplebucket --delimiter / -
List versions of all objects whose names are alphabetically after "test.txt" in a bucket named examplebucket.
ossutil api list-object-versions --bucket examplebucket --key-marker test.txt -
List versions of all objects in a bucket named examplebucket and URL-encode the names of the returned objects.
ossutil api list-object-versions --bucket examplebucket --encoding-type url -
List versions of all objects that are after the "123" version of the test.txt object in a bucket named examplebucket.
ossutil api list-object-versions --bucket examplebucket --key-marker test.txt --version-id-marker 123