Class DefaultEc2MetadataClient
java.lang.Object
software.amazon.awssdk.imds.internal.BaseEc2MetadataClient
software.amazon.awssdk.imds.internal.DefaultEc2MetadataClient
- All Implemented Interfaces:
AutoCloseable
,Ec2MetadataClient
,SdkAutoCloseable
@Immutable
@ThreadSafe
public final class DefaultEc2MetadataClient
extends BaseEc2MetadataClient
implements Ec2MetadataClient
An Implementation of the Ec2Metadata Interface.
-
Nested Class Summary
Nested classes/interfaces inherited from interface software.amazon.awssdk.imds.Ec2MetadataClient
Ec2MetadataClient.Builder
-
Method Summary
-
Method Details
-
toString
-
close
public void close()Description copied from interface:SdkAutoCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-
builder
public static software.amazon.awssdk.imds.internal.DefaultEc2MetadataClient.Ec2MetadataBuilder builder() -
get
Gets the specified instance metadata value by the given path. Will retry base on theretry policy
provided, in the case of an IOException during request. Will not retry on SdkClientException, like 4XX HTTP error.- Specified by:
get
in interfaceEc2MetadataClient
- Parameters:
path
- Input path of the resource to get.- Returns:
- Instance metadata value as part of MetadataResponse Object
- Throws:
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.
-