Class: ZAWS::Command::Vpc

Inherits:
Thor
  • Object
show all
Defined in:
lib/zaws/command/vpc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Vpc

Returns a new instance of Vpc.



13
14
15
16
17
18
19
20
# File 'lib/zaws/command/vpc.rb', line 13

def initialize(*args)
  super
  shellout=ZAWS::Helper::Shell.new
  awscli = ZAWS::AWSCLI.new(shellout,false)
  @aws = ZAWS::AWS.new(shellout, awscli)
  @out = $stdout
  @print_exit_code = false
end

Instance Attribute Details

#awsObject

Returns the value of attribute aws.



9
10
11
# File 'lib/zaws/command/vpc.rb', line 9

def aws
  @aws
end

#outObject

Returns the value of attribute out.



10
11
12
# File 'lib/zaws/command/vpc.rb', line 10

def out
  @out
end

Returns the value of attribute print_exit_code.



11
12
13
# File 'lib/zaws/command/vpc.rb', line 11

def print_exit_code
  @print_exit_code
end

Instance Method Details

#check_management_dataObject



30
31
32
# File 'lib/zaws/command/vpc.rb', line 30

def check_management_data
  @aws.ec2.vpc.check_management_data(options[:region],  @out, (options[:verbose] ? @out : nil), options[:profile])
end

#declare(cidr, externalid) ⇒ Object



37
38
39
40
41
# File 'lib/zaws/command/vpc.rb', line 37

def declare(cidr,externalid)
  exitcode= @aws.ec2.vpc.declare(options[:region],cidr, externalid,options[:availabilitytimeout], @out, (options[:verbose] ? @out : nil), options[:profile])
  exit exitcode unless @print_exit_code
@out.puts(exitcode)
end

#viewObject



24
25
26
# File 'lib/zaws/command/vpc.rb', line 24

def view
  @aws.ec2.vpc.view(options[:region], options[:viewtype], @out, (options[:verbose] ? @out : nil))
end

#view_peeringObject



45
46
47
# File 'lib/zaws/command/vpc.rb', line 45

def view_peering
  @aws.ec2.vpc.view_peering(options[:region], options[:viewtype], @out, (options[:verbose] ? @out : nil))
end