Lists all vectors stored in an index.
Permissions
Alibaba Cloud accounts have full permissions by default. Resource Access Management (RAM) users and RAM roles have no permissions by default. Grant permissions using a RAM policy or a bucket policy.
| API | Action | Description |
|---|---|---|
| ListVectors | oss:ListVectors | Lists vector data. |
Command format
ossutil vectors-api list-vectors --bucket <value> --index-name <value> [--max-results <int>] [--next-token <string>] [--return-data | --no-return-data] [--return-metadata | --no-return-metadata] [--segment-count <int> --segment-index <int>]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
--bucket | string | Yes | The name of the vector bucket. |
--index-name | string | Yes | The name of the index. |
--max-results | int | No | The maximum number of results to return per response. Default: 500. Maximum: 1000. The total data size per response cannot exceed 1 MB. |
--next-token | string | No | The pagination token. Set this to the nextToken value from the previous response to retrieve the next page. The token must be 1–512 bytes. |
--return-data | — | No | Returns vector data when present or set to true. |
--return-metadata | — | No | Returns metadata when present or set to true. |
--segment-count | int | No | The total number of parallel segments. Maximum value: 16. Set to 1 for serial processing. |
--segment-index | int | No | The index of the segment to scan. Must be less than the value of --segment-count. |
Note
The list-vectors command corresponds to the ListVectors API operation. For global command-line options, see Global command-line options.
Examples
List all vectors in an index
ossutil vectors-api list-vectors --bucket examplebucket --index-name indexLimit the number of results
Return the first 100 vectors:
ossutil vectors-api list-vectors --bucket examplebucket --index-name index --max-results 100Paginate through results
Pass the nextToken from each response as --next-token in the next request:
ossutil vectors-api list-vectors --bucket examplebucket --index-name index --next-token <nextToken>Return vector data
ossutil vectors-api list-vectors --bucket examplebucket --index-name index --return-dataReturn metadata
ossutil vectors-api list-vectors --bucket examplebucket --index-name index --return-metadata