Class: ZAWS::AWSCLI::Commands::EC2::DescribeVPCs

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

Instance Method Summary collapse

Constructor Details

#initialize(shellout, awscli) ⇒ DescribeVPCs

Returns a new instance of DescribeVPCs.



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

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

Instance Method Details

#execute(region, view, filters, verbose = nil, profile = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/zaws/external/awscli/commands/ec2/describe_vpcs.rb', line 12

def execute(region, view, filters, verbose=nil,profile=nil)
  profile_opt=profile.nil? ? '' :" --profile #{profile}"
  comline="aws --output #{view} --region #{region} ec2 describe-vpcs#{profile_opt}"
  comline = comline + " --filters" if filters.length > 0
  filters.each do |key, item|
    comline = comline + " \"Name=#{key},Values=#{item}\""
  end
  @awscli.data_ec2.vpc.load(comline, @shellout.cli(comline, verbose),verbose)
end