Describe Instances operation


The Describe Instances operation enables you to retrieve information about instances that you own.

If you specify one or more instance IDs, the Describe Instances operation returns information for the specified instances. If you do not specify any instance IDs, the operation returns information for all relevant instances. If you specify an invalid instance ID, the operation returns a fault. If you specify an instance that you do not own, it will not be included in the results retrieved from Amazon EC2.

The following figure shows a sample <items> XML element for the Describe Instances operation. 

Sample <items> XML element for the Describe Instances operation

<items>
   <item>
       <parameters>
           <instances-set>
               <!--Zero or more repetitions:-->
               <item>
                   <instance-id></instance-id>
               </item>
           </instances-set>
       </parameters>
   </item>
</items>

The following table describes the elements for this adapter request. 

Adapter request elements for the Describe Instances operation

Element

Definition

Required

<wsdl-location>

Specifies the target Web Service Description Language (WSDL) URL for Amazon EC2

Examples:

Conditional:

  • Required if not specified in the request
  • If specified in the configuration and request, the value in the request overrides the value in the configuration
<endpoint-address>

Specifies the web service endpoint for the adapter to use while performing operations on Amazon EC2 instances across different regions
Default value: US East region: http://us-east-1.ec2.amazonaws.com/

No

<signature-properties>

Specifies the mode for signing the adapter request

Conditional:

  • Required if not specified in the configuration
  • If <signature-properties mode = "key-files">, requires <private-key-file>
     and <certificate-file>
  • If <signature-properties mode = "key-data">, requires <private-key-data> and <certificate-data> 

    Failed to execute the [panel] macro.

<operation-name>

Contains the name of the operation: describe-instances

Yes

<instance-set>

contains one or more instance IDs corresponding to the instances that you want to query for description

Yes

The following figure shows a sample adapter request for the Describe Instances operation. 

Sample adapter request for the Describe Instances operation

<amazon-ec2-request>
   <wsdl-location>http://ec2.amazonaws.com/doc/2009-11-30/</wsdl-location>
   <endpoint-address>http://us-east-1.ec2.amazonaws.com/</endpoint-address>
   <signature-properties mode = "key-files">
       <private-key-file>C:\Security\
pk-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</private-key-file>
       <certificate-file>C:\Security\
cert-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</certificate-file>
   </signature-properties>
   <operation-name>describe-instances</operation-name>
   <parameters>
       <instances-set>
           <item>
               <instance-id>i-bd90bfd5</instance-id>
           </item>
       </instances-set>
   </parameters>
</amazon-ec2-request>

The following figure shows the response for the sample Describe Instances operation. 

Sample adapter response for the Describe Instances operation

<amazon-ec2-response>
   <metadata>
       <status>success</status>
   </metadata>
   <DescribeInstancesResponse>
       <requestId>b17d2e68-fbd2-484b-92c0-7ff7e7f3dbc6</requestId>
       <reservationSet>
           <item>
               <reservationId>r-094ccf61</reservationId>
               <ownerId>622872856407</ownerId>
               <groupSet>
                   <item>
                       <groupId>testlsec</groupId>
                   </item>
               </groupSet>
               <instancesSet>
                   <item>
                       <instanceId>i-bd90bfd5</instanceId>
                       <imageId>ami-b232d0db</imageId>
                       <instanceState>
                           <code>16</code>
                           <name>running</name>
                       </instanceState>
                       <privateDnsName>domU-12-31-38-00-29-A2.compute-1.internal
</privateDnsName>
                       <dnsName>ec2-174-129-149-12.compute-1.amazonaws.com
</dnsName>
                       <reason/>
                       <keyName>testkeys</keyName>
                       <amiLaunchIndex>0</amiLaunchIndex>
                       <productCodes/>
                       <instanceType>m1.small</instanceType>
                       <launchTime>2010-01-06T10:36:45.000Z</launchTime>
                       <placement>
                           <availabilityZone>us-east-1a</availabilityZone>
                       </placement>
                       <kernelId>aki-94c527fd</kernelId>
                       <ramdiskId>ari-96c527ff</ramdiskId>
                       <monitoring>
                           <state>disabled</state>
                       </monitoring>
                       <privateIpAddress>10.252.46.80</privateIpAddress>
                       <ipAddress>174.129.149.12</ipAddress>
                       <rootDeviceType>ebs</rootDeviceType>
                       <rootDeviceName>/dev/sda1</rootDeviceName>
                       <blockDeviceMapping>
                           <item>
                               <deviceName>/dev/sda1</deviceName>
                               <ebs>
                                   <volumeId>vol-0767a06e</volumeId>
                                   <status>attached</status>
                                   <attachTime>2010-01-06T10:36:50.000Z
</attachTime>
                                   <deleteOnTermination>true
</deleteOnTermination>
                               </ebs>
                           </item>
                       </blockDeviceMapping>
                   </item>
               </instancesSet>
           </item>
       </reservationSet>
   </DescribeInstancesResponse>
</amazon-ec2-response>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*