Class: Fog::Identity::OpenStack::V3::Domain

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/openstack/models/identity_v3/domain.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Class Method Details

.use_cache(cache) ⇒ Object



42
43
44
# File 'lib/fog/openstack/models/identity_v3/domain.rb', line 42

def self.use_cache(cache)
  @@cache = cache
end

Instance Method Details

#createObject



34
35
36
37
38
39
40
# File 'lib/fog/openstack/models/identity_v3/domain.rb', line 34

def create
  @@cache.clear if @@cache
  requires :name
  merge_attributes(
      service.create_domain(attributes).body['domain'])
  self
end

#destroyObject



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

def destroy
  @@cache.clear if @@cache
  requires :id
  service.delete_domain(self.id)
  true
end

#to_sObject



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

def to_s
  self.name
end

#update(attr = nil) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/openstack/models/identity_v3/domain.rb', line 26

def update(attr = nil)
  @@cache.clear if @@cache
  requires :id, :name
  merge_attributes(
      service.update_domain(self.id, attr || attributes).body['domain'])
  self
end