Getting Started - API
It makes use of a new version of our API which provides much greater flexibility. To make use of it, first ensure that you have the latest version of the sanblaze Python package installed, then do the following in an interpreter session or a script:
sb_python -m pip install sanblaze --pre --upgrade
Import the new API object. Note that other portions of the API are under active development, so may be unstable.
from sanblaze import APICreate an instance of the API, and pass in the target number of your device on the system.
a = API(101)Call get_features on the object, with the desired Feature Identifier.
result = a.get_features(0x7e)This returns a dictionary containing the parsed drive response, and some other details.
{'status': 0, 'reason': 'Success', 'cqe': {'DW2': {'SQID': 0, 'SQHD': 46}, 'DW3': {'SF': {'DNR': 0, 'M': 0, 'CRD': 0, 'SCT': 0, 'SC': 0}, 'P': 1, 'CID': 378}}, 'time_us': 1816, 'data': {'Number of Metadata Element Descriptors': 3, 'Reserved 01:01': 0, 'Metadata Element Descriptor 0': {'ET': 1, 'Reserved 07:05': 0, 'ER': 0, 'Reserved 15:12': 0, 'ELEN': 13, 'EVAL': {'Operating System Controller Name': 'efffefffffffg'}}, 'Metadata Element Descriptor 1': {'ET': 2, 'Reserved 07:05': 0, 'ER': 0, 'Reserved 15:12': 0, 'ELEN': 13, 'EVAL': {'Operating System Driver Name': 'efffdfffffffg'}}, 'Metadata Element Descriptor 2': {'ET': 3, 'Reserved 07:05': 0, 'ER': 0, 'Reserved 15:12': 0, 'ELEN': 10, 'EVAL': {'Operating System Driver Version': 'efffdfffff'}}}}‘status’ is 0 if the command was successful, and 1 otherwise.
‘reason’ will provide an explanation of the status.
‘cqe’ is the parse Completion Queue Entry
‘time_us’ is the command duration in microseconds
‘data’ is the parsed data buffer returned from the drive
To show the contents of ‘data’ in an easily readable format, you can call call its internal function display()
result['data'].display() Get Features - Controller Metadata ---------------------------------- Number of Metadata Element Descriptors 03h Reserved 01:01 00h Metadata Element Descriptor 0 : ET 0_0001b Reserved 07:05 000b ER 0000b Reserved 15:12 0000b ELEN 0000_0000_0000_1101b EVAL : : Operating System Controller Name efffefffffffg Metadata Element Descriptor 1 : ET 0_0010b Reserved 07:05 000b ER 0000b Reserved 15:12 0000b ELEN 0000_0000_0000_1101b EVAL : : Operating System Driver Name efffdfffffffg Metadata Element Descriptor 2 : ET 0_0011b Reserved 07:05 000b ER 0000b Reserved 15:12 0000b ELEN 0000_0000_0000_1010b EVAL : : Operating System Driver Version efffdfffff