public class EC2MetadataClient
extends java.lang.Object
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static java.lang.String |
EC2_METADATA_SERVICE_OVERRIDE
System property for overriding the Amazon EC2 Instance Metadata Service endpoint.
|
static java.lang.String |
SECURITY_CREDENTIALS_RESOURCE
Default resource path for credentials in the Amazon EC2 Instance Metadata Service.
|
| コンストラクタと説明 |
|---|
EC2MetadataClient() |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
java.lang.String |
getDefaultCredentials()
Connects to the Amazon EC2 Instance Metadata Service to retrieve the
default credential information (if any).
|
java.lang.String |
readResource(java.lang.String resourcePath)
Connects to the metadata service to read the specified resource and
returns the text contents.
|
public static final java.lang.String EC2_METADATA_SERVICE_OVERRIDE
public static final java.lang.String SECURITY_CREDENTIALS_RESOURCE
public java.lang.String getDefaultCredentials()
throws java.io.IOException
java.io.IOException - If any problems are encountered while connecting to the
Amazon EC2 Instance Metadata Service.public java.lang.String readResource(java.lang.String resourcePath)
throws java.io.IOException,
AmazonClientException
resourcePath - The resourcejava.io.IOException - If any problems were encountered while connecting to metadata
service for the requested resource path.AmazonClientException - If the requested metadata service is not found.