Class: Fog::Compute::OpenStack::SecurityGroups

Inherits:
OpenStack::Collection show all
Defined in:
lib/fog/openstack/models/compute/security_groups.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

#destroy, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object



10
11
12
# File 'lib/fog/openstack/models/compute/security_groups.rb', line 10

def all(options = {})
  load_response(service.list_security_groups(options), 'security_groups')
end

#get(security_group_id) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/fog/openstack/models/compute/security_groups.rb', line 14

def get(security_group_id)
  if security_group_id
    new(service.get_security_group(security_group_id).body['security_group'])
  end
rescue Fog::Compute::OpenStack::NotFound
  nil
end