HewlettPackard / python-ilorest-library

Python library for interacting with devices which support a Redfish Service
Apache License 2.0
181 stars 89 forks source link

ilorest rawpost question #140

Closed ssampath closed 1 year ago

ssampath commented 1 year ago

Hi,

I am trying to execute the following action and getting an error. Any help appreciated.

# ilorest get --selector Chassis.
iLOrest : RESTful Interface Tool version 3.5.0.0
Copyright (c) 2014-2022 Hewlett Packard Enterprise Development LP
-----------------------------------------------------------------------------------------------------------------------------------------------------
@odata.context=/redfish/v1/$metadata#Chassis.Chassis
@odata.etag=W/"B0694B6C"
@odata.id=/redfish/v1/Chassis/1/
@odata.type=#Chassis.v1_10_2.Chassis
AssetTag=""
ChassisType=RackMount
Id=1
IndicatorLED=Off
Links=
       ManagedBy=
                  @odata.id=/redfish/v1/Managers/1/
       ComputerSystems=
                        @odata.id=/redfish/v1/Systems/1/
Manufacturer=HPE
Model=Alletra Storage Gen6
Name=Computer System Chassis
NetworkAdapters=
                 @odata.id=/redfish/v1/Chassis/1/NetworkAdapters/
Oem=
     Hpe=
          @odata.context=/redfish/v1/$metadata#HpeServerChassis.HpeServerChassis
          @odata.type=#HpeServerChassis.v2_3_1.HpeServerChassis
          Actions=
                   #HpeServerChassis.DisableMCTPOnServer=
                                                          target=/redfish/v1/Chassis/1/Actions/Oem/Hpe/HpeServerChassis.DisableMCTPOnServer/
                   #HpeServerChassis.FactoryResetMCTP=
                                                       target=/redfish/v1/Chassis/1/Actions/Oem/Hpe/HpeServerChassis.FactoryResetMCTP/
          ElConfigOverride=False

#
# ilorest rawpost -u USER_LOGIN -p PASSWORD /redfish/v1/Chassis/1/Actions/Oem/Hpe/HpeServerChassis.DisableMCTPOnServer/             iLOrest : RESTful Interface Tool version 3.5.0.0
Copyright (c) 2014-2022 Hewlett Packard Enterprise Development LP
-----------------------------------------------------------------------------------------------------------------------------------------------------

Error: File '/redfish/v1/Chassis/1/Actions/Oem/Hpe/HpeServerChassis.DisableMCTPOnServer/' doesn't exist. Please create file by running 'save' command.
rajeevkallur commented 1 year ago

This is not the right syntax for rawpost. rawpost needs a json with path and body. Please see the documentation at https://hewlettpackard.github.io/python-redfish-utility/#rawpost-command

Closing... Please reopen if you still have the issue after following the above documentation.