Class: Fog::Identity::Proxmox::User

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

Overview

class User model

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

#change_passwordObject


66
67
68
69
70
# File 'lib/fog/identity/proxmox/models/user.rb', line 66

def change_password
  requires :userid
  requires :password
  service.change_password(userid, password)
end

#create(new_attributes = {}) ⇒ Object


50
51
52
# File 'lib/fog/identity/proxmox/models/user.rb', line 50

def create(new_attributes = {})
  service.create_user(attributes.merge(new_attributes))
end

#destroyObject


54
55
56
57
58
# File 'lib/fog/identity/proxmox/models/user.rb', line 54

def destroy
  requires :userid
  service.delete_user(userid)
  true
end

#to_sObject


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

def to_s
  userid
end

#updateObject


60
61
62
63
64
# File 'lib/fog/identity/proxmox/models/user.rb', line 60

def update
  requires :userid
  attr = attributes.reject { |key, _value| key == :userid }
  service.update_user(userid, attr)
end