Class: ZAWS::External::AWSCLI::Commands::EC2::CreateSecurityGroup

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CreateSecurityGroup.



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

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

Instance Method Details

#awsObject



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

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

#clear_settingsObject



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

def clear_settings
  @aws=nil
  @vpc_id=nil
  @group_name=nil
  @description=nil
end

#description(description) ⇒ Object



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

def description(description)
  @description=description
  self
end

#get_commandObject



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

def get_command
  command = "ec2 create-security-group"
  command = "#{command} --vpc-id #{@vpc_id}" if @vpc_id
  command = "#{command} --group-name #{@group_name}" if @group_name
  command = "#{command} --description '#{@description}'" if @description
  return command
end

#group_name(name) ⇒ Object



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

def group_name(name)
  @group_name=name
  self
end

#vpc_id(vpc_id) ⇒ Object



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

def vpc_id(vpc_id)
  @vpc_id=vpc_id
  self
end