Interface OpenSearchMemoryClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder()
method.
Amazon OpenSearch Memory lets your AI agents and applications recall facts and summaries across sessions. Your agents send events, such as conversation turns, and search the memories derived from them.
A space groups related events and memories, and holds the memory strategies that you configure for them. Use the space operations to create, get, list, update, and delete spaces. Use the event and memory operations to write, read, list, search, update, and delete a space's events and memories.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptiondefault BatchGetEventResponsebatchGetEvent(Consumer<BatchGetEventRequest.Builder> batchGetEventRequest) Gets up to 10 events by ID, each asGetEventreturns it, including its payload.default BatchGetEventResponsebatchGetEvent(BatchGetEventRequest batchGetEventRequest) Gets up to 10 events by ID, each asGetEventreturns it, including its payload.builder()Create a builder that can be used to configure and create aOpenSearchMemoryClient.static OpenSearchMemoryClientcreate()Create aOpenSearchMemoryClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default CreateEventResponsecreateEvent(Consumer<CreateEventRequest.Builder> createEventRequest) Submits an event (conversation turns, structured data, or a PDF document stored in Amazon S3) to a session in a space.default CreateEventResponsecreateEvent(CreateEventRequest createEventRequest) Submits an event (conversation turns, structured data, or a PDF document stored in Amazon S3) to a session in a space.default CreateMemoryResponsecreateMemory(Consumer<CreateMemoryRequest.Builder> createMemoryRequest) Writes a memory that you have already formed, without extracting it from events.default CreateMemoryResponsecreateMemory(CreateMemoryRequest createMemoryRequest) Writes a memory that you have already formed, without extracting it from events.default CreateSpaceResponsecreateSpace(Consumer<CreateSpaceRequest.Builder> createSpaceRequest) Creates a space.default CreateSpaceResponsecreateSpace(CreateSpaceRequest createSpaceRequest) Creates a space.default DeleteEventResponsedeleteEvent(Consumer<DeleteEventRequest.Builder> deleteEventRequest) Deletes an event.default DeleteEventResponsedeleteEvent(DeleteEventRequest deleteEventRequest) Deletes an event.default DeleteMemoryResponsedeleteMemory(Consumer<DeleteMemoryRequest.Builder> deleteMemoryRequest) Deletes a memory, including its content and embedding.default DeleteMemoryResponsedeleteMemory(DeleteMemoryRequest deleteMemoryRequest) Deletes a memory, including its content and embedding.default DeleteSpaceResponsedeleteSpace(Consumer<DeleteSpaceRequest.Builder> deleteSpaceRequest) Deletes a space and its memories.default DeleteSpaceResponsedeleteSpace(DeleteSpaceRequest deleteSpaceRequest) Deletes a space and its memories.default GetEventResponsegetEvent(Consumer<GetEventRequest.Builder> getEventRequest) Gets an event by ID, including its payload.default GetEventResponsegetEvent(GetEventRequest getEventRequest) Gets an event by ID, including its payload.default GetMemoryResponsegetMemory(Consumer<GetMemoryRequest.Builder> getMemoryRequest) Gets a memory by ID, as returned bySearchMemoriesorListMemories.default GetMemoryResponsegetMemory(GetMemoryRequest getMemoryRequest) Gets a memory by ID, as returned bySearchMemoriesorListMemories.default GetSpaceResponsegetSpace(Consumer<GetSpaceRequest.Builder> getSpaceRequest) Returns a space's configuration and status.default GetSpaceResponsegetSpace(GetSpaceRequest getSpaceRequest) Returns a space's configuration and status.default ListEventsResponselistEvents(Consumer<ListEventsRequest.Builder> listEventsRequest) Lists the events in a session, sorted by time.default ListEventsResponselistEvents(ListEventsRequest listEventsRequest) Lists the events in a session, sorted by time.default ListEventsIterablelistEventsPaginator(Consumer<ListEventsRequest.Builder> listEventsRequest) This is a variant oflistEvents(software.amazon.awssdk.services.opensearchmemory.model.ListEventsRequest)operation.default ListEventsIterablelistEventsPaginator(ListEventsRequest listEventsRequest) This is a variant oflistEvents(software.amazon.awssdk.services.opensearchmemory.model.ListEventsRequest)operation.default ListMemoriesResponselistMemories(Consumer<ListMemoriesRequest.Builder> listMemoriesRequest) Lists a space's memories without a query, for example the most recent memories or the memories of one strategy.default ListMemoriesResponselistMemories(ListMemoriesRequest listMemoriesRequest) Lists a space's memories without a query, for example the most recent memories or the memories of one strategy.default ListMemoriesIterablelistMemoriesPaginator(Consumer<ListMemoriesRequest.Builder> listMemoriesRequest) This is a variant oflistMemories(software.amazon.awssdk.services.opensearchmemory.model.ListMemoriesRequest)operation.default ListMemoriesIterablelistMemoriesPaginator(ListMemoriesRequest listMemoriesRequest) This is a variant oflistMemories(software.amazon.awssdk.services.opensearchmemory.model.ListMemoriesRequest)operation.default ListSpacesResponselistSpaces(Consumer<ListSpacesRequest.Builder> listSpacesRequest) Lists the spaces in your account in the current Region.default ListSpacesResponselistSpaces(ListSpacesRequest listSpacesRequest) Lists the spaces in your account in the current Region.default ListSpacesIterablelistSpacesPaginator(Consumer<ListSpacesRequest.Builder> listSpacesRequest) This is a variant oflistSpaces(software.amazon.awssdk.services.opensearchmemory.model.ListSpacesRequest)operation.default ListSpacesIterablelistSpacesPaginator(ListSpacesRequest listSpacesRequest) This is a variant oflistSpaces(software.amazon.awssdk.services.opensearchmemory.model.ListSpacesRequest)operation.default ListTagsForResourceResponselistTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) Lists the tags for the specified space.default ListTagsForResourceResponselistTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) Lists the tags for the specified space.default SearchEventsResponsesearchEvents(Consumer<SearchEventsRequest.Builder> searchEventsRequest) Searches a space's events by relevance.default SearchEventsResponsesearchEvents(SearchEventsRequest searchEventsRequest) Searches a space's events by relevance.default SearchEventsIterablesearchEventsPaginator(Consumer<SearchEventsRequest.Builder> searchEventsRequest) This is a variant ofsearchEvents(software.amazon.awssdk.services.opensearchmemory.model.SearchEventsRequest)operation.default SearchEventsIterablesearchEventsPaginator(SearchEventsRequest searchEventsRequest) This is a variant ofsearchEvents(software.amazon.awssdk.services.opensearchmemory.model.SearchEventsRequest)operation.default SearchMemoriesResponsesearchMemories(Consumer<SearchMemoriesRequest.Builder> searchMemoriesRequest) Searches a space's memories by relevance.default SearchMemoriesResponsesearchMemories(SearchMemoriesRequest searchMemoriesRequest) Searches a space's memories by relevance.default SearchMemoriesIterablesearchMemoriesPaginator(Consumer<SearchMemoriesRequest.Builder> searchMemoriesRequest) This is a variant ofsearchMemories(software.amazon.awssdk.services.opensearchmemory.model.SearchMemoriesRequest)operation.default SearchMemoriesIterablesearchMemoriesPaginator(SearchMemoriesRequest searchMemoriesRequest) This is a variant ofsearchMemories(software.amazon.awssdk.services.opensearchmemory.model.SearchMemoriesRequest)operation.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadatadefault TagResourceResponsetagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) Adds the specified tags to the specified space.default TagResourceResponsetagResource(TagResourceRequest tagResourceRequest) Adds the specified tags to the specified space.default UntagResourceResponseuntagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) Removes the specified tags from the specified space.default UntagResourceResponseuntagResource(UntagResourceRequest untagResourceRequest) Removes the specified tags from the specified space.default UpdateMemoryResponseupdateMemory(Consumer<UpdateMemoryRequest.Builder> updateMemoryRequest) Updates a memory in place.default UpdateMemoryResponseupdateMemory(UpdateMemoryRequest updateMemoryRequest) Updates a memory in place.default UpdateSpaceResponseupdateSpace(Consumer<UpdateSpaceRequest.Builder> updateSpaceRequest) Updates a space's memory strategies, retention settings, or extraction model.default UpdateSpaceResponseupdateSpace(UpdateSpaceRequest updateSpaceRequest) Updates a space's memory strategies, retention settings, or extraction model.default OpenSearchMemoryWaiterwaiter()Create an instance ofOpenSearchMemoryWaiterusing this client.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
-
-
Method Details
-
batchGetEvent
default BatchGetEventResponse batchGetEvent(BatchGetEventRequest batchGetEventRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Gets up to 10 events by ID, each as
GetEventreturns it, including its payload.If you supply
actorIdorsessionId, every requested event must match it. Each event has its own outcome. The operation reports an event that it can't return inerrorsinstead of failing, with an error code named for the exception thatGetEventwould return for it. The operation reports both an event that doesn't exist and an event outside the supplied scope asRESOURCE_NOT_FOUND.The exception is the space's customer managed AWS KMS key: if it is disabled, pending deletion, can't be used for decryption, or was deleted, the whole call fails with
ValidationException, asGetEventdoes.- Parameters:
batchGetEventRequest-- Returns:
- Result of the BatchGetEvent operation returned by the service.
- See Also:
-
batchGetEvent
default BatchGetEventResponse batchGetEvent(Consumer<BatchGetEventRequest.Builder> batchGetEventRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Gets up to 10 events by ID, each as
GetEventreturns it, including its payload.If you supply
actorIdorsessionId, every requested event must match it. Each event has its own outcome. The operation reports an event that it can't return inerrorsinstead of failing, with an error code named for the exception thatGetEventwould return for it. The operation reports both an event that doesn't exist and an event outside the supplied scope asRESOURCE_NOT_FOUND.The exception is the space's customer managed AWS KMS key: if it is disabled, pending deletion, can't be used for decryption, or was deleted, the whole call fails with
ValidationException, asGetEventdoes.
This is a convenience which creates an instance of the
BatchGetEventRequest.Builderavoiding the need to create one manually viaBatchGetEventRequest.builder()- Parameters:
batchGetEventRequest- AConsumerthat will call methods onBatchGetEventRequest.Builderto create a request.- Returns:
- Result of the BatchGetEvent operation returned by the service.
- See Also:
-
createEvent
default CreateEventResponse createEvent(CreateEventRequest createEventRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Submits an event (conversation turns, structured data, or a PDF document stored in Amazon S3) to a session in a space.
The operation returns as soon as the event is saved.
GetEventandListEventsreturn it immediately.SearchEventsreturns it after it's indexed.SearchMemoriesreturns memories extracted from it only after a strategy's extraction trigger fires and the memories are indexed.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
createEventRequest-- Returns:
- Result of the CreateEvent operation returned by the service.
- See Also:
-
createEvent
default CreateEventResponse createEvent(Consumer<CreateEventRequest.Builder> createEventRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Submits an event (conversation turns, structured data, or a PDF document stored in Amazon S3) to a session in a space.
The operation returns as soon as the event is saved.
GetEventandListEventsreturn it immediately.SearchEventsreturns it after it's indexed.SearchMemoriesreturns memories extracted from it only after a strategy's extraction trigger fires and the memories are indexed.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
CreateEventRequest.Builderavoiding the need to create one manually viaCreateEventRequest.builder()- Parameters:
createEventRequest- AConsumerthat will call methods onCreateEventRequest.Builderto create a request.- Returns:
- Result of the CreateEvent operation returned by the service.
- See Also:
-
createMemory
default CreateMemoryResponse createMemory(CreateMemoryRequest createMemoryRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Writes a memory that you have already formed, without extracting it from events. The service embeds the text as given and stores it as a memory of the named strategy. To have the service extract memories from conversation turns, use
CreateEventinstead.The operation returns before the memory is searchable. The returned
memoryIdis final, but until the memory is indexed,GetMemory,UpdateMemory, andDeleteMemoryreturnResourceNotFoundExceptionfor it.If the request would exceed the service's rate for embedding requests, it fails with
ThrottlingException. Retry with exponential backoff.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
createMemoryRequest- The request forCreateMemory.- Returns:
- Result of the CreateMemory operation returned by the service.
- See Also:
-
createMemory
default CreateMemoryResponse createMemory(Consumer<CreateMemoryRequest.Builder> createMemoryRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Writes a memory that you have already formed, without extracting it from events. The service embeds the text as given and stores it as a memory of the named strategy. To have the service extract memories from conversation turns, use
CreateEventinstead.The operation returns before the memory is searchable. The returned
memoryIdis final, but until the memory is indexed,GetMemory,UpdateMemory, andDeleteMemoryreturnResourceNotFoundExceptionfor it.If the request would exceed the service's rate for embedding requests, it fails with
ThrottlingException. Retry with exponential backoff.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
CreateMemoryRequest.Builderavoiding the need to create one manually viaCreateMemoryRequest.builder()- Parameters:
createMemoryRequest- AConsumerthat will call methods onCreateMemoryRequest.Builderto create a request. The request forCreateMemory.- Returns:
- Result of the CreateMemory operation returned by the service.
- See Also:
-
createSpace
default CreateSpaceResponse createSpace(CreateSpaceRequest createSpaceRequest) throws ConflictException, AccessDeniedException, ThrottlingException, ServiceQuotaExceededException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Creates a space. A space is an AWS resource that stores the events you send and the memories extracted from them, and defines the memory strategies that extract those memories.
The operation returns before provisioning finishes, with
statusCREATING. CallGetSpaceuntil the status isACTIVE, and then use the space. If provisioning fails, the status becomesFAILEDandstatusReasonsays why.- Parameters:
createSpaceRequest-- Returns:
- Result of the CreateSpace operation returned by the service.
- See Also:
-
createSpace
default CreateSpaceResponse createSpace(Consumer<CreateSpaceRequest.Builder> createSpaceRequest) throws ConflictException, AccessDeniedException, ThrottlingException, ServiceQuotaExceededException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Creates a space. A space is an AWS resource that stores the events you send and the memories extracted from them, and defines the memory strategies that extract those memories.
The operation returns before provisioning finishes, with
statusCREATING. CallGetSpaceuntil the status isACTIVE, and then use the space. If provisioning fails, the status becomesFAILEDandstatusReasonsays why.
This is a convenience which creates an instance of the
CreateSpaceRequest.Builderavoiding the need to create one manually viaCreateSpaceRequest.builder()- Parameters:
createSpaceRequest- AConsumerthat will call methods onCreateSpaceRequest.Builderto create a request.- Returns:
- Result of the CreateSpace operation returned by the service.
- See Also:
-
deleteEvent
default DeleteEventResponse deleteEvent(DeleteEventRequest deleteEventRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Deletes an event. Deletion can't be undone. The event stops appearing in
SearchEventsresults shortly after you delete it. Deleting an event that doesn't exist returnsResourceNotFoundException.Deleting an event doesn't delete the memories derived from it, because a memory can combine content from several events. To remove them, use
DeleteMemory.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
deleteEventRequest-- Returns:
- Result of the DeleteEvent operation returned by the service.
- See Also:
-
deleteEvent
default DeleteEventResponse deleteEvent(Consumer<DeleteEventRequest.Builder> deleteEventRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Deletes an event. Deletion can't be undone. The event stops appearing in
SearchEventsresults shortly after you delete it. Deleting an event that doesn't exist returnsResourceNotFoundException.Deleting an event doesn't delete the memories derived from it, because a memory can combine content from several events. To remove them, use
DeleteMemory.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
DeleteEventRequest.Builderavoiding the need to create one manually viaDeleteEventRequest.builder()- Parameters:
deleteEventRequest- AConsumerthat will call methods onDeleteEventRequest.Builderto create a request.- Returns:
- Result of the DeleteEvent operation returned by the service.
- See Also:
-
deleteMemory
default DeleteMemoryResponse deleteMemory(DeleteMemoryRequest deleteMemoryRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Deletes a memory, including its content and embedding. Deletion can't be undone. Searches stop returning the memory shortly after you delete it.
Deleting a memory that no longer exists returns
ResourceNotFoundException, so the operation is not idempotent. If you retry deletes, treat that error as success.A memory past its expiry (set from the space's
memoryExpiryDayswhen the memory is written) reads as not found: the operation returnsResourceNotFoundException, as for a memory that was already deleted.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
deleteMemoryRequest-- Returns:
- Result of the DeleteMemory operation returned by the service.
- See Also:
-
deleteMemory
default DeleteMemoryResponse deleteMemory(Consumer<DeleteMemoryRequest.Builder> deleteMemoryRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Deletes a memory, including its content and embedding. Deletion can't be undone. Searches stop returning the memory shortly after you delete it.
Deleting a memory that no longer exists returns
ResourceNotFoundException, so the operation is not idempotent. If you retry deletes, treat that error as success.A memory past its expiry (set from the space's
memoryExpiryDayswhen the memory is written) reads as not found: the operation returnsResourceNotFoundException, as for a memory that was already deleted.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
DeleteMemoryRequest.Builderavoiding the need to create one manually viaDeleteMemoryRequest.builder()- Parameters:
deleteMemoryRequest- AConsumerthat will call methods onDeleteMemoryRequest.Builderto create a request.- Returns:
- Result of the DeleteMemory operation returned by the service.
- See Also:
-
deleteSpace
default DeleteSpaceResponse deleteSpace(DeleteSpaceRequest deleteSpaceRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Deletes a space and its memories. Deletion can't be undone. After you delete the space, you can't retrieve its events, and the service removes them when they reach their expiry.
The operation returns with
statusDELETING. When deletion finishes,GetSpacereturnsResourceNotFoundException. If deletion fails, the status becomesFAILED. A space that isCREATINGorUPDATINGcan't be deleted until that finishes: the request fails withConflictException. Deleting a space that is alreadyDELETINGreturnsDELETINGagain.- Parameters:
deleteSpaceRequest-- Returns:
- Result of the DeleteSpace operation returned by the service.
- See Also:
-
deleteSpace
default DeleteSpaceResponse deleteSpace(Consumer<DeleteSpaceRequest.Builder> deleteSpaceRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Deletes a space and its memories. Deletion can't be undone. After you delete the space, you can't retrieve its events, and the service removes them when they reach their expiry.
The operation returns with
statusDELETING. When deletion finishes,GetSpacereturnsResourceNotFoundException. If deletion fails, the status becomesFAILED. A space that isCREATINGorUPDATINGcan't be deleted until that finishes: the request fails withConflictException. Deleting a space that is alreadyDELETINGreturnsDELETINGagain.
This is a convenience which creates an instance of the
DeleteSpaceRequest.Builderavoiding the need to create one manually viaDeleteSpaceRequest.builder()- Parameters:
deleteSpaceRequest- AConsumerthat will call methods onDeleteSpaceRequest.Builderto create a request.- Returns:
- Result of the DeleteSpace operation returned by the service.
- See Also:
-
getEvent
default GetEventResponse getEvent(GetEventRequest getEventRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Gets an event by ID, including its payload.
If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
getEventRequest-- Returns:
- Result of the GetEvent operation returned by the service.
- See Also:
-
getEvent
default GetEventResponse getEvent(Consumer<GetEventRequest.Builder> getEventRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Gets an event by ID, including its payload.
If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
GetEventRequest.Builderavoiding the need to create one manually viaGetEventRequest.builder()- Parameters:
getEventRequest- AConsumerthat will call methods onGetEventRequest.Builderto create a request.- Returns:
- Result of the GetEvent operation returned by the service.
- See Also:
-
getMemory
default GetMemoryResponse getMemory(GetMemoryRequest getMemoryRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Gets a memory by ID, as returned by
SearchMemoriesorListMemories. A memory that doesn't exist returnsResourceNotFoundException. UnlikeSearchMemories, this operation also returns memories that consolidation has superseded.A memory past its expiry (set from the space's
memoryExpiryDayswhen the memory is written) reads as not found:ResourceNotFoundException, the same answer as for an ID that does not exist.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
getMemoryRequest-- Returns:
- Result of the GetMemory operation returned by the service.
- See Also:
-
getMemory
default GetMemoryResponse getMemory(Consumer<GetMemoryRequest.Builder> getMemoryRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Gets a memory by ID, as returned by
SearchMemoriesorListMemories. A memory that doesn't exist returnsResourceNotFoundException. UnlikeSearchMemories, this operation also returns memories that consolidation has superseded.A memory past its expiry (set from the space's
memoryExpiryDayswhen the memory is written) reads as not found:ResourceNotFoundException, the same answer as for an ID that does not exist.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
GetMemoryRequest.Builderavoiding the need to create one manually viaGetMemoryRequest.builder()- Parameters:
getMemoryRequest- AConsumerthat will call methods onGetMemoryRequest.Builderto create a request.- Returns:
- Result of the GetMemory operation returned by the service.
- See Also:
-
getSpace
default GetSpaceResponse getSpace(GetSpaceRequest getSpaceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Returns a space's configuration and status.
- Parameters:
getSpaceRequest-- Returns:
- Result of the GetSpace operation returned by the service.
- See Also:
-
getSpace
default GetSpaceResponse getSpace(Consumer<GetSpaceRequest.Builder> getSpaceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Returns a space's configuration and status.
This is a convenience which creates an instance of the
GetSpaceRequest.Builderavoiding the need to create one manually viaGetSpaceRequest.builder()- Parameters:
getSpaceRequest- AConsumerthat will call methods onGetSpaceRequest.Builderto create a request.- Returns:
- Result of the GetSpace operation returned by the service.
- See Also:
-
listEvents
default ListEventsResponse listEvents(ListEventsRequest listEventsRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Lists the events in a session, sorted by time. Optionally limit the results to events whose
eventTimestampfalls betweeneventTimestampAfterandeventTimestampBefore. Returns event metadata only. CallGetEventfor the payload. For full-text or relevance search, useSearchEvents.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
listEventsRequest-- Returns:
- Result of the ListEvents operation returned by the service.
- See Also:
-
listEvents
default ListEventsResponse listEvents(Consumer<ListEventsRequest.Builder> listEventsRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Lists the events in a session, sorted by time. Optionally limit the results to events whose
eventTimestampfalls betweeneventTimestampAfterandeventTimestampBefore. Returns event metadata only. CallGetEventfor the payload. For full-text or relevance search, useSearchEvents.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
ListEventsRequest.Builderavoiding the need to create one manually viaListEventsRequest.builder()- Parameters:
listEventsRequest- AConsumerthat will call methods onListEventsRequest.Builderto create a request.- Returns:
- Result of the ListEvents operation returned by the service.
- See Also:
-
listEventsPaginator
default ListEventsIterable listEventsPaginator(ListEventsRequest listEventsRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
listEvents(software.amazon.awssdk.services.opensearchmemory.model.ListEventsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.ListEventsIterable responses = client.listEventsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.ListEventsIterable responses = client .listEventsPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.ListEventsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.ListEventsIterable responses = client.listEventsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listEvents(software.amazon.awssdk.services.opensearchmemory.model.ListEventsRequest)operation.- Parameters:
listEventsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listEventsPaginator
default ListEventsIterable listEventsPaginator(Consumer<ListEventsRequest.Builder> listEventsRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
listEvents(software.amazon.awssdk.services.opensearchmemory.model.ListEventsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.ListEventsIterable responses = client.listEventsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.ListEventsIterable responses = client .listEventsPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.ListEventsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.ListEventsIterable responses = client.listEventsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listEvents(software.amazon.awssdk.services.opensearchmemory.model.ListEventsRequest)operation.
This is a convenience which creates an instance of the
ListEventsRequest.Builderavoiding the need to create one manually viaListEventsRequest.builder()- Parameters:
listEventsRequest- AConsumerthat will call methods onListEventsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listMemories
default ListMemoriesResponse listMemories(ListMemoriesRequest listMemoriesRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Lists a space's memories without a query, for example the most recent memories or the memories of one strategy. Filter by strategy and optionally by owning actor or session, sort by creation or update time, and page through the results. Results have no relevance score. To query or filter by metadata, use
SearchMemories.If memories are written or deleted while you page, the results can skip a memory or return it twice. You can page through only a limited number of results. A request past that limit fails with
ValidationException(reasoninvalidNextToken), and the message gives the limit.Memories past their expiry (set from the space's
memoryExpiryDayswhen each memory is written) are left out. UnlikeSearchMemories, this operation also returns memories that consolidation has superseded.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
listMemoriesRequest-- Returns:
- Result of the ListMemories operation returned by the service.
- See Also:
-
listMemories
default ListMemoriesResponse listMemories(Consumer<ListMemoriesRequest.Builder> listMemoriesRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Lists a space's memories without a query, for example the most recent memories or the memories of one strategy. Filter by strategy and optionally by owning actor or session, sort by creation or update time, and page through the results. Results have no relevance score. To query or filter by metadata, use
SearchMemories.If memories are written or deleted while you page, the results can skip a memory or return it twice. You can page through only a limited number of results. A request past that limit fails with
ValidationException(reasoninvalidNextToken), and the message gives the limit.Memories past their expiry (set from the space's
memoryExpiryDayswhen each memory is written) are left out. UnlikeSearchMemories, this operation also returns memories that consolidation has superseded.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
ListMemoriesRequest.Builderavoiding the need to create one manually viaListMemoriesRequest.builder()- Parameters:
listMemoriesRequest- AConsumerthat will call methods onListMemoriesRequest.Builderto create a request.- Returns:
- Result of the ListMemories operation returned by the service.
- See Also:
-
listMemoriesPaginator
default ListMemoriesIterable listMemoriesPaginator(ListMemoriesRequest listMemoriesRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
listMemories(software.amazon.awssdk.services.opensearchmemory.model.ListMemoriesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.ListMemoriesIterable responses = client.listMemoriesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.ListMemoriesIterable responses = client .listMemoriesPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.ListMemoriesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.ListMemoriesIterable responses = client.listMemoriesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listMemories(software.amazon.awssdk.services.opensearchmemory.model.ListMemoriesRequest)operation.- Parameters:
listMemoriesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listMemoriesPaginator
default ListMemoriesIterable listMemoriesPaginator(Consumer<ListMemoriesRequest.Builder> listMemoriesRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
listMemories(software.amazon.awssdk.services.opensearchmemory.model.ListMemoriesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.ListMemoriesIterable responses = client.listMemoriesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.ListMemoriesIterable responses = client .listMemoriesPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.ListMemoriesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.ListMemoriesIterable responses = client.listMemoriesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listMemories(software.amazon.awssdk.services.opensearchmemory.model.ListMemoriesRequest)operation.
This is a convenience which creates an instance of the
ListMemoriesRequest.Builderavoiding the need to create one manually viaListMemoriesRequest.builder()- Parameters:
listMemoriesRequest- AConsumerthat will call methods onListMemoriesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listSpaces
default ListSpacesResponse listSpaces(ListSpacesRequest listSpacesRequest) throws AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Lists the spaces in your account in the current Region.
- Parameters:
listSpacesRequest-- Returns:
- Result of the ListSpaces operation returned by the service.
- See Also:
-
listSpaces
default ListSpacesResponse listSpaces(Consumer<ListSpacesRequest.Builder> listSpacesRequest) throws AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Lists the spaces in your account in the current Region.
This is a convenience which creates an instance of the
ListSpacesRequest.Builderavoiding the need to create one manually viaListSpacesRequest.builder()- Parameters:
listSpacesRequest- AConsumerthat will call methods onListSpacesRequest.Builderto create a request.- Returns:
- Result of the ListSpaces operation returned by the service.
- See Also:
-
listSpacesPaginator
default ListSpacesIterable listSpacesPaginator(ListSpacesRequest listSpacesRequest) throws AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
listSpaces(software.amazon.awssdk.services.opensearchmemory.model.ListSpacesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.ListSpacesIterable responses = client.listSpacesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.ListSpacesIterable responses = client .listSpacesPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.ListSpacesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.ListSpacesIterable responses = client.listSpacesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listSpaces(software.amazon.awssdk.services.opensearchmemory.model.ListSpacesRequest)operation.- Parameters:
listSpacesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listSpacesPaginator
default ListSpacesIterable listSpacesPaginator(Consumer<ListSpacesRequest.Builder> listSpacesRequest) throws AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
listSpaces(software.amazon.awssdk.services.opensearchmemory.model.ListSpacesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.ListSpacesIterable responses = client.listSpacesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.ListSpacesIterable responses = client .listSpacesPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.ListSpacesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.ListSpacesIterable responses = client.listSpacesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listSpaces(software.amazon.awssdk.services.opensearchmemory.model.ListSpacesRequest)operation.
This is a convenience which creates an instance of the
ListSpacesRequest.Builderavoiding the need to create one manually viaListSpacesRequest.builder()- Parameters:
listSpacesRequest- AConsumerthat will call methods onListSpacesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Lists the tags for the specified space.
- Parameters:
listTagsForResourceRequest-- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Lists the tags for the specified space.
This is a convenience which creates an instance of the
ListTagsForResourceRequest.Builderavoiding the need to create one manually viaListTagsForResourceRequest.builder()- Parameters:
listTagsForResourceRequest- AConsumerthat will call methods onListTagsForResourceRequest.Builderto create a request.- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
searchEvents
default SearchEventsResponse searchEvents(SearchEventsRequest searchEventsRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Searches a space's events by relevance. It works like
SearchMemorieswithout the memory type and strategy selector. The query is a subset of the OpenSearch Query DSL. The service validates it, limits the search to the actor inactorIdand the sessions insessionIds, and returns ranked results. Each result is the matching chunk of an event, not the whole event. You can page through only a limited number of results. A request past that limit fails withValidationException(reasoninvalidNextToken), and the message gives the limit.If the results are larger than 5 MiB, the request fails with
ValidationException(reasonqueryBodyTooLarge). LowermaxResults.If the request would exceed the service's rate for embedding requests, it fails with
ThrottlingException. Retry with exponential backoff.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
searchEventsRequest-- Returns:
- Result of the SearchEvents operation returned by the service.
- See Also:
-
searchEvents
default SearchEventsResponse searchEvents(Consumer<SearchEventsRequest.Builder> searchEventsRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Searches a space's events by relevance. It works like
SearchMemorieswithout the memory type and strategy selector. The query is a subset of the OpenSearch Query DSL. The service validates it, limits the search to the actor inactorIdand the sessions insessionIds, and returns ranked results. Each result is the matching chunk of an event, not the whole event. You can page through only a limited number of results. A request past that limit fails withValidationException(reasoninvalidNextToken), and the message gives the limit.If the results are larger than 5 MiB, the request fails with
ValidationException(reasonqueryBodyTooLarge). LowermaxResults.If the request would exceed the service's rate for embedding requests, it fails with
ThrottlingException. Retry with exponential backoff.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
SearchEventsRequest.Builderavoiding the need to create one manually viaSearchEventsRequest.builder()- Parameters:
searchEventsRequest- AConsumerthat will call methods onSearchEventsRequest.Builderto create a request.- Returns:
- Result of the SearchEvents operation returned by the service.
- See Also:
-
searchEventsPaginator
default SearchEventsIterable searchEventsPaginator(SearchEventsRequest searchEventsRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
searchEvents(software.amazon.awssdk.services.opensearchmemory.model.SearchEventsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.SearchEventsIterable responses = client.searchEventsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.SearchEventsIterable responses = client .searchEventsPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.SearchEventsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.SearchEventsIterable responses = client.searchEventsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
searchEvents(software.amazon.awssdk.services.opensearchmemory.model.SearchEventsRequest)operation.- Parameters:
searchEventsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
searchEventsPaginator
default SearchEventsIterable searchEventsPaginator(Consumer<SearchEventsRequest.Builder> searchEventsRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
searchEvents(software.amazon.awssdk.services.opensearchmemory.model.SearchEventsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.SearchEventsIterable responses = client.searchEventsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.SearchEventsIterable responses = client .searchEventsPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.SearchEventsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.SearchEventsIterable responses = client.searchEventsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
searchEvents(software.amazon.awssdk.services.opensearchmemory.model.SearchEventsRequest)operation.
This is a convenience which creates an instance of the
SearchEventsRequest.Builderavoiding the need to create one manually viaSearchEventsRequest.builder()- Parameters:
searchEventsRequest- AConsumerthat will call methods onSearchEventsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
searchMemories
default SearchMemoriesResponse searchMemories(SearchMemoriesRequest searchMemoriesRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Searches a space's memories by relevance. The query is a subset of the OpenSearch Query DSL. The service validates it, limits the search to the requested strategies and to the actor in
actorId, and returns one ranked list of memories. You can page through only a limited number of results. A request past that limit fails withValidationException(reasoninvalidNextToken), and the message gives the limit.Memories past their expiry (set from the space's
memoryExpiryDayswhen each memory is written) are left out of the results. Only current memories are returned: a memory that consolidation has superseded (an older version of a fact that a newer memory replaced) is left out.If the results are larger than 5 MiB, the request fails with
ValidationException(reasonqueryBodyTooLarge). LowermaxResults.If the request would exceed the service's rate for embedding requests, it fails with
ThrottlingException. Retry with exponential backoff.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
searchMemoriesRequest-- Returns:
- Result of the SearchMemories operation returned by the service.
- See Also:
-
searchMemories
default SearchMemoriesResponse searchMemories(Consumer<SearchMemoriesRequest.Builder> searchMemoriesRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Searches a space's memories by relevance. The query is a subset of the OpenSearch Query DSL. The service validates it, limits the search to the requested strategies and to the actor in
actorId, and returns one ranked list of memories. You can page through only a limited number of results. A request past that limit fails withValidationException(reasoninvalidNextToken), and the message gives the limit.Memories past their expiry (set from the space's
memoryExpiryDayswhen each memory is written) are left out of the results. Only current memories are returned: a memory that consolidation has superseded (an older version of a fact that a newer memory replaced) is left out.If the results are larger than 5 MiB, the request fails with
ValidationException(reasonqueryBodyTooLarge). LowermaxResults.If the request would exceed the service's rate for embedding requests, it fails with
ThrottlingException. Retry with exponential backoff.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
SearchMemoriesRequest.Builderavoiding the need to create one manually viaSearchMemoriesRequest.builder()- Parameters:
searchMemoriesRequest- AConsumerthat will call methods onSearchMemoriesRequest.Builderto create a request.- Returns:
- Result of the SearchMemories operation returned by the service.
- See Also:
-
searchMemoriesPaginator
default SearchMemoriesIterable searchMemoriesPaginator(SearchMemoriesRequest searchMemoriesRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
searchMemories(software.amazon.awssdk.services.opensearchmemory.model.SearchMemoriesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.SearchMemoriesIterable responses = client.searchMemoriesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.SearchMemoriesIterable responses = client .searchMemoriesPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.SearchMemoriesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.SearchMemoriesIterable responses = client.searchMemoriesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
searchMemories(software.amazon.awssdk.services.opensearchmemory.model.SearchMemoriesRequest)operation.- Parameters:
searchMemoriesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
searchMemoriesPaginator
default SearchMemoriesIterable searchMemoriesPaginator(Consumer<SearchMemoriesRequest.Builder> searchMemoriesRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException This is a variant of
searchMemories(software.amazon.awssdk.services.opensearchmemory.model.SearchMemoriesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.opensearchmemory.paginators.SearchMemoriesIterable responses = client.searchMemoriesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.opensearchmemory.paginators.SearchMemoriesIterable responses = client .searchMemoriesPaginator(request); for (software.amazon.awssdk.services.opensearchmemory.model.SearchMemoriesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.opensearchmemory.paginators.SearchMemoriesIterable responses = client.searchMemoriesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
searchMemories(software.amazon.awssdk.services.opensearchmemory.model.SearchMemoriesRequest)operation.
This is a convenience which creates an instance of the
SearchMemoriesRequest.Builderavoiding the need to create one manually viaSearchMemoriesRequest.builder()- Parameters:
searchMemoriesRequest- AConsumerthat will call methods onSearchMemoriesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
tagResource
default TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Adds the specified tags to the specified space.
- Parameters:
tagResourceRequest-- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Adds the specified tags to the specified space.
This is a convenience which creates an instance of the
TagResourceRequest.Builderavoiding the need to create one manually viaTagResourceRequest.builder()- Parameters:
tagResourceRequest- AConsumerthat will call methods onTagResourceRequest.Builderto create a request.- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Removes the specified tags from the specified space.
- Parameters:
untagResourceRequest-- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Removes the specified tags from the specified space.
This is a convenience which creates an instance of the
UntagResourceRequest.Builderavoiding the need to create one manually viaUntagResourceRequest.builder()- Parameters:
untagResourceRequest- AConsumerthat will call methods onUntagResourceRequest.Builderto create a request.- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
updateMemory
default UpdateMemoryResponse updateMemory(UpdateMemoryRequest updateMemoryRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Updates a memory in place. Supply only the fields to change. Omitted fields keep their stored values. A request must supply
contentormetadata, or it fails withValidationException. Supplyingcontentre-embeds the memory. A change to metadata alone doesn't.The memory keeps its
memoryIdacross updates. Shortly after an update, searches stop returning the previous content.memoryTypecan't be changed. To change it, delete the memory and create a new one.A memory past its expiry (set from the space's
memoryExpiryDayswhen the memory is written) reads as not found: the operation fails withResourceNotFoundExceptionand changes nothing. An update does not move the expiry.Concurrent updates to one memory are last-writer-wins. There is no version check. To avoid lost updates, serialize your updates to a memory.
If you supply
contentand the request would exceed the service's rate for embedding requests, it fails withThrottlingException. Retry with exponential backoff.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.- Parameters:
updateMemoryRequest-- Returns:
- Result of the UpdateMemory operation returned by the service.
- See Also:
-
updateMemory
default UpdateMemoryResponse updateMemory(Consumer<UpdateMemoryRequest.Builder> updateMemoryRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Updates a memory in place. Supply only the fields to change. Omitted fields keep their stored values. A request must supply
contentormetadata, or it fails withValidationException. Supplyingcontentre-embeds the memory. A change to metadata alone doesn't.The memory keeps its
memoryIdacross updates. Shortly after an update, searches stop returning the previous content.memoryTypecan't be changed. To change it, delete the memory and create a new one.A memory past its expiry (set from the space's
memoryExpiryDayswhen the memory is written) reads as not found: the operation fails withResourceNotFoundExceptionand changes nothing. An update does not move the expiry.Concurrent updates to one memory are last-writer-wins. There is no version check. To avoid lost updates, serialize your updates to a memory.
If you supply
contentand the request would exceed the service's rate for embedding requests, it fails withThrottlingException. Retry with exponential backoff.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren't allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.
This is a convenience which creates an instance of the
UpdateMemoryRequest.Builderavoiding the need to create one manually viaUpdateMemoryRequest.builder()- Parameters:
updateMemoryRequest- AConsumerthat will call methods onUpdateMemoryRequest.Builderto create a request.- Returns:
- Result of the UpdateMemory operation returned by the service.
- See Also:
-
updateSpace
default UpdateSpaceResponse updateSpace(UpdateSpaceRequest updateSpaceRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, ServiceQuotaExceededException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Updates a space's memory strategies, retention settings, or extraction model. Supply only the fields to change. Omitted fields keep their current values.
If the request changes the set of strategies, a strategy's configuration, a retention setting, or the extraction model, the space moves to
UPDATING. When the change is complete, the space returns toACTIVE, or moves toFAILEDif the change can't be applied. While the space isUPDATING,GetSpacereturns the previous configuration. A request that only changes strategy descriptions or repeats the values the space has stored is applied immediately and doesn't change the status. Sending a retention value that the space never set also moves the space toUPDATING, even one that matches the behavior without it, such as 90 foreventExpiryDaysor 0 formemoryExpiryDays. A space that isCREATING,UPDATING, orDELETINGcan't be updated: the request fails withConflictException.- Parameters:
updateSpaceRequest-- Returns:
- Result of the UpdateSpace operation returned by the service.
- See Also:
-
updateSpace
default UpdateSpaceResponse updateSpace(Consumer<UpdateSpaceRequest.Builder> updateSpaceRequest) throws ConflictException, ResourceNotFoundException, AccessDeniedException, ThrottlingException, ServiceQuotaExceededException, InternalServerException, ValidationException, AwsServiceException, SdkClientException, OpenSearchMemoryException Updates a space's memory strategies, retention settings, or extraction model. Supply only the fields to change. Omitted fields keep their current values.
If the request changes the set of strategies, a strategy's configuration, a retention setting, or the extraction model, the space moves to
UPDATING. When the change is complete, the space returns toACTIVE, or moves toFAILEDif the change can't be applied. While the space isUPDATING,GetSpacereturns the previous configuration. A request that only changes strategy descriptions or repeats the values the space has stored is applied immediately and doesn't change the status. Sending a retention value that the space never set also moves the space toUPDATING, even one that matches the behavior without it, such as 90 foreventExpiryDaysor 0 formemoryExpiryDays. A space that isCREATING,UPDATING, orDELETINGcan't be updated: the request fails withConflictException.
This is a convenience which creates an instance of the
UpdateSpaceRequest.Builderavoiding the need to create one manually viaUpdateSpaceRequest.builder()- Parameters:
updateSpaceRequest- AConsumerthat will call methods onUpdateSpaceRequest.Builderto create a request.- Returns:
- Result of the UpdateSpace operation returned by the service.
- See Also:
-
waiter
Create an instance ofOpenSearchMemoryWaiterusing this client.Waiters created via this method are managed by the SDK and resources will be released when the service client is closed.
- Returns:
- an instance of
OpenSearchMemoryWaiter
-
create
Create aOpenSearchMemoryClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aOpenSearchMemoryClient. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-