class Solusvm::Client
Solusvm::Client
is the class for working with clients.
Public Instance Methods
authenticate(username, password)
click to toggle source
Verify a clients login. Returns true when the specified login is correct.
# File lib/solusvm/client.rb, line 29 def authenticate(username, password) perform_request({action: 'client-authenticate', username: username, password: password}) end
change_password(username, new_password)
click to toggle source
Change client password for the solus admin.
# File lib/solusvm/client.rb, line 19 def change_password(username, new_password) perform_request({action: "client-updatepassword", username: username, password: new_password}) end
create(options ={})
click to toggle source
Creates a client.
Options:
-
:username
-
:password
-
:email
-
:firstname
-
:lastname
-
:company
# File lib/solusvm/client.rb, line 14 def create(options ={}) perform_request(options.merge(action: 'client-create')) && returned_parameters end
delete(username)
click to toggle source
Deletes an existing client.
# File lib/solusvm/client.rb, line 34 def delete(username) perform_request({action: "client-delete", username: username}) end
exists?(username)
click to toggle source
Checks wether a specific client exists.
# File lib/solusvm/client.rb, line 24 def exists?(username) perform_request({action: 'client-checkexists', username: username}) end
list()
click to toggle source
Lists existing clients.
# File lib/solusvm/client.rb, line 39 def list perform_request({action: "client-list"}, "client") if returned_parameters["clients"] && returned_parameters["clients"]["client"] returned_parameters["clients"]["client"] elsif returned_parameters["clients"] [] end end