Describeinstances

harlowja edited this page Apr 11, 2012 · 9 revisions

Describeinstances

Method information

Request

Type: GET/POST

Uri: http://$HOST:$PORT/$PATH/

Notes: Performed using euca-describe-instances using euca2ools_2.0.0~bzr464-0ubuntu2 on Ubuntu 11.10

Params:

AWSAccessKeyId=<VARIABLE>&Action=DescribeInstances&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=<VARIABLE>&Version=2010-08-31

  1. Filters can be passed in in the following format Filter.X.Name=<VARIABLE> with corresponding Filter.X.Value.Z=<VARIABLE> to provide the value for that filter (only applicable for Version >= 2010-08-31)

Exact version requested: 2010-08-31

Restricted to: N/A

Docs

  1. http://docs.amazonwebservices.com/AWSEC2/2010-08-31/APIReference/index.html?ApiReference-query-DescribeInstances.html

XSD

  1. https://github.com/yahoo/Openstack-EC2/blob/master/data/xsds/2010-08-31.ec2.wsdl.xsd#L471

Expected response

An XML response (with status code 200) conforming to the previous XSD would be expected.

Actual response

<?xml version="1.0" ?>
<DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
   <requestId>req-75fc0e37-f94a-441d-ae53-9ae0723c9e7e</requestId>
   <reservationSet>
      <item>
         <ownerId>e1ad0e85617347b5bcd3976ed93cc1f7</ownerId>
         <groupSet>
            <item>
               <groupId>default</groupId>
            </item>
         </groupSet>
         <reservationId>r-bez59frg</reservationId>
         <instancesSet>
            <item>
               <placement>
                  <availabilityZone>nova</availabilityZone>
               </placement>
               <rootDeviceType>instance-store</rootDeviceType>
               <keyName/>
               <instanceId>i-00000003</instanceId>
               <instanceState>
                  <code>0</code>
                  <name>error</name>
               </instanceState>
               <publicDnsName/>
               <imageId>ami-00000003</imageId>
               <productCodesSet/>
               <privateDnsName>server-3</privateDnsName>
               <dnsName>server-3</dnsName>
               <launchTime>2012-04-11T21:50:21.000Z</launchTime>
               <amiLaunchIndex>0</amiLaunchIndex>
               <rootDeviceName>/dev/sda1</rootDeviceName>
               <kernelId>aki-00000001</kernelId>
               <ramdiskId>ari-00000002</ramdiskId>
               <ipAddress/>
               <instanceType>m1.small</instanceType>
               <privateIpAddress/>
            </item>
         </instancesSet>
      </item>
   </reservationSet>
</DescribeInstancesResponse>

Errors

An error will be sent back in the following XML format (with a 400 status code):

<?xml version="1.0"?>
<Response>
   <Errors>
      <Error>
         <Code>%s</Code>
         <Message>%s</Message>
      </Error>
   </Errors>
   <RequestID>%s</RequestID>
</Response>

Codes

  1. Unauthorized
  2. UnknownError (on db failures?)
  3. (Others??)

Issues

  1. Does not comply to defined schema (ordering mainly)
  2. Version support is weak/non-existent; code copies input version parameter and echos it back
  3. Filters are not valid in versions < 2010-08-31, but openstack does not reject filters or acknowledge them (beyond inherit filter for instance id) even if a version >= 2010-08-31 is provided (ie no advanced filter support)
  4. Error XML response creation does not do XML escaping, see LP bug #978439
  5. No validation of the output
    • Does not ensure it conforms to a given version
    • No concept of separate renderers for all supported versions
  6. EC2 docs specify if you specify an invalid instance ID, a fault is returned, this does not occur