ec2stack/templates/instances.xml (60 lines of code) (raw):

{% extends "response.xml" %} {% block response_content %} <reservationSet> {% if response %} <item> <reservationId>None</reservationId> <groupSet /> <instancesSet> {% for instance in response.virtualmachine %} <item> <instanceId>{{ instance.id }}</instanceId> <imageId>{{ instance.templateid }}</imageId> <instanceState> {% if instance.state == 'Starting' %} <code>0</code> <name>pending</name> {% elif instance.state == 'Running' %} <code>16</code> <name>running</name> {% elif instance.state == 'Destroyed' %} <code>32</code> <name>shutting-down</name> {% elif instance.state == 'Stopping' %} <code>64</code> <name>stopping</name> {% elif instance.state == 'Expunging' %} <code>48</code> <name>terminated</name> {% elif instance.state == 'Stopped' %} <code>80</code> <name>stopped</name> {% endif %} </instanceState> <keyName>{{ instance.keypair }}</keyName> <instanceType>{{ instance.serviceofferingname }}</instanceType> <launchTime>{{ instance.created }}</launchTime> <placement> <availabilityZone>{{ instance.zonename }}</availabilityZone> <tenancy>default</tenancy> </placement> {% if 'nic' in instance %} <privateIpAddress>{{ instance.nic.0.ipaddress }}</privateIpAddress> <ipAddress>{{ instance.nic.0.ipaddress }}</ipAddress> {% endif %} <groupSet> {% for securitygroup in instance.securitygroup %} <item> <groupId>{{ securitygroup.id }}</groupId> <groupName>{{ securitygroup.name }}</groupName> </item> {% endfor %} </groupSet> <hypervisor>{{ instance.hypervisor }}</hypervisor> </item> {% endfor %} </instancesSet> </item> {% endif %} </reservationSet> {% endblock %}