|
Post by manojkiran on Dec 18, 2020 10:17:49 GMT
Hi All,
I am a beginner to redfish & I am trying to write a redfish CSDL for creating an OEM Service with certain API's as Actions.
The service root looks like below :
{ "@odata.id": "/redfish/v1", "@odata.type": "#ServiceRoot.v1_5_0.ServiceRoot", "AccountService": { "@odata.id": "/redfish/v1/AccountService" }, "CertificateService": { "@odata.id": "/redfish/v1/CertificateService" }, "Chassis": { "@odata.id": "/redfish/v1/Chassis" }, "EventService": { "@odata.id": "/redfish/v1/EventService" }, "Id": "RootService", "JsonSchemas": { "@odata.id": "/redfish/v1/JsonSchemas" }, "Links": { "Sessions": { "@odata.id": "/redfish/v1/SessionService/Sessions" } }, "Managers": { "@odata.id": "/redfish/v1/Managers" }, "Name": "Root Service", "Oem": { "IBM": { "@odata.type": "#OemRedfish.v1_0_0.IBMServiceRoot", "LockService": { "@odata.id": "/redfish/v1/Oem/IBM/LockService" } } }, "RedfishVersion": "1.9.0", "Registries": { "@odata.id": "/redfish/v1/Registries" }, "SessionService": { "@odata.id": "/redfish/v1/SessionService" }, "Systems": { "@odata.id": "/redfish/v1/Systems" }, "Tasks": { "@odata.id": "/redfish/v1/TaskService" }, "UUID": "419a3d3a-4f72-4c41-8857-42dd39b2440b", "UpdateService": { "@odata.id": "/redfish/v1/UpdateService" } }
And a GET on /redfish/v1/Oem/IBM/LockService shows :
{ "@odata.id": "/redfish/v1/Oem/IBM/LockService", "@odata.type": "#LockService.v1_0_0.LockService", "Actions": { "#LockService.AcquireLock": { "target": "/redfish/v1/Oem/IBM/LockService/Actions/LockService.AcquireLock" }, "#LockService.GetLockList": { "target": "/redfish/v1/Oem/IBM/LockService/Actions/LockService.GetLockList" }, "#LockService.ReleaseLock": { "target": "/redfish/v1/Oem/IBM/LockService/Actions/LockService.ReleaseLock" }, }, "Id": "LockService", "Name": "LockService" }
My question is , can an URI like LockService, just have only Actions without having any resource collection underneath it ?
|
|
|
Post by jautor on Dec 20, 2020 16:45:36 GMT
As long as the OEM resource has the (few) required properties, there's nothing "wrong" with this. But I'd suggest that you'd want to return data on a GET here where possible. The Action for "GetLockList" (not knowing anything else about that data) would seem like a candidate for just returning that "list of locks" in the resource, or perhaps that's an OEM Resource Collection?
Jeff
|
|
|
Post by manojkiran on Jan 4, 2021 10:15:28 GMT
As long as the OEM resource has the (few) required properties, there's nothing "wrong" with this. But I'd suggest that you'd want to return data on a GET here where possible. The Action for "GetLockList" (not knowing anything else about that data) would seem like a candidate for just returning that "list of locks" in the resource, or perhaps that's an OEM Resource Collection? Jeff Hi Jeff,
Thanks for the answer.
No - As the locks are associated with sessions , the GetLockList action also takes list of sessionID's as input & returns the lock structure that are acquired by the respective sessions in the request. And the locks - here are NOT BMC resources , they are purely virtual resources which only a specific vendor can understand . These API's were already written as REST API's & now i was trying to convert these API's to redfish OEM Actions.
So i just wanted to confirm , if we have only Actions & no resource collection underneath an OEM service ? would that be considered as adhering to the redfish protocol ?
|
|
|
Post by mraineri on Jan 4, 2021 13:59:42 GMT
Yes, that is perfectly legal to do, as long as you have the mandatory resource properties as well as Jeff said (like Id and Name). It looks like you do have those, so it is valid. But also going further with what Jeff was recommending, it could be possible to list out the session IDs in your resource and have sets of data for each session ID in the GET response so you don't need that "Get" action. It could be something like:
{ "Id": "LockService", "Name": "LockService", "Actions": { ... }, "Locks": [ { "SessionId": "12345", <Other lock data for 12345> }, { "SessionId": "67890", <Other lock data for 67890> }, ... ] } It could be broken down further where each "Lock" is its own resource as Jeff was suggesting. In the end though, this is entirely a modeling exercise and there are going to be many different ways to do this; it'll be dependent on your use cases for your clients.
|
|