Class: Fog::Compute::Cloudstack::SecurityGroupRule
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Cloudstack::SecurityGroupRule
- Defined in:
- lib/fog/cloudstack/models/compute/security_group_rule.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
14 15 16 17 18 19 |
# File 'lib/fog/cloudstack/models/compute/security_group_rule.rb', line 14 def destroy data = service.send("revoke_security_group_#{self.direction}", "id" => self.id) job = service.jobs.new(data["revokesecuritygroup#{self.direction}"]) job.wait_for { ready? } job.successful? end |
#port_range ⇒ Object
21 22 23 |
# File 'lib/fog/cloudstack/models/compute/security_group_rule.rb', line 21 def port_range (self.start_port..self.end_port) end |
#reload ⇒ Object
40 41 42 43 44 |
# File 'lib/fog/cloudstack/models/compute/security_group_rule.rb', line 40 def reload requires :id, :security_group_id, :cidr merge_attributes(security_group.rules.get(self.id)) end |
#save ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fog/cloudstack/models/compute/security_group_rule.rb', line 25 def save requires :security_group_id, :cidr, :direction data = service.send("authorize_security_group_#{self.direction}".to_sym, params) job = service.jobs.new(data["authorizesecuritygroup#{self.direction}response"]) job.wait_for { ready? } # durty merge_attributes(job.result.send("#{self.direction}_rules").last) self end |
#security_group ⇒ Object
36 37 38 |
# File 'lib/fog/cloudstack/models/compute/security_group_rule.rb', line 36 def security_group service.security_groups.get(self.security_group_id) end |