Class: ZAWS::External::AWSCLI::Commands::EC2::AssociateAddress

Inherits:
Object
  • Object
show all
Defined in:
lib/zaws/external/awscli/commands/ec2/associate_address.rb

Instance Method Summary collapse

Constructor Details

#initialize(shellout = nil, awscli = nil) ⇒ AssociateAddress

Returns a new instance of AssociateAddress.



7
8
9
10
11
12
# File 'lib/zaws/external/awscli/commands/ec2/associate_address.rb', line 7

def initialize(shellout=nil, awscli=nil)
  @shellout=shellout
  @awscli=awscli
  clear_settings
  self
end

Instance Method Details

#allocation_id(id) ⇒ Object



31
32
33
34
# File 'lib/zaws/external/awscli/commands/ec2/associate_address.rb', line 31

def allocation_id(id)
  @allocation_id=id
  self
end

#awsObject



14
15
16
17
# File 'lib/zaws/external/awscli/commands/ec2/associate_address.rb', line 14

def aws
  @aws ||= ZAWS::External::AWSCLI::Commands::AWS.new(self)
  @aws
end

#clear_settingsObject



19
20
21
22
23
24
# File 'lib/zaws/external/awscli/commands/ec2/associate_address.rb', line 19

def clear_settings
  @instance_id=nil
  @allocation_id=nil
  @aws=nil
  self
end

#get_commandObject



36
37
38
39
40
41
# File 'lib/zaws/external/awscli/commands/ec2/associate_address.rb', line 36

def get_command
  command = "ec2 associate-address"
  command = "#{command} --instance-id #{@instance_id}" if @instance_id
  command = "#{command} --allocation-id #{@allocation_id}" if @allocation_id
  return command
end

#instance_id(id) ⇒ Object



26
27
28
29
# File 'lib/zaws/external/awscli/commands/ec2/associate_address.rb', line 26

def instance_id(id)
  @instance_id=id
  self
end