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

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

Instance Attribute Summary

Attributes inherited from Fog::OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from Fog::OpenStack::Collection

#destroy, #find_by_id, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object



10
11
12
# File 'lib/fog/openstack/compute/models/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/compute/models/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::OpenStack::Compute::NotFound
  nil
end