oneview_redfish_toolkit.api package

Submodules

oneview_redfish_toolkit.api.blade_chassis module

class oneview_redfish_toolkit.api.blade_chassis.BladeChassis(server_hardware)[source]

Bases: oneview_redfish_toolkit.api.chassis.Chassis

Creates a Blade Chassis Redfish dict

Populates self.redfish with some hardcoded Chassis values and with the response of OneView server hardware resources.

oneview_redfish_toolkit.api.blade_manager module

class oneview_redfish_toolkit.api.blade_manager.BladeManager(server_hardware)[source]

Bases: oneview_redfish_toolkit.api.manager.Manager

Creates a Manager Redfish dict for a Blade

Populates self.redfish with some hardcoded Manager values and with the response from OneView.

oneview_redfish_toolkit.api.chassis module

class oneview_redfish_toolkit.api.chassis.Chassis(oneview_resource)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Super class of Chassis resources

Populates self.redfish with common value between Enclosure, Rack and Blade.

SCHEMA_NAME = 'Chassis'

oneview_redfish_toolkit.api.chassis_collection module

class oneview_redfish_toolkit.api.chassis_collection.ChassisCollection(server_hardware, enclosures, racks)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Chassis Collection Redfish dict

Populates self.redfish with some hardcoded ChassisCollection values and with the response of Oneview with all server hardware, enclosures and racks resource.

SCHEMA_NAME = 'ChassisCollection'

oneview_redfish_toolkit.api.computer_system module

class oneview_redfish_toolkit.api.computer_system.ComputerSystem(server_hardware, server_hardware_types)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Computer System Redfish dict

Populates self.redfish with ComputerSystem data retrieved from oneview

SCHEMA_NAME = 'ComputerSystem'
get_oneview_power_configuration(reset_type)[source]

Maps Redfish’s power options to OneView’s power option

Maps the known Redfish power options to OneView Power option. If a unknown power option shows up it will raise an Exception.

Parameters:reset_type – Redfish power option.
Returns:Dict with OneView power configuration.
Return type:dict
Exception:
OneViewRedfishError: raises an exception if reset_type is an unmapped value.
map_boot(boot_list)[source]

Maps Oneview’s boot options to Redfish’s boot option

Maps the known OneView boot options to Redfish boot option. If a unknown boot option shows up it will be mapped to None

Parameters:boot_list – List with OneView boot options
Returns:list with Redfish boot options

oneview_redfish_toolkit.api.computer_system_collection module

class oneview_redfish_toolkit.api.computer_system_collection.ComputerSystemCollection(server_hardware)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Computer System Collection Redfish dict

Populates self.redfish with some hardcoded ComputerSystemCollection values and with the response of Oneview with all server hardware.

SCHEMA_NAME = 'ComputerSystemCollection'

oneview_redfish_toolkit.api.enclosure_chassis module

class oneview_redfish_toolkit.api.enclosure_chassis.EnclosureChassis(enclosure, environmental_configuration)[source]

Bases: oneview_redfish_toolkit.api.chassis.Chassis

Creates an Enclosure Chassis Redfish dict

Populates self.redfish with some hardcoded Enclosure Chassis values and with the response of OneView enclosure resources.

oneview_redfish_toolkit.api.enclosure_manager module

class oneview_redfish_toolkit.api.enclosure_manager.EnclosureManager(enclosure, oneview_version)[source]

Bases: oneview_redfish_toolkit.api.manager.Manager

Creates a Manager Redfish dict for Enclosure

Populates self.redfish with some hardcoded Manager values and with the response from OneView.

oneview_redfish_toolkit.api.errors module

exception oneview_redfish_toolkit.api.errors.OneViewRedfishError(msg)[source]

Bases: exceptions.Exception

exception oneview_redfish_toolkit.api.errors.OneViewRedfishResourceNotAccessibleError(resource_name, resource_type)[source]

Bases: oneview_redfish_toolkit.api.errors.OneViewRedfishError

exception oneview_redfish_toolkit.api.errors.OneViewRedfishResourceNotFoundError(resource_name, resource_type)[source]

Bases: oneview_redfish_toolkit.api.errors.OneViewRedfishError

oneview_redfish_toolkit.api.event module

class oneview_redfish_toolkit.api.event.Event(oneview_alert, event_type)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Event Redfish dict

Populates self.redfish with some hardcoded Event values and with the response from OneView.

SCHEMA_NAME = 'Event'

oneview_redfish_toolkit.api.event_service module

class oneview_redfish_toolkit.api.event_service.EventService(delivery_retry_attempts, delivery_retry_interval)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Event Service dict

Populates self.redfish with EventService values.

