Class: Fog::Compute::Cloudstack::SecurityGroup
- Defined in:
- lib/fog/cloudstack/models/compute/security_group.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Fog::Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
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 |