|
Post by AMI_ivywang on Oct 3, 2023 6:41:05 GMT
Hi,
We have an "action resource(POST (action))" displayed in the Redfish service when the feature is enabled. When we disable the feature, the "action resource(POST (action))" will not be displayed in the service which means user cannot find this resource. Which one is the correct response?
1. Return status code 404 + message Base.1.12.ActionNotSupported 2. Return status code 404 + message Base.1.12.ResourceMissingAtURI
Refer to the Base.1.12.0.json: ActionNotSupported: "Description": "Indicates that the action supplied with the POST operation is not supported by the resource." "Message": "The action %1 is not supported by the resource."
ResourceMissingAtURI: "Description": "Indicates that the operation expected an image or other resource at the provided URI but none was found. Examples of this are in requests that require URIs like firmware update." "Message": "The resource at the URI '%1' was not found."
Thank you Ivy
|
|
|
Post by mraineri on Oct 3, 2023 13:03:14 GMT
ResourceMissingAtURI is used when the Redfish service attempts to connect to a remote server as part of a request; it's not used in the general 404 path. For example, if the Redfish client performs a SimpleUpdate action, and the ImageURI parameter points to something invalid, then the image server would return a 404 to the Redfish service, which in turn means the Redfish service should return ResourceMissingAtURI to the Redfish client.
ActionNotSupported would be the correct, but InvalidURI would also be okay here since the expected client behavior would be to not access the URI again.
|
|
|
Post by AMI_ivywang on Oct 4, 2023 3:52:08 GMT
Hi, Thank you for the reply. Still have some questions.
1. Can "ActionNotSupported" use in other operations like GET/PATCH/DELETE or only use in the "POST operation"?
- GET/PATCH/DELETE "action resource(POST (action)) - not be displayed in the service " - POST "action resource(POST (action)) - not be displayed in the service "
Refer to the Base.1.12.0.json: ActionNotSupported: "Description": "Indicates that the action supplied with the POST operation is not supported by the resource." "Message": "The action %1 is not supported by the resource."
2. So, when the client access an invalid URI, should the correct response be "404 + Base.1.12.InvalidURI", "404 + Base.1.12.ActionNotSupported" or both "InvalidURI/ActionNotSupported" is ok?
For example: GET/PATCH /POST/DELETE - /redfish/v1/123 GET/PATCH /POST/DELETE - /redfish/v1/missing_resource
|
|
|
Post by mraineri on Oct 4, 2023 13:06:18 GMT
1) No, that would not be appropriate. "Action" is specifically a Redfish action where a user performs a POST to an action URI.
2) For an invalid URI, "ActionNotSupported" is only applicable for action URIs. So, for example, if your service is aware of the ComputerSystem.Reset action, but does not implement it, and a user performs a POST to /redfish/v1/Systems/{SystemId}/Actions/ComputerSystem.Reset, you can return ActionNotSupported. Returning InvalidURI at the same time may also be good since it is a correct message too. However, other type of requests, like GET and PATCH, would only return InvalidURI.
|
|
|
Post by AMI_Mani on Oct 6, 2023 2:47:55 GMT
Hi,
Assume if i give Get/Patch/delete request for Action like redfish/v1/Systems/{SystemId}/Actions/ComputerSystem.Reset, what needs to provide ActionNotSupported or InvalidURI
Thanks, Mani
|
|
|
Post by mraineri on Oct 6, 2023 19:16:00 GMT
I could see a few different options, and it's really going to come down to how your web service layers on the upfront checks. You could in theory have an upfront check for the allowable methods, and if you detect the URI is an action URI, you can return a message indicating "operation not allowed" with a 405 response. If you do URI checks first, then you can return either (or both) of those messages. Still, in the end the client's reaction will be the same: don't perform that request again.
|
|