Interface SageMakerA2IRuntimeClient
-
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
@Generated("software.amazon.awssdk:codegen") @ThreadSafe public interface SageMakerA2IRuntimeClient extends AwsClient
Service client for accessing Amazon Augmented AI Runtime. This can be created using the staticbuilder()method.Amazon Augmented AI (Amazon A2I) adds the benefit of human judgment to any machine learning application. When an AI application can't evaluate data with a high degree of confidence, human reviewers can take over. This human review is called a human review workflow. To create and start a human review workflow, you need three resources: a worker task template, a flow definition, and a human loop.
For information about these resources and prerequisites for using Amazon A2I, see Get Started with Amazon Augmented AI in the Amazon SageMaker Developer Guide.
This API reference includes information about API actions and data types that you can use to interact with Amazon A2I programmatically. Use this guide to:
-
Start a human loop with the
StartHumanLoopoperation when using Amazon A2I with a custom task type. To learn more about the difference between custom and built-in task types, see Use Task Types . To learn how to start a human loop using this API, see Create and Start a Human Loop for a Custom Task Type in the Amazon SageMaker Developer Guide. -
Manage your human loops. You can list all human loops that you have created, describe individual human loops, and stop and delete human loops. To learn more, see Monitor and Manage Your Human Loop in the Amazon SageMaker Developer Guide.
Amazon A2I integrates APIs from various AWS services to create and start human review workflows for those services. To learn how Amazon A2I uses these APIs, see Use APIs in Amazon A2I in the Amazon SageMaker Developer Guide.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSERVICE_METADATA_IDValue for looking up the service's metadata from theServiceMetadataProvider.static StringSERVICE_NAME
-
Method Summary
-
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
-
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
- See Also:
- Constant Field Values
-
SERVICE_METADATA_ID
static final String SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
- Constant Field Values
-
-
Method Detail
-
deleteHumanLoop
default DeleteHumanLoopResponse deleteHumanLoop(DeleteHumanLoopRequest deleteHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Deletes the specified human loop for a flow definition.
If the human loop was deleted, this operation will return a
ResourceNotFoundException.- Parameters:
deleteHumanLoopRequest-- Returns:
- Result of the DeleteHumanLoop operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
deleteHumanLoop
default DeleteHumanLoopResponse deleteHumanLoop(Consumer<DeleteHumanLoopRequest.Builder> deleteHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Deletes the specified human loop for a flow definition.
If the human loop was deleted, this operation will return a
ResourceNotFoundException.
This is a convenience which creates an instance of the
DeleteHumanLoopRequest.Builderavoiding the need to create one manually viaDeleteHumanLoopRequest.builder()- Parameters:
deleteHumanLoopRequest- AConsumerthat will call methods onDeleteHumanLoopRequest.Builderto create a request.- Returns:
- Result of the DeleteHumanLoop operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
describeHumanLoop
default DescribeHumanLoopResponse describeHumanLoop(DescribeHumanLoopRequest describeHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Returns information about the specified human loop. If the human loop was deleted, this operation will return a
ResourceNotFoundExceptionerror.- Parameters:
describeHumanLoopRequest-- Returns:
- Result of the DescribeHumanLoop operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
describeHumanLoop
default DescribeHumanLoopResponse describeHumanLoop(Consumer<DescribeHumanLoopRequest.Builder> describeHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Returns information about the specified human loop. If the human loop was deleted, this operation will return a
ResourceNotFoundExceptionerror.
This is a convenience which creates an instance of the
DescribeHumanLoopRequest.Builderavoiding the need to create one manually viaDescribeHumanLoopRequest.builder()- Parameters:
describeHumanLoopRequest- AConsumerthat will call methods onDescribeHumanLoopRequest.Builderto create a request.- Returns:
- Result of the DescribeHumanLoop operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
listHumanLoops
default ListHumanLoopsResponse listHumanLoops(ListHumanLoopsRequest listHumanLoopsRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Returns information about human loops, given the specified parameters. If a human loop was deleted, it will not be included.
- Parameters:
listHumanLoopsRequest-- Returns:
- Result of the ListHumanLoops operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
listHumanLoops
default ListHumanLoopsResponse listHumanLoops(Consumer<ListHumanLoopsRequest.Builder> listHumanLoopsRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Returns information about human loops, given the specified parameters. If a human loop was deleted, it will not be included.
This is a convenience which creates an instance of the
ListHumanLoopsRequest.Builderavoiding the need to create one manually viaListHumanLoopsRequest.builder()- Parameters:
listHumanLoopsRequest- AConsumerthat will call methods onListHumanLoopsRequest.Builderto create a request.- Returns:
- Result of the ListHumanLoops operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
listHumanLoopsPaginator
default ListHumanLoopsIterable listHumanLoopsPaginator(ListHumanLoopsRequest listHumanLoopsRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
This is a variant of
listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)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.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client.listHumanLoopsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client .listHumanLoopsPaginator(request); for (software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client.listHumanLoopsPaginator(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
listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)operation.- Parameters:
listHumanLoopsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
listHumanLoopsPaginator
default ListHumanLoopsIterable listHumanLoopsPaginator(Consumer<ListHumanLoopsRequest.Builder> listHumanLoopsRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
This is a variant of
listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)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.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client.listHumanLoopsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client .listHumanLoopsPaginator(request); for (software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsIterable responses = client.listHumanLoopsPaginator(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
listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest)operation.
This is a convenience which creates an instance of the
ListHumanLoopsRequest.Builderavoiding the need to create one manually viaListHumanLoopsRequest.builder()- Parameters:
listHumanLoopsRequest- AConsumerthat will call methods onListHumanLoopsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
startHumanLoop
default StartHumanLoopResponse startHumanLoop(StartHumanLoopRequest startHumanLoopRequest) throws ValidationException, ThrottlingException, ServiceQuotaExceededException, InternalServerException, ConflictException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Starts a human loop, provided that at least one activation condition is met.
- Parameters:
startHumanLoopRequest-- Returns:
- Result of the StartHumanLoop operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ThrottlingException- You exceeded the maximum number of requests.ServiceQuotaExceededException- You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your AWS account. For a list of Amazon A2I service quotes, see Amazon Augmented AI Service Quotes. Delete some resources or request an increase in your service quota. You can request a quota increase using Service Quotas or the AWS Support Center. To request an increase, see AWS Service Quotas in the AWS General Reference.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.ConflictException- Your request has the same name as another active human loop but has different input data. You cannot start two human loops with the same name and different input data.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
startHumanLoop
default StartHumanLoopResponse startHumanLoop(Consumer<StartHumanLoopRequest.Builder> startHumanLoopRequest) throws ValidationException, ThrottlingException, ServiceQuotaExceededException, InternalServerException, ConflictException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Starts a human loop, provided that at least one activation condition is met.
This is a convenience which creates an instance of the
StartHumanLoopRequest.Builderavoiding the need to create one manually viaStartHumanLoopRequest.builder()- Parameters:
startHumanLoopRequest- AConsumerthat will call methods onStartHumanLoopRequest.Builderto create a request.- Returns:
- Result of the StartHumanLoop operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ThrottlingException- You exceeded the maximum number of requests.ServiceQuotaExceededException- You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your AWS account. For a list of Amazon A2I service quotes, see Amazon Augmented AI Service Quotes. Delete some resources or request an increase in your service quota. You can request a quota increase using Service Quotas or the AWS Support Center. To request an increase, see AWS Service Quotas in the AWS General Reference.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.ConflictException- Your request has the same name as another active human loop but has different input data. You cannot start two human loops with the same name and different input data.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
stopHumanLoop
default StopHumanLoopResponse stopHumanLoop(StopHumanLoopRequest stopHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Stops the specified human loop.
- Parameters:
stopHumanLoopRequest-- Returns:
- Result of the StopHumanLoop operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
stopHumanLoop
default StopHumanLoopResponse stopHumanLoop(Consumer<StopHumanLoopRequest.Builder> stopHumanLoopRequest) throws ValidationException, ResourceNotFoundException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException, SageMakerA2IRuntimeException
Stops the specified human loop.
This is a convenience which creates an instance of the
StopHumanLoopRequest.Builderavoiding the need to create one manually viaStopHumanLoopRequest.builder()- Parameters:
stopHumanLoopRequest- AConsumerthat will call methods onStopHumanLoopRequest.Builderto create a request.- Returns:
- Result of the StopHumanLoop operation returned by the service.
- Throws:
ValidationException- The request isn't valid. Check the syntax and try again.ResourceNotFoundException- We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.ThrottlingException- You exceeded the maximum number of requests.InternalServerException- We couldn't process your request because of an issue with the server. Try again later.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerA2IRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
create
static SageMakerA2IRuntimeClient create()
Create aSageMakerA2IRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.
-
builder
static SageMakerA2IRuntimeClientBuilder builder()
Create a builder that can be used to configure and create aSageMakerA2IRuntimeClient.
-
serviceMetadata
static ServiceMetadata serviceMetadata()
-
serviceClientConfiguration
default SageMakerA2IRuntimeServiceClientConfiguration serviceClientConfiguration()
- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient
-
-