1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
require 'fog/openstack/models/collection'
require 'fog/openstack/introspection/models/rules'
module Fog
module OpenStack
class Introspection
class RulesCollection < Fog::OpenStack::Collection
model Fog::OpenStack::Introspection::Rules
def all(_options = {})
load_response(service.list_rules, 'rules')
end
def get(uuid)
data = service.get_rules(uuid).body
new(data)
rescue Fog::OpenStack::Introspection::NotFound
nil
end
def destroy(uuid)
rules = get(uuid)
rules.destroy
end
def destroy_all
service.delete_rules_all
end
end
end
end
end
|