Class: Fog::Compute::OpenStack::SecurityGroup
- Defined in:
- lib/fog/openstack/models/compute/security_group.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #create_security_group_rule(min, max, ip_protocol = "tcp", cidr = "0.0.0.0/0", group_id = nil) ⇒ Object
- #delete_security_group_rule(rule_id) ⇒ Object
- #destroy ⇒ Object
- #save ⇒ Object
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
#create_security_group_rule(min, max, ip_protocol = "tcp", cidr = "0.0.0.0/0", group_id = nil) ⇒ Object
31 32 33 34 |
# File 'lib/fog/openstack/models/compute/security_group.rb', line 31 def create_security_group_rule(min, max, ip_protocol = "tcp", cidr = "0.0.0.0/0", group_id = nil) requires :id service.create_security_group_rule(id, ip_protocol, min, max, cidr, group_id) end |
#delete_security_group_rule(rule_id) ⇒ Object
36 37 38 39 |
# File 'lib/fog/openstack/models/compute/security_group.rb', line 36 def delete_security_group_rule(rule_id) service.delete_security_group_rule(rule_id) true end |
#destroy ⇒ Object
25 26 27 28 29 |
# File 'lib/fog/openstack/models/compute/security_group.rb', line 25 def destroy requires :id service.delete_security_group(id) true end |
#save ⇒ Object
17 18 19 20 21 22 |
# File 'lib/fog/openstack/models/compute/security_group.rb', line 17 def save requires :name, :description data = service.create_security_group(name, description) merge_attributes(data.body['security_group']) true end |