HewlettPackard / python-redfish-utility

Python-based utility for interacting with devices supporting a Redfish Service
Other
86 stars 41 forks source link

ilorest: LLDPEnabled - /redfish/v1/Chassis/1/NetworkAdapters/ #76

Closed ralfgro closed 8 months ago

ralfgro commented 1 year ago

I'm a noob regarding restful api, I tried to find out how to set change LLDPEnabled to false for all of my network adapters.

I can get the proper setting with rawget in ilorest (I used this for server deployment), but I don't see LLDP mentioned anywhere in the ilorest documentation. So it's had to find the right way to change the value. I found https://hewlettpackard.github.io/ilo-rest-api-docs/ilo5/#ethernet1962, but if I do 'select Port.v1_5_0.Port' I only see data for the storage/FC adapters, nothing about network interfaces.

rawget "/redfish/v1/chassis/1/networkadapters/DE07A000/Ports/1/"

{
  "@Redfish.Settings": {
    "@odata.type": "#Settings.v1_3_3.Settings",
    "SettingsObject": {
      "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/DE07A000/Ports/1/Settings"
    },
    "SupportedApplyTimes": [
      "OnReset"
    ]
  },
  "@odata.context": "/redfish/v1/$metadata#Port.Port",
  "@odata.etag": "W/\"B05807A4\"",
  "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/DE07A000/Ports/1",
  "@odata.type": "#Port.v1_6_0.Port",
  "ActiveWidth": 0,
  "CurrentSpeedGbps": 0.0,
  "Enabled": true,
  "Ethernet": {
    "AssociatedMACAddresses": [
      "5c:6f:69:18:f6:c0"
    ],
    "FlowControlConfiguration": "None",
    "FlowControlStatus": "None",
    "**LLDPEnabled**": true,
    "LLDPReceive": {
      "ChassisId": "",
      "ChassisIdSubtype": "NotTransmitted",
      "ManagementAddressIPv4": "",
      "ManagementAddressIPv6": "",
      "ManagementAddressMAC": "",
      "ManagementVlanId": 4095,
      "PortId": "",
      "PortIdSubtype": "NotTransmitted"
    },
    "LLDPTransmit": {
      "ChassisId": "5c:6f:69:18:f6:c0",
      "ChassisIdSubtype": "MacAddr",
      "ManagementAddressIPv4": "",
      "ManagementAddressIPv6": "",
      "ManagementAddressMAC": "5c:6f:69:18:f6:c0",
      "ManagementVlanId": 4095,
      "PortId": "5c:6f:69:18:f6:c0",
      "PortIdSubtype": "MacAddr"
    },
    "SupportedEthernetCapabilities": [
      "WakeOnLAN"
    ],
    "WakeOnLANEnabled": true
  },
  "Id": "1",
  "InterfaceEnabled": true,
  "LinkConfiguration": [
    {
      "AutoSpeedNegotiationCapable": true,
      "AutoSpeedNegotiationEnabled": true,
      "CapableLinkSpeedGbps": [
        10.0,
        1.0
      ],
      "ConfiguredNetworkLinks": [
        {
          "ConfiguredLinkSpeedGbps": 10.0,
          "ConfiguredWidth": 1
        },
        {
          "ConfiguredLinkSpeedGbps": 1.0,
          "ConfiguredWidth": 1
        }
      ]
    }
  ],
  "LinkNetworkTechnology": "Ethernet",
  "LinkState": "Enabled",
  "LinkStatus": "NoLink",
  "LinkTransitionIndicator": 0,
  "MaxFrameSize": 9622,
  "MaxSpeedGbps": 10.0,
  "Name": "Ethernet Port 1",
  "PortId": "1",
  "PortProtocol": "Ethernet",
  "PortType": "BidirectionalPort",
  "SFP": {
    "Status": {
      "State": "Absent"
    },
    "SupportedSFPTypes": [
      "SFP",
      "SFPPlus",
      "SFP28"
    ]
  },
  "SignalDetected": false,
  "Status": {
    "Health": "OK",
    "State": "Enabled"
  },
  "Width": 1
}
rajeevkallur commented 8 months ago

@ralfgro , You can set LLDPEnabled to particular adapter using rawpatch or set command. If you would like to do it for all your network adapters, you can write a .bat or .sh script.