Class: Fog::Introspection::OpenStack::RulesCollection

Inherits:
OpenStack::Collection show all
Defined in:
lib/fog/introspection/openstack/models/rules_collection.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

#find_by_id, #load_response, #summary

Instance Method Details

#all(_options = {}) ⇒ Object


10
11
12
# File 'lib/fog/introspection/openstack/models/rules_collection.rb', line 10

def all(_options = {})
  load_response(service.list_rules, 'rules')
end

#destroy(uuid) ⇒ Object


21
22
23
24
# File 'lib/fog/introspection/openstack/models/rules_collection.rb', line 21

def destroy(uuid)
  rules = get(uuid)
  rules.destroy
end

#destroy_allObject


26
27
28
# File 'lib/fog/introspection/openstack/models/rules_collection.rb', line 26

def destroy_all
  service.delete_rules_all
end

#get(uuid) ⇒ Object


14
15
16
17
18
19
# File 'lib/fog/introspection/openstack/models/rules_collection.rb', line 14

def get(uuid)
  data = service.get_rules(uuid).body
  new(data)
rescue Fog::Introspection::OpenStack::NotFound
  nil
end