Class: Fog::Identity::OpenStack::V3::Domains

Inherits:
OpenStack::Collection show all
Defined in:
lib/fog/openstack/models/identity_v3/domains.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

#get, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object


11
12
13
# File 'lib/fog/openstack/models/identity_v3/domains.rb', line 11

def all(options = {})
  load_response(service.list_domains(options), 'domains')
end

#auth_domains(options = {}) ⇒ Object


15
16
17
# File 'lib/fog/openstack/models/identity_v3/domains.rb', line 15

def auth_domains(options = {})
  load(service.auth_domains(options).body['domains'])
end

#destroy(id) ⇒ Object


27
28
29
30
# File 'lib/fog/openstack/models/identity_v3/domains.rb', line 27

def destroy(id)
  domain = self.find_by_id(id)
  domain.destroy
end

#find_by_id(id) ⇒ Object


19
20
21
22
23
24
25
# File 'lib/fog/openstack/models/identity_v3/domains.rb', line 19

def find_by_id(id)
  cached_domain = self.find { |domain| domain.id == id }
  return cached_domain if cached_domain
  domain_hash = service.get_domain(id).body['domain']
  Fog::Identity::OpenStack::V3::Domain.new(
      domain_hash.merge(:service => service))
end