@Immutable @ThreadSafe public final class DefaultEc2MetadataClient extends BaseEc2MetadataClient implements Ec2MetadataClient
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultEc2MetadataClient.Ec2MetadataBuilder |
Ec2MetadataClient.BuilderDEFAULT_TOKEN_TTL, endpoint, IMDS_HTTP_DEFAULTS, requestMarshaller, retryPolicy, tokenTtl| Modifier and Type | Method and Description |
|---|---|
static DefaultEc2MetadataClient.Ec2MetadataBuilder |
builder()
Creates a default builder for
Ec2MetadataClient. |
void |
close() |
Ec2MetadataResponse |
get(String path)
Gets the specified instance metadata value by the given path.
|
shouldRetry, uncheckedInputStreamToUtf8clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic void close()
close in interface AutoCloseableclose in interface SdkAutoCloseablepublic static DefaultEc2MetadataClient.Ec2MetadataBuilder builder()
Ec2MetadataClientEc2MetadataClient.builder in interface Ec2MetadataClientpublic Ec2MetadataResponse get(String path)
retry policy provided, in the case of an IOException during request. Will not retry on
SdkClientException, like 4XX HTTP error.get in interface Ec2MetadataClientpath - Input path of the resource to get.SdkClientException - if the request for a token or the request for the Metadata does not have a 2XX SUCCESS response,
if the maximum number of retries is reached, or if another IOException is thrown during the
request.Copyright © 2023. All rights reserved.