Menu
Amazon Elastic Compute Cloud
API Reference (API Version 2015-10-01)

MonitorInstances

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

For information about the common parameters that all actions use, see Common Query Parameters.

DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No

InstanceId.N

One or more instance IDs.

Type: String list

Required: Yes

Response Elements

The following elements are returned.

instancesSet

Monitoring information for one or more instances.

Type: InstanceMonitoring list

requestId

The ID of the request.

Type: String

Errors

For information about the errors that are common to all actions, see Common Client Errors.

Examples

Example

This example enables monitoring for two instances.

Sample Request

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

Sample Response

<MonitorInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2015-10-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>