class AwsCli::CLI::EC2::VPC::NetworkInterfaces

Public Instance Methods

attach() click to toggle source
# File lib/awscli/cli/ec2/vpc/net_interfaces.rb, line 35
def attach
  create_ec2_object
  @ec2.attach options[:network_interface_id], options[:instance_id], options[:device_index]
end
create() click to toggle source
# File lib/awscli/cli/ec2/vpc/net_interfaces.rb, line 19
def create
  create_ec2_object
  @ec2.create options
end
deattach() click to toggle source
# File lib/awscli/cli/ec2/vpc/net_interfaces.rb, line 43
def deattach
  create_ec2_object
  @ec2.deattach options[:attachment_id], options[:force]
end
delete() click to toggle source
# File lib/awscli/cli/ec2/vpc/net_interfaces.rb, line 26
def delete
  create_ec2_object
  @ec2.delete options[:network_interface_id]
end
list() click to toggle source
# File lib/awscli/cli/ec2/vpc/net_interfaces.rb, line 9
def list
  create_ec2_object
  @ec2.list
end
modify_attribute() click to toggle source
# File lib/awscli/cli/ec2/vpc/net_interfaces.rb, line 55
def modify_attribute
  create_ec2_object
  @ec2.modify_attribute options
end

Private Instance Methods

create_ec2_object() click to toggle source
# File lib/awscli/cli/ec2/vpc/net_interfaces.rb, line 62
def create_ec2_object
  puts "ec2 Establishing Connetion..."
  $ec2_conn = if parent_options[:region]
                Awscli::Connection.new.request_ec2(parent_options[:region])
              else
                Awscli::Connection.new.request_ec2
              end
  puts "ec2 Establishing Connetion... OK"
  @ec2 = Awscli::EC2::NetworkInterfaces.new($ec2_conn)
end