com.amazonaws.internal

## クラス EC2MetadataClient

- java.lang.Object
- - com.amazonaws.internal.EC2MetadataClient

-     public class EC2MetadataClient
      extends java.lang.Object

  Simple client for accessing the Amazon EC2 Instance Metadata Service.

- - ### フィールドの概要

    フィールド
    修飾子とタイプ | フィールドと説明
    --- | ---
    `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.

    - ### クラスから継承されたメソッド java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### フィールドの詳細

    - #### EC2_METADATA_SERVICE_OVERRIDE

          public static final java.lang.String EC2_METADATA_SERVICE_OVERRIDE

      System property for overriding the Amazon EC2 Instance Metadata Service endpoint.
      関連項目:
        定数フィールド値

    - #### SECURITY_CREDENTIALS_RESOURCE

          public static final java.lang.String SECURITY_CREDENTIALS_RESOURCE

      Default resource path for credentials in the Amazon EC2 Instance Metadata Service.
      関連項目:
        定数フィールド値

  - ### コンストラクタの詳細

    - #### EC2MetadataClient

          public EC2MetadataClient()

  - ### メソッドの詳細

    - #### getDefaultCredentials

          public java.lang.String getDefaultCredentials()
                                                 throws java.io.IOException

      Connects to the Amazon EC2 Instance Metadata Service to retrieve the default credential information (if any).
      戻り値:
        The response from the Amazon EC2 Instance Metadata Service, or null if no credential information was available.
      例外:
        `java.io.IOException` - If any problems are encountered while connecting to the Amazon EC2 Instance Metadata Service.

    - #### readResource

          public java.lang.String readResource(java.lang.String resourcePath)
                                        throws java.io.IOException,
                                               AmazonClientException

      Connects to the metadata service to read the specified resource and returns the text contents.
      パラメータ:
        `resourcePath` - The resource
      戻り値:
        The text payload returned from the Amazon EC2 Instance Metadata service for the specified resource path.
      例外:
        `java.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.