|
Post by AMI_shirleyh on Mar 5, 2021 11:45:32 GMT
Can we provide the following ExtendedInfo message with 200 Status code for POST Action on the issued URI without enveloping inside an error object ?
Basically we need to know why should we envelope an informational or success related messages inside an error object as it would not be meaningful.
Use case 1
{ "@message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_8.Message", "Message": "This action has been initiated successfully. Please allow upto 4-5 secs and verify the value of the "PropertyName" property in /redfish/v1/Managers/Self instance", "MessageArgs": [ "POSTActionname", "PropertyName", "/redfish/v1/Managers/Self" ], "MessageId": "XYZ.1.0.DelayInActionCompletion", "Resolution": "Check the property value update after 4-5 seconds", "Severity": "OK" } ] }
Use case 2 {
"@odata.type": "#Message.v1_0_8.Message", "Message": "The request body submitted contain no data to act upon and no changes to the resource took place.", "MessageId": "Base.1.5.NoOperation", "Resolution": "Add properties in the JSON object and resubmit the request.", "Severity": "Warning"
}
Use case 3 { "error": { "code": "Base.1.8.Success", "message": "Successfully Completed Request", "@message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message",
"MessageId": "Base.1.8.Success", "Message": "Successfully Completed Request", "Severity": "OK", "MessageSeverity": "OK", "Resolution": "None" } ] } }
Please let us know which Use cases are valid ?
Thanks Shirley
|
|
|
Post by mraineri on Mar 5, 2021 15:33:35 GMT
No, that's not allowed; what you have shown for use case 3 is the only valid format. You can use other messages in that format for your other use cases, but they need to be wrapped in that "error" property. For example:
{ "error": { "code": "Base.1.5.NoOperation", "message": "The request body submitted contain no data to act upon and no changes to the resource took place.", "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The request body submitted contain no data to act upon and no changes to the resource took place.", "MessageId": "Base.1.5.NoOperation", "Resolution": "Add properties in the JSON object and resubmit the request.", "Severity": "Warning" } ] } }
Currently the format of the response stems from behavior inherited from OData. Actions in Redfish did not explicitly define a response body (in CSDL, this is done with the "ReturnType" term), so the behavior here is to use the OData-defined "error" response. In hindsight, we probably should have defined a "ReturnType" for all of our actions.
|
|
|
Post by AMI_shirleyh on Mar 5, 2021 17:04:16 GMT
Thanks a lot for your reply and confirmation.
|
|
|
Post by AMI_shirleyh on Mar 9, 2021 11:58:44 GMT
One more quick question :-
For Partial Success of the attributes in case of Patch, do we need to envelope in error object or as provided as a sample in SPEC in Section "10.8.2.1 Extended object information", we can display as below ?
Use Case 1 - Without Error Object Enveloped ___________ { "@odata.id": "/redfish/v1/Managers/1/SerialInterfaces/1", "@odata.type": "#SerialInterface.v1_0_0.SerialInterface", "Name": "Managed Serial Interface 1", "Description": "Management for Serial Interface", "Status": { "State": "Enabled", "Health": "OK" }, "InterfaceEnabled": true, "SignalType": "Rs232", "BitRate": "115200", "Parity": "None", "DataBits": "8", "StopBits": "1", "FlowControl": "None", "ConnectorType": "RJ45", "PinOut": "Cyclades", "@message.ExtendedInfo": [ { "MessageId": "Base.1.8.PropertyDuplicate", "Message": "Indicates that a duplicate property was included in the request body.", "RelatedProperties": [ "#/InterfaceEnabled" ], "Severity": "Warning", "MessageSeverity": "Warning", "Resolution": "Remove the duplicate property from the request body and resubmit the request if the operation failed." } ] }
Use Case 2 - With Error Object Enveloped ___________ { "@odata.context": "/redfish/v1/$metadata#AccountService.AccountService", "@odata.etag": "\"1615289432\"", "@odata.id": "/redfish/v1/AccountService", "@odata.type": "#AccountService.v1_6_0.AccountService", "AccountLockoutCounterResetAfter": 30, "AccountLockoutCounterResetEnabled": true, "AccountLockoutDuration": 30, "AccountLockoutThreshold": 5, "Accounts": { "@odata.id": "/redfish/v1/AccountService/Accounts" }, "ActiveDirectory": { "Authentication": { "Password": null, "Username": "AD1111" }, "ServiceEnabled": true }, "AdditionalExternalAccountProviders": { "@odata.id": "/redfish/v1/AccountService/ExternalAccountProviders" }, "AuthFailureLoggingThreshold": 3, "Description": "Redfish User Accounts", "Id": "AccountService", "LDAP": { "Authentication": { "AuthenticationType": "UsernameAndPassword", "Password": null, "Username": "cn=megarac,dc=ldapfts,dc=com" }, "LDAPService": { "SearchSettings": { "BaseDistinguishedNames": [ "dc=ldapfts,dc=com" ], "GroupsAttribute": "cn" } }, "ServiceAddresses": [ "172.16.126.33:389" ], "ServiceEnabled": true }, "LocalAccountAuth": "LocalFirst", "MaxPasswordLength": 20, "MinPasswordLength": 8, "Name": "Account Service", "PrivilegeMap": { "@odata.id": "/redfish/v1/Registries/Redfish_1.0.3_PrivilegeRegistry.json" }, "Roles": { "@odata.id": "/redfish/v1/AccountService/Roles" }, "ServiceEnabled": true, "Status": { "Health": "OK", "State": "Enabled" }, "error": { "@message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_8.Message", "Message": "The value 13 for the property #/LDAP/ServiceEnabled is of a different type than the property can accept.", "MessageArgs": [ "13", "#/LDAP/ServiceEnabled" ], "MessageId": "Base.1.5.PropertyValueTypeError", "RelatedProperties": [ "#/LDAP/ServiceEnabled" ], "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed.", "Severity": "Warning" }, { "@odata.type": "#Message.v1_0_8.Message", "Message": "Modifying the values. It may take a few seconds for the changes to reflect", "MessageId": "Conteso.1.0.ModifyingValues", "Resolution": "Wait a few seconds before sending additional requests to this resource.", "Severity": "OK" } ], "code": "Base.1.5.GeneralError", "message": "A general error has occurred. See Resolution for information on how to resolve the error." } }
Use case 1 & 2 both are valid ?
|
|
|
Post by mraineri on Mar 10, 2021 21:17:27 GMT
In the partial success use case, there is no error object. I know older versions of the spec called this out by mistake, and the latest version should have the correct behavior. In the case of partial success, the response is supposed to be 200 OK with the resource representation in the body, as well as the "@message.ExtendedInfo" array property. So, use case 1 is correct, but use case 2 is not.
|
|
|
Post by AMI_archerwen on Aug 17, 2023 4:05:43 GMT
Hi,
We have a TaskMonitors response for update firmware will be shows like below when completed. { "error": { "@message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_8.Message", "Message": "Task /redfish/v1/UpdateService/upload has completed.", "MessageArgs": [ "/redfish/v1/UpdateService/upload" ], "MessageId": "Task.1.0.Completed", "Resolution": "None", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_8.Message", "Message": "Action /redfish/v1/UpdateService/upload firmware update is completed.", "MessageArgs": [ "/redfish/v1/UpdateService/upload" ], "MessageId": "UpdateService.1.0.FirmwareUpdateCompleted", "Resolution": "None", "Severity": "OK" } ], "code": "Base.1.12.GeneralError", "message": "A general error has occurred. See Resolution for information on how to resolve the error, or @message.ExtendedInfo if Resolution is not provided." } }
If we have multiple message under @message.ExtendedInfo, can we shows the "code" and "message" like I marked in bold?
Thanks, Archer.
|
|
|
Post by mraineri on Aug 17, 2023 12:10:49 GMT
Using "GeneralError" is probably not a good case here since there's no error. Base.1.12.Success would be more appropriate here. While Base.1.12.Success doesn't call out looking in the ExtendedInfo array, the specification is clear in that clients should always look into that array to understand the entirety of what happened.
|
|