Class: ZAWS::Command::Vpc
- Inherits:
-
Thor
- Object
- Thor
- ZAWS::Command::Vpc
- Defined in:
- lib/zaws/command/vpc.rb
Instance Attribute Summary collapse
-
#aws ⇒ Object
Returns the value of attribute aws.
-
#out ⇒ Object
Returns the value of attribute out.
-
#print_exit_code ⇒ Object
Returns the value of attribute print_exit_code.
Instance Method Summary collapse
- #check_management_data ⇒ Object
- #declare(cidr, externalid) ⇒ Object
-
#initialize(*args) ⇒ Vpc
constructor
A new instance of Vpc.
- #view ⇒ Object
- #view_peering ⇒ Object
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
#aws ⇒ Object
Returns the value of attribute aws.
9 10 11 |
# File 'lib/zaws/command/vpc.rb', line 9 def aws @aws end |
#out ⇒ Object
Returns the value of attribute out.
10 11 12 |
# File 'lib/zaws/command/vpc.rb', line 10 def out @out end |
#print_exit_code ⇒ Object
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_data ⇒ Object
30 31 32 |
# File 'lib/zaws/command/vpc.rb', line 30 def check_management_data @aws.ec2.vpc.check_management_data([:region], @out, ([:verbose] ? @out : nil), [: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([:region],cidr, externalid,[:availabilitytimeout], @out, ([:verbose] ? @out : nil), [:profile]) exit exitcode unless @print_exit_code @out.puts(exitcode) end |
#view ⇒ Object
24 25 26 |
# File 'lib/zaws/command/vpc.rb', line 24 def view @aws.ec2.vpc.view([:region], [:viewtype], @out, ([:verbose] ? @out : nil)) end |
#view_peering ⇒ Object
45 46 47 |
# File 'lib/zaws/command/vpc.rb', line 45 def view_peering @aws.ec2.vpc.view_peering([:region], [:viewtype], @out, ([:verbose] ? @out : nil)) end |