def get_total_cpus(self, identity): """Get computer system total count of available CPUs :returns: available CPU count as `int` or `None` if CPU count can't be determined """ raise error.NotSupportedError('Not implemented')
def get_total_memory(self, identity): """Get computer system total memory :returns: available RAM in GiB as `int` or `None` if total memory count can't be determined """ raise error.NotSupportedError('Not implemented')
def get_boot_mode(self, identity): """Get computer system boot mode. :returns: either *UEFI* or *Legacy* as `str` or `None` if current boot mode can't be determined """ raise error.NotSupportedError('Not implemented')
def set_bios(self, identity, attributes): """Update BIOS attributes :param attributes: key-value pairs of attributes to update :raises: `FishyError` if BIOS attributes cannot be processed """ raise error.NotSupportedError('Not implemented')
def get_bios(self, identity): """Get BIOS attributes for the system :returns: key-value pairs of BIOS attributes :raises: `FishyError` if BIOS attributes cannot be processed """ raise error.NotSupportedError('Not implemented')
def set_boot_mode(self, identity, boot_mode): """Set computer system boot mode. :param boot_mode: string literal requesting boot mode change on the system. Valid values are: *UEFI*, *Legacy*. :raises: `FishyError` if boot mode can't be set """ raise error.NotSupportedError('Not implemented')
def find_or_create_storage_volume(self, data): """Find/create volume based on existence in the virtualization backend :param data: data about the volume in dict form with values for `Id`, `Name`, `CapacityBytes`, `VolumeType`, `libvirtPoolName` and `libvirtVolName` :returns: Id of the volume if successfully found/created else None """ raise error.NotSupportedError('Not implemented')
def get_boot_image(self, identity, device): """Get backend VM boot image info :param identity: node name or ID :param device: device type (from `sushy_tools.emulator.constants`) :returns: a `tuple` of (boot_image, write_protected, inserted) :raises: `error.FishyError` if boot device can't be accessed """ raise error.NotSupportedError('Not implemented')
def set_boot_mode(self, identity, boot_mode): """Set computer system boot mode. :param boot_mode: string literal requesting boot mode change on the system. Valid values are: *UEFI*, *Legacy*. :raises: `error.FishyError` if boot mode can't be set """ # just to make sure passed identity exists self._get_instance(identity) msg = ('The cloud driver %(driver)s does not allow changing boot ' 'mode through Redfish' % {'driver': self.driver}) raise error.NotSupportedError(msg)
def set_boot_image(self, identity, device, boot_image=None, write_protected=True): """Set backend VM boot image :param identity: node name or ID :param device: device type (from `sushy_tools.emulator.constants`) :param boot_image: path to the image file or `None` to remove configured image entirely :param write_protected: expose media as read-only or writable :raises: `error.FishyError` if boot device can't be set """ raise error.NotSupportedError('Not implemented')
def set_power_state(self, identity, state): # hardware actions are not immediate apply_time = int(time.time()) + random.randint(1, 11) system = self._get(identity) if 'On' in state: pending_state = 'On' elif state in ('ForceOff', 'GracefulShutdown'): pending_state = 'Off' elif 'Restart' in state: system['power_state'] = 'Off' pending_state = 'On' else: raise error.NotSupportedError( f'Power state {state} is not supported') if system['power_state'] != pending_state: self._update(system, pending_power={ 'power_state': pending_state, 'apply_time': apply_time, })
def get_simple_storage_collection(self, identity): raise error.NotSupportedError('Not implemented')
def get_simple_storage_collection(self, identity): """Get a dict of Simple Storage Controllers and their devices :returns: dict of Simple Storage Controllers and their atributes """ raise error.NotSupportedError('Not implemented')
def get_nics(self, identity): """Get list of NICs and their attributes :returns: list of dictionaries of NICs and their attributes """ raise error.NotSupportedError('Not implemented')
def reset_bios(self, identity): """Reset BIOS attributes to default :raises: `FishyError` if BIOS attributes cannot be processed """ raise error.NotSupportedError('Not implemented')