class EC2::Ec2Stub
Public Class Methods
new(vpc)
click to toggle source
# File lib/etude_for_aws/ec2/ec2.rb, line 122 def initialize(vpc) @config = ConfigurationStub.new @gateway = Ec2ApiGatewayStub.new setup_config(vpc) end
Public Instance Methods
reboot()
click to toggle source
Calls superclass method
EC2::Ec2#reboot
# File lib/etude_for_aws/ec2/ec2.rb, line 145 def reboot instance_id = 'String' @gateway.client.stub_responses(:describe_instances, { reservations: [ { instances: [ instance_id: instance_id, state: {'code':16} ] } ] }) @ec2_instances << Ec2Instance.new(self, instance_id) super end
start()
click to toggle source
Calls superclass method
EC2::Ec2#start
# File lib/etude_for_aws/ec2/ec2.rb, line 128 def start instance_id = 'String' @gateway.client.stub_responses(:describe_instances, { reservations: [ { instances: [ instance_id: instance_id, state: {'code':89} ] } ] }) @ec2_instances << Ec2Instance.new(self, instance_id) super end
stop()
click to toggle source
Calls superclass method
EC2::Ec2#stop
# File lib/etude_for_aws/ec2/ec2.rb, line 162 def stop instance_id = 'String' @gateway.client.stub_responses(:describe_instances, { reservations: [ { instances: [ instance_id: instance_id, state: {'code':16} ] } ] }) @ec2_instances << Ec2Instance.new(self, instance_id) super end
Private Instance Methods
create_ec2_instance()
click to toggle source
Calls superclass method
EC2::Ec2#create_ec2_instance
# File lib/etude_for_aws/ec2/ec2.rb, line 188 def create_ec2_instance super end
create_key_pair()
click to toggle source
Calls superclass method
EC2::Ec2#create_key_pair
# File lib/etude_for_aws/ec2/ec2.rb, line 184 def create_key_pair super end
create_security_group()
click to toggle source
Calls superclass method
EC2::Ec2#create_security_group
# File lib/etude_for_aws/ec2/ec2.rb, line 180 def create_security_group super end
delete_key_pair()
click to toggle source
Calls superclass method
EC2::Ec2#delete_key_pair
# File lib/etude_for_aws/ec2/ec2.rb, line 214 def delete_key_pair super end
delete_security_group()
click to toggle source
Calls superclass method
EC2::Ec2#delete_security_group
# File lib/etude_for_aws/ec2/ec2.rb, line 209 def delete_security_group super @security_group = nil end
terminate_ec2_instance()
click to toggle source
Calls superclass method
EC2::Ec2#terminate_ec2_instance
# File lib/etude_for_aws/ec2/ec2.rb, line 192 def terminate_ec2_instance @gateway.client.stub_responses(:describe_instances, { reservations: [ { instances: [ instance_id: 'String', state: {'code':16} ] } ] }) @ec2_instances.first.instance_variable_set :@instance_id,'String' unless @ec2_instances.first.nil? super @ec2_instances = [] end