public class AWSLambdaClient extends AmazonWebServiceClient implements AWSLambda
Overview
This is the AWS Lambda API Reference. The AWS Lambda Developer Guide provides additional information. For the service overview, see What is AWS Lambda, and for information about how the service works, see AWS Lambda: How it Works in the AWS Lambda Developer Guide.
Modifier and Type | Field and Description |
---|---|
protected List<com.amazonaws.transform.JsonErrorUnmarshaller> |
jsonErrorUnmarshallers
List of exception unmarshallers for all AWS Lambda exceptions.
|
client, clientConfiguration, endpoint, endpointPrefix, LOGGING_AWS_REQUEST_METRIC, requestHandler2s, timeOffset
Constructor and Description |
---|
AWSLambdaClient()
Deprecated.
|
AWSLambdaClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on AWSLambda using the
specified AWS account credentials.
|
AWSLambdaClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWSLambda using the
specified AWS account credentials and client configuration options.
|
AWSLambdaClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on AWSLambda using the
specified AWS account credentials provider.
|
AWSLambdaClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWSLambda using the
specified AWS account credentials provider and client configuration
options.
|
AWSLambdaClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
HttpClient httpClient)
Constructs a new client to invoke service methods on AWSLambda using the
specified AWS account credentials provider, client configuration options
and request metric collector.
|
AWSLambdaClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector)
Deprecated.
|
AWSLambdaClient(ClientConfiguration clientConfiguration)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Deprecated.
ResponseMetadata cache can hold up to 50 requests and
responses in memory and will cause memory issue. This method
now always returns null.
|
InvokeResult |
invoke(InvokeRequest invokeRequest)
Invokes a Lambda function.
|
addRequestHandler, addRequestHandler, configSigner, configSigner, createExecutionContext, createExecutionContext, createExecutionContext, endClientExecution, endClientExecution, findRequestMetricCollector, getEndpoint, getEndpointPrefix, getRegions, getRequestMetricsCollector, getServiceAbbreviation, getServiceName, getServiceNameIntern, getSigner, getSignerByURI, getSignerRegionOverride, getTimeOffset, isProfilingEnabled, isRequestMetricsEnabled, removeRequestHandler, removeRequestHandler, requestMetricCollector, setConfiguration, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withTimeOffset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setEndpoint, setRegion, shutdown
protected List<com.amazonaws.transform.JsonErrorUnmarshaller> jsonErrorUnmarshallers
@Deprecated public AWSLambdaClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
@Deprecated public AWSLambdaClient(ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling
how this client connects to AWSLambda (ex: proxy settings,
retry counts, etc.).DefaultAWSCredentialsProviderChain
public AWSLambdaClient(AWSCredentials awsCredentials)
If AWS session credentials are passed in, then those credentials will be used to authenticate requests. Otherwise, if AWS long-term credentials are passed in, then session management will be handled automatically by the SDK. Callers are encouraged to use long-term credentials and let the SDK handle starting and renewing sessions.
Automatically managed sessions will be shared among all clients that use
the same credentials and service endpoint. To opt out of this behavior,
explicitly provide an instance of AWSCredentialsProvider
that
returns AWSSessionCredentials
.
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.public AWSLambdaClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
If AWS session credentials are passed in, then those credentials will be used to authenticate requests. Otherwise, if AWS long-term credentials are passed in, then session management will be handled automatically by the SDK. Callers are encouraged to use long-term credentials and let the SDK handle starting and renewing sessions.
Automatically managed sessions will be shared among all clients that use
the same credentials and service endpoint. To opt out of this behavior,
explicitly provide an instance of AWSCredentialsProvider
that
returns AWSSessionCredentials
.
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.clientConfiguration
- The client configuration options controlling
how this client connects to AWSLambda (ex: proxy settings,
retry counts, etc.).public AWSLambdaClient(AWSCredentialsProvider awsCredentialsProvider)
If AWS session credentials are passed in, then those credentials will be used to authenticate requests. Otherwise, if AWS long-term credentials are passed in, then session management will be handled automatically by the SDK. Callers are encouraged to use long-term credentials and let the SDK handle starting and renewing sessions.
Automatically managed sessions will be shared among all clients that use
the same credentials and service endpoint. To opt out of this behavior,
explicitly provide an instance of AWSCredentialsProvider
that
returns AWSSessionCredentials
.
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.public AWSLambdaClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
If AWS session credentials are passed in, then those credentials will be used to authenticate requests. Otherwise, if AWS long-term credentials are passed in, then session management will be handled automatically by the SDK. Callers are encouraged to use long-term credentials and let the SDK handle starting and renewing sessions.
Automatically managed sessions will be shared among all clients that use
the same credentials and service endpoint. To opt out of this behavior,
explicitly provide an instance of AWSCredentialsProvider
that
returns AWSSessionCredentials
.
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- The client configuration options controlling
how this client connects to AWSLambda (ex: proxy settings,
retry counts, etc.).@Deprecated public AWSLambdaClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- The client configuration options controlling
how this client connects to AWSLambda (ex: proxy settings,
retry counts, etc.).requestMetricCollector
- optional request metric collectorpublic AWSLambdaClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, HttpClient httpClient)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- The client configuration options controlling
how this client connects to AWSLambda (ex: proxy settings,
retry counts, etc.).httpClient
- A http clientpublic InvokeResult invoke(InvokeRequest invokeRequest) throws AmazonServiceException, AmazonClientException
Invokes a Lambda function. You can invoke a function synchronously (and
wait for the response), or asynchronously. To invoke a function
asynchronously, set InvocationType
to Event
.
For synchronous invocation, details about the function response, including errors, are included in the response body and headers. For either invocation type, you can find more information in the execution log and trace. To record function errors for asynchronous invocations, configure your function with a dead letter queue.
The status code in the API response doesn't reflect function errors.
Error codes are reserved for errors that prevent your function from
executing, such as permissions errors, limit
errors, or issues with your function's code and configuration. For
example, Lambda returns TooManyRequestsException
if
executing the function would cause you to exceed a concurrency limit at
either the account level (ConcurrentInvocationLimitExceeded
)
or function level (
ReservedFunctionConcurrentInvocationLimitExceeded
).
For functions with a long timeout, your client might be disconnected during synchronous invocation while it waits for a response. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long connections with timeout or keep-alive settings.
This operation requires permission for the
lambda:InvokeFunction
action.
invoke
in interface AWSLambda
invokeRequest
- ServiceException
ResourceNotFoundException
InvalidRequestContentException
RequestTooLargeException
UnsupportedMediaTypeException
TooManyRequestsException
InvalidParameterValueException
EC2UnexpectedException
SubnetIPAddressLimitReachedException
ENILimitReachedException
EC2ThrottledException
EC2AccessDeniedException
InvalidSubnetIDException
InvalidSecurityGroupIDException
InvalidZipFileException
KMSDisabledException
KMSInvalidStateException
KMSAccessDeniedException
KMSNotFoundException
InvalidRuntimeException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by AWS
Lambda indicating either a problem with the data in the
request, or a server side issue.@Deprecated public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AWSLambda
request
- The originally executed requestCopyright © 2019. All rights reserved.