Class: ILO_SDK::Client
- Inherits:
-
Object
- Object
- ILO_SDK::Client
- Includes:
- AccountServiceHelper, BiosHelper, BootSettingsHelper, ChassisHelper, ComputerDetailsHelper, ComputerSystemHelper, DateTimeHelper, FirmwareUpdateHelper, HttpsCertHelper, LogEntryHelper, ManagerNetworkProtocolHelper, PowerHelper, Rest, SNMPServiceHelper, SecureBootHelper, ServiceRootHelper, VirtualMediaHelper
- Defined in:
- lib/ilo-sdk/client.rb
Overview
The client defines the connection to the iLO and handles communication with it
Constant Summary
Constants included from Rest
Rest::RESPONSE_CODE_ACCEPTED, Rest::RESPONSE_CODE_BAD_REQUEST, Rest::RESPONSE_CODE_CREATED, Rest::RESPONSE_CODE_NOT_FOUND, Rest::RESPONSE_CODE_NO_CONTENT, Rest::RESPONSE_CODE_OK, Rest::RESPONSE_CODE_UNAUTHORIZED
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#password ⇒ Object
Returns the value of attribute password.
-
#ssl_enabled ⇒ Object
Returns the value of attribute ssl_enabled.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
Create a client object.
Methods included from HttpsCertHelper
#generate_csr, #get_certificate, #get_csr, #import_certificate
Methods included from ServiceRootHelper
Methods included from ChassisHelper
#get_power_metrics, #get_thermal_metrics
Methods included from ComputerSystemHelper
#get_asset_tag, #get_indicator_led, #set_asset_tag, #set_indicator_led
Methods included from VirtualMediaHelper
#eject_virtual_media, #get_virtual_media, #insert_virtual_media, #virtual_media_inserted?
Methods included from FirmwareUpdateHelper
#get_fw_version, #set_fw_upgrade
Methods included from BootSettingsHelper
#get_boot_baseconfig, #get_boot_order, #get_temporary_boot_order, #revert_boot, #set_boot_order, #set_temporary_boot_order
Methods included from BiosHelper
#get_bios_baseconfig, #get_bios_dhcp, #get_bios_service, #get_uefi_shell_startup, #get_url_boot_file, #revert_bios, #set_bios_dhcp, #set_bios_service, #set_uefi_shell_startup, #set_url_boot_file
Methods included from SecureBootHelper
#get_uefi_secure_boot, #set_uefi_secure_boot
Methods included from LogEntryHelper
#clear_logs, #get_logs, #logs_empty?
Methods included from AccountServiceHelper
#change_password, #create_user, #delete_user, #get_users, #userhref
Methods included from PowerHelper
#get_power_state, #reset_ilo, #set_power_state
Methods included from SNMPServiceHelper
#get_snmp_alerts_enabled, #get_snmp_mode, #set_snmp
Methods included from ComputerDetailsHelper
#get_array_controller_details, #get_computer_details, #get_computer_network_details, #get_general_computer_details
Methods included from DateTimeHelper
#get_ntp, #get_ntp_servers, #get_time_zone, #set_ntp, #set_ntp_servers, #set_time_zone
Methods included from ManagerNetworkProtocolHelper
Methods included from Rest
#response_handler, #rest_api, #rest_delete, #rest_get, #rest_patch, #rest_post, #rest_put
Constructor Details
#initialize(options = {}) ⇒ Client
Create a client object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ilo-sdk/client.rb', line 31 def initialize( = {}) = Hash[.map { |k, v| [k.to_sym, v] }] # Convert string hash keys to symbols @logger = [:logger] || Logger.new(STDOUT) [:debug, :info, :warn, :error, :level=].each { |m| raise "Logger must respond to #{m} method " unless @logger.respond_to?(m) } @log_level = [:log_level] || :info @logger.level = @logger.class.const_get(@log_level.upcase) rescue @log_level @host = [:host] raise 'Must set the host option' unless @host @host = 'https://' + @host unless @host.start_with?('http://', 'https://') @ssl_enabled = [:ssl_enabled].nil? ? true : [:ssl_enabled] raise 'ssl_enabled option must be either true or false' unless [true, false].include?(@ssl_enabled) @logger.warn 'User option not set. Using default (Administrator)' unless [:user] @user = [:user] || 'Administrator' @password = [:password] raise 'Must set the password option' unless @password end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
20 21 22 |
# File 'lib/ilo-sdk/client.rb', line 20 def host @host end |
#log_level ⇒ Object
Returns the value of attribute log_level.
20 21 22 |
# File 'lib/ilo-sdk/client.rb', line 20 def log_level @log_level end |
#logger ⇒ Object
Returns the value of attribute logger.
20 21 22 |
# File 'lib/ilo-sdk/client.rb', line 20 def logger @logger end |
#password ⇒ Object
Returns the value of attribute password.
20 21 22 |
# File 'lib/ilo-sdk/client.rb', line 20 def password @password end |
#ssl_enabled ⇒ Object
Returns the value of attribute ssl_enabled.
20 21 22 |
# File 'lib/ilo-sdk/client.rb', line 20 def ssl_enabled @ssl_enabled end |
#user ⇒ Object
Returns the value of attribute user.
20 21 22 |
# File 'lib/ilo-sdk/client.rb', line 20 def user @user end |