sushy.resources package¶
Subpackages¶
- sushy.resources.chassis package
- Subpackages
- Submodules
- sushy.resources.chassis.chassis module
ActionsField
Chassis
Chassis.asset_tag
Chassis.chassis_type
Chassis.depth_mm
Chassis.description
Chassis.get_allowed_reset_chassis_values()
Chassis.height_mm
Chassis.identity
Chassis.indicator_led
Chassis.managers
Chassis.manufacturer
Chassis.model
Chassis.name
Chassis.part_number
Chassis.physical_security
Chassis.power
Chassis.power_state
Chassis.reset_chassis()
Chassis.serial_number
Chassis.set_indicator_led()
Chassis.sku
Chassis.status
Chassis.systems
Chassis.thermal
Chassis.uuid
Chassis.weight_kg
Chassis.width_mm
ChassisCollection
PhysicalSecurity
- sushy.resources.chassis.constants module
CHASSIS_INTRUSION_SENSOR_HARDWARE_INTRUSION
CHASSIS_INTRUSION_SENSOR_NORMAL
CHASSIS_INTRUSION_SENSOR_RE_ARM_AUTOMATIC
CHASSIS_INTRUSION_SENSOR_RE_ARM_MANUAL
CHASSIS_INTRUSION_SENSOR_TAMPERING_DETECTED
CHASSIS_TYPE_BLADE
CHASSIS_TYPE_CARD
CHASSIS_TYPE_CARTRIDGE
CHASSIS_TYPE_COMPONENT
CHASSIS_TYPE_DRAWER
CHASSIS_TYPE_ENCLOSURE
CHASSIS_TYPE_EXPANSION
CHASSIS_TYPE_IP_BASED_DRIVE
CHASSIS_TYPE_MODULE
CHASSIS_TYPE_OTHER
CHASSIS_TYPE_POD
CHASSIS_TYPE_RACK
CHASSIS_TYPE_RACK_GROUP
CHASSIS_TYPE_RACK_MOUNT
CHASSIS_TYPE_ROW
CHASSIS_TYPE_SHELF
CHASSIS_TYPE_SIDECAR
CHASSIS_TYPE_SLED
CHASSIS_TYPE_STAND_ALONE
CHASSIS_TYPE_STORAGE_ENCLOSURE
CHASSIS_TYPE_ZONE
- sushy.resources.chassis.mappings module
- Module contents
- sushy.resources.compositionservice package
- Submodules
- sushy.resources.compositionservice.compositionservice module
- sushy.resources.compositionservice.constants module
- sushy.resources.compositionservice.mappings module
- sushy.resources.compositionservice.resourceblock module
- sushy.resources.compositionservice.resourcezone module
- Module contents
- sushy.resources.eventservice package
- Submodules
- sushy.resources.eventservice.constants module
- sushy.resources.eventservice.eventdestination module
- sushy.resources.eventservice.eventservice module
ActionsField
EventService
EventService.delivery_retry_attempts
EventService.delivery_retry_interval
EventService.event_types_for_subscription
EventService.get_event_types_for_subscription()
EventService.identity
EventService.name
EventService.service_enabled
EventService.status
EventService.submit_test_event()
EventService.subscriptions
- sushy.resources.eventservice.mappings module
- Module contents
- sushy.resources.fabric package
- Submodules
- sushy.resources.fabric.constants module
- sushy.resources.fabric.endpoint module
- sushy.resources.fabric.fabric module
- sushy.resources.fabric.mappings module
- Module contents
- sushy.resources.manager package
- Submodules
- sushy.resources.manager.constants module
COMMAND_SHELL_IPMI
COMMAND_SHELL_OEM
COMMAND_SHELL_SSH
COMMAND_SHELL_TELNET
GRAPHICAL_CONSOLE_KVMIP
GRAPHICAL_CONSOLE_OEM
MANAGER_TYPE_AUXILIARY_CONTROLLER
MANAGER_TYPE_BMC
MANAGER_TYPE_ENCLOSURE_MANAGER
MANAGER_TYPE_MANAGEMENT_CONTROLLER
MANAGER_TYPE_RACK_MANAGER
RESET_MANAGER_FORCE_RESTART
RESET_MANAGER_GRACEFUL_RESTART
SERIAL_CONSOLE_IPMI
SERIAL_CONSOLE_OEM
SERIAL_CONSOLE_SSH
SERIAL_CONSOLE_TELNET
- sushy.resources.manager.manager module
ActionsField
Manager
Manager.auto_dst_enabled
Manager.chassis
Manager.command_shell
Manager.description
Manager.firmware_version
Manager.get_allowed_reset_manager_values()
Manager.get_supported_command_shell_types()
Manager.get_supported_graphical_console_types()
Manager.get_supported_serial_console_types()
Manager.graphical_console
Manager.identity
Manager.manager_type
Manager.model
Manager.name
Manager.reset_manager()
Manager.serial_console
Manager.systems
Manager.uuid
Manager.virtual_media
ManagerCollection
RemoteAccessField
- sushy.resources.manager.mappings module
- sushy.resources.manager.virtual_media module
- Module contents
- sushy.resources.oem package
- sushy.resources.registry package
- Submodules
- sushy.resources.registry.attribute_registry module
AttributeListField
AttributeListField.allowable_values
AttributeListField.attribute_type
AttributeListField.default_value
AttributeListField.display_name
AttributeListField.immutable
AttributeListField.lower_bound
AttributeListField.max_length
AttributeListField.min_length
AttributeListField.name
AttributeListField.read_only
AttributeListField.reset_required
AttributeListField.unique
AttributeListField.upper_bound
AttributeRegistry
AttributeRegistryEntryField
- sushy.resources.registry.message_registry module
- sushy.resources.registry.message_registry_file module
- Module contents
- sushy.resources.sessionservice package
- sushy.resources.system package
- Subpackages
- Submodules
- sushy.resources.system.bios module
- sushy.resources.system.constants module
BOOT_SOURCE_TARGET_BIOS_SETUP
BOOT_SOURCE_TARGET_CD
BOOT_SOURCE_TARGET_DIAGS
BOOT_SOURCE_TARGET_FLOPPY
BOOT_SOURCE_TARGET_HDD
BOOT_SOURCE_TARGET_NONE
BOOT_SOURCE_TARGET_PXE
BOOT_SOURCE_TARGET_SD_CARD
BOOT_SOURCE_TARGET_UEFI_HTTP
BOOT_SOURCE_TARGET_UEFI_SHELL
BOOT_SOURCE_TARGET_UEFI_TARGET
BOOT_SOURCE_TARGET_USB
BOOT_SOURCE_TARGET_USB_CD
BOOT_SOURCE_TARGET_UTILITIES
SECURE_BOOT_DISABLED
SECURE_BOOT_ENABLED
SYSTEM_INDICATOR_LED_BLINKING
SYSTEM_INDICATOR_LED_LIT
SYSTEM_INDICATOR_LED_OFF
SYSTEM_INDICATOR_LED_UNKNOWN
SYSTEM_POWER_STATE_OFF
SYSTEM_POWER_STATE_ON
SYSTEM_POWER_STATE_POWERING_OFF
SYSTEM_POWER_STATE_POWERING_ON
SYSTEM_TYPE_COMPOSED
SYSTEM_TYPE_OS
SYSTEM_TYPE_PHYSICAL
SYSTEM_TYPE_PHYSICALLY_PARTITIONED
SYSTEM_TYPE_VIRTUAL
SYSTEM_TYPE_VIRTUALLY_PARTITIONED
- sushy.resources.system.ethernet_interface module
- sushy.resources.system.mappings module
- sushy.resources.system.processor module
- sushy.resources.system.secure_boot module
- sushy.resources.system.secure_boot_database module
- sushy.resources.system.simple_storage module
- sushy.resources.system.system module
ActionsField
BootField
MemorySummaryField
System
System.asset_tag
System.bios
System.bios_version
System.boot
System.chassis
System.description
System.ethernet_interfaces
System.get_allowed_reset_system_values()
System.get_allowed_system_boot_source_values()
System.hostname
System.identity
System.indicator_led
System.maintenance_window
System.managers
System.manufacturer
System.memory_summary
System.name
System.part_number
System.power_state
System.processors
System.reset_system()
System.secure_boot
System.serial_number
System.set_indicator_led()
System.set_system_boot_options()
System.set_system_boot_source()
System.simple_storage
System.sku
System.status
System.storage
System.system_type
System.uuid
SystemCollection
- Module contents
- sushy.resources.taskservice package
- sushy.resources.updateservice package
- Submodules
- sushy.resources.updateservice.constants module
- sushy.resources.updateservice.mappings module
- sushy.resources.updateservice.softwareinventory module
SoftwareInventory
SoftwareInventory.identity
SoftwareInventory.lowest_supported_version
SoftwareInventory.manufacturer
SoftwareInventory.name
SoftwareInventory.related_item
SoftwareInventory.release_date
SoftwareInventory.software_id
SoftwareInventory.status
SoftwareInventory.uefi_device_paths
SoftwareInventory.updateable
SoftwareInventory.version
SoftwareInventoryCollection
- sushy.resources.updateservice.updateservice module
ActionsField
UpdateService
UpdateService.firmware_inventory
UpdateService.get_allowed_transfer_protocols()
UpdateService.get_task_monitor()
UpdateService.http_push_uri
UpdateService.http_push_uri_targets
UpdateService.http_push_uri_targets_busy
UpdateService.identity
UpdateService.name
UpdateService.service_enabled
UpdateService.simple_update()
UpdateService.software_inventory
UpdateService.status
- Module contents
Submodules¶
sushy.resources.base module¶
- class sushy.resources.base.AbstractDataReader¶
Bases:
object
- abstract get_data()¶
Based on data source get data and parse to JSON
- set_connection(connector, path)¶
Sets mandatory connection parameters
- Parameters:
connector – A Connector instance
path – path of the resource
- class sushy.resources.base.CompositeField(*args, **kwargs)¶
Bases:
Mapping
,Field
Base class for fields consisting of several sub-fields.
- class sushy.resources.base.DictionaryField(*args, **kwargs)¶
Bases:
Field
Base class for fields consisting of dictionary of several sub-fields.
- class sushy.resources.base.Field(path, required=False, default=None, adapter=<function Field.<lambda>>)¶
Bases:
object
Definition for fields fetched from JSON.
- class sushy.resources.base.FieldData(status_code, headers, json_doc)¶
Bases:
object
Contains data to be used when constructing Fields
- property headers¶
The headers
- property json_doc¶
The parsed JSON body
- property status_code¶
The status code
- class sushy.resources.base.JsonArchiveReader(archive_file)¶
Bases:
AbstractDataReader
Gets the data from JSON file in archive
- get_data()¶
Gets JSON file from archive. Currently supporting ZIP only
- class sushy.resources.base.JsonDataReader¶
Bases:
AbstractDataReader
Gets the data from HTTP response given by path
- get_data()¶
Gets JSON file from URI directly
- class sushy.resources.base.JsonPackagedFileReader(resource_package_name)¶
Bases:
AbstractDataReader
Gets the data from packaged file given by path
- get_data()¶
Gets JSON file from packaged file denoted by path
- class sushy.resources.base.JsonPublicFileReader¶
Bases:
AbstractDataReader
Loads the data from the Internet
- get_data()¶
Get JSON file from full URI
- class sushy.resources.base.LinksField(*args, **kwargs)¶
Bases:
CompositeField
Reference to linked resources.
- oem_vendors = <sushy.resources.base.Field object>¶
- class sushy.resources.base.ListField(*args, **kwargs)¶
Bases:
Field
Base class for fields consisting of a list of several sub-fields.
- class sushy.resources.base.MappedField(field, mapping, required=False, default=None)¶
Bases:
Field
Field taking real value from a mapping.
- class sushy.resources.base.MappedListField(field, mapping, required=False, default=None)¶
Bases:
Field
Field taking a list of values with a mapping for the values
Given JSON {‘field’:[‘xxx’, ‘yyy’]}, a sushy resource definition and mapping {‘xxx’:’a’, ‘yyy’:’b’}, the sushy object to come out will be like resource.field = [‘a’, ‘b’]
- class sushy.resources.base.MessageListField(*args, **kwargs)¶
Bases:
ListField
List of messages with details of settings update status
- message = <sushy.resources.base.Field object>¶
Human readable message, if provided
- message_args = <sushy.resources.base.Field object>¶
List of message substitution arguments for the message referenced by message_id from the message registry
- message_id = <sushy.resources.base.Field object>¶
The key for this message which can be used to look up the message in a message registry
- resolution = <sushy.resources.base.Field object>¶
Used to provide suggestions on how to resolve the situation that caused the error
- severity = <sushy.resources.base.MappedField object>¶
Severity of the error
- class sushy.resources.base.ResourceBase(connector, path='', redfish_version=None, registries=None, reader=None, json_doc=None, root=None)¶
Bases:
object
- clone_resource(new_resource, path='')¶
Instantiate given resource using existing BMC connection context
- get_oem_extension(vendor)¶
Get the OEM extension instance for this resource by OEM vendor
- Parameters:
vendor – the OEM vendor string which is the vendor-specific extensibility identifier. Examples are ‘Contoso’, ‘Hpe’. Possible value can be got from
oem_vendors
attribute.- Returns:
the Redfish resource OEM extension instance.
- Raises:
OEMExtensionNotFoundError
- invalidate(force_refresh=False)¶
Mark the resource as stale, prompting refresh() before getting used.
If
force_refresh
is set to True, then it invokesrefresh()
on the resource.- Parameters:
force_refresh – will invoke refresh on the resource, if set to True.
- Raises:
ResourceNotFoundError
- Raises:
ConnectionError
- Raises:
HTTPError
- property json¶
- links = <sushy.resources.base.LinksField object>¶
- property oem_vendors¶
- property path¶
- redfish_version = None¶
The Redfish version
- refresh(force=True, json_doc=None)¶
Refresh the resource
Freshly retrieves/fetches the resource attributes and invokes
_parse_attributes()
method on successful retrieval. It is recommended not to override this method in concrete ResourceBase classes. Resource classes can place their refresh specific operations in_do_refresh()
method, if needed. This method represents the template method in the paradigm of Template design pattern.- Parameters:
force – if set to False, will only refresh if the resource is marked as stale, otherwise neither it nor its subresources will be refreshed.
json_doc – parsed JSON document in form of Python types.
- Raises:
ResourceNotFoundError
- Raises:
ConnectionError
- Raises:
HTTPError
- property registries¶
- property resource_name¶
- property root¶
- class sushy.resources.base.ResourceCollectionBase(connector, path, redfish_version=None, registries=None, root=None)¶
Bases:
ResourceBase
- get_member(identity)¶
Given the identity return a
_resource_type
object- Parameters:
identity – The identity of the
_resource_type
- Returns:
The
_resource_type
object- Raises:
ResourceNotFoundError
- get_members()¶
Return a list of
_resource_type
objects present in collection- Returns:
A list of
_resource_type
objects
- members_identities = <sushy.resources.base.Field object>¶
A tuple with the members identities
- name = <sushy.resources.base.Field object>¶
The name of the collection
- sushy.resources.base.get_reader(connector, path, reader=None)¶
Create and configure the reader.
- Parameters:
connector – A Connector instance
path – sub-URI path to the resource.
reader – Reader to use to fetch JSON data.
- Returns:
the reader
sushy.resources.common module¶
- class sushy.resources.common.ActionField(*args, **kwargs)¶
Bases:
CompositeField
- operation_apply_time_support = <sushy.resources.common.OperationApplyTimeSupportField object>¶
- target_uri = <sushy.resources.base.Field object>¶
- class sushy.resources.common.IdRefField(*args, **kwargs)¶
Bases:
CompositeField
Reference to the resource odata identity field.
- resource_uri = <sushy.resources.base.Field object>¶
The unique identifier for a resource
- class sushy.resources.common.IdentifiersListField(*args, **kwargs)¶
Bases:
ListField
This type describes any additional identifiers for a resource.
- durable_name = <sushy.resources.base.Field object>¶
This indicates the world wide, persistent name of the resource.
- durable_name_format = <sushy.resources.base.MappedField object>¶
This represents the format of the DurableName property.
- class sushy.resources.common.InitializeActionField(*args, **kwargs)¶
Bases:
ActionField
- allowed_values = <sushy.resources.base.Field object>¶
- class sushy.resources.common.OperationApplyTimeSupportField¶
Bases:
CompositeField
- maintenance_window_duration_in_seconds = <sushy.resources.base.Field object>¶
The expiry time of maintenance window in seconds
- maintenance_window_start_time = <sushy.resources.base.Field object>¶
The start time of a maintenance window
- mapped_supported_values = <sushy.resources.base.MappedListField object>¶
The types of apply times that the client is allowed request when performing a create, delete, or action operation returned as a mapped list
- supported_values = <sushy.resources.base.Field object>¶
The types of apply times that the client is allowed request when performing a create, delete, or action operation returned as an unmapped list
Deprecated: Use mapped_supported_values.
- class sushy.resources.common.ResetActionField(*args, **kwargs)¶
Bases:
ActionField
- allowed_values = <sushy.resources.base.Field object>¶
- class sushy.resources.common.StatusField(*args, **kwargs)¶
Bases:
CompositeField
This Field describes the status of a resource and its children.
This field shall contain any state or health properties of a resource.
- health = <sushy.resources.base.MappedField object>¶
Represents health of resource w/o considering its dependent resources
- health_rollup = <sushy.resources.base.MappedField object>¶
Represents health state of resource and its dependent resources
- state = <sushy.resources.base.MappedField object>¶
Indicates the known state of the resource, such as if it is enabled.
sushy.resources.constants module¶
- sushy.resources.constants.INDICATOR_LED_BLINKING = 'indicator led blinking'¶
The Indicator LED is blinking
- sushy.resources.constants.INDICATOR_LED_LIT = 'indicator led lit'¶
The Indicator LED is lit
- sushy.resources.constants.INDICATOR_LED_OFF = 'indicator led off'¶
The Indicator LED is off
- sushy.resources.constants.INDICATOR_LED_UNKNOWN = 'indicator led unknown'¶
The state of the Indicator LED cannot be determine
- sushy.resources.constants.POWER_STATE_OFF = 'off'¶
The resource is powered off, although some components may continue to have AUX power such as management controller
- sushy.resources.constants.POWER_STATE_ON = 'on'¶
The resource is powered on
- sushy.resources.constants.POWER_STATE_POWERING_OFF = 'powering off'¶
A temporary state between On and Off. The power off action can take time while the OS is in the shutdown process
- sushy.resources.constants.POWER_STATE_POWERING_ON = 'powering on'¶
A temporary state between Off and On. This temporary state can be very short
- sushy.resources.constants.RESET_TYPE_FORCE_OFF = 'force off'¶
Turn the unit off immediately (non-graceful shutdown)
- sushy.resources.constants.RESET_TYPE_FORCE_ON = 'force on'¶
Turn the unit on immediately
- sushy.resources.constants.RESET_TYPE_FORCE_RESTART = 'force restart'¶
Perform an immediate (non-graceful) shutdown, followed by a restart
- sushy.resources.constants.RESET_TYPE_GRACEFUL_RESTART = 'graceful restart'¶
Perform a graceful shutdown followed by a restart of the system
- sushy.resources.constants.RESET_TYPE_GRACEFUL_SHUTDOWN = 'graceful shutdown'¶
Perform a graceful shutdown and power off
- sushy.resources.constants.RESET_TYPE_NMI = 'nmi'¶
Generate a Diagnostic Interrupt (usually an NMI on x86 systems) to cease normal operations, perform diagnostic actions and typically halt the system
- sushy.resources.constants.RESET_TYPE_ON = 'on'¶
Turn the unit on
- sushy.resources.constants.RESET_TYPE_POWER_CYCLE = 'power cycle'¶
Perform a power cycle of the unit
- sushy.resources.constants.RESET_TYPE_PUSH_POWER_BUTTON = 'push power button'¶
Simulate the pressing of the physical power button on this unit
sushy.resources.mappings module¶
sushy.resources.settings module¶
- class sushy.resources.settings.MaintenanceWindowField(*args, **kwargs)¶
Bases:
CompositeField
- maintenance_window_duration_in_seconds = <sushy.resources.base.Field object>¶
The expiry time of maintenance window in seconds
- maintenance_window_start_time = <sushy.resources.base.Field object>¶
The start time of a maintenance window
- sushy.resources.settings.NO_UPDATES = 4¶
No updates made
- class sushy.resources.settings.SettingsApplyTimeField¶
Bases:
CompositeField
- apply_time = <sushy.resources.base.Field object>¶
When the future configuration should be applied
- apply_time_allowable_values = <sushy.resources.base.Field object>¶
The list of allowable ApplyTime values
- maintenance_window_duration_in_seconds = <sushy.resources.base.Field object>¶
The expiry time of maintenance window in seconds
- maintenance_window_start_time = <sushy.resources.base.Field object>¶
The start time of a maintenance window
- class sushy.resources.settings.SettingsField¶
Bases:
CompositeField
The settings of a resource
Represents the future state and configuration of the resource. The field is added to resources that support future state and configuration.
This field includes several properties to help clients monitor when the resource is consumed by the service and determine the results of applying the values, which may or may not have been successful.
- commit(connector, value)¶
Commits new settings values
The new values will be applied when the system or a service restarts.
- Parameters:
connector – A Connector instance
value – Value representing JSON whose structure is specific to each resource and the caller must format it correctly
- get_status(registries)¶
Determines the status of last update based
Uses message id-s and severity to determine the status.
- Parameters:
registries – registries to use to parse message
- Returns:
SettingsUpdate
object containing status and any messages
- property maintenance_window¶
MaintenanceWindow field
Indicates if a given resource has a maintenance window assignment for applying settings or operations
- messages = <sushy.resources.base.MessageListField object>¶
Represents the results of the last time the values of the Settings resource were applied to the server
- property operation_apply_time_support¶
OperationApplyTimeSupport field
Indicates if a client is allowed to request for a specific apply time of a create, delete, or action operation of a given resource
- property resource_uri¶
- time = <sushy.resources.base.Field object>¶
Indicates the time the settings were applied to the server
- class sushy.resources.settings.SettingsUpdate(status, messages)¶
Bases:
object
Contains Settings update status and details of the update
- property messages¶
List of
MessageListField
with messages from the update
- property status¶
The status of the update
- sushy.resources.settings.UPDATE_FAILURE = 2¶
Update encountered errors
- sushy.resources.settings.UPDATE_PENDING = 3¶
Update waiting for being applied
- sushy.resources.settings.UPDATE_SUCCESS = 1¶
Update was successful
- sushy.resources.settings.UPDATE_UNKNOWN = 0¶
Update status unknown
sushy.resources.task_monitor module¶
- class sushy.resources.task_monitor.TaskMonitor(connector, path='', redfish_version=None, root=None)¶
Bases:
ResourceBase
Deprecated: Use sushy.taskmonitor.TaskMonitor
- property in_progress¶
Checks the status of the async task
- Returns:
True if the async task is still in progress, False otherwise
- property location_header¶
The Location header returned from the GET on the Task Monitor
- Returns:
The Location header (an absolute URL)
- property response¶
The response from the last TaskMonitor in_progress check
- Returns:
The requests response object or None
- property retry_after¶
Time the client should wait before querying the task status
- Returns:
The Retry-After time in datetime format
- set_retry_after(value)¶
Set the time the client should wait before querying the task status
- Parameters:
value – The value of the Retry-After header, which can be the number of seconds to wait or an HTTP-date string as defined by RFC 7231
- Returns:
The TaskMonitor object
- property sleep_for¶
Seconds the client should wait before querying the operation status
- Returns:
The number of seconds to wait