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

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

Overview

class User model

Instance Method Summary collapse

Instance Method Details

#change_passwordObject



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

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

#destroyObject



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

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

#save(options = {}) ⇒ Object



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

def save(options = {})
  service.create_user(attributes.merge(options))
  reload
end

#updateObject



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

def update
  requires :userid
  service.update_user(userid, attributes.reject { |attribute| [:userid].include? attribute })
  reload
end