|
Post by dugganj on Nov 3, 2016 19:39:30 GMT
The Redfish specification at redfish.dmtf.org/schemas/DSP0266_1.0.html in section 6.5.4.1 states that an odata.context field can have a ResourceType, which is "the fully qualified name of the unversioned resource type". I have looked in the spec and could not find a definition of what an unversioned resource type is. I also looked in the odata specs, and could not figure it out. What is an unversioned resource type? More importantly, how can I use it (the odata.context) to determine precisely which entity type an instance refers to? My apologies if I missed something obvious in the spec... jpd
|
|
|
Post by j2hilland on Nov 3, 2016 20:14:43 GMT
This is a hard to understand part of the spec, regardless of which spec you look at. That's why we have the mockups. Fist of all, remember this property should only ever be decoded by generic OData clients. The rest of the client community is likely to never care. Looking at a Chassis from our mockups, it has the format "/redfish/v1/$metadata#Chassis.Chassis" The first part is the canonical location of the $metadata object. It has references to all other schema used in an implementation. In the DMTF samples, the metadata document has the schema location as well as namespaces that are both versioned and un-versioned. The second part has the namespace and the entity definition. For DMTF schemas, we keep these the same. Thus it is Chassis.Chassis.
There are other formats you can use, such as the path format, but as we were developing the mockups we found it to be problematic for both clients and services and thus recommend the simpler format.
|
|
|
Post by dugganj on Nov 3, 2016 21:21:45 GMT
Thanks. As I read your description and walk through the schema, I see what is going on.
Question -- if I support Chassis.v1_0_0, do I use /redfish/v1/$metadata/Chassis.v1_0_0.Chassis? As I write this, it occurs to me that the 'unversioned' in the name 'unversioned resource type' implies I should still use /redfish/v1/$metadata/Chassis.Chassis... If I do so, though, do I not lose some information (the fact that I support v1_0_0)?
jpd
|
|
|
Post by j2hilland on Nov 3, 2016 21:39:24 GMT
So there is @odata.type, odata.context and @odata.id. OData.context is easiest to just leave unversioned. Take a look at DSP2043 (but a non work-in-progress version) and unzip it and look at the $metadata resource and you'll see the connection between the context and the $metadata. So just leave those as /redfish/v1/$metdata#<namespace>.<entity>. Odata.id is the self pointer. Note that the Id property in the resource will be the last segment of the URI. So if Id is 1 of a chassis, it would be /redfish/v1/chassis/1. Odata.type is the schema namespace and entity and we play a trick here. The namespace also has the version in it from an OData view point, as well as the entity definition. For JSON schema, it tells you the schema and version. So it is Chassis.v1_0_0.Chassis. We have to use the "v" because Odata won't let you start with a number and the underscores to make it a string since the period is a delimiter. So in the mockup, you will find that /redfish/v1/Chassis/1 has the following properties:
"@odata.context": "/redfish/v1/$metadata#Chassis.Chassis", "@odata.id": "/redfish/v1/Chassis/1", "@odata.type": "#Chassis.v1_0_0.Chassis"
I hope that explains it. Once you get it down, just follow the pattern!
|
|