SCHEMA_NAME = 'EventService'
set_service_status()[source]

oneview_redfish_toolkit.api.manager module

class oneview_redfish_toolkit.api.manager.Manager(oneview_resource, firmware_version)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Manager Redfish dict

Populates self.redfish with some hardcoded Manager values and with the response from OneView.

SCHEMA_NAME = 'Manager'

oneview_redfish_toolkit.api.manager_collection module

class oneview_redfish_toolkit.api.manager_collection.ManagerCollection(server_hardware, enclosures)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Manager Collection Redfish dict

Populates self.redfish with some hardcoded ManagerCollection values and with the response of Oneview with all server hardware, enclosures resource.

SCHEMA_NAME = 'ManagerCollection'

oneview_redfish_toolkit.api.metadata module

class oneview_redfish_toolkit.api.metadata.Metadata(reference_list)[source]

Bases: object

Creates a redfish $metadata XML

serialize()[source]

oneview_redfish_toolkit.api.network_adapter module

class oneview_redfish_toolkit.api.network_adapter.NetworkAdapter(device_id, server_hardware)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a NetworkAdapter Redfish dict

Populates self.redfish with NetworkAdapter data retrieved from OneView

SCHEMA_NAME = 'NetworkAdapter'

oneview_redfish_toolkit.api.network_adapter_collection module

class oneview_redfish_toolkit.api.network_adapter_collection.NetworkAdapterCollection(server_hardware)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a NetworkAdapterCollection Redfish dict

Populates self.redfish with some hardcoded NetworkAdapterCollection values and Oneview ServerHardware result

SCHEMA_NAME = 'NetworkAdapterCollection'

oneview_redfish_toolkit.api.network_device_function module

class oneview_redfish_toolkit.api.network_device_function.NetworkDeviceFunction(device_id, device_function_id, server_hardware)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a NetworkDeviceFunction Redfish dict

Populates self.redfish with NetworkDeviceFunction data retrieved from OneView

SCHEMA_NAME = 'NetworkDeviceFunction'

oneview_redfish_toolkit.api.network_device_function_collection module

class oneview_redfish_toolkit.api.network_device_function_collection.NetworkDeviceFunctionCollection(device_id, server_hardware)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Network Device Function Collection Redfish dict

Populates self.redfish with a NetworkDeviceFunctionCollection

SCHEMA_NAME = 'NetworkDeviceFunctionCollection'

oneview_redfish_toolkit.api.network_interface module

class oneview_redfish_toolkit.api.network_interface.NetworkInterface(device_id, server_hardware)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a NetworkInterface Redfish dict

Populates self.redfish with NetworkInterface data retrieved from OneView

SCHEMA_NAME = 'NetworkInterface'

oneview_redfish_toolkit.api.network_interface_collection module

class oneview_redfish_toolkit.api.network_interface_collection.NetworkInterfaceCollection(server_hardware)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Network Interface Collection Redfish dict

Populates self.redfish with some hardcoded NetworkInterfaceCollection values and Oneview ServerHardware result

SCHEMA_NAME = 'NetworkInterfaceCollection'

oneview_redfish_toolkit.api.network_port module

class oneview_redfish_toolkit.api.network_port.NetworkPort(device_id, port_id, server_hardware)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a NetworkPort Redfish dict

Populates self.redfish with NetworkPort data retrieved from OneView

SCHEMA_NAME = 'NetworkPort'

oneview_redfish_toolkit.api.network_port_collection module

class oneview_redfish_toolkit.api.network_port_collection.NetworkPortCollection(server_hardware, device_id)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Network Port Collection Redfish dict

Populates self.redfish with some hardcoded NetworkPortCollection values and Oneview ServerHardware result.

SCHEMA_NAME = 'NetworkPortCollection'

oneview_redfish_toolkit.api.odata module

