|
Post by AMI_alvin on Apr 22, 2021 3:36:33 GMT
Hi,
There are some description in DSP0266_1.11.0 about handling OData annotations for PATCH(update).
And my question is :
1. If client provides a property like "@odata.test", is this also one OData annotation and PATCH(update) should ignore this property? Or the OData annotation should only be "@odata.etag", "@odata.context", "@odata.id", and "@odata.type"? 2. Is there any definition in Spec for this part? 3. How the other operations (e.g. POST(create), PUT(replace) ) would handle the OData annotation?
Thank you, Alvin
|
|
|
Post by mraineri on Apr 23, 2021 12:16:53 GMT
This is effectively anything containing "@odata." in the property name. We do not enumerate the complete list since there are implementations that support more OData functionality than specified by Redfish. We only define terms that are directly used by Redfish. The OData JSON Format Specification contains a section called "Control Information" that defines all of the possible terms: docs.oasis-open.org/odata/odata-json-format/v4.0/odata-json-format-v4.0.html. I would expect the same behavior with regards to POST and PUT, so we should make that clear. One thing that came to mind though is there are some cases where we have writable links to other resources. For example, "Endpoints" within the "Links" property of "EndpointGroup" is writable for assigning and removing endpoints from a group. In this case "@odata.id" is processed in these requests. So, we'll also need to clarify that "@odata.id" is something that isn't necessarily ignored in PATCH requests.
|
|
|
Post by AMI_shirleyh on May 21, 2021 10:25:39 GMT
Hi,
Given the following Patch request in the URI http://{{ip}}/redfish/v1/Chassis/Self/Power:- { "PowerControl": [ { "@odata.id": "/redfish/v1/Chassis/Self/Power#/PowerControl/0" } ] }
When this is the request where odata.id is provided inside the PowerControl property, should we ignore and return 204 or will it be appropriate to show 400 with No Operation.
Thanks.
|
|
|
Post by mraineri on May 21, 2021 12:44:45 GMT
In this case, 400 with the NoOperation message is recommended since the only leaf property being specified is "@odata.id". However, it is still allowable to return a 2XX status.
|
|
|
Post by AMI_shirleyh on May 21, 2021 16:26:44 GMT
Thanks a lot. I also had the same opinion. Just wanted to check with you guyz.
|
|
|
Post by AMI_alvin on Jun 15, 2021 7:26:04 GMT
Hi mraineri, I was confused with the rules of returning 2XX or 400 NoOpearion in PATCH @odata.id cases. 1. As your reply, so there are ""some"" resources that need to support PATCH "@odata.id" like "Endpoints" within the "Links" property of "EndpointGroup". Is there any other case like this? How can we identify the URI need to support PATCH @odata.id or not? 2. For the case "@odata.id": "/redfish/v1/Chassis/Self/Power#/PowerControl/0" above, why 400 NoOperation is recommended, but it is still allowable to return 2XX status? 3. For Deep PATCH operation, it should provide @odata.id in the request body. So is this also a case that needs to provide @odata.id?
|
|
|
Post by mraineri on Jun 15, 2021 13:18:17 GMT
For question 1: if the permissions for the property is marked as read-write, then services can allow for a client to PATCH @odata.id (if they want to support it).
For question 2: this is for backwards compatibility. The original version of the specification simply said to ignore all OData annotations, which means the service would respond with 2XX. However, feedback on this behavior indicated this could encourage folks to write bad clients, so we made a recommendation that going forward 400 is a better response in that scenario.
For question 3: that's a good point; @odata.id is needed to direct the deep operation in certain cases. We'll need to clarify this in the spec.
|
|
|
Post by AMI_alvin on Jun 16, 2021 13:50:04 GMT
Okay. That's clear to me, thank you.
|
|