Amazon Elastic Compute Cloud
API Reference (API Version 2014-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

MonitorInstances

Description

Enables monitoring for a running instance. For more information about monitoring instances, see Monitoring Your Instances and Volumes in the Amazon Elastic Compute Cloud User Guide.

Request Parameters

InstanceId.n

One or more instance IDs.

Type: String

Default: None

Required: Yes

Response Elements

The following elements are returned in a MonitorInstancesResponse element.

requestId

The ID of the request.

Type: xsd:string

instancesSet

A list of instances. Each instance is wrapped in an item element.

Type: MonitorInstancesResponseSetItemType

Errors

The following are some of the client API errors you may encounter when using this request. For more information about common API errors, see Common Causes of EC2 API Client Errors. For a summary of API error codes, see Client Error Codes.

Examples

Example Request

This example enables monitoring for two instances.

https://ec2.amazonaws.com/?Action=MonitorInstances
&InstanceId.1=i-43a4412a
&InstanceId.2=i-23a3397d
&AUTHPARAMS

Example Response

<MonitorInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2014-02-01/">
    <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
    <instancesSet>
      <item>
        <instanceId>i-43a4412a</instanceId>
        <monitoring>
          <state>pending</state>
        </monitoring>
    </item>
    <item>
      <instanceId>i-23a3397d</instanceId>
        <monitoring>
          <state>pending</state>
        </monitoring>
      </item>
    </instancesSet>
</MonitorInstancesResponse>