Class: ZAWS::External::AWSCLI::Commands::EC2::DescribeImages

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DescribeImages.



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

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

Instance Method Details

#awsObject



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

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

#clear_settingsObject



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

def clear_settings
  @aws=nil
  @filter=nil
  @owner=nil
  @image_ids=nil
  self
end

#filterObject



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

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

#get_commandObject



43
44
45
46
47
48
49
# File 'lib/zaws/external/awscli/commands/ec2/describe_images.rb', line 43

def get_command
  command = "ec2 describe-images"
  command = "#{command} --owner #{@owner}" if @owner
  command = "#{command} --image-ids #{@image_ids}" if @image_ids
  command = "#{command} #{@filter.get_command}" if @filter
  return command
end

#image_ids(id) ⇒ Object



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

def image_ids(id)
  @image_ids=id
  self
end

#owner(owner) ⇒ Object



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

def owner(owner)
  @owner=owner
  self
end