Class: ZAWS::External::AWSCLI::Commands::EC2::DescribeSubnets

Inherits:
AWSCLI::Data::EC2::Subnet show all
Defined in:
lib/zaws/external/awscli/commands/ec2/describe_subnets.rb

Instance Method Summary collapse

Methods inherited from AWSCLI::Data::EC2::Subnet

#available, #id_by_cidrblock, #id_by_ip, #load, #validJSON, #view

Constructor Details

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

Returns a new instance of DescribeSubnets.



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

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

Instance Method Details

#awsObject



10
11
12
13
# File 'lib/zaws/external/awscli/commands/ec2/describe_subnets.rb', line 10

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

#clear_settingsObject



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

def clear_settings
  @aws=nil
  @filter=nil
end

#execute(verbose = nil) ⇒ Object



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

def execute(verbose=nil)
  comline=@aws.get_command
  load(comline, @shellout.cli(comline, verbose), verbose)
end

#filterObject



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

def filter
  @filter ||= ZAWS::External::AWSCLI::Commands::EC2::Filter.new()
  @filter
end

#get_commandObject



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

def get_command
  command = "ec2 describe-subnets"
  command = "#{command} #{@filter.get_command}" if @filter
  return command
end