DMTF / Redfish-Interface-Emulator

The Redfish Interface Emulator can emulate a Redfish-based interface statically (GET) or dynamically (POST, PATCH, DELETE)
Other
59 stars 24 forks source link

Restricting the creation of Composed Systems to valid previously created resources? #75

Closed felipeportella closed 5 years ago

felipeportella commented 5 years ago

Hi,

I'm new to the Redfish API and maybe I'm misunderstanding the proposal of the emulator. There is a way to only allow the creation of the new system with valid resources?

From the tests I performed, the Emulator doesn't do any validation against the ResourceDictionary created when the emulator starts. It seems the initial POPULATE is used only to provide some initial examples and not to initialize which will be the valid infrastructure ...

I was expecting that in a POST to CreateGenericComputerSystem, I was enforced to provide a valid existing configuration (payload). Without this validation I was able to create systems with invalid NumberOfProcessors, for example, or any other invalid resource.

I'm misunderstanding the concept of the emulator? There is a way to do this check if a configuration is valid during the POST?

I'm trying to use it as a datacenter emulator of available resources to play (evaluate) different allocation policies of these resources, but to do that I can't have an allocation of an invalid resource. Maybe I need to create an intermediate layer to validate with the GET if the Composed system has only valid existing resources ...

Thank you!

jcleung5549 commented 5 years ago

Felipe,

The Interface Emulator is framework on which various behaviors of the interface can be quickly implemented and an instantiated. Only with additional coding for Redfish Service behavior can the Interface Emulator be used as you envision. The fidelity to the behavior is dependent on this additional coding.

For example, the Storage Network Industry Association (SNIA) created the Swordfish API Emulator (github.com/SNIA/Swordfish-API-Emulator) by adding the behavioral code.

Contribution to the repository have been made to add the emulator of services. For example, the specific composition behavior code was contributed to emulate the Composition Service.