Class: Fog::Identity::Proxmox::Domain

Inherits:
Proxmox::Model show all
Defined in:
lib/fog/identity/proxmox/models/domain.rb

Overview

class Domain model authentication

Instance Method Summary collapse

Methods inherited from Proxmox::Model

#initialize, #inspect

Constructor Details

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

Instance Method Details

#create(new_attributes = {}) ⇒ Object


41
42
43
44
# File 'lib/fog/identity/proxmox/models/domain.rb', line 41

def create(new_attributes = {})
  attr = type.attributes.merge(new_attributes).merge(realm: realm)
  service.create_domain(attr)
end

#destroyObject


46
47
48
49
50
# File 'lib/fog/identity/proxmox/models/domain.rb', line 46

def destroy
  requires :realm
  service.delete_domain(realm)
  true
end

#to_sObject


37
38
39
# File 'lib/fog/identity/proxmox/models/domain.rb', line 37

def to_s
  realm
end

#updateObject


52
53
54
55
56
57
# File 'lib/fog/identity/proxmox/models/domain.rb', line 52

def update
  requires :realm
  attr = type.attributes
  attr.delete_if { |key, _value| key == :type }
  service.update_domain(realm, attr)
end