NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class InstanceMetadataClient

Client used for interacting with the Amazon EC2 instance metadata server

  Guzzle\Common\AbstractHasDispatcher implements Guzzle\Common\HasDispatcherInterface
  Guzzle\Http\Client implements Guzzle\Http\ClientInterface
  Guzzle\Service\Client implements Guzzle\Service\ClientInterface
  Aws\Common\Client\AbstractClient implements Aws\Common\Client\AwsClientInterface
  Aws\Common\InstanceMetadata\InstanceMetadataClient

Namespace: Aws\Common\InstanceMetadata
Located at Aws/Common/InstanceMetadata/InstanceMetadataClient.php

## Methods summary

- `public static` `factory ( array|Collection $config = array() )`

  Factory method to create a new InstanceMetadataClient using an array of configuration options.

- `public` `__construct ( Guzzle\Common\Collection $config )`

  Constructor override

- `public` `getInstanceProfileCredentials ( )`

  Get instance profile credentials

## Methods detail

# `public static `Aws\Common\InstanceMetadata\InstanceMetadataClient``
`factory( array|`Guzzle\Common\Collection` $config = array() )`

Factory method to create a new InstanceMetadataClient using an array of configuration options.

The configuration options accepts the following array keys and values:

- base_url: Override the base URL of the instance metadata server
- version: Version of the metadata server to interact with

#### Parameters

$config
  `array|`Guzzle\Common\Collection``
  $config Configuration options

#### Returns

``Aws\Common\InstanceMetadata\InstanceMetadataClient``

#### Overrides

`Guzzle\Service\Client::factory`
# `public`
`__construct( `Guzzle\Common\Collection` $config )`

Constructor override

#### Parameters

$config
  `CredentialsInterface`
  $credentials AWS credentials

#### Throws

``InvalidArgumentException``
if an endpoint provider isn't provided

#### Overrides

`Aws\Common\Client\AbstractClient::__construct`
# `public `Aws\Common\Credentials\Credentials``
`getInstanceProfileCredentials( )`

Get instance profile credentials

#### Returns

``Aws\Common\Credentials\Credentials``

#### Throws

``Aws\Common\Exception\InstanceProfileCredentialsException``

### Methods inherited from Aws\Common\Client\AbstractClient

`__call()`, `createRequest()`, `getAllEvents()`, `getApiVersion()`, `getCredentials()`, `getRegion()`, `getRegions()`, `getSignature()`, `getWaiter()`, `getWaiterFactory()`, `send()`, `setCredentials()`, `setRegion()`, `setWaiterFactory()`, `waitUntil()`

### Methods inherited from Guzzle\Service\Client

`execute()`, `executeMultiple()`, `getCommand()`, `getCommandFactory()`, `getDescription()`, `getInflector()`, `getIterator()`, `getResourceIteratorFactory()`, `prepareCommand()`, `setCommandFactory()`, `setDescription()`, `setInflector()`, `setResourceIteratorFactory()`

### Methods inherited from Guzzle\Http\Client

`delete()`, `expandTemplate()`, `extractPharCacert()`, `get()`, `getBaseUrl()`, `getConfig()`, `getCurlMulti()`, `getDefaultOption()`, `getDefaultUserAgent()`, `getUriTemplate()`, `head()`, `initSsl()`, `options()`, `patch()`, `post()`, `prepareRequest()`, `put()`, `sendMultiple()`, `setBaseUrl()`, `setConfig()`, `setCurlMulti()`, `setDefaultOption()`, `setRequestFactory()`, `setSslVerification()`, `setUriTemplate()`, `setUserAgent()`

### Methods inherited from Guzzle\Common\AbstractHasDispatcher

`addSubscriber()`, `dispatch()`, `getEventDispatcher()`, `setEventDispatcher()`

### Magic methods summary

## Constants summary

### Constants inherited from Guzzle\Service\Client

`COMMAND_PARAMS`

### Constants inherited from Guzzle\Http\Client

`CURL_OPTIONS`, `DEFAULT_SELECT_TIMEOUT`, `DISABLE_REDIRECTS`, `MAX_HANDLES`, `REQUEST_OPTIONS`, `SSL_CERT_AUTHORITY`

### Constants inherited from Guzzle\Http\ClientInterface

`CREATE_REQUEST`, `HTTP_DATE`

## Properties summary

### Properties inherited from Aws\Common\Client\AbstractClient

`$aggregator`, `$credentials`, `$signature`, `$waiterFactory`

### Properties inherited from Guzzle\Service\Client

`$commandFactory`, `$inflector`, `$resourceIteratorFactory`, `$serviceDescription`

### Properties inherited from Guzzle\Http\Client

`$defaultHeaders`, `$requestFactory`, `$userAgent`

### Properties inherited from Guzzle\Common\AbstractHasDispatcher

`$eventDispatcher`