Class: Fog::Compute::HP::SecurityGroups

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

Instance Method Summary collapse

Instance Method Details

#allObject



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

def all
  items = service.list_security_groups.body['security_groups']
  load(items)
end

#get(security_group_id) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/fog/hp/models/compute/security_groups.rb', line 15

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