softlayer / softlayer.github.io

A collection of SoftLayer API examples in a variety of languages
https://softlayer.github.io
13 stars 18 forks source link

SoftLayer_Hardware_Server API serivce: SoftLayer_Hardware_Server is lack of bios/ipmi firmware update info #340

Closed jujuv587 closed 2 months ago

jujuv587 commented 7 months ago

SoftLayer_Hardware_Server API serivce: SoftLayer_Hardware_Server is lack of bios/ipmi firmware update info.

Hi IBM Cloud, when a baremetal needs a critical firmware update on bios/ipmi, it only shows from UI page.

Screenshot 2024-04-05 at 4 07 29 PM

I’m developing an SL API service automation to confirm if a firmware has critical updates to do before sending power off commands and perform firmware updates.

I looked into

https://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/

However, the service only contains firmwareUpdate functionalities without providing the current version/up-to-date version/firmware Update status info.

I also looked into SoftLayer_Hardware_Component_Firmware data type returned and found the create/build dates, isQualified, serverity info, version is not well recorded in terms of getting current/target version and lack of explanation on the document link.

Could you please let me know if there’s a way in softlayer API that can provide firmware update required info or how SoftLayer_Hardware_Component_Firmware data type attributes recorded?

Thanks

allmightyspiff commented 2 months ago

Hello,

Sorry for the delay on answering this. SoftLayer_Hardware_Component::hasUpgradeableFirmware is the property you are looking for.

API response would look something like this:

slcli --format=json call-api SoftLayer_Hardware_Server getObject --id=3220256 --mask="mask[id,hostname,activeComponents[id,revision,componentRevision,hasUpgradeableFirmware]]"
{
  "hostname": "fra02-ocp-virt",
  "id": 3220256,
  "activeComponents": [
    {
      "componentRevision": "TN05",
      "hasUpgradeableFirmware": true,
      "id": 19906770,
      "revision": {
        "firmwareVersionId": 110505,
        "hardwareComponentId": 19906770,
        "id": 13404668,
        "revision": "TN05"
      }
    },
    {
      "componentRevision": null,
      "hasUpgradeableFirmware": false,
      "id": 13120803,
      "revision": {
        "firmwareVersionId": null,
        "hardwareComponentId": 13120803,
        "id": 5768905
      }
    },
    {
      "componentRevision": " 7.00",
      "hasUpgradeableFirmware": true,
      "id": 22811766,
      "revision": {
        "firmwareVersionId": 186238,
        "hardwareComponentId": 22811766,
        "id": 16507548,
        "revision": " 7.00"
      }
    }
  ]
}

Hope that helps.

Also, the component->hardwareComponentModel->firmwares relationship will show you which firmware versions are available for a given component.

Output would look something like this.


slcli --format=json call-api SoftLayer_Hardware_Server getObject --id=3220256 --mask="mask[id,hostname,activeComponents[id,revision,componentRevision,hasUpgradeableFirmware,hardwareComponentModel[id,firmwares]]]"

{
  "hostname": "fra02-ocp-virt",
  "id": 3220256,
  "activeComponents": [
    {
      "componentRevision": " 7.00",
      "hardwareComponentModel": {
        "id": 3340,
        "firmwares": [
          {
            "buildDate": null,
            "createDate": "2024-05-30T13:02:25-06:00",
            "hardwareComponentModelId": 3340,
            "id": 279379,
            "isQualified": 1,
            "severity": 2,
            "version": "9.20"
          },
          {
            "buildDate": null,
            "createDate": "2020-10-26T10:05:36-06:00",
            "hardwareComponentModelId": 3340,
            "id": 198940,
            "isQualified": 0,
            "severity": 3,
            "version": " 7.00(7.00)"
          },
          {
            "buildDate": null,
            "createDate": "2023-01-27T09:54:39-06:00",
            "hardwareComponentModelId": 3340,
            "id": 252818,
            "isQualified": 0,
            "severity": 3,
            "version": "7.00(7.00)"
          },
          {
            "buildDate": null,
            "createDate": "2020-07-07T20:43:22-06:00",
            "hardwareComponentModelId": 3340,
            "id": 186138,
            "isQualified": 0,
            "severity": 3,
            "version": "7.00"
          },
          {
            "buildDate": null,
            "createDate": "2019-11-24T16:32:21-06:00",
            "hardwareComponentModelId": 3340,
            "id": 166838,
            "isQualified": 0,
            "severity": 3,
            "version": "6.01"
          },
          {
            "buildDate": null,
            "createDate": "2020-04-19T10:59:41-06:00",
            "hardwareComponentModelId": 3340,
            "id": 178638,
            "isQualified": 0,
            "severity": 3,
            "version": "7"
          },
          {
            "buildDate": null,
            "createDate": "2020-06-08T13:48:09-06:00",
            "hardwareComponentModelId": 3340,
            "id": 183838,
            "isQualified": 0,
            "severity": 3,
            "version": "7.01"
          },
          {
            "buildDate": null,
            "createDate": "2020-09-05T10:19:11-06:00",
            "hardwareComponentModelId": 3340,
            "id": 192240,
            "isQualified": 0,
            "severity": 3,
            "version": " 6.01(6.01)"
          },
          {
            "buildDate": null,
            "createDate": "2023-03-03T05:38:04-06:00",
            "hardwareComponentModelId": 3340,
            "id": 256512,
            "isQualified": 0,
            "severity": 3,
            "version": "6.01(6.01)"
          },
          {
            "buildDate": null,
            "createDate": "2023-07-03T22:19:56-06:00",
            "hardwareComponentModelId": 3340,
            "id": 264129,
            "isQualified": 0,
            "severity": 3,
            "version": "0.00"
          },
          {
            "buildDate": null,
            "createDate": "2021-05-21T14:16:32-06:00",
            "hardwareComponentModelId": 3340,
            "id": 215952,
            "isQualified": 0,
            "severity": 3,
            "version": "7.0"
          },
          {
            "buildDate": null,
            "createDate": "2022-10-11T18:30:55-06:00",
            "hardwareComponentModelId": 3340,
            "id": 245113,
            "isQualified": 0,
            "severity": 3,
            "version": "0.1"
          }
        ]
      },
      "hasUpgradeableFirmware": true,
      "id": 22811766,
      "revision": {
        "firmwareVersionId": 186238,
        "hardwareComponentId": 22811766,
        "id": 16507548,
        "revision": " 7.00"
      }
    }
  ]
}