Class: ZAWS::External::AWSCLI::Commands::EC2::AuthorizeSecurityGroupIngress

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of AuthorizeSecurityGroupIngress.



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

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

Instance Method Details

#awsObject



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

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

#cidr(cidr) ⇒ Object



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

def cidr(cidr)
  @cidr=cidr
  self
end

#clear_settingsObject



19
20
21
22
23
24
25
26
27
# File 'lib/zaws/external/awscli/commands/ec2/authorize_security_group_ingress.rb', line 19

def clear_settings
  @group_id=nil
  @cidr=nil
  @protocol=nil
  @port=nil
  @aws=nil
  @source_group=nil
  self
end

#get_commandObject



54
55
56
57
58
59
60
61
62
# File 'lib/zaws/external/awscli/commands/ec2/authorize_security_group_ingress.rb', line 54

def get_command
  command = "ec2 authorize-security-group-ingress"
  command = "#{command} --group-id #{@group_id}" if @group_id
  command = "#{command} --source-group #{@source_group}" if @source_group
  command = "#{command} --cidr #{@cidr}" if @cidr
  command = "#{command} --protocol #{@protocol}" if @protocol
  command = "#{command} --port #{@port}" if @port
  return command
end

#group_id(id) ⇒ Object



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

def group_id(id)
  @group_id=id
  self
end

#port(port) ⇒ Object



49
50
51
52
# File 'lib/zaws/external/awscli/commands/ec2/authorize_security_group_ingress.rb', line 49

def port(port)
  @port=port
  self
end

#protocol(protocol) ⇒ Object



44
45
46
47
# File 'lib/zaws/external/awscli/commands/ec2/authorize_security_group_ingress.rb', line 44

def protocol(protocol)
  @protocol=protocol
  self
end

#source_group(group) ⇒ Object



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

def source_group(group)
  @source_group=group
  self
end