Class: Fog::Compute::Cloudstack::SecurityGroup
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Cloudstack::SecurityGroup
- Defined in:
- lib/fog/cloudstack/models/compute/security_group.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
16 17 18 19 20 |
# File 'lib/fog/cloudstack/models/compute/security_group.rb', line 16 def destroy requires :id service.delete_security_group('id' => self.id) true end |
#egress_rules ⇒ Object
22 23 24 |
# File 'lib/fog/cloudstack/models/compute/security_group.rb', line 22 def egress_rules attributes[:egress_rules] || [] end |
#ingress_rules ⇒ Object
26 27 28 |
# File 'lib/fog/cloudstack/models/compute/security_group.rb', line 26 def ingress_rules attributes[:ingress_rules] || [] end |
#rules ⇒ Object
44 45 46 |
# File 'lib/fog/cloudstack/models/compute/security_group.rb', line 44 def rules service.security_group_rules.all("security_group_id" => self.id) end |
#save ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fog/cloudstack/models/compute/security_group.rb', line 30 def save requires :name = { 'name' => self.name, 'account' => self.account, 'description' => self.description, 'projectid' => self.project_id, 'domainid' => self.domain_id, } data = service.create_security_group() merge_attributes(data['createsecuritygroupresponse']['securitygroup']) end |