Class: ZAWS::External::AWSCLI::Commands::EC2::DescribeSecurityGroups

Inherits:
Data::EC2::SecurityGroup show all
Defined in:
lib/zaws/external/awscli/commands/ec2/describe_security_groups.rb

Instance Method Summary collapse

Methods inherited from Data::EC2::SecurityGroup

#exists, #load, #validJSON, #view

Constructor Details

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

Returns a new instance of DescribeSecurityGroups.



11
12
13
14
15
16
# File 'lib/zaws/external/awscli/commands/ec2/describe_security_groups.rb', line 11

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

Instance Method Details

#awsObject



23
24
25
26
# File 'lib/zaws/external/awscli/commands/ec2/describe_security_groups.rb', line 23

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

#clear_settingsObject



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

def clear_settings
  @aws=nil
  @filter=nil
end

#execute(verbose = nil) ⇒ Object



18
19
20
21
# File 'lib/zaws/external/awscli/commands/ec2/describe_security_groups.rb', line 18

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

#filterObject



28
29
30
31
# File 'lib/zaws/external/awscli/commands/ec2/describe_security_groups.rb', line 28

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

#get_commandObject



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

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