|
Post by ffcactus on Aug 18, 2018 3:20:57 GMT
The specification doesn't have a very clear explanation and with no example... Suppose I defined an action that allocates IPv4 address from an IPv4 pool.
POST /redfish/v1/oem/IPv4Pools/{id}/Actions/IPv4Pool.Allocate Request Body: null
In case of success, I think the response should at least contains the allocated IPv4 address. Is the following response correct? Response Status Code: 200 Response Body: { "IPv4Address": "1.1.1.1" "@message.ExtendedInfo": { "@odata.type": "", "MessageId": "Base.1.0.Success", .... } }
IN case of failure, I think the response is explicit like this: { "error": { "code": "Base.1.0.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information.", "@message.ExtendedInfo": [{ "odata.type": "", "MessageId": "IPv4Pool.1.0.Empty", .... }] } }
|
|
fish
Guppy
Posts: 65
|
Post by fish on Aug 21, 2018 12:39:53 GMT
|
|
tony
Minnow
Posts: 1
|
Post by tony on Aug 23, 2018 11:49:11 GMT
If the action is excuted successfully, the response body alse need an "error" message like the following, It looks a bit strange
{ "error" : { "code" : "Base.1.0.GeneralError", "message" : "A general error has occurred. See ExtendedInfo for more information.", "@message.ExtendedInfo: [ { "@odata.type" : "/redfish/v1/$metadata#MessageRegistry.1.0.0.MessageRegistry", "MessageId" : "Base.1.0.Success", "RelatedProperties" : [], ... } ] } }
|
|
|
Post by jautor on Sept 4, 2018 19:47:25 GMT
The payload should return the "error" object (which comes from the OData specification definition...) but you can use the "Base.1.0.Success" message in the "code" so that it's at least not buried in something related to GeneralError. So:
But it's a very good point that this is not shown in the Redfish specification as an example, so I've asked that an example of Success be added to the document for clarification.
Jeff
|
|
|
Post by ffcactus on Oct 9, 2018 7:13:42 GMT
The payload should return the "error" object (which comes from the OData specification definition...) but you can use the "Base.1.0.Success" message in the "code" so that it's at least not buried in something related to GeneralError. So: But it's a very good point that this is not shown in the Redfish specification as an example, so I've asked that an example of Success be added to the document for clarification. Jeff Hi Jeff, In my example, if the IPv4 allocation operation success, I think the more meaning response should be the IPv4 address allocated since HTTP status 200 already indicated the success. If I also have to include the "error" property in the payload, could you provide an example too? Thanks and Regards, Bai, Bin
|
|