Redfish: Added IndicatorLED commands to the Systems category (#4458) (#4494)

* Redfish: Added IndicatorLED commands to the Systems category

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Method call typo fix

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Update 4084-add-redfish-system-indicator-led.yml

* Backwards compatibility suggestion

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
(cherry picked from commit a9125c02e7)

Co-authored-by: Mike Raineri <michael.raineri@dell.com>
This commit is contained in:
patchback[bot] 2022-04-11 20:22:58 +02:00 committed by GitHub
parent bec382df87
commit 6a74c46e1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 5 deletions

View file

@ -732,14 +732,22 @@ class RedfishUtils(object):
def get_multi_volume_inventory(self):
return self.aggregate_systems(self.get_volume_inventory)
def manage_indicator_led(self, command):
def manage_system_indicator_led(self, command):
return self.manage_indicator_led(command, self.systems_uri)
def manage_chassis_indicator_led(self, command):
return self.manage_indicator_led(command, self.chassis_uri)
def manage_indicator_led(self, command, resource_uri=None):
result = {}
key = 'IndicatorLED'
if resource_uri is None:
resource_uri = self.chassis_uri
payloads = {'IndicatorLedOn': 'Lit', 'IndicatorLedOff': 'Off', "IndicatorLedBlink": 'Blinking'}
result = {}
response = self.get_request(self.root_uri + self.chassis_uri)
response = self.get_request(self.root_uri + resource_uri)
if response['ret'] is False:
return response
result['ret'] = True
@ -749,7 +757,7 @@ class RedfishUtils(object):
if command in payloads.keys():
payload = {'IndicatorLED': payloads[command]}
response = self.patch_request(self.root_uri + self.chassis_uri, payload)
response = self.patch_request(self.root_uri + resource_uri, payload)
if response['ret'] is False:
return response
else: