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

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

Instance Method Summary collapse

Instance Method Details

#allObject



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

def all
  load(service.list_security_groups.body['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