Class: Awscli::EC2::Spot
- Inherits:
-
Object
- Object
- Awscli::EC2::Spot
- Defined in:
- lib/awscli/ec2.rb
Overview
> ReservedInstances
Instance Method Summary collapse
- #cancel_spot_instance_requests(sid) ⇒ Object
- #create_spot_datafeed_subsription(bucket, prefix) ⇒ Object
- #delete_spot_datafeed_subsription ⇒ Object
- #describe_spot_datafeed_subscription ⇒ Object
- #describe_spot_price_history(filters) ⇒ Object
- #describe_spot_requests ⇒ Object
-
#initialize(connection) ⇒ Spot
constructor
A new instance of Spot.
- #list_filters ⇒ Object
- #request_spot_instances(options) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Spot
Returns a new instance of Spot.
680 681 682 |
# File 'lib/awscli/ec2.rb', line 680 def initialize(connection) @conn = connection end |
Instance Method Details
#cancel_spot_instance_requests(sid) ⇒ Object
725 726 727 728 729 730 |
# File 'lib/awscli/ec2.rb', line 725 def cancel_spot_instance_requests(sid) sr = @conn.spot_requests.get(sid) abort "Cannot find spot request with id: #{sid}" unless sr sr.destroy puts "Deleted spot request: #{sid}" end |
#create_spot_datafeed_subsription(bucket, prefix) ⇒ Object
712 713 714 |
# File 'lib/awscli/ec2.rb', line 712 def create_spot_datafeed_subsription(bucket, prefix) @conn.create_spot_datafeed_subscription(bucket, prefix) end |
#delete_spot_datafeed_subsription ⇒ Object
716 717 718 |
# File 'lib/awscli/ec2.rb', line 716 def delete_spot_datafeed_subsription @conn.delete_spot_datafeed_subscription end |
#describe_spot_datafeed_subscription ⇒ Object
688 689 690 |
# File 'lib/awscli/ec2.rb', line 688 def describe_spot_datafeed_subscription @conn.describe_spot_datafeed_subscription end |
#describe_spot_price_history(filters) ⇒ Object
692 693 694 695 696 697 698 699 700 |
# File 'lib/awscli/ec2.rb', line 692 def describe_spot_price_history(filters) puts filters response = if filters.nil? @conn.describe_spot_price_history.body['spotPriceHistorySet'] else @conn.describe_spot_price_history(filters).body['spotPriceHistorySet'] end Formatador.display_table(response) end |
#describe_spot_requests ⇒ Object
684 685 686 |
# File 'lib/awscli/ec2.rb', line 684 def describe_spot_requests @conn.spot_requests.table end |
#list_filters ⇒ Object
702 703 704 705 706 707 708 709 710 |
# File 'lib/awscli/ec2.rb', line 702 def list_filters filters = [ {:filter_name => "instance-type", :desc => "Type of instance"}, {:filter_name => "product-description", :desc => "Product description for the Spot Price"}, {:filter_name => "spot-price", :desc => "Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported)"}, {:filter_name => "timestamp", :desc => "Timestamp of the Spot Price history, e.g., 2010-08-16T05:06:11.000Z. You can use wildcards (* and ?)"}, ] Formatador.display_table(filters, [:filter_name, :desc]) end |
#request_spot_instances(options) ⇒ Object
720 721 722 723 |
# File 'lib/awscli/ec2.rb', line 720 def request_spot_instances() sr = @conn.spot_requests.create() puts "Created spot request: #{sr.id}" end |