Class: SolusVM::Client
Overview
SolusVM::Client is the class for working with clients.
Constant Summary
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) authenticate(username, password)
Verify a client's login.
-
- (Object) change_password(username, new_password)
Change client password for the Solus admin.
-
- (Object) create(options = {})
Creates a client.
-
- (Object) delete(username)
Deletes an existing client.
-
- (Boolean) exists?(username)
Checks if a specific client exists.
-
- (Object) list
Lists existing clients.
Methods inherited from Base
#api_endpoint, #api_id, #api_key, #api_login, #api_options, #conn, #initialize, #log_messages, #parse_error, #parse_response, #parse_returned_params_as_list, #perform_request, #ssl_option, #statusmsg, #successful?, #validate_server_type
Constructor Details
This class inherits a constructor from SolusVM::Base
Instance Method Details
- (Object) authenticate(username, password)
Verify a client's login.
46 47 48 |
# File 'lib/solusvm/client.rb', line 46 def authenticate(username, password) perform_request(action: 'client-authenticate', username: username, password: password) end |
- (Object) change_password(username, new_password)
Change client password for the Solus admin.
26 27 28 |
# File 'lib/solusvm/client.rb', line 26 def change_password(username, new_password) perform_request(action: "client-updatepassword", username: username, password: new_password) end |
- (Object) create(options = {})
Creates a client.
16 17 18 |
# File 'lib/solusvm/client.rb', line 16 def create( = {}) perform_request(.merge(action: 'client-create')) && returned_parameters end |
- (Object) delete(username)
Deletes an existing client.
55 56 57 |
# File 'lib/solusvm/client.rb', line 55 def delete(username) perform_request(action: "client-delete", username: username) end |
- (Boolean) exists?(username)
Checks if a specific client exists.
35 36 37 38 |
# File 'lib/solusvm/client.rb', line 35 def exists?(username) perform_request(action: 'client-checkexists', username: username) !!statusmsg.match(/Client exists/i) end |
- (Object) list
Lists existing clients.
62 63 64 65 |
# File 'lib/solusvm/client.rb', line 62 def list perform_request(action: "client-list") returned_parameters["clients"] end |