class Spotdog::EC2

Constants

PRODUCT_DESCRIPTIONS

Public Class Methods

new(client) click to toggle source
# File lib/spotdog/ec2.rb, line 17
def initialize(client)
  @client = client
end
spot_price_history(client: Aws::EC2::Client.new, instance_types: nil, max_results: nil, product_descriptions: nil, start_time: nil, end_time: nil) click to toggle source
# File lib/spotdog/ec2.rb, line 12
def self.spot_price_history(client: Aws::EC2::Client.new, instance_types: nil, max_results: nil,
  product_descriptions: nil, start_time: nil, end_time: nil)
  self.new(client).spot_price_history(instance_types, max_results, product_descriptions, start_time, end_time)
end

Public Instance Methods

spot_price_history(instance_types, max_results, product_descriptions, start_time, end_time) click to toggle source
# File lib/spotdog/ec2.rb, line 21
def spot_price_history(instance_types, max_results, product_descriptions, start_time, end_time)
  @client.describe_spot_price_history(
    instance_types: instance_types,
    max_results: max_results,
    product_descriptions: product_descriptions,
    start_time: start_time,
    end_time: end_time,
  ).spot_price_history.map(&:to_h)
end