Package software.amazon.awssdk.imds
Interface Ec2MetadataAsyncClient
-
- All Superinterfaces:
AutoCloseable,SdkAutoCloseable
- All Known Implementing Classes:
DefaultEc2MetadataAsyncClient
public interface Ec2MetadataAsyncClient extends SdkAutoCloseable
Interface to represent the Ec2Metadata Client Class. Used to access instance metadata from a running EC2 instance.Instantiate the Ec2MetadataAsyncClient
Default configuration
Custom configuration
Example of a client configured for using IPV6 and a fixed delay for retry attempts :Use the client
Call thegetmethod on the client with a path to an instance metadata:Closing the client
Once all operations are done, you may close the client to free any resources used by it.
Note: A single client instance should be reused for multiple requests when possible.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceEc2MetadataAsyncClient.BuilderThe builder definition for aEc2MetadataClient.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Ec2MetadataAsyncClient.Builderbuilder()Creates a builder for an async client instance.static Ec2MetadataAsyncClientcreate()Create anEc2MetadataAsyncClientinstance using the default values.CompletableFuture<Ec2MetadataResponse>get(String path)Gets the specified instance metadata value by the given path.-
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
-
-
-
-
Method Detail
-
get
CompletableFuture<Ec2MetadataResponse> get(String path)
Gets the specified instance metadata value by the given path. For more information about instance metadata, check the Instance metadata documentation.- Parameters:
path- Input path- Returns:
- A CompletableFuture that completes when the MetadataResponse is made available.
-
create
static Ec2MetadataAsyncClient create()
Create anEc2MetadataAsyncClientinstance using the default values.- Returns:
- the client instance.
-
builder
static Ec2MetadataAsyncClient.Builder builder()
Creates a builder for an async client instance.- Returns:
- the newly created builder instance.
-
-