You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current implementation of the OFMF we strongly rely on the RedFish emulator REST api even for manipulating data objects.
As an example, when aa a result of an event, we want to create an instance of a particular object we most of the times have to import the class defining the object and invoke the POST method for that class by also filling up the relevant fields of a mockup request.
Even if using the methods from api_emulator/utils.py, all the utils in there rely on the request object .
In the example below, the create_and_patch_object can be used to create a new object and patch the parent collection. However, the code verifies whether the request.data exists, where request is a global object coming from the restful API.
So let's say the OFMF receives an event. Events are delivered as a POST on the /EventListener URL path and as a result the request object is populated with the REST request for the event. If while handling such event one wants to create another object using the create_and_patch_object method, they would pass the config of the new object. The method however will pollute the content with data coming from the request object.
As a work-around at the moment we resort to modifying request.data with the configuration of the new object before invoking the above method.
We should instead have an interface to a data storage that allows manipulation of the objects independently from the RedFish REST API emulator.
The text was updated successfully, but these errors were encountered:
In the current implementation of the OFMF we strongly rely on the RedFish emulator REST api even for manipulating data objects.
As an example, when aa a result of an event, we want to create an instance of a particular object we most of the times have to import the class defining the object and invoke the POST method for that class by also filling up the relevant fields of a mockup request.
Even if using the methods from
api_emulator/utils.py
, all the utils in there rely on the request object .In the example below, the
create_and_patch_object
can be used to create a new object and patch the parent collection. However, the code verifies whether therequest.data
exists, whererequest
is a global object coming from the restful API.OFMF-Reference/api_emulator/utils.py
Lines 193 to 209 in 0191734
So let's say the OFMF receives an event. Events are delivered as a POST on the
/EventListener
URL path and as a result therequest
object is populated with the REST request for the event. If while handling such event one wants to create another object using thecreate_and_patch_object
method, they would pass theconfig
of the new object. The method however will pollute the content with data coming from the request object.As a work-around at the moment we resort to modifying
request.data
with the configuration of the new object before invoking the above method.We should instead have an interface to a data storage that allows manipulation of the objects independently from the RedFish REST API emulator.
The text was updated successfully, but these errors were encountered: