### Install libvirt development files Source: https://github.com/openstack/sushy/blob/master/doc/source/contributor/index.md Install libvirt development files required for sushy-tools dependencies. This example is for Fedora. ```default sudo dnf install -y libvirt-devel ``` -------------------------------- ### Install sushy-tools Source: https://github.com/openstack/sushy/blob/master/doc/source/contributor/index.md Install the sushy-tools package, which provides Redfish emulators. This command installs the package for the current user. ```default sudo pip install --user sushy-tools ``` -------------------------------- ### Install Sushy with virtualenvwrapper Source: https://github.com/openstack/sushy/blob/master/doc/source/install/index.md If using virtualenvwrapper, create a new virtual environment and then install Sushy within it. ```bash $ mkvirtualenv sushy $ pip install sushy ``` -------------------------------- ### Perform System Actions Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/usage.md Illustrates how to perform system actions such as resetting the system, getting allowed reset types, and setting the boot source. ```python # Power the system ON sys_inst.reset_system(sushy.ResetType.ON) # Get a list of allowed reset values print(sys_inst.get_allowed_reset_system_values()) # Refresh the system object (with all its sub-resources) sys_inst.refresh() # Alternatively, you can only refresh the resource if it is stale by passing # force=False: sys_inst.refresh(force=False) # A resource can be marked stale by calling invalidate. Note that its # subresources won't be marked as stale, and thus they won't be refreshed by # a call to refresh(force=False) sys_inst.invalidate() # Get the current power state print(sys_inst.power_state) # Set the next boot device to boot once from PXE in UEFI mode sys_inst.set_system_boot_source(sushy.BootSource.PXE, enabled=sushy.BootSourceOverrideEnabled.ONCE, mode=sushy.BootSourceOverrideMode.UEFI) # Get the current boot source information print(sys_inst.boot) # Get a list of allowed boot source target values print(sys_inst.get_allowed_system_boot_source_values()) # Get the memory summary print(sys_inst.memory_summary) # Get the processor summary print(sys_inst.processors.summary) ``` -------------------------------- ### Run sushy-emulator with custom parameters Source: https://github.com/openstack/sushy/blob/master/doc/source/contributor/index.md Start the sushy-emulator with custom port and libvirt URI. This allows for more specific configurations for testing. ```sh sushy-emulator --port 8000 --libvirt-uri "qemu:///system" ``` -------------------------------- ### Storage Controller Summary Example Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.system.storage.md An example of the dictionary format returned by the storage controller summary property. It maps controller IDs to their health and state. ```python {'RAID.Integrated.1-1': {'Health': sushy.Health.OK, 'State': sushy.State.ENABLED}} ``` -------------------------------- ### Install Sushy with pip Source: https://github.com/openstack/sushy/blob/master/doc/source/install/index.md Use this command to install Sushy globally. Ensure pip is up-to-date. ```bash $ pip install sushy ``` -------------------------------- ### Install libvirt development files on Fedora Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/contributor/index.md Install the necessary libvirt development files required for sushy-tools dependencies on Fedora systems. ```bash sudo dnf install -y libvirt-devel ``` -------------------------------- ### Run sushy-static emulator Source: https://github.com/openstack/sushy/blob/master/doc/source/contributor/index.md Start the sushy-static emulator, which serves Redfish mockup files. Point the --mockup-files argument to the directory where you extracted the files. ```default sushy-static --mockup-files /DSP2043-server ``` -------------------------------- ### Create and Use Sushy System Object Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/usage.md Shows how to instantiate a Sushy client, retrieve system information, manage system collections, and perform actions like resetting the system or setting the boot source. Includes examples for refreshing resources and handling stale states. ```python import logging import sushy # Enable logging at DEBUG level LOG = logging.getLogger('sushy') LOG.setLevel(logging.DEBUG) LOG.addHandler(logging.StreamHandler()) s = sushy.Sushy('http://localhost:8000/redfish/v1', username='foo', password='bar') # Get the Redfish version print(s.redfish_version) # Instantiate a system object sys_inst = s.get_system('/redfish/v1/Systems/437XR1138R2') # Using system collections # Instantiate a SystemCollection object sys_col = s.get_system_collection() # Print the ID of the systems available in the collection print(sys_col.members_identities) # Get a list of systems objects available in the collection sys_col_insts = sys_col.get_members() # Instantiate a system object, same as getting it directly # from the s.get_system() sys_inst = sys_col.get_member(sys_col.members_identities[0]) # Refresh the system collection object # # See below for more options on how to refresh resources. sys_col.refresh() # Using system actions # Power the system ON sys_inst.reset_system(sushy.ResetType.ON) # Get a list of allowed reset values print(sys_inst.get_allowed_reset_system_values()) # Refresh the system object (with all its sub-resources) sys_inst.refresh() # Alternatively, you can only refresh the resource if it is stale by passing # force=False: sys_inst.refresh(force=False) # A resource can be marked stale by calling invalidate. Note that its # subresources won't be marked as stale, and thus they won't be refreshed by # a call to refresh(force=False) sys_inst.invalidate() # Get the current power state print(sys_inst.power_state) # Set the next boot device to boot once from PXE in UEFI mode sys_inst.set_system_boot_source(sushy.BootSource.PXE, enabled=sushy.BootSourceOverrideEnabled.ONCE, mode=sushy.BootSourceOverrideMode.UEFI) # Get the current boot source information print(sys_inst.boot) # Get a list of allowed boot source target values print(sys_inst.get_allowed_system_boot_source_values()) # Get the memory summary print(sys_inst.memory_summary) # Get the processor summary print(sys_inst.processors.summary) ``` -------------------------------- ### Run sushy-emulator with SSL enabled Source: https://github.com/openstack/sushy/blob/master/doc/source/contributor/index.md Start the sushy-emulator with SSL enabled by providing the generated key and certificate files. This allows Sushy to connect securely. ```default sushy-emulator --ssl-key key.pem --ssl-certificate cert.pem ``` -------------------------------- ### Install Sushy with pip Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/install/index.md Use this command to install Sushy in your Python environment. ```bash $ pip install sushy ``` -------------------------------- ### Run sushy-emulator Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/contributor/index.md Start the sushy-emulator, which provides a ReST API to interact with virtual machines via the Redfish protocol. This allows for dynamic testing of Sushy. ```sh sushy-emulator ``` -------------------------------- ### Manage System Collection Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/usage.md Shows how to instantiate a SystemCollection object, retrieve system identities, get member system instances, and refresh the collection. ```python # Instantiate a SystemCollection object sys_col = s.get_system_collection() # Print the ID of the systems available in the collection print(sys_col.members_identities) # Get a list of systems objects available in the collection sys_col_insts = sys_col.get_members() # Instantiate a system object, same as getting it directly # from the s.get_system() sys_inst = sys_col.get_member(sys_col.members_identities[0]) # Refresh the system collection object # # See below for more options on how to refresh resources. sys_col.refresh() ``` -------------------------------- ### Run sushy-emulator Source: https://github.com/openstack/sushy/blob/master/doc/source/contributor/index.md Start the sushy-emulator, which provides a dynamic Redfish API interacting with virtual machines. This command runs the emulator with default settings. ```sh sushy-emulator ``` -------------------------------- ### Create and Use Sushy Manager Object Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/usage.md Illustrates how to instantiate a Sushy client, retrieve manager information, manage manager collections, and query supported console types. Includes examples for refreshing manager objects. ```python import logging import sushy # Enable logging at DEBUG level LOG = logging.getLogger('sushy') LOG.setLevel(logging.DEBUG) LOG.addHandler(logging.StreamHandler()) s = sushy.Sushy('http://localhost:8000/redfish/v1', username='foo', password='bar') # Instantiate a manager object mgr_inst = s.get_manager('BMC') # Get the manager name & description print(mgr_inst.name) print(mgr_inst.description) # Using manager collections # Instantiate a ManagerCollection object mgr_col = s.get_manager_collection() # Print the ID of the managers available in the collection print(mgr_col.members_identities) # Get a list of manager objects available in the collection mgr_insts = mgr_col.get_members() # Instantiate a manager object, same as getting it directly # from the s.get_manager() mgr_inst = mgr_col.get_member(mgr_col.members_identities[0]) # Refresh the manager collection object mgr_col.invalidate() mgr_col.refresh() # Using manager actions # Get supported graphical console types print(mgr_inst.get_supported_graphical_console_types()) # Get supported serial console types print(mgr_inst.get_supported_serial_console_types()) ``` -------------------------------- ### HTTP Methods (GET, PATCH, POST, PUT) Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md These methods allow for interacting with resources via HTTP GET, PATCH, POST, and PUT requests. They support optional path, data, and headers, as well as blocking and timeout configurations for asynchronous operations. ```APIDOC ## GET /resource ### Description Retrieves a resource. ### Method GET ### Endpoint /resource ### Parameters #### Query Parameters - **path** (string) - Optional - Sub-URI path to the resource. - **data** (object) - Optional - JSON data. - **headers** (object) - Optional - Dictionary of headers. - **blocking** (boolean) - Optional - Whether to block for asynchronous operations. - **timeout** (number) - Optional - Max time in seconds to wait for blocking async call. - **extra_session_req_kwargs** (object) - Optional - Keyword arguments to pass to the requests session object. ### Response #### Success Response (200) - **response** (object) - The response object from the requests library. #### Error Response - **ConnectionError** - **HTTPError ## PATCH /resource ### Description Updates a resource using the HTTP PATCH method. ### Method PATCH ### Endpoint /resource ### Parameters #### Query Parameters - **path** (string) - Optional - Sub-URI path to the resource. - **data** (object) - Optional - JSON data. - **headers** (object) - Optional - Dictionary of headers. - **etag** (string) - Optional - ETag string for conditional requests. - **blocking** (boolean) - Optional - Whether to block for asynchronous operations. - **timeout** (number) - Optional - Max time in seconds to wait for blocking async call. - **extra_session_req_kwargs** (object) - Optional - Keyword arguments to pass to the requests session object. ### Response #### Success Response (200) - **response** (object) - The response object from the requests library. #### Error Response - **ConnectionError** - **HTTPError ## POST /resource ### Description Creates or performs an action on a resource using the HTTP POST method. ### Method POST ### Endpoint /resource ### Parameters #### Query Parameters - **path** (string) - Optional - Sub-URI path to the resource. - **data** (object) - Optional - JSON data. - **headers** (object) - Optional - Dictionary of headers. - **blocking** (boolean) - Optional - Whether to block for asynchronous operations. - **timeout** (number) - Optional - Max time in seconds to wait for blocking async call. - **extra_session_req_kwargs** (object) - Optional - Keyword arguments to pass to the requests session object. ### Response #### Success Response (200) - **response** (object) - The response object from the requests library. #### Error Response - **ConnectionError** - **HTTPError ## PUT /resource ### Description Replaces or creates a resource using the HTTP PUT method. ### Method PUT ### Endpoint /resource ### Parameters #### Query Parameters - **path** (string) - Optional - Sub-URI path to the resource. - **data** (object) - Optional - JSON data. - **headers** (object) - Optional - Dictionary of headers. - **blocking** (boolean) - Optional - Whether to block for asynchronous operations. - **timeout** (number) - Optional - Max time in seconds to wait for blocking async call. - **extra_session_req_kwargs** (object) - Optional - Keyword arguments to pass to the requests session object. ### Response #### Success Response (200) - **response** (object) - The response object from the requests library. #### Error Response - **ConnectionError** - **HTTPError ``` -------------------------------- ### Get System Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves a System object by its identity. If no identity is provided, it attempts to default to a single available system, failing if there are more or less than one. It can raise UnknownDefaultError if the default system cannot be determined. ```python sushy_client.get_system(identity='system_id') ``` -------------------------------- ### Get Supported Command Shell Types Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/usage.md Retrieves the types of command shells supported by the manager. No specific setup is required beyond having a manager instance. ```python print(mgr_inst.get_supported_command_shell_types()) ``` -------------------------------- ### System Resource Methods Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.md This section details the methods available for interacting with the System resource, including resetting, setting boot options, and managing the indicator LED. ```APIDOC ## System Resource Methods ### Description Provides methods for managing system operations such as resetting, setting boot options, and controlling the indicator LED. ### Methods - **get_allowed_reset_system_values()** - Returns the allowed values for resetting the system. - **get_allowed_system_boot_source_values()** - Returns the allowed values for system boot sources. - **reset_system()** - Resets the system. - **set_indicator_led()** - Sets the state of the indicator LED. - **set_system_boot_options()** - Sets the system boot options. - **set_system_boot_source()** - Sets the system boot source. ``` -------------------------------- ### Create and Use Sushy System Object Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/usage.md Demonstrates how to initialize the Sushy client, retrieve a specific system instance, and access its properties like Redfish version. ```python import logging import sushy # Enable logging at DEBUG level LOG = logging.getLogger('sushy') LOG.setLevel(logging.DEBUG) LOG.addHandler(logging.StreamHandler()) s = sushy.Sushy('http://localhost:8000/redfish/v1', username='foo', password='bar') # Get the Redfish version print(s.redfish_version) # Instantiate a system object sys_inst = s.get_system('/redfish/v1/Systems/437XR1138R2') ``` -------------------------------- ### Create and Use Sushy Client with Sessions Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/usage.md Demonstrates how to initialize a Sushy client, interact with a ComputerSystem resource, and manage sessions explicitly. Sessions are automatically created and recreated on timeout, but can also be explicitly created, retrieved, and deleted. ```python import logging import sushy # Enable logging at DEBUG level LOG = logging.getLogger('sushy') LOG.setLevel(logging.DEBUG) LOG.addHandler(logging.StreamHandler()) s = sushy.Sushy('http://localhost:8000/redfish/v1', username='foo', password='bar') # Get the ComputerSystem object (if there is only one), otherwise # the identity must be provided as a path to the system. system = s.get_system() # A session is created automatically for you. # Print the boot field in the ComputerSystem. print(system.boot) # Upon session timeout, Sushy recreates the session based upon # provided credentials. If this fails, an exception is raised. # Explicitly request a session_key and session_uri. # This is not stored, but may be useful. session_key, session_uri = s.create_session(username='foo', password='bar') # Retrieve the session session = s.get_session(session_uri) # Delete the session session.delete() ``` -------------------------------- ### get_extension Function Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.oem.dell.resources.taskservice.md A utility function to get the Dell Task Service extension. ```APIDOC ## get_extension ### Description Function to retrieve the Dell Task Service extension. ### Signature `get_extension(*args, **kwargs)` ``` -------------------------------- ### Sushy Client Initialization Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.md Instantiate the Sushy client with connection details. ```APIDOC ## Sushy Client Initialization ### Description Instantiate the Sushy client with connection details. ### Parameters - **base_url** (string) - Required - The base URL for the Redfish service. - **username** (string) - Optional - The username for authentication. - **password** (string) - Optional - The password for authentication. - **root_prefix** (string) - Optional - The root prefix for Redfish API (defaults to '/redfish/v1/'). - **verify** (boolean) - Optional - Whether to verify SSL certificates (defaults to True). - **auth** (object) - Optional - Authentication object. - **connector** (object) - Optional - Custom connector object. - **public_connector** (object) - Optional - Public connector object. - **language** (string) - Optional - Language for Redfish responses (defaults to 'en'). - **server_side_retries** (integer) - Optional - Number of server-side retries (defaults to 10). - **server_side_retries_delay** (integer) - Optional - Delay between server-side retries (defaults to 3). - **read_timeout** (integer) - Optional - Read timeout in seconds (defaults to 60). - **connect_timeout** (integer) - Optional - Connect timeout in seconds. - **tls_min_version** (string) - Optional - Minimum TLS version. - **tls_ciphers** (string) - Optional - TLS ciphers to use. ``` -------------------------------- ### SoftwareInventory Resource Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.resources.md Represents software inventory information, including details about installed software. ```APIDOC ## SoftwareInventory ### Description Details about a piece of software installed on the system. ### Attributes - **identity**: Unique identifier for the software inventory item. - **lowest_supported_version**: The lowest version of this software that is supported. - **manufacturer**: The manufacturer of the software. - **name**: The name of the software. - **related_item**: Link to related resources. - **release_date**: The release date of this software version. - **software_id**: The unique identifier for this software. - **status**: The status of the software (e.g., Installed, Available). - **uefi_device_paths**: UEFI device paths associated with this software. ``` -------------------------------- ### Volume Initialization Actions Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.resources.system.md Details the action for initializing a storage volume. ```APIDOC ## ActionsField.initialize ### Description Represents the action to initialize a storage volume. This action may require specific parameters. ### Method POST ### Endpoint (Endpoint details not provided in source, typically part of a Volume resource) ### Parameters (Specific parameters for initialization are not detailed in the source, but can be obtained via `Volume.get_allowed_initialize_volume_values()`) ### Request Example (Example request body not provided in source) ### Response (Response details not provided in source) ``` -------------------------------- ### Set System Boot Options Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.system.md Allows setting the boot source, its override enabled status, boot mode, and HTTP boot URI for the next system reboot. ```APIDOC ## POST /redfish/v1/Systems/{SystemId}/Actions/SetSystemBootOptions ### Description Sets the boot source, boot frequency, and/or boot mode for the next system reboot. ### Method POST ### Endpoint /redfish/v1/Systems/{SystemId}/Actions/SetSystemBootOptions ### Parameters #### Request Body - **target** (sushy.BootSource) - Optional - The target boot source. - **enabled** (sushy.BootSourceOverrideEnabled) - Optional - How long the override is enabled. - **mode** (sushy.BootSourceOverrideMode) - Optional - The boot mode. - **http_boot_uri** (string) - Optional - The requested HTTP Boot URI. Only valid when target is UefiHTTP. ### Response #### Success Response (204) No content is returned on successful execution. #### Error Response - **InvalidParameterValueError**: If any information passed is invalid. ``` -------------------------------- ### Get KVM Session API Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.oem.dell.resources.manager.md Retrieves temporary credentials for establishing a KVM session. ```APIDOC ## GET /redfish/v1/Managers/{ManagerId}/iDRACCardService/Actions/iDRACCardService.GetKvmSession ### Description Gets temporary credentials for a KVM session. ### Method GET ### Endpoint /redfish/v1/Managers/{ManagerId}/iDRACCardService/Actions/iDRACCardService.GetKvmSession ### Response #### Success Response (200) - **TempUsername** (string) - Temporary username for KVM session. - **TempPassword** (string) - Temporary password for KVM session. ### Response Example { "TempUsername": "temp_user", "TempPassword": "temp_password" } ``` -------------------------------- ### Get Certificate Service Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves the CertificateService object. This method is used to access certificate-related functionalities. ```python sushy_client.get_certificate_service() ``` -------------------------------- ### Get Allowed Reset iDRAC Values Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.oem.dell.resources.manager.md Retrieves the set of allowed values for the iDRAC reset operation. ```APIDOC ## get_allowed_reset_idrac_values() ### Description Get the allowed values for resetting the idrac. ### Returns A set of allowed values. ``` -------------------------------- ### System Boot Management Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.md APIs for managing system boot settings and progress. ```APIDOC ## GET /redfish/v1/Systems/{SystemId} ### Description Retrieves system-level information, including boot settings. ### Method GET ### Endpoint /redfish/v1/Systems/{SystemId} ### Response #### Success Response (200) - **Boot** (object) - Contains boot settings. - **Mode** (string) - The current boot mode (e.g., "UEFI", "Legacy"). - **Enabled** (boolean) - Indicates if boot is enabled. - **HttpBootUri** (string) - The URI for HTTP boot. - **Target** (string) - The boot target. - **AllowedValues** (array) - Allowed values for boot settings. - **BootProgress** (object) - Contains boot progress information. - **LastBootSecondsCount** (integer) - The number of seconds since the last boot. #### Response Example ```json { "@odata.type": "#ComputerSystem.ComputerSystem", "Id": "System.Embedded.1", "Name": "System", "Boot": { "Mode": "UEFI", "Enabled": true, "HttpBootUri": "http://192.168.1.100/boot", "Target": "CD/DVD", "AllowedValues": ["UEFI", "Legacy"] }, "BootProgress": { "LastBootSecondsCount": 120 } } ``` ``` -------------------------------- ### Get Session Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves a Session object by its identity. This method is used to access a specific session resource. ```python sushy_client.get_session(identity='session_id') ``` -------------------------------- ### Get Fabric Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves a Fabric object by its identity. This method is used to access a specific fabric resource. ```python sushy_client.get_fabric(identity='fabric_id') ``` -------------------------------- ### Get Sub-Resource Path Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md A helper function to find the path of a sub-resource. It can handle both single resources and collections. ```python sushy.utils.get_sub_resource_path_by(resource, subresource_name, is_collection=False) ``` -------------------------------- ### Get Sessions Path Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Returns the URL path for the Sessions resource. This is a utility method for constructing API requests. ```python sushy_client.get_sessions_path() ``` -------------------------------- ### UpdateService.simple_update Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.resources.md Initiates a simple update operation through the UpdateService. This method is used to start a firmware or software update process. ```APIDOC ## UpdateService.simple_update() ### Description Initiates a simple update operation through the UpdateService. ### Method POST ### Endpoint /redfish/v1/UpdateService/Actions/Oem/Sushy/SimpleUpdate ### Request Body - **ImageURI** (string) - Required - The URI of the update image. - **TransferProtocol** (string) - Optional - The transfer protocol to use for the update. ``` -------------------------------- ### Download Redfish mockup files Source: https://github.com/openstack/sushy/blob/master/doc/source/contributor/index.md Download Redfish mockup files from the DMTF website. These files are used by the static emulator. ```default wget https://www.dmtf.org/sites/default/files/standards/documents/DSP2043_1.0.0.zip ``` -------------------------------- ### lazy_registries Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.md Gets and combines all message registries. This property fetches all registries provided by the Redfish service and combines them with packaged standard registries. ```APIDOC ## lazy_registries ### Description Gets and combines all message registries together. Fetches all registries if any provided by Redfish service and combines together with packaged standard registries. ### Returns dict: of combined message registries where key is Registry_name.Major_version.Minor_version and value is registry itself. ``` -------------------------------- ### Download Redfish mockup files Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/contributor/index.md Download Redfish mockup files from the DMTF website. These files are used by the sushy-static emulator. ```bash wget https://www.dmtf.org/sites/default/files/standards/documents/DSP2043_1.0.0.zip ``` -------------------------------- ### Get Registries Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.md Fetches and combines all registries provided by the Redfish service, along with packaged standard registries. Supports both message and attribute registries. ```APIDOC ## GET registries ### Description Gets and combines all registries together. Fetches all registries if any provided by Redfish service and combines together with packaged standard registries. Both message and attribute registries are supported from the Redfish service. ### Method GET ### Endpoint /redfish/v1/Registries ### Response #### Success Response (200) - **registries** (dict) - A dictionary of combined registries keyed by both the registry name (Registry_name.Major_version.Minor_version) and the registry file identity, with the value being the actual registry itself. ``` -------------------------------- ### DellLCService.is_realtime_ready() Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.oem.dell.resources.md Checks if the Dell real-time services are ready. ```APIDOC ## DellLCService.is_realtime_ready() ### Description Checks if the Dell real-time services are ready. ### Method GET ### Endpoint /redfish/v1/Oem/Dell/LifecycleService/IsRealtimeReady ``` -------------------------------- ### registries Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.md Gets and combines all registries, including message and attribute registries. This property fetches registries from the Redfish service and combines them with standard registries. ```APIDOC ## registries ### Description Gets and combines all registries together. Fetches all registries if any provided by Redfish service and combines together with packaged standard registries. Both message and attribute registries are supported from the Redfish service. ### Returns dict: of combined registries keyed by both the registry name (Registry_name.Major_version.Minor_version) and the registry file identity, with the value being the actual registry itself. ``` -------------------------------- ### Use OEM Extensions with Sushy Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/usage.md Shows how to interact with OEM-specific extensions provided by vendors on Redfish resources. This involves checking for OEM vendor IDs, retrieving OEM extension objects, and calling vendor-specific methods like setting a virtual boot device. ```python import sushy root = sushy.Sushy('http://localhost:8000/redfish/v1') # Instantiate a system object system = root.get_system('/redfish/v1/Systems/437XR1138R2') print('Working on system resource %s' % system.identity) for manager in system.managers: print('Using System manager %s' % manager.identity) # Get a list of OEM extension names for the system manager oem_vendors = manager.oem_vendors print('Listing OEM extension name(s) for the System ' 'manager %s' % manager.identity ) print(*oem_vendors, sep="\n") try: manager_oem = manager.get_oem_extension('Acme') except sushy.exceptions.OEMExtensionNotFoundError: print('ERROR: Acme OEM extension not found in ' 'Manager %s' % manager.identity) continue print('%s is an OEM extension of Manager %s' % (manager_oem.get_extension(), manager.identity)) # set boot device to a virtual media device image manager_oem.set_virtual_boot_device(sushy.VirtualMediaType.CD, manager=manager) ``` -------------------------------- ### Get Event Service Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves the EventService object. This method is used to access event-related functionalities. It may raise a MissingAttributeError if the EventService is not found. ```python sushy_client.get_event_service() ``` -------------------------------- ### Get Allowed Manager Reset Values Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/usage.md Fetches a list of acceptable values for resetting the manager. This is useful for understanding the available reset actions. ```python print(mgr_inst.get_allowed_reset_manager_values()) ``` -------------------------------- ### Secure Boot Resource Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.system.md Documentation for the SecureBoot resource, including its properties, actions, and methods for managing secure boot settings. ```APIDOC ## Secure Boot Resource Details ### Class: sushy.resources.system.secure_boot.SecureBoot - Bases: `ResourceBase` ### Properties - **current_boot** (MappedField): The UEFI Secure Boot state during the current boot cycle. - **description** (Field): Human-readable description of the BIOS resource. - **enabled** (Field): Whether the UEFI Secure Boot takes effect on next boot. This property can be enabled in UEFI boot mode only. - **identity** (Field): The Bios resource identity string. - **mode** (MappedField): The current UEFI Secure Boot Mode. - **name** (Field): The name of the resource. ### Methods - **databases**: Property that returns a `SimpleStorageCollection` instance representing the secure boot databases. Raises `MissingAttributeError` if `SecureBootDatabases/@odata.id` is missing. - **get_allowed_reset_keys_values()**: Returns a set with the allowed values for resetting the keys. - **reset_keys(reset_type)**: Resets secure boot keys. `reset_type` should be one of SECURE_BOOT_RESET_KEYS_* constants. - **set_enabled(enabled)**: Enables or disables secure boot for the next boot. `enabled` should be a boolean. ### Actions #### ActionsField - Bases: `CompositeField` - Properties: - **reset_keys** (ResetKeysActionField): Action that resets the UEFI Secure Boot keys. #### ResetKeysActionField - Bases: `ActionField` - Properties: - **allowed_values** (Field) ``` -------------------------------- ### Create Sushy Client with Session Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/usage.md Creates a Sushy client instance and automatically establishes a session. Logging is enabled at DEBUG level for detailed session information. Credentials are provided during instantiation. ```python import logging import sushy # Enable logging at DEBUG level LOG = logging.getLogger('sushy') LOG.setLevel(logging.DEBUG) LOG.addHandler(logging.StreamHandler()) s = sushy.Sushy('http://localhost:8000/redfish/v1', username='foo', password='bar') # Get the ComputerSystem object (if there is only one), otherwise # the identity must be provided as a path to the system. system = s.get_system() # A session is created automatically for you. # Print the boot field in the ComputerSystem. print(system.boot) ``` -------------------------------- ### Get KVM Session Credentials Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.oem.dell.resources.manager.md Retrieves temporary credentials for establishing a KVM session. The returned TempUsername and TempPassword can be used with the provided URL template. ```APIDOC ## get_kvm_session() ### Description Get temporary credentials for KVM session The TempUsername and TempPassword fields can be used in the following url template: [https:/](https:/)/{host}/console?username={}&tempUsername={}&tempPassword={} The username is the user used to generate these session-credentials. ### Returns Dict with the fields TempUsername and TempPassword as strings None, if the API did not return any credentials, but did not raise an error. When and why that should happen is unclear, but specified in the API doc. ``` -------------------------------- ### Import System Configuration Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.oem.dell.resources.manager.md Initiates the import of a system configuration. This action is part of the Dell Manager Actions. ```APIDOC ## DellManagerActionsField.import_system_configuration ### Description Initiates the import of a system configuration. ### Method POST ### Endpoint /redfish/v1/Managers/{ManagerId}/Actions/DellManagerActionsField/ImportSystemConfiguration ### Request Body (No specific request body fields are documented in the source) ### Response #### Success Response (200) (No specific response fields are documented in the source) ``` -------------------------------- ### Get Session Service Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves the SessionService object. This method is used to access session-related functionalities. It may raise a MissingAttributeError if the collection attribute is not found. ```python sushy_client.get_session_service() ``` -------------------------------- ### Sushy Resources System Package Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Documentation for system-related resources in Sushy, covering BIOS, network interfaces, storage, and more. ```APIDOC ## Sushy Resources System Package ### Description This package encompasses various resources related to system hardware and configuration, including BIOS, network interfaces, PCIe devices, and storage. ### Modules - **sushy.resources.system.bios** - **sushy.resources.system.constants** - **sushy.resources.system.ethernet_interface** - **sushy.resources.system.pcie_device** - **sushy.resources.system.port** - **sushy.resources.system.processor** - **sushy.resources.system.secure_boot** - **sushy.resources.system.secure_boot_database** - **sushy.resources.system.simple_storage** - **sushy.resources.system.system** ``` -------------------------------- ### DellLCService.is_realtime_ready Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.oem.dell.resources.manager.md Checks if the system is ready to accept real-time operations. ```APIDOC ## is_realtime_ready ### Description Indicates if real-time operations are ready to be accepted. ### Method GET ### Endpoint /redfish/v1/Managers/{ManagerId}/LifecycleService ### Returns - **is_realtime_ready** (boolean) - True if ready to accept real-time operations, otherwise false. ``` -------------------------------- ### SecureBoot Resource Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.md Details about the Secure Boot configuration of the system. ```APIDOC ## SecureBoot Resource ### Description Manages and provides information about the system's Secure Boot configuration. ### Properties - **current_boot** (string) - The current boot mode of Secure Boot. - **databases** (array) - A list of Secure Boot databases. - **description** (string) - A description of the Secure Boot resource. - **enabled** (boolean) - Indicates if Secure Boot is enabled. - **identity** (string) - A unique identifier for the Secure Boot resource. - **mode** (string) - The current mode of Secure Boot. - **name** (string) - The name of the Secure Boot resource. ### Actions - **reset_keys()**: Resets the Secure Boot keys. This action is available if the `ActionsField.reset_keys` property is present. - **Description**: Resets the Secure Boot keys to their default or a specified state. - **Method**: POST - **Endpoint**: (Specific endpoint determined by the service) - **Request Body**: May include parameters to specify the reset behavior (e.g., `ResetKeysActionField`). - **Response**: Typically a 204 No Content or a 200 OK with updated status. ### Methods - **get_allowed_reset_keys_values()**: Retrieves the allowed values for the reset keys action. ### Related Resources - [`ActionsField`](sushy.resources.system.md#sushy.resources.system.secure_boot.ActionsField) - [`ResetKeysActionField`](sushy.resources.system.md#sushy.resources.system.secure_boot.ResetKeysActionField) ``` -------------------------------- ### Boot Progress States Constants Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.system.md Defines the possible states for the boot progress indicator. ```APIDOC ## Boot Progress States Enum ### Description An enumeration of constants representing the progress of the system boot process. ### Values - **BUS** (string) - Initialization of the buses has started. - **HARDWARE_COMPLETE** (string) - Hardware Initialization is completed. - **MEMORY** (string) - Initialization of memory has started. - **NONE** (string) - The system is not booting. - **OEM** (string) - OEM Defined Boot Progress State. - **OS_BOOT_STARTED** (string) - Boot of the Operating System has started. - **OS_RUNNING** (string) - Operating System Running. - **PCI_RESOURCE_CONFIG** (string) - Initialization of PCI Resources has started. ``` -------------------------------- ### Extract Redfish mockup files Source: https://github.com/openstack/sushy/blob/master/doc/source/contributor/index.md Extract the downloaded Redfish mockup zip file to a specified directory. This prepares the files for the static emulator. ```default unzip DSP2043_1.0.0.zip -d ``` -------------------------------- ### Get System Collection Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves the SystemCollection object. This method is used to access a collection of system resources. It may raise a MissingAttributeError if the collection attribute is not found. ```python sushy_client.get_system_collection() ``` -------------------------------- ### Get Manager Collection Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves the ManagerCollection object. This method is used to access a collection of manager resources. It may raise a MissingAttributeError if the collection attribute is not found. ```python sushy_client.get_manager_collection() ``` -------------------------------- ### System API Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.system.md APIs for managing system-level configurations. ```APIDOC ## GET /redfish/v1/Systems/{SystemId} ### Description Retrieves the system resource, which represents the main computer system. ### Method GET ### Endpoint /redfish/v1/Systems/{SystemId} ### Parameters #### Path Parameters - **SystemId** (string) - Required - The ID of the system. ### Response #### Success Response (200) - **Actions** (object) - Contains links to actions that can be performed on the system. - **reset** (object) - Link to the reset action. - **boot** (object) - Boot settings for the system. - **allowed_values** (array) - Allowed boot modes. - **enabled** (string) - Whether boot is enabled. - **http_boot_uri** (string) - URI for HTTP boot. - **mode** (string) - Current boot mode. - **target** (string) - Boot target. - **boot_progress** (object) - Information about the system's boot progress. - **last_boot_seconds_count** (integer) - Number of seconds the last boot took. - **last_state** (string) - The last recorded boot progress state. - **last_state_updated_at** (string) - Date-time when the last state was updated. - **oem_last_state** (string) - OEM-specific last state information. - **memory_summary** (object) - Summary of the system's memory. - **health** (string) - Overall health state of the memory. - **size_gib** (integer) - Total installed memory size in GiB. #### Response Example { "@odata.id": "/redfish/v1/Systems/System.Embedded.1", "Actions": { "#Reset": { "target": "/redfish/v1/Systems/System.Embedded.1/Reset" } }, "Boot": { "AllowedValues": [ "UEFI", "Legacy" ], "Enabled": "True", "Mode": "UEFI", "Target": "BootNext" }, "BootProgress": { "LastBootSecondsCount": 120, "LastState": "OSRunning", "LastStateUpdatedAt": "2023-10-27T10:00:00Z" }, "MemorySummary": { "Health": "OK", "SizeInGiB": 64 } } ## POST /redfish/v1/Systems/{SystemId}/Reset ### Description Resets the system. ### Method POST ### Endpoint /redfish/v1/Systems/{SystemId}/Reset ### Parameters #### Path Parameters - **SystemId** (string) - Required - The ID of the system. #### Request Body - **ResetType** (string) - Required - The type of reset to perform (e.g., ForceRestart, GracefulRestart, PowerCycle). ### Request Example { "ResetType": "ForceRestart" } ### Response #### Success Response (200) - **Status** (string) - Indicates the status of the reset operation. #### Response Example { "Status": "Reset initiated successfully" } ``` -------------------------------- ### Get Fabric Collection Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves the FabricCollection object. This method is used to access a collection of fabric resources. It may raise a MissingAttributeError if the collection attribute is not found. ```python sushy_client.get_fabric_collection() ``` -------------------------------- ### DellManagerExtension.import_system_configuration() Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.oem.dell.resources.md Imports a system configuration to the Dell iDRAC. ```APIDOC ## DellManagerExtension.import_system_configuration() ### Description Imports a system configuration to the Dell iDRAC. ### Method POST ### Endpoint /redfish/v1/Oem/Dell/Manager/Actions/DellManagerExtension.ImportSystemConfiguration ### Request Body - **ImportJobSchedule** (object) - Required - Specifies the schedule for importing the configuration. - **ImportNow** (boolean) - Optional - If true, the import is performed immediately. - **ImportFormat** (string) - Optional - The format of the imported configuration (e.g., "XML", "JSON"). - **ImportProtocol** (string) - Optional - The protocol to use for importing (e.g., "HTTP", "NFS", "CIFS"). - **ShareParameters** (object) - Optional - Parameters for the specified share protocol. - **ShareName** (string) - Required if ImportProtocol is "NFS" or "CIFS" - The name of the network share. - **Username** (string) - Optional - The username for accessing the share. - **Password** (string) - Optional - The password for accessing the share. - **IPAddress** (string) - Required if ImportProtocol is "NFS" or "CIFS" - The IP address of the share server. - **DirectoryPath** (string) - Optional - The directory path on the share. - **FileName** (string) - Required - The name of the configuration file to import. ``` -------------------------------- ### Get Composition Service Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves the CompositionService object. This method is used to access composition-related functionalities. It may raise a MissingAttributeError if the composition service attribute is not found. ```python sushy_client.get_composition_service() ``` -------------------------------- ### System Actions Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.resources.system.md Details the actions that can be performed on the System resource, such as resetting the system or changing boot source values. ```APIDOC ## System Actions ### Description Provides methods to interact with and control the system resource. ### Methods - **get_allowed_reset_system_values()** Get the allowed values for resetting the system. * **Returns:** A set with the allowed values. - **get_allowed_system_boot_source_values()** Get the allowed values for changing the boot source. * **Returns:** A set with the allowed values. ``` -------------------------------- ### Set Virtual Boot Device Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.oem.dell.resources.manager.md Sets the boot device for a node, including virtual media options via OEM extension. ```APIDOC ## POST /redfish/v1/Systems/{SystemId}/Oem/Dell/Actions/Manager.SetVirtualBootDevice ### Description Sets the boot device for a node. Dell iDRAC Redfish implementation supports setting boot devices via an OEM extension, including virtual media. ### Method POST ### Endpoint /redfish/v1/Systems/{SystemId}/Oem/Dell/Actions/Manager.SetVirtualBootDevice ### Parameters #### Request Body - **device** (str) - Required - The boot device. Values are vendor-specific. - **persistent** (boolean) - Optional - Whether to set next-boot or make the change permanent. Default: False. - **manager** (str) - Optional - Manager of OEM extension. - **system** (str) - Optional - System of OEM extension. ### Raises - **InvalidParameterValue** - If the Dell OEM extension cannot be used. - **ExtensionError** - On failure to perform the requested operation. ### Response #### Success Response (200) - **Status** (string) - Indicates the status of the operation. #### Response Example { "Status": "Boot device set successfully." } ``` -------------------------------- ### Get Chassis Collection Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.md Retrieves the ChassisCollection object. This method is used to access a collection of chassis resources. It may raise a MissingAttributeError if the collection attribute is not found. ```python sushy_client.get_chassis_collection() ``` -------------------------------- ### Extract Redfish mockup files Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/contributor/index.md Extract the downloaded Redfish mockup zip file to a specified directory. This prepares the files for use with the sushy-static emulator. ```bash unzip DSP2043_1.0.0.zip -d ``` -------------------------------- ### Get Storage Controller Summary Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.system.storage.md Retrieves a summary of storage controllers, providing their IDs and health/state status. This is useful for monitoring the overall health of storage devices. ```python controller_collection.summary ``` -------------------------------- ### Volume Initialize Types Source: https://github.com/openstack/sushy/blob/master/doc/source/reference/api/sushy.resources.system.storage.md Defines the methods for initializing storage volumes. ```APIDOC ## Enum sushy.resources.system.storage.constants.VolumeInitializeType ### Description Represents the different types of volume initialization. ### Values - **FAST** ('Fast'): Prepares the volume for use quickly by erasing only the beginning and end of the space. - **SLOW** ('Slow'): Prepares the volume for use slowly by completely erasing the volume. ``` -------------------------------- ### Example Usage of cache_it Decorator Source: https://github.com/openstack/sushy/blob/master/releasenotes/source/reference/api/sushy.md Demonstrates how to use the @cache_it decorator to cache method return values in a Sushy resource. Shows selective cache clearing using cache_clear. ```python class SomeResource(base.ResourceBase): ... @cache_it def get_summary(self): # do some calculation and return the result # and this result will be cached. return result ... def _do_refresh(self, force): cache_clear(self, force) ``` ```python class SomeResource(base.ResourceBase): ... @property @cache_it def nested_resource(self): return NestedResource( self._conn, "Path/to/NestedResource", redfish_version=self.redfish_version) ... def _do_refresh(self, force): # selective attribute clearing cache_clear(self, force, only_these=['nested_resource']) ```