class oneview_redfish_toolkit.api.odata.Odata[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a hardcoded odata redfish dict

Populates self.redfish with a hardcoded odata values. These should have all service offered by the servers.

SCHEMA_NAME = None

oneview_redfish_toolkit.api.rack_chassis module

class oneview_redfish_toolkit.api.rack_chassis.RackChassis(rack)[source]

Bases: oneview_redfish_toolkit.api.chassis.Chassis

Creates a Rack Chassis Redfish dict

Populates self.redfish with some hardcoded Rack Chassis values and with the response of OneView Rack.

oneview_redfish_toolkit.api.redfish_error module

class oneview_redfish_toolkit.api.redfish_error.RedfishError(code, message)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Redfish Error Dict

Populates self.redfish with errors. Will not validate as there’s no schema to validate against.

SCHEMA_NAME = None
add_extended_info(message_id, message_args=[], related_properties=[])[source]

Adds an item to ExtendedInfo list using values from DMTF registry

Adds an item to ExtendedInfo list using the values for Message, Severity and Resolution from DMTF Base Registry.

Parameters:
  • message_id – Id of the message; oneOf the keys in Redfish Registry Messages
  • message_args – List of string to replace markers on Redfish messages. Must have the same length as the number of % signs found in the registry Message field
  • related_properties – Properties relates to this e error if necessary

oneview_redfish_toolkit.api.redfish_json_validator module

class oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator(schema_name)[source]

Bases: object

Validates a json object against a Redfish schema

Base class for redfish classes. Have a builtin validate method and a serialize method. Creates and empty OrderedDict called redfish which must be populated with the redfish data for validation. The Serialize method always validates the redfish content before generating the json string, It returns the redfish json string on successful validation and raises an exception on validation failure

get_resource_by_id(resource_list, resource_number_key, resource_id)[source]

Gets a specific resource in the resource list

Validates the resource ID and gets the resource in the resource list.

Parameters:
  • resource_list – List of resources.
  • resource_number_key – Field name of the resource number in the JSON.
  • resource_id – Resource’s ID that will be searched in the resource list.
Returns:

Resource in the list.

Exception:

OneViewRedfishError: If the ID is not an integer. OneViewRedfishResourceNotFoundError: If the resource

was not found.
serialize()[source]

Generates a json string from redfish content

Serialize the contents of self.redfish. Uses the value of indent_json from redfish section of ini file to indent or not the result.

Returns:json string with the contents of self.redfish
Return type:string

oneview_redfish_toolkit.api.scmb module

oneview_redfish_toolkit.api.scmb.check_cert_exist()[source]
oneview_redfish_toolkit.api.scmb.consume_message(ch, method, properties, body)[source]
oneview_redfish_toolkit.api.scmb.get_cert()[source]
oneview_redfish_toolkit.api.scmb.is_cert_working_with_scmb()[source]
oneview_redfish_toolkit.api.scmb.listen_scmb()[source]
oneview_redfish_toolkit.api.scmb.scmb_connect()[source]

oneview_redfish_toolkit.api.service_root module

class oneview_redfish_toolkit.api.service_root.ServiceRoot(oneview_uuid)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a hardcoded ServiceRoot redfish dict

Populates self.redfish with a hardcoded ServiceRoot values for a BladeSystem

SCHEMA_NAME = 'ServiceRoot'

oneview_redfish_toolkit.api.session module

class oneview_redfish_toolkit.api.session.Session(username)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Super class of Session Service

Populates self.redfish with Session response.

SCHEMA_NAME = 'Session'

oneview_redfish_toolkit.api.status_mapping module

oneview_redfish_toolkit.api.status_mapping.get_redfish_health(oneview_status)[source]

Gets corresponding Redfish Health

oneview_redfish_toolkit.api.status_mapping.get_redfish_state(oneview_status)[source]

Gets corresponding Redfish State

oneview_redfish_toolkit.api.storage module

class oneview_redfish_toolkit.api.storage.Storage(uuid, server_hardware_type)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Storage Redfish dict

Populates self.redfish with Storage data retrieved from OneView

SCHEMA_NAME = 'Storage'
map_supported_device_protos(drive_technologies)[source]

oneview_redfish_toolkit.api.storage_collection module

class oneview_redfish_toolkit.api.storage_collection.StorageCollection(uuid)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Storage Collection Redfish dict

Populates self.redfish with some hardcoded StorageCollection values

SCHEMA_NAME = 'StorageCollection'

oneview_redfish_toolkit.api.subscription module

class oneview_redfish_toolkit.api.subscription.Subscription(subscription_id, destination, event_types, context)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates the Subscription class

Populates self.redfish with Subscription response.

SCHEMA_NAME = 'EventDestination'
get_event_types()[source]

Gets the list of event types

get_id()[source]

Gets subscription Id

oneview_redfish_toolkit.api.subscription_collection module

class oneview_redfish_toolkit.api.subscription_collection.SubscriptionCollection(all_subscriptions)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Subscription Collection Redfish dict

Populates self.redfish with some hardcoded SubscriptionCollection values

SCHEMA_NAME = 'EventDestinationCollection'

oneview_redfish_toolkit.api.thermal module

class oneview_redfish_toolkit.api.thermal.Thermal(utilization, uuid, name)[source]

Bases: oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator

Creates a Thermal Redfish dict

Populates self.redfish with Thermal data retrieved from OneView

SCHEMA_NAME = 'Thermal'

Module contents