Method: Fog::Compute::AWS::Real#describe_reserved_instances

Defined in:
lib/fog/compute/requests/aws/describe_reserved_instances.rb

#describe_reserved_instances(filters = {}) ⇒ Object

Describe all or specified reserved instances

Parameters

  • filters<~Hash> - List of filters to limit results with

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘requestId’<~String> - Id of request

      • ‘reservedInstancesSet’<~Array>:

        • ‘availabilityZone’<~String> - availability zone of the instance

        • ‘duration’<~Integer> - duration of reservation, in seconds

        • ‘fixedPrice’<~Float> - purchase price of reserved instance

        • ‘instanceType’<~String> - type of instance

        • ‘instanceCount’<~Integer> - number of reserved instances

        • ‘productDescription’<~String> - reserved instance description

        • ‘reservedInstancesId’<~String> - id of the instance

        • ‘start’<~Time> - start time for reservation

        • ‘state’<~String> - state of reserved instance purchase, in .[pending-payment, active, payment-failed, retired]

        • ‘usagePrice“<~Float> - usage price of reserved instances, per hour

Amazon API Reference



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/fog/compute/requests/aws/describe_reserved_instances.rb', line 30

def describe_reserved_instances(filters = {})
  unless filters.is_a?(Hash)
    Formatador.display_line("[yellow][WARN] describe_reserved_instances with #{filters.class} param is deprecated, use describe_reserved_instances('reserved-instances-id' => []) instead[/] [light_black](#{caller.first})[/]")
    filters = {'reserved-instances-id' => [*filters]}
  end
  params = Fog::AWS.indexed_filters(filters)
  request({
    'Action'    => 'DescribeReservedInstances',
    :idempotent => true,
    :parser     => Fog::Parsers::Compute::AWS::DescribeReservedInstances.new
  }.merge!(params))
end