list_vectors
async
¶
list_vectors(
*,
config_overrides: Optional[AsyncS3VectorsClientConfig] = None,
vector_bucket_name: Optional[VectorBucketName] = None,
index_name: Optional[IndexName] = None,
index_arn: Optional[IndexArn] = None,
max_results: Optional[ListVectorsMaxResults] = None,
next_token: Optional[ListVectorsNextToken] = None,
segment_count: Optional[ListVectorsSegmentCount] = None,
segment_index: Optional[ListVectorsSegmentIndex] = None,
return_data: Optional[bool] = None,
return_metadata: Optional[bool] = None,
) -> ListVectorsOutput
List vectors in the specified vector index. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN).
ListVectors operations proceed sequentially; however, for faster performance on a large number of vectors in a vector index, applications can request a parallel ListVectors operation by providing the segmentCount and segmentIndex parameters.
- Permissions
-
You must have the
s3vectors:ListVectorspermission to use this operation. Additional permissions are required based on the request parameters you specify:-
With only
s3vectors:ListVectorspermission, you can list vector keys whenreturnDataandreturnMetadataare both set to false or not specified.. -
If you set
returnDataorreturnMetadatato true, you must have boths3vectors:ListVectorsands3vectors:GetVectorspermissions. The request fails with a403 Forbiddenerror if you request vector data or metadata without thes3vectors:GetVectorspermission.
-
Parameters:
-
vector_bucket_name(Optional[VectorBucketName], default:None) –The name of the vector bucket.
-
index_name(Optional[IndexName], default:None) –The name of the vector index.
-
index_arn(Optional[IndexArn], default:None) –The Amazon resource Name (ARN) of the vector index.
-
max_results(Optional[ListVectorsMaxResults], default:None) –The maximum number of vectors to return on a page.
If you don't specify
maxResults, theListVectorsoperation uses a default value of 500.If the processed dataset size exceeds 1 MB before reaching the
maxResultsvalue, the operation stops and returns the vectors that are retrieved up to that point, along with anextTokenthat you can use in a subsequent request to retrieve the next set of results. -
next_token(Optional[ListVectorsNextToken], default:None) –Pagination token from a previous request. The value of this field is empty for an initial request.
-
segment_count(Optional[ListVectorsSegmentCount], default:None) –For a parallel
ListVectorsrequest,segmentCountrepresents the total number of vector segments into which theListVectorsoperation will be divided. The value ofsegmentCountcorresponds to the number of application workers that will perform the parallelListVectorsoperation. For example, if you want to use four application threads to list vectors in a vector index, specify asegmentCountvalue of 4.If you specify a
segmentCountvalue of 1, theListVectorsoperation will be sequential rather than parallel.If you specify
segmentCount, you must also specifysegmentIndex. -
segment_index(Optional[ListVectorsSegmentIndex], default:None) –For a parallel
ListVectorsrequest,segmentIndexis the index of the segment from which to list vectors in the current request. It identifies an individual segment to be listed by an application worker.Segment IDs are zero-based, so the first segment is always 0. For example, if you want to use four application threads to list vectors in a vector index, then the first thread specifies a
segmentIndexvalue of 0, the second thread specifies 1, and so on.The value of
segmentIndexmust be less than the value provided forsegmentCount.If you provide
segmentIndex, you must also providesegmentCount. -
return_data(Optional[bool], default:None) –If true, the vector data of each vector will be included in the response. The default value is
false. -
return_metadata(Optional[bool], default:None) –If true, the metadata associated with each vector will be included in the response. The default value is
false.
Raises:
-
AccessDeniedException–Access denied.
-
InternalServerException–The request failed due to an internal server error.
-
RequestTimeoutException–The request timed out. Retry your request.
-
TooManyRequestsException–The request was denied due to request throttling.
-
ValidationException–The requested action isn't valid.
-
NotFoundException–The request was rejected because the specified resource can't be found.
-
ServiceUnavailableException–The service is unavailable. Wait briefly and retry your request. If it continues to fail, increase your waiting time between retries.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_s3vectors/_services/async_s3_vectors.py
1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 | |