Version check and device selection

Describes the /version, /reset and /descriptor endpoints.

These examples are meant to be run on the device!
If you want to run them from a remote computer, you need to change “localhost” to the IP/hostname.
You will also need to generate an access token and use the “auth basic” method.
Tokens can be generated on the http://noreya-nexus.local/nexuscontrolui/system/settings#access-token page.
The username is always “token” while the password must be token value.
You may also want to use the secure protocol https://.

GET /

The “/” (/1.0,/1.1,…) endpoint shows version information and all connected devices handled by this driver.

The “version": “api”: {…} resource must be checked for compatibility by any client.

The “devices” array contains all usable devices and the “slot_number” number must be used to build the further URL.
e.g: “slot_number” is 3:

<HOSTNAME>/api/<service>/<version>/3/descriptor

For the versioning strategy and format, see the Versioning chapter.

The fields “driver_session” and “device_session” must stored by the client and checked frequently.
If any of the values change the client must re-initialize the device.

Request:

Method: GET
URL : localhost/api/<service>/<version>/

Response:

{
  "driver_session": "<String>",
  "version": {
    "api": {
      "major": <uint>,
      "minor": <uint>,
      "patch": <uint>
    },
    "service": {
      "major": <uint>,
      "minor": <uint>,
      "patch": <uint>
    },
    "module_driver": {
      "major": <uint>,
      "minor": <uint>,
      "patch": <uint>
    },
    "kernel_driver": {
      "major": <uint>,
      "minor": <uint>,
      "patch": <uint>
    }
  },
  "devices": [
    {
      "slot_number": <uint>,
      "sdbp_version": {
        "major": <uint>,
        "minor": <uint>,
        "patch": <uint>
      },
      "device_session": "<String>"
    }
  ]
}

Example:

Request:

curl http://localhost/api/bmc/1.0/

Response:

{
  "driver_session": "ZVHGTLCFDUD1FKLJCHG5PWYULHVRJ8AV7Q8A2W703UHVYZFYJPWUCYNDSR65AWUU",
  "version": {
    "api": {
      "major": 0,
      "minor": 9,
      "patch": 0
    },
    "service": {
      "major": 0,
      "minor": 9,
      "patch": 0
    },
    "module_driver": {
      "major": 0,
      "minor": 9,
      "patch": 0
    },
    "kernel_driver": {
      "major": 1,
      "minor": 1,
      "patch": 0
    }
  },
  "devices": [
    {
      "slot_number": 0,
      "sdbp_version": {
        "major": 1,
        "minor": 0,
        "patch": 0
      },
      "device_session": "AAHGTLCFDUD1FKLJCHG5PWYULHVRJ8AV7Q8A2W703UHVYZFYJPWUCYNDSR65AWSS"
    }
  ]
}

POST /reset

Resets the entire module to the initial state.
This is equal to a driver restart (SUSPEND) not a system reset (SYSTEM_RESET).

Request:

Method: POST
URL: localhost/api/<service>/<version>/<slot>/reset

Parameters:

{
  "reset": "yes"
}

Response:

{
  "status": "success"
}

Example

Request:

curl http://localhost/api/bmc/1.0/0/reset --header "Content-Type: application/json" --request POST --data '{"reset": "yes"}'

Response:

{
  "status": "success"
}

GET /descriptor

The “/descriptor” endpoint shows the device descriptor.

Request:

Method: GET
URL : localhost/api/<service>/<version>/<slot>/descriptor

Response:

{
  "slot_number": <uint>,
  "vendor_product_id": <string>,
  "product_name": <string>,
  "vendor_name": <string>,
  "serial_code": <string>,
  "fw_version": {
    "stability": <string>,
    "version": {
      "major": <uint>,
      "minor": <uint>,
      "patch": <uint>
    }
  },
  "hw_version": {
    "major": <uint>,
    "minor": <uint>,
    "patch": <uint>
  },
  "protocol_version": {
    "major": <uint>,
    "minor": <uint>,
    "patch": <uint>
  },
  "bootloader_state": <string>,
  "max_frame_size": <uint>,
  "max_power_12v": <uint>,
  "max_power_5v0": <uint>,
  "max_power_3v3": <uint>,
  "max_sclk_speed": <uint>
}

Example:

Request:

curl http://localhost/api/bmc/1.0/0/descriptor

Response:

{
  "slot_number": 0,
  "vendor_product_id": "modules.noreya.tech/bmc",
  "product_name": "Baseboard Management Controller",
  "vendor_name": "NOREYA",
  "serial_code": "0000-0000-2039-3639-424E-5317-003A-0036",
  "fw_version": {
    "stability": "A",
    "version": {
      "major": 0,
      "minor": 9,
      "patch": 3
    }
  },
  "hw_version": {
    "major": 4,
    "minor": 1,
    "patch": 1
  },
  "protocol_version": {
    "major": 1,
    "minor": 0,
    "patch": 0
  },
  "bootloader_state": "supported",
  "max_frame_size": 64,
  "max_power_12v": 0,
  "max_power_5v0": 550,
  "max_power_3v3": 7915,
  "max_sclk_speed": 16000
}