/AWS1/IF_S3V=>LISTVECTORS()¶
About ListVectors¶
Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change.
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.
-
Method Signature¶
METHODS /AWS1/IF_S3V~LISTVECTORS
IMPORTING
!IV_VECTORBUCKETNAME TYPE /AWS1/S3VVECTORBUCKETNAME OPTIONAL
!IV_INDEXNAME TYPE /AWS1/S3VINDEXNAME OPTIONAL
!IV_INDEXARN TYPE /AWS1/S3VINDEXARN OPTIONAL
!IV_MAXRESULTS TYPE /AWS1/S3VLISTVECTORSMAXRESULTS OPTIONAL
!IV_NEXTTOKEN TYPE /AWS1/S3VLISTVECTORSNEXTTOKEN OPTIONAL
!IV_SEGMENTCOUNT TYPE /AWS1/S3VLISTVECTORSSEGMENTCNT OPTIONAL
!IV_SEGMENTINDEX TYPE /AWS1/S3VLISTVECTORSSEGMENTIDX OPTIONAL
!IV_RETURNDATA TYPE /AWS1/S3VBOOLEAN OPTIONAL
!IV_RETURNMETADATA TYPE /AWS1/S3VBOOLEAN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_s3vlistvectorsoutput
RAISING
/AWS1/CX_S3VACCESSDENIEDEX
/AWS1/CX_S3VINTERNALSERVEREX
/AWS1/CX_S3VREQUESTTIMEOUTEX
/AWS1/CX_S3VTOOMANYREQUESTSEX
/AWS1/CX_S3VVALIDATIONEX
/AWS1/CX_S3VNOTFOUNDEXCEPTION
/AWS1/CX_S3VSERVICEUNAVAILEX
/AWS1/CX_S3VCLIENTEXC
/AWS1/CX_S3VSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Optional arguments:¶
iv_vectorbucketname TYPE /AWS1/S3VVECTORBUCKETNAME /AWS1/S3VVECTORBUCKETNAME¶
The name of the vector bucket.
iv_indexname TYPE /AWS1/S3VINDEXNAME /AWS1/S3VINDEXNAME¶
The name of the vector index.
iv_indexarn TYPE /AWS1/S3VINDEXARN /AWS1/S3VINDEXARN¶
The Amazon resource Name (ARN) of the vector index.
iv_maxresults TYPE /AWS1/S3VLISTVECTORSMAXRESULTS /AWS1/S3VLISTVECTORSMAXRESULTS¶
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.
iv_nexttoken TYPE /AWS1/S3VLISTVECTORSNEXTTOKEN /AWS1/S3VLISTVECTORSNEXTTOKEN¶
Pagination token from a previous request. The value of this field is empty for an initial request.
iv_segmentcount TYPE /AWS1/S3VLISTVECTORSSEGMENTCNT /AWS1/S3VLISTVECTORSSEGMENTCNT¶
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.
iv_segmentindex TYPE /AWS1/S3VLISTVECTORSSEGMENTIDX /AWS1/S3VLISTVECTORSSEGMENTIDX¶
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.
iv_returndata TYPE /AWS1/S3VBOOLEAN /AWS1/S3VBOOLEAN¶
If true, the vector data of each vector will be included in the response. The default value is
false.
iv_returnmetadata TYPE /AWS1/S3VBOOLEAN /AWS1/S3VBOOLEAN¶
If true, the metadata associated with each vector will be included in the response. The default value is
false.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_s3vlistvectorsoutput /AWS1/CL_S3VLISTVECTORSOUTPUT¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->listvectors(
iv_indexarn = |string|
iv_indexname = |string|
iv_maxresults = 123
iv_nexttoken = |string|
iv_returndata = ABAP_TRUE
iv_returnmetadata = ABAP_TRUE
iv_segmentcount = 123
iv_segmentindex = 123
iv_vectorbucketname = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_listvectorsnexttoken = lo_result->get_nexttoken( ).
LOOP AT lo_result->get_vectors( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_vectorkey = lo_row_1->get_key( ).
lo_vectordata = lo_row_1->get_data( ).
IF lo_vectordata IS NOT INITIAL.
LOOP AT lo_vectordata->get_float32( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_float = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
lo_value = lo_row_1->get_metadata( ).
IF lo_value IS NOT INITIAL.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.