Class: ZAWS::External::AWSCLI::Commands::EC2::CreateRoute

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CreateRoute.



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

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

Instance Method Details

#awsObject



14
15
16
17
# File 'lib/zaws/external/awscli/commands/ec2/create_route.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/create_route.rb', line 19

def clear_settings
  @aws=nil
  @route_table_id=nil
  @dest_cidr_block=nil
  @instance_id=nil
end

#destination_cidr_block(cidr) ⇒ Object



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

def destination_cidr_block(cidr)
  @dest_cidr_block=cidr
  self
end

#gateway_id(id) ⇒ Object



41
42
43
44
# File 'lib/zaws/external/awscli/commands/ec2/create_route.rb', line 41

def gateway_id(id)
  @gateway_id=id
  self
end

#get_commandObject



46
47
48
49
50
51
52
53
# File 'lib/zaws/external/awscli/commands/ec2/create_route.rb', line 46

def get_command
  command = "ec2 create-route"
  command = "#{command} --route-table-id #{@route_table_id}" if @route_table_id
  command = "#{command} --destination-cidr-block #{@dest_cidr_block}" if @dest_cidr_block
  command = "#{command} --instance-id #{@instance_id}" if @instance_id
  command = "#{command} --gateway-id #{@gateway_id}" if @gateway_id
  return command
end

#instance_id(id) ⇒ Object



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

def instance_id(id)
  @instance_id=id
  self
end

#route_table_id(id) ⇒ Object



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

def route_table_id(id)
  @route_table_id=id
  self
end