Class: Fog::AWS::EC2::SecurityGroup
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::EC2::SecurityGroup
show all
- Defined in:
- lib/fog/aws/models/ec2/security_group.rb
Instance Attribute Summary
Attributes inherited from Model
#connection
Instance Method Summary
collapse
Methods inherited from Model
#_dump, _load, aliases, attribute, attributes, #attributes, #collection, identity, #identity, #initialize, #inspect, #merge_attributes, #new_record?, #reload, #requires, #wait_for
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#authorize_group_and_owner(group, owner) ⇒ Object
13
14
15
16
17
18
19
20
21
|
# File 'lib/fog/aws/models/ec2/security_group.rb', line 13
def authorize_group_and_owner(group, owner)
requires :name
connection.authorize_security_group_ingress(
'GroupName' => @name,
'SourceSecurityGroupName' => group,
'SourceSecurityGroupOwnerId' => owner
)
end
|
#authorize_port_range(range, options = {}) ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/fog/aws/models/ec2/security_group.rb', line 23
def authorize_port_range(range, options = {})
requires :name
connection.authorize_security_group_ingress(
'CidrIp' => options[:cidr_ip] || '0.0.0.0/0',
'FromPort' => range.min,
'GroupName' => @name,
'ToPort' => range.max,
'IpProtocol' => options[:ip_protocol] || 'tcp'
)
end
|
#destroy ⇒ Object
35
36
37
38
39
40
|
# File 'lib/fog/aws/models/ec2/security_group.rb', line 35
def destroy
requires :name
connection.delete_security_group(@name)
true
end
|
#save ⇒ Object
42
43
44
45
46
47
|
# File 'lib/fog/aws/models/ec2/security_group.rb', line 42
def save
requires :name
data = connection.create_security_group(@name, @description).body
true
end
|