Class: Aws::Ec2::QEc2DescribeInstancesParser
- Defined in:
- lib/ec2/ec2.rb
Overview
PARSERS: Instances
Constant Summary
Constants inherited from AwsParser
AwsParser::DEFAULT_XML_LIBRARY
Instance Attribute Summary
Attributes inherited from AwsParser
Instance Method Summary collapse
Methods inherited from AwsParser
#initialize, #method_missing, #parse, #tag_end, #tag_start, #tagtext, #text, xml_lib, xml_lib=
Constructor Details
This class inherits a constructor from Aws::AwsParser
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Aws::AwsParser
Instance Method Details
#reset ⇒ Object
1907 1908 1909 |
# File 'lib/ec2/ec2.rb', line 1907 def reset @result = [] end |
#tagend(name) ⇒ Object
1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 |
# File 'lib/ec2/ec2.rb', line 1824 def tagend(name) case name when 'rootDeviceType' then @instance[:root_device_type] = @text when 'architecture' then @instance[:architecture] = @text when 'rootDeviceName' then @instance[:root_device_name] = @text # reservation when 'reservationId' then @reservation[:aws_reservation_id] = @text when 'ownerId' then @reservation[:aws_owner] = @text when 'groupId' then @reservation[:aws_groups] << @text # instance when 'instanceId' then @instance[:aws_instance_id] = @text when 'imageId' then @instance[:aws_image_id] = @text when 'dnsName' then @instance[:dns_name] = @text when 'privateDnsName' then @instance[:private_dns_name] = @text when 'reason' then @instance[:aws_reason] = @text when 'keyName' then @instance[:ssh_key_name] = @text when 'amiLaunchIndex' then @instance[:ami_launch_index] = @text when 'code' then @instance[:aws_state_code] = @text when 'name' then @instance[:aws_state] = @text when 'productCode' then @instance[:aws_product_codes] << @text when 'instanceType' then @instance[:aws_instance_type] = @text when 'launchTime' then @instance[:aws_launch_time] = @text when 'kernelId' then @instance[:aws_kernel_id] = @text when 'ramdiskId' then @instance[:aws_ramdisk_id] = @text when 'platform' then @instance[:aws_platform] = @text when 'availabilityZone' then @instance[:aws_availability_zone] = @text when 'privateIpAddress' then @instance[:aws_private_ip_address] = @text when 'subnetId' then @instance[:subnet_id] = @text when 'vpcId' then @instance[:vpc_id] = @text when 'key' then @tag_key = @text when 'value' then @tag_value = @text when 'deviceName' then @device_name = @text when 'volumeId' then @volume_id = @text when 'state' if @xmlpath == 'DescribeInstancesResponse/reservationSet/item/instancesSet/item/monitoring' || # DescribeInstances property @xmlpath == 'RunInstancesResponse/instancesSet/item/monitoring' # RunInstances property @instance[:monitoring_state] = @text end when 'item' if @xmlpath=='DescribeInstancesResponse/reservationSet/item/instancesSet/item/tagSet' # Tags @instance[:tags][@tag_key] = @tag_value elsif @xmlpath == 'DescribeInstancesResponse/reservationSet/item/instancesSet/item/blockDeviceMapping' # Block device mappings @instance[:block_device_mappings] << { @device_name => @volume_id } elsif @xmlpath == 'DescribeInstancesResponse/reservationSet/item/instancesSet' || # DescribeInstances property @xmlpath == 'RunInstancesResponse/instancesSet' # RunInstances property @reservation[:instances_set] << @instance elsif @xmlpath=='DescribeInstancesResponse/reservationSet' # DescribeInstances property @result << @reservation end when 'RunInstancesResponse' then @result << @reservation # RunInstances property end end |
#tagstart(name, attributes) ⇒ Object
:nodoc:
1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 |
# File 'lib/ec2/ec2.rb', line 1793 def (name, attributes) # DescribeInstances property if (name == 'item' && @xmlpath == 'DescribeInstancesResponse/reservationSet') || # RunInstances property (name == 'RunInstancesResponse') @reservation = {:aws_groups => [], :instances_set => []} elsif (name == 'item') && # DescribeInstances property (@xmlpath=='DescribeInstancesResponse/reservationSet/item/instancesSet' || # RunInstances property @xmlpath=='RunInstancesResponse/instancesSet') # the optional params (sometimes are missing and we dont want them to be nil) @instance = {:aws_reason => '', :dns_name => '', :private_dns_name => '', :ami_launch_index => '', :ssh_key_name => '', :aws_state => '', :root_device_type => '', :root_device_name => '', :architecture => '', :subnet_id => '', :vpc_id => '', :block_device_mappings => [], :aws_product_codes => [], :tags => {}} end end |