Dell EMC OpenManage Python Software Development Kit Version 1.0 API Reference Guide February 2018 Rev.
Notes, cautions, and warnings NOTE: A NOTE indicates important information that helps you make better use of your product. CAUTION: A CAUTION indicates either potential damage to hardware or loss of data and tells you how to avoid the problem. WARNING: A WARNING indicates a potential for property damage, personal injury, or death. © 2018 Dell Inc. or its subsidiaries. All rights reserved. Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries.
Contents Chapter 1: Introduction to OpenManage python software development toolkit.............................. 4 SDK concepts and architectural components.............................................................................................................. 4 Chapter 2: Installation and Uninstallation of OMPSDK...................................................................5 Chapter 3: OpenManage Python SDK API introduction..................................................................
1 Introduction to OpenManage python software development toolkit DellEMC OpenManage python software development kit (OMPSDK) is a library for programatically managing DellEMC Servers and Chassis. Using this library a user can perform lifecycle operations on DellEMC PowerEdge servers, chassis storage and switches.
2 Installation and Uninstallation of OMPSDK Installing OMPSDK To install OMPSDK, there are some prerequisites which are essential. Prerequisites: Ensure that you have the following: ● Python v2.7 or v3.4 and above. ● Package management system (pip). Run the following command pip install omsdk OMPSDK is installed and the package is available in PyPI (Python package Index).
3 OpenManage Python SDK API introduction OpenManage Python SDK (OMPSDK) API Module allows data center and IT administrators to automate and orchestrate the provisioning, configuration, deployment, and update of Dell EMC PowerEdge Servers (12th generation of PowerEdge servers and later) by using the management automation capabilities in-built into the integrated Dell remote access controller (iDRAC). This product evolves conservatively and values simplicity in design and setup.
Table 3. Parameter for Protocol preference Parameter Name Type Allowed Values protopref Enumeration of preferred protocol Description The preferred protocol used if the device supports the protocol. ProtocolEnum.WSMAN ProtocolEnum.SNMP ProtocolEnum.REDFISH Table 4. Parameter for protocol specific options Parameter Name Type Allowed Values pOptions Dictionary of protocol-specific options Description A protocol-specific option for passed, port, timeout and so on.
Table 7. Parameters for credentials Parameter Name Type Allowed Values creds Dictionary of credentials Description A bundle of credentials to find the device driver. Snmpv2Credentials UserCredentials Snmpv2Credentials UserCredentials Table 8. Parameters for preferred protocol Parameter Name Type Allowed Values protopref Enumeration of preferred protocol NA Description The preferred protocol used if the device supports the protocol. Table 9.
Table 11. Parameters for Sdkbase.iBaseDriver.get_partial_entityjson Parameter Name Type Allowed Values en iDRACCompEnum CMCCompEnum iDRAC CMC iDRACCompEnum.BIOS iDRACCompEnum.Controlle rBattery iDRACCompEnum.Controlle r iDRACCompEnum.CPU iDRACCompEnum.Enclosure iDRACCompEnum.Enclosure EMM iDRACCompEnum.Enclosure PSU iDRACCompEnum.Enclosure FanSensor iDRACCompEnum.Enclosure TempSensor iDRACCompEnum.Fan iDRACCompEnum.FC iDRACCompEnum.HostNIC iDRACCompEnum.iDRAC iDRACCompEnum.iDRACNIC iDRACCompEnum.
Table 12. Return Type Returns Return type JSON JSON Only the components passed in enumeration. Sdkbase.iBaseDriver.ContainmentTree API string/Method: Sdkbase.iBaseDriver.ContainmentTree. Description: The Sdkbase.iBaseDriver.ContainmentTree() is used to create and return the component tree of the device with keys of the Components organized in a tree structure. Sdkdevice.iDeviceDriver.get_json_device API string/Method: Sdkdevice.iDeviceDriver.get_json_device. Description: The Sdkdevice.iDeviceDriver.
Table 14. Parameter for Component (continued) Parameter Name Type Allowed Values iDRACCompEnum.NIC CMCCompEnum.System iDRACCompEnum.PCIDevice CMCCompEnum.VirtualDisk iDRACCompEnum.PowerSupply iDRACCompEnum.PresenceAndSt atusSensor iDRACCompEnum.PhysicalDisk iDRACCompEnum.Sensors_Amper age iDRACCompEnum.Sensors_Batte ry iDRACCompEnum.Sensors_Fan iDRACCompEnum.Sensors_Intru sion iDRACCompEnum.Sensors_Tempe rature iDRACCompEnum.Sensors_Volta ge iDRACCompEnum.SystemMetrics iDRACCompEnum.VFlash iDRACCompEnum.
Description: Credentials username and password for WSMAN communication with the device. Table 18. Parameters for Sdkcreds.UserCredentials Parameter Name Type username String Description User name for WSMAN communication. Table 19. Parameter for password Parameter Name Type Allowed Values password String NA Description Password for WSMAN communication. Sdkwsmanbase.WsManOptions API string/Method: Sdkwsmanbase.WsManOptions . Description: Options to establish WSMAN communication. Table 20.
Sdkredfishbase.RedfishOptions API string/Method: Sdkredfishbase.RedfishOptions. Description: Options to establish REDFISH communication. Table 26. Parameters for Sdkredfishbase.RedfishOptions Parameter Name Type authentication AuthenticationType Description HTTP authentication type Basic, Digest. Table 27. Parameter for port Parameter Name Type Allowed Values port Integer NA Description HTTPS port number for WSMAN communication. Table 28.
Table 32. Parameters for idrac.config_mgr.power_boot(PowerBootEnum.Enabled) Parameter Name Type Allowed Values power_boot(power_state) Enum PowerBootEnum Description Allows you to power On/Off the Server. Enabled Disabled Reset 1 - Reset 2 - Enabled 3 - Disabled Returns: None. Return Type: None. idrac.config_mgr.reset_idrac API string/Method: idrac.config_mgr.reset_idrac. Protocol Support: Redfish. Description: This method is used to reset the iDRAC. Parameters: Table 33. Parameters for idrac.
Table 35. Parameters for idrac.config_mgr.reset_to_factory Parameter Name Type Allowed Values preserver_config ResetToFactoryPreserveEnum ResetToFactoryPreserveEnum.ResetExceptN ICAndUsers ResetToFactoryPreserveEnum.ResetAll ResetToFactoryPreserveEnum.ResetAllExce ptDefaultUser Description Allows you to preserve the configuration 0 - ResetToFactoryPreserveEnum.ResetExceptNICAndUsers Allows you to reset the device without resetting the NIC and User settings. 1 - ResetToFactoryPreserveEnum.
Table 38. Parameters for idrac.config_mgr.scp_export Parameter Name Type include_in_expor IncludeInExportEnum t Allowed Values IncludeInExportEnum.Default IncludeInExportEnum.Include_Read_Only IncludeInExportEnum.Include_Password_Ha sh_Values IncludeInExportEnum.Include_Both This API allows you to include more while exporting the file. The additional information added with include_in_export are: Description 1 - IncludeInExportEnum.Include_Read_Only - Includes read only values. 2 - IncludeInExportEnum.
Table 41. Parameters for idrac.config_mgr.scp_export (continued) Parameter Name Type Allowed Values SCPTargetEnum.IDRAC - The module exports only the iDRAC component in SCP file. SCPTargetEnum.BIOS - The module exports BIOS configuration in SCP file. SCPTargetEnum.NIC - The module exports NIC configuration in SCP file. SCPTargetEnum.RAID - The module exports RAID configuration in SCP file. This module will import the configuration component from the exported SCP Default - SCPTargetEnum.
Table 46. Parameters for idrac.config_mgr.scp_import Parameter Name share_path Description Type FileOnShare (for CIFS & NFS Share) LocalFile (For Local Share) SCP exports can be directed to local file systems and network shares. NFS - Network File System IPAddress - Name of the NFS share server. Sharename - The NFS share name. Mountpoint - To mount the shared file. UserCredentials - Username and password for accessing the shared file.
Table 50. Parameters for idrac.config_mgr.scp_import Parameter Name (job-wait=True)] (job-wait = False) Return Type XML or JSON file Exports the server configuration profile to the provided network share or to the local path. Description JobID - It is in the format JID_XXXXXXXXXXXX. Job Status - It allows the user to check the status of job completion. idrac.log_mgr.lclog_export API string/Method: idrac.log_mgr.lclog_export. Protocol Support: WSMAN.
creds=UserCredentials(, )) lclog_file = nfs_share.new_file() msg = idrac.log_mgr.lclog_export(lclog_file) # Export LC Logs - CIFS Share cifs_share = FileOnShare(remote=\\\, isFolder=, creds=UserCredentials(, )) lclog_file = cifs_share.new_file() msg = idrac.log_mgr.lclog_export(lclog_file) # Export LC Logs - Local Share local_share = LocalFile(local=os.path.join(, "path", "to", "lc-logs-file.
Example: # Export LC Full Logs - NFS Share nfs_share = FileOnShare(remote=:/, mount_point=:\>, isFolder=, creds=UserCredentials(, )) tsr_file = nfs_share.new_file() idrac.log_mgr.complete_lclog_export(tsr_file) # Export LC Full Logs - CIFS Share cifs_share = FileOnShare(remote=\\\, isFolder=, creds=UserCredentials(, )) tsr_file = cifs_share.
Table 58. Parameters for idrac.config_mgr.export_tsr Parameter Name Type Allowed Values tsr_store_path FileOnShare—for CIFS and NFS Share Description This method collects the TSR i.e hardware, OS and App data, then compresses and saves the .zip file to remote share path. The FileOnShare API allows you to view the share path where file needs to be exported. Example: #Export TSR - NFS Share nfs_share = FileOnShare(remote=:/, mount_point=:\>, isFolder=
Table 60. Parameters for idrac.user_mgr.Users.new Parameter Name Type Allowed Values Password_Users String User defined string Description Allows you to create a password. Table 61. Parameters for idrac.user_mgr.Users.new Parameter Name Type Allowed Values Privilege_Users ENUM Description Allows you to create a privileged user, Privilege_UsersTypes.Administrator Privilege_UsersTypes.NoAccess Privilege_UsersTypes.Readonly Privilege_UsersTypes.Operator Table 62. Parameters for idrac.user_mgr.
Table 66. Parameters for idrac.user_mgr.Users.new Parameter Name Type Allowed Values ProtocolEnable_Users ENUM Description Allows you to enable a protocol for a user. ProtocolEnable_UserTypes.Enabled ProtocolEnable_UsersTypes.Disabled Table 67. Parameters for idrac.user_mgr.Users.new Parameter Name Type AuthenticationProtocol ENUM _Users Description Allowed Values AuthenticationProtocol_UsersTypes.SHA AuthenticationProtocol_UsersTypes.MD5 AuthenticationProtocol_UsersTypes.
Table 69. Parameters for idrac.user_mgr.Users.remove Parameter Name Type Allowed Values UserName_Users String User Defined string Description Allows you to create a user name. Example: #Set liason share myshare = FileOnShare(remote="://", mount_point='Z:\', isFolder=False, creds=UserCredentials(, )) liason_share_status = idrac.config_mgr.set_liason_share(myshare) idrac.user_mgr.Users.remove(UserName_Users="XYZ123") apply_status = idrac.
Example: #Set liason share myshare = FileOnShare(remote="://", mount_point='Z:\', isFolder=False, creds=UserCredentials(, )) liason_share_status = idrac.config_mgr.set_liason_share(myshare) #Configure iDRAC DNS COnfiguration msg = idrac.config_mgr.configure_dns(register_idrac_on_dns = DNSRegister_NICTypes.Enabled, dns_idrac_name = None, auto_config = DNSDomainNameFromDHCP_NICTypes.Disabled, static_dns = None) print(Prettifyer().
Table 78. Parameters for idrac.config_mgr.configure_ipv4 (continued) Parameter Name Type Allowed Values Description Indicates whether DHCP is used to obtain primary and secondary DNS server addresses from Table 79. Parameters for idrac.config_mgr.configure_ipv4 Parameter Name Type Allowed Values enable_ipv4 Enum Description Indicates whether the IPv4 protocol is Enabled or Disabled. Enable_IPv4Types.Enabled Enable_IPv4Types.Disabled Table 80. Parameters for idrac.config_mgr.
Table 83. Parameters for idrac.config_mgr.configure_static_ipv4 Parameter Name Type Allowed Values dns_1 String User defined values Description Indicates the static DNS server IPv4 address if DHCP is not used to get the DNS address. Table 84. Parameters for idrac.config_mgr.configure_static_ipv4 Parameter Name Type Allowed Values dns_2 String User defined values Description Indicates the static alternate DNS server IPv4 address if DHCP is not used to get the DNS address. Table 85.
Description: The idrac.config_mgr.configure_timezone() allows you to configure the time zone Settings. Table 88. Parameters for idrac.config_mgr.configure_timezone Parameter Name Type Allowed Values timezone String Timezone Description Configures the time zone. Example: #Set liason share myshare = FileOnShare(remote="://", mount_point='Z:\', isFolder=False, creds=UserCredentials(, )) liason_share_status = idrac.config_mgr.
Table 92. Parameters for idrac.config_mgr.configure_web_server Parameter Name Type Allowed Values Timeout Number Timeout seconds Description Enter the time (in seconds) for which a connection is allowed to remain Idle. The session is canceled when the time-out is reached. Changes to the timeout setting do not affect the current session. When you change this time, you must logout and log in again for the new setting to take effect. Timeout range is 60–10,800 seconds. The default value is 1800 seconds.
Table 94. Parameters for idrac.config_mgr.configure_web_server (continued) Parameter Name Type Allowed Values Higher TLSProtocol_WebServerTypes.TLS 1.2 Only Description To specify the minimum supported level of TLS protocol, select one of the following options: TLS 1.0 and Higher TLS 1.1 and Higher TLS 1.2 Only NOTE: TLS 1.1 and Higher is the default option. For better security, Dell recommends to use TLS 1.2.
Table 97. Parameters for idrac.config_mgr.configure_snmp Parameter Name Type Allowed Values alert_port Number Alert port number Description Enter the SNMP port number that must be used for SNMP traps. The default value is 162. Range is 1-65535. Table 98. Parameters for idrac.config_mgr.configure_snmp Parameter Name Type Allowed Values discovery_port Number Discovery port number Description Allows the server to discover the available port. Table 99. Parameters for idrac.config_mgr.
Syslog idrac.config_mgr.enable_syslog API string/Method: idrac.config_mgr.enable_syslog. Protocol Support: WSMAN. Description: The idrac.config_mgr.enable_syslog() enables System Log configuration. Allows you to enable the System Log configuration. Return type: JSON Example: #Set liason share myshare = FileOnShare(remote="://", mount_point='Z:\', isFolder=False, creds=UserCredentials(, )) liason_share_status = idrac.config_mgr.
idrac.config_mgr.disable_system_lockdown API string/Method: idrac.config_mgr.disable_system_lockdown. Protocol Support: WSMAN, Redfish. Description: The idrac.config_mgr.disable_system_lockdown() performs a Lockdown disable operation. NOTE: Lockdown is supported only on 14th Generation of PowerEdge Servers. Return type: JSON Example: # Enable System Lockdown msg = idrac.config_mgr.disable_system_lockdown() CSIOR idrac.config_mgr.enable_csior API string/Method: idrac.config_mgr.enable_csior.
liason_share_status = idrac.config_mgr.set_liason_share(myshare) #Alert Configuration idrac.config_mgr.configure_idrac_alerts ( enable_alerts=AlertEnable_IPMILanTypes.Disabled ) apply_status = idrac.config_mgr.apply_changes(reboot=False) Returns: Success or Failure. Return Type: JSON. idrac.config_mgr.configure_snmp_trap_destination API string/Method: idrac.config_mgr.configure_snmp_trap_destination. Protocol Support: Redfish. Description: The idrac.config_mgr.
( destination_number = 1, destination = "1.1.1.1", snmp_v3_username = None, state = State_SNMPAlertTypes.Disabled ) apply_status = idrac.config_mgr.apply_changes(reboot=False) Returns: None. Return Type: None. idrac.config_mgr.configure_smtp_server_settings API string/Method: idrac.config_mgr.configure_smtp_server_settings. Protocol Support: Redfish. Description: The idrac.config_mgr.configure_smtp_server_settings() allows you to configure the SMTP Server Settings. Table 106. Parameters for idrac.
Example: #Set liason share myshare = FileOnShare(remote="://", mount_point='Z:\', isFolder=False, creds=UserCredentials(, )) liason_share_status = idrac.config_mgr.set_liason_share(myshare) idrac.config_mgr.configure_smtp_server_settings ( smtp_ip_address = "1.1.1.1", smtp_port = 26, authentication = SMTPAuthentication_RemoteHostsTypes.Enabled, username = None, password = None ) apply_status = idrac.config_mgr.
idrac.config_mgr.configure_email_alerts ( alert_number = 4, state=Enable_EmailAlertTypes.Enabled, address = "test@abc.com", custom_message = "test" ) apply_status = idrac.config_mgr.apply_changes(reboot=False) Returns: True or False. Return Type: JSON. Boot Settings Configuration API list This section lists the available Boot settings configuration APIs. idrac.config_mgr.configure_boot_mode API string/Method: idrac.config_mgr.configure_boot_mode. Protocol Support: Redfish. Description: The idrac.
Table 116. Parameters for idrac.config_mgr.configure_onetime_boot_mode (continued) Parameter Name Type Allowed Values OneTimeBootModeTypes.OneTimeCustomHddSe qStr OneTimeBootModeTypes.OneTimeCustomUefiB ootSeqStr OneTimeBootModeTypes.OneTimeHddSeq OneTimeBootModeTypes.OneTimeUefiBootSeq Description Allows you to enable or disable the one time boot mode. Example: #Set liason share myshare = FileOnShare(remote="://", mount_point='Z:\', isFolder=False, creds=User
boot_sequence="device-1, device-2, device-3" ) apply_status = idrac.config_mgr.apply_changes(reboot=True) Returns: Success or Failure. Return Type: JSON. idrac.config_mgr.configure_nvme_mode API string/Method: idrac.config_mgr.configure_nvme_mode. Protocol Support: Redfish. Description: The idrac.config_mgr.configure_nvme_mode() allows you to configure the NVME Mode. Table 119. Parameters for idrac.config_mgr.
mount_point='Z:\', isFolder=False, creds=UserCredentials(, )) liason_share_status = idrac.config_mgr.set_liason_share(myshare) idrac.config_mgr.configure_secure_boot_mode ( SecureBootModeTypes.UserMode ) apply_status = idrac.config_mgr.apply_changes(reboot=True) Returns: Success or Failure. Return Type: JSON. idrac.config_mgr.configure_boot_to_network_iso API string/Method: idrac.config_mgr.configure_boot_to_network_iso. Protocol Support: WSMAN. Description: The idrac.config_mgr.
Table 124. Parameters for idrac.config_mgr.configure_update_from_repo Parameter Name Type Allowed Values apply_update Boolean True Description Allows you to apply the update to the firmware. Table 125. Parameters for idrac.config_mgr.configure_update_from_repo Parameter Name Type Allowed Values reboot_needed Boolean False Description Allows you to perform a reboot. Table 126. Parameters for idrac.config_mgr.
Table 128. Parameters for idrac.config_mgr.RaidHelper.new_virtual_disk Parameter Name Type Allowed Values span_depth Number User defined values Description Depth of the disk span. Table 129. Parameters for idrac.config_mgr.RaidHelper.new_virtual_disk Parameter Name Type Allowed Values span_length Number User defined values Description Length of the disk span. Table 130. Parameters for idrac.config_mgr.RaidHelper.
Table 134. Parameters for idrac.config_mgr.RaidHelper.new_virtual_disk (continued) Parameter Name Type Allowed Values Description Allows you to set the default RAID write policy. Table 135. Parameters for idrac.config_mgr.RaidHelper.new_virtual_disk Parameter Name Type Allowed Values RAIDdefaultReadPolicy ENUM Description Allows you to set the default RAID read policy. RAIDdefaultReadPolicyTypes.Adaptive RAIDdefaultReadPolicyTypes.AdaptiveRead Ahead RAIDdefaultReadPolicyTypes.
Table 141. Parameters for idrac.config_mgr.RaidHelper.new_virtual_disk Parameter Name Type Allowed Values RAIDforeignConfig ENUM Description Allows you to set the external configuration types. RAIDforeignConfigTypes.Clear RAIDforeignConfigTypes.Ignore RAIDforeignConfigTypes.Import Table 142. Parameters for idrac.config_mgr.RaidHelper.new_virtual_disk Parameter Name Type Allowed Values RAIDreconstructRate Number User defined RAID reconstruct rate.
RAIDforeignConfig=RAIDforeignConfigTypes.Clear, RAIDreconstructRate="30", RAIDccMode=RAIDccModeTypes.Normal ) apply_status = idrac.config_mgr.apply_changes(reboot=True) Returns: Success or Failure. Return Type: JSON. idrac.config_mgr.RaidHelper.delete_virtual_disk API string/Method: idrac.config_mgr.RaidHelper.delete_virtual_disk. Protocol Support: WSMAN, Redfish. Description: The idrac.config_mgr.RaidHelper.delete_virtual_disk() allows you to create a RAID. Table 145. Parameters for idrac.config_mgr.
Protocol Support: WSMAN. Description: The delete_job(jobid) method is used to delete a job. Return type: String Example: # Delete a job job_status = idrac.job_mgr.delete_job(jobid=”jid_1234”) idrac.job_mgr.delete_all_jobs API string/Method: idrac.job_mgr.delete_all_jobs. Protocol Support: WSMAN. Description: The delete_all_jobs() is used to delete all jobs. Return type: String Example: # Delete all jobs job_status = idrac.job_mgr.
4 Getting Started The following sections provide information about using OMPSDK to connect, disconnect and communicate with the device.
Table 147. Monitoring API methods (continued) creds Device credentials - bundle of credentials for finding the device driver. protopref The preferred protocol to be used if the device supports the protocol. pOptions Other protocol specific parameters options to be passed. For example: SNMP timeout, retry, port. Returns The driver handle for further configuration or monitoring.
NOTE: This network share is required to have a share between iDRAC and OMPSDK for configuration. Pre-requisite - The share needs to be manually mounted. FileOnShare(remote = ':/Share', mount_point = '/mnt/Share', isFolder = True, creds) idrac.config_mgr.set_liason_share(myshare) FileOnShare methods are: Network file share (NFS), Common internet file system (Windows Style, CIFS), Template (%D, %M, %Y... %ip), access credentials. Table 150.
Export server configuration profile You can export Server Configuration Profile (SCP) with various components such as iDRAC, BIOS, NIC, RAID together or with one of these components. You can export SCP from iDRAC to a local or a network shared location. For shared location, make sure that a network share path is established. While exporting SCP to Network File System (NFS) or (CIFS) share, provide the IP address of the network share where the exported file needs to reside in the share_name parameter. idrac.
idrac.user_mgr.User.new(): Creates the user credentials for WSMAN communication. idrac.user_mgr.Users.remove(): Deletes the user credentials for WSMAN communication. iDRAC Network Configuration The following API's provides information about the network configuration API's available. ● ● ● ● iDRAC iDRAC iDRAC iDRAC DNS configuration DHCP configuration Static IP configuration Time Zone configuration iDRAC DNS configuration idrac.config_mgr.configure_dns(): Allows you to configure the DNS server.
CSIOR Configuration idrac.config_mgr.enable_csior(): Allows you to enable the CSIOR option in iDRAC which enables the collection of system inventory on reboot. idrac.config_mgr.disable_csior(): Allows you to disable the CSIOR option in iDRAC which disables the collection of system inventory on reboot. SNMP traps Configuration idrac.config_mgr.configure_snmp_trap_destination(): Allows you to configure the SNMP trap destination settings. SMTP (E-Mail) Configuration idrac.config_mgr.
Delete single job idrac.job_mgr.delete_job(): Allows you to delete the job. Delete all jobs idrac.job_mgr.delete_all_jobs(): Allows you to delete all jobs. View job status idrac.job_mgr.get_job_status(): Allows you to get the job status for the provided job ID. iDRAC LC status check The following API provides the information to check the LC status. idrac.config_mgr.LCStatus(): Provides the Status of LifeCycle Controller.