Class: Fog::Compute::HP::SecurityGroup
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::HP::SecurityGroup
- Defined in:
- lib/fog/hp/models/compute/security_group.rb
Instance Method Summary collapse
- #create_rule(range, ip_protocol = "tcp", cidr = "0.0.0.0/0", group_id = nil) ⇒ Object
- #delete_all_rules ⇒ Object
- #delete_rule(rule_id) ⇒ Object
- #destroy ⇒ Object
- #save ⇒ Object
Instance Method Details
#create_rule(range, ip_protocol = "tcp", cidr = "0.0.0.0/0", group_id = nil) ⇒ Object
29 30 31 32 |
# File 'lib/fog/hp/models/compute/security_group.rb', line 29 def create_rule(range, ip_protocol = "tcp", cidr = "0.0.0.0/0", group_id=nil) requires :id service.create_security_group_rule(id, ip_protocol, range.min, range.max, cidr, group_id) end |
#delete_all_rules ⇒ Object
39 40 41 42 43 44 |
# File 'lib/fog/hp/models/compute/security_group.rb', line 39 def delete_all_rules() self.rules.each do |rule| delete_rule(rule['id']) end true end |
#delete_rule(rule_id) ⇒ Object
34 35 36 37 |
# File 'lib/fog/hp/models/compute/security_group.rb', line 34 def delete_rule(rule_id) service.delete_security_group_rule(rule_id) true end |
#destroy ⇒ Object
14 15 16 17 18 19 |
# File 'lib/fog/hp/models/compute/security_group.rb', line 14 def destroy requires :id service.delete_security_group(id) true end |
#save ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/fog/hp/models/compute/security_group.rb', line 21 def save requires :name, :description data = service.create_security_group(name, description) merge_attributes(data.body['security_group']) true end |