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

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

Instance Attribute Summary

Attributes inherited from Collection

#response

Instance Method Summary collapse

Methods inherited from Collection

#find_by_id, #load_response, #summary

Instance Method Details

#all(_options = {}) ⇒ Object



10
11
12
# File 'lib/fog/openstack/introspection/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/openstack/introspection/models/rules_collection.rb', line 21

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

#destroy_allObject



26
27
28
# File 'lib/fog/openstack/introspection/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/openstack/introspection/models/rules_collection.rb', line 14

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