|
Post by gudge on Jan 2, 2018 22:39:35 GMT
Hi, I am using the following uri to force restart the system. http://IP/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset?ResetType=ForceRestart The error message : <pre style="font-size:12px; font-family:monospace; color:#8B0000;">[web.lua] Error in RequestHandler, thread: 0xb6739bb0 is dead. ./redfish/system-actions.lua:0: attempt to index a nil value stack traceback: ./turbo/httpserver.lua:278: in function <./turbo/httpserver.lua:255> [C]: in function 'xpcall' ./turbo/iostream.lua:553: in function <./turbo/iostream.lua:544> [C]: in function 'xpcall' ./turbo/ioloop.lua:573: in function <./turbo/ioloop.lua:572> Could you please let me know where I am going wrong ?. I am following the documentation on : www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.0.2.pdfPage 28. I am using Postman. Thanks
|
|
|
Post by mraineri on Jan 3, 2018 15:23:49 GMT
Two issues I see:
First, it looks like the service you're interacting with does not handle queries properly and is causing a crash of some sort. I'd recommend contacting the vendor about that.
Second, to perform an action, you don't embed the parameters in the URI; you provide the parameters in the JSON body of the request. You should be doing something like this:
POST http://IP/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset
Body: { "ResetType": "ForceRestart" }
|
|
|
Post by gudge on Jan 3, 2018 21:44:11 GMT
Two issues I see: First, it looks like the service you're interacting with does not handle queries properly and is causing a crash of some sort. I'd recommend contacting the vendor about that. Second, to perform an action, you don't embed the parameters in the URI; you provide the parameters in the JSON body of the request. You should be doing something like this: POST http://IP/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset
Body: { "ResetType": "ForceRestart" }
Thanks for the reply. The following command lists the set of values which I can use. ~$ curl -u username:password http://IP/redfish/v1/Systems/Self Output: {"@odata.context":"/redfish/v1/$metadata#Systems/Members(SerialNumber,Boot,Id,AssetTag,PowerState,SystemType,PartNumber,Description,Status,Name,SKU,Links,LogServices,Manufacturer,IndicatorLED,Model,IndicatorLED@Redfish.AllowableValues)/$entity","@odata.etag":"W/\"0\"","@odata.id":"/redfish/v1/Systems/Self","@odata.type":"#ComputerSystem.v1_1_0.ComputerSystem","Actions":{"#ComputerSystem.Reset":{"ResetType@Redfish.AllowableValues":["On","ForceOff","ForceRestart","GracefulShutdown"],"target":"/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset"}},"AssetTag":"Free form asset tag","Boot":{"BootSourceOverrideEnabled":"Disabled","BootSourceOverrideEnabled@Redfish.AllowableValues":["Disabled","Once","Continuous"]},"Description":"System Self","Id":"Self","IndicatorLED":"Off","IndicatorLED@Redfish.AllowableValues":["Lit","Blinking","Off"],"Links":{"Chassis":[{"@odata.id":"/redfish/v1/Chassis/Self"}],"ManagedBy":[{"@odata.id":"/redfish/v1/Managers/Self"}]},"LogServices":{"@odata.id":"/redfish/v1/Systems/Self/LogServices"},"Manufacturer":"","Model":"","Name":"System","PartNumber":"","PowerState":"On","SKU":"","SerialNumber":"","Status":{"Health":"OK","HealthRollup":"OK","State":"Enabled"},"SystemType":"Physical"} This tells me the allowed values for ResetType are On,ForceOff,ForceRestart,GracefulShutdown Now, curl -u username:password -H "Content-Type: application/json" -X POST http://IP/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset -d '{"ResetType": "On"}' Does not give any output. So I assume it is fine. Please correct me if I am wrong. When I use ForceRestart I get the following error: curl -u username:password -H "Content-Type: application/json" -X POST http://IP/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset -d '{"ResetType": "ForceRestart"}' Error: {"error":{"@message.ExtendedInfo":[{"@odata.type":"/redfish/v1/$metadata#Message.v1_0_2.Message","Message":"The value ForceRestart for the parameter ResetType in the action /redfish/v1/Systems/Self/Actions/ComputerSystem.Reset is of a different format than the parameter can accept.","MessageArgs":["ForceRestart","ResetType","/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset"],"MessageId":"Base.1.0.ActionParameterValueFormatError","RelatedProperties":["ResetType"],"Resolution":"Correct the value for the parameter in the request body and resubmit the request if the operation failed.","Severity":"Warning"}],"code":"Base.1.0.ActionParameterValueFormatError","message":"The value ForceRestart for the parameter ResetType in the action /redfish/v1/Systems/Self/Actions/ComputerSystem.Reset is of a different format than the parameter can accept."}} Thanks in advance.
|
|
|
Post by j2hilland on Jan 3, 2018 21:48:45 GMT
What was the HTTP response code in both cases? If you got a 200 on the first one (and the machine turned on) then you know it was accepted. I would also try a ForceOff and see what happens. It does appear to be a bug in the implementation if it indicates it supports ForceRestart and then treats it as an error. As previously stated, contact the vendor. It is also odd to have empty strings for some of the properties like Model, partNumber, SKU, etc. They should probably just be absent if there are no values for them (unless you removed them).
|
|
|
Post by gudge on Jan 3, 2018 23:39:24 GMT
What was the HTTP response code in both cases? If you got a 200 on the first one (and the machine turned on) then you know it was accepted. I would also try a ForceOff and see what happens. It does appear to be a bug in the implementation if it indicates it supports ForceRestart and then treats it as an error. As previously stated, contact the vendor. It is also odd to have empty strings for some of the properties like Model, partNumber, SKU, etc. They should probably just be absent if there are no values for them (unless you removed them). curl -u username:password -H "Content-Type: application/json" -i -X POST http://IP/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset -d '{"ResetType": "On"}' HTTP/1.1 204 No Content curl -u username:password -H "Content-Type: application/json" -i -X POST http://IP/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset -d '{"ResetType": "ForceRestart"}' HTTP/1.1 400 Bad Request curl -u username:password -H "Content-Type: application/json" -i -X POST http://IP/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset -d '{"ResetType": "ForceOff"}' I get similar response as ForceRestart. HTTP/1.1 400 Bad Request I have not removed any of the properties (Model, partNumber, SKU). As advised I will contact the Vendor. Thanks
|
|
|
Post by mraineri on Jan 4, 2018 13:38:02 GMT
In the first case where you're using "ResetType" set to "On", it returned a 204, which is a successful response.
For the other cases, it appears the service is erroneously reporting that it's capable of supporting the ForceRestart and ForceOff parameters. I can see from your other post that the error message returned indicates that it does not support those options. This is something else to report to the vendor.
|
|
|
Post by gudge on Jan 11, 2018 0:11:25 GMT
As you all suggested. I contacted the vendor and it worked. Thanks for your help.
|
|