dmtf / redfish-profile-simulator Goto Github PK
View Code? Open in Web Editor NEWA Flask-based simulator of a Redfish Service implementing the proposed OCP feature Profile.
License: Other
A Flask-based simulator of a Redfish Service implementing the proposed OCP feature Profile.
License: Other
Hello
How to perform patch operation on the service?
Can you please provide the procedure?
Thanks.
When the profile simulator handles a POST to the Sessions collection (to create a new session), it responds with 200 OK. It should respond with 201 Created.
Tried changing the BootOverride:
redfishtool -r 127.0.0.1:5000 -u root -p password123456 -S Never Systems --all setBootOverride Disabled Once
redfishtool: Transport: Response Error: status_code: 500 -- Internal Server Error
But the RedfishProfileSimulator gave an error saying it can not find root.systems
127.0.0.1 - - [19/Jul/2022 18:03:43] "GET /redfish/v1/Systems/2M220100SL/ HTTP/1.1" 200 -
in rfAuthRequired
headers: Host: 127.0.0.1:5000
Accept-Encoding: identity
User-Agent: python-requests/2.27.1
Accept: application/json
Connection: keep-alive
Odata-Version: 4.0
Content-Type: application/json
Content-Length: 51
Authorization: Basic cm9vdDpwYXNzd29yZDEyMzQ1Ng==
rdata:{'Boot': {'BootSourceOverrideEnabled': 'Disabled'}}
[2022-07-19 18:03:43,830] ERROR in app: Exception on /redfish/v1/Systems/2M220100SL/ [PATCH]
Traceback (most recent call last):
File "/gsa/yktgsa-h3/13/jimlund/venv/lib64/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/gsa/yktgsa-h3/13/jimlund/venv/lib64/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/gsa/yktgsa-h3/13/jimlund/venv/lib64/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/gsa/yktgsa-h3/13/jimlund/venv/lib64/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/gsa/yktgsa-h3/13/jimlund/redfish/Redfish-Profile-Simulator/v1sim/flask_redfish_auth.py", line 139, in decorated
return (f(*args, **kwargs))
File "/gsa/yktgsa-h3/13/jimlund/redfish/Redfish-Profile-Simulator/v1sim/redfishURIs.py", line 86, in rf_computer_systempatch
obj = patch_path(root.systems, sys_path)
AttributeError: 'RfServiceRoot' object has no attribute 'systems'
127.0.0.1 - - [19/Jul/2022 18:03:43] "PATCH /redfish/v1/Systems/2M220100SL/ HTTP/1.1" 500 -
I do not know how to get the profile name and the details of resource and properties the profile defined?
Hi,
I ran the Redfish Validator on the Redfish Simulator.
I had 2 error messages:
In the resource $metadata, the RedfishExtensions.v1_0_0 namespace must have an alias of 'Redfish'. The alias is 'RedfishExtensions'. This may cause properties of the form [PropertyName]@Redfish.TermName to be unrecognized.
And:
No such reference Redfish in /redfish/v1/$metadata
I changed the Alias from "RedfishExtensions" to "Redfish" as indicated
and now I have no error message
in file Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/$metadata/index.xml
=> isn't it a bug in $metadata/index.html page in the Simulator ?
Regards,
Francine
Hi,
I ran the Redfish Profile Simulator (RPS).
I ran the Redfish Interop Validator (RIV) on it.
/redfish/v1/Systems does not exist in $metadata so RPS returns :
{ "@odata.id": "/redfish/v1/Systems" }
instead of its /MockupData/.../Systems/index.json file.
`
{
"@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
"Name": "Computer System Collection",
"[email protected]": 1,
"Members": [
{
"@odata.id": "/redfish/v1/Systems/2M220100SL"
}
],
"@odata.context": "/redfish/v1/$metadata#ComputerSystemCollection.ComputerSystemCollection",
"@odata.id": "/redfish/v1/Systems",
"@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright."
}
`
line 45 of resource.py
component Systems is not in $metadata components
What did I miss?
Regards,
Francine
Steps to reproduce:
Install and run Simulator.
Do a GET to /redfish/v1/odata
Additional info: DMTF/Redfish-Service-Conformance-Check#163
Below is the code in the Redfish-Profile-Simulator\v1sim\systems.py, which is used to walk through the mockup folders under Systems in order to get the json files.
We can see some strings which doesn’t match the properties under ComputerSystem in ComputerSystem.json: “bios” should be “Bios”, NetworkAdapters should be “NetworkInterfaces “,”PCIDevices” should be “PCIeDevices”.
class RfSystemObj(RfResource):
def create_sub_objects(self, base_path, rel_path):
resource_path = os.path.join(base_path, rel_path)
contents = os.listdir(resource_path)
for item in contents:
if item == "bios":
self.components[item] = RfBios(base_path, os.path.join(rel_path, item), parent=self)
elif item == "EthernetInterfaces":
self.components[item] = RfEthernetCollection(base_path, os.path.join(rel_path, item), parent=self)
elif item == "LogServices":
self.components[item] = RfLogServiceCollection(base_path, os.path.join(rel_path, item), parent=self)
elif item == "Memory":
self.components[item] = RfMemoryCollection(base_path, os.path.join(rel_path, item), parent=self)
elif item == "Processors":
self.components[item] = RfProcessorCollection(base_path, os.path.join(rel_path, item), parent=self)
elif item == "SimpleStorage":
self.components[item] = RfSimpleStorageCollection(base_path, os.path.join(rel_path, item), parent=self)
elif item == "SmartStorage":
self.components[item] = RfSmartStorage(base_path, os.path.join(rel_path, item), parent=self)
elif item == "SecureBoot":
self.components[item] = RfSecureBoot(base_path, os.path.join(rel_path, item), parent=self)
elif item == "NetworkAdapters":
self.components[item] = RfNetworkAdapterCollection(base_path, os.path.join(rel_path, item), parent=self)
elif item == "PCIDevices":
self.components[item] = RfPCIDeviceCollection(base_path, os.path.join(rel_path, item), parent=self)
elif item == "PCISlots":
self.components[item] = RfPCISlotCollection(base_path, os.path.join(rel_path, item), parent=self)
elif item == "FirmwareInventory":
self.components[item] = RfSystemFirmwareInventory(base_path, os.path.join(rel_path, item), parent=self)
elif item == "USBDevices":
self.components[item] = RfUSBDeviceCollection(base_path, os.path.join(rel_path, item), parent=self)
elif item == "USBPorts":
self.components[item] = RfUSBPortCollection(base_path, os.path.join(rel_path, item), parent=self)
While investigating DMTF/Redfish-Service-Validator#234 I found a few of issues with the handling of /redfish/v1/$metadata in the simulator.
[2018-05-24 11:12:51,896] ERROR in app: Exception on /redfish/v1/$metadata/ [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1974, in make_response
rv = self.response_class.force_type(rv, request.environ)
File "/usr/local/lib/python3.6/site-packages/werkzeug/wrappers.py", line 921, in force_type
response = BaseResponse(*_run_wsgi_app(response, environ))
File "/usr/local/lib/python3.6/site-packages/werkzeug/test.py", line 923, in run_wsgi_app
app_rv = app(environ, start_response)
TypeError: 'RfOdataMetadata' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1816, in full_dispatch_request
return self.finalize_request(rv)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1831, in finalize_request
response = self.make_response(rv)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in make_response
reraise(TypeError, new_error, sys.exc_info()[2])
File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 34, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1974, in make_response
rv = self.response_class.force_type(rv, request.environ)
File "/usr/local/lib/python3.6/site-packages/werkzeug/wrappers.py", line 921, in force_type
response = BaseResponse(*_run_wsgi_app(response, environ))
File "/usr/local/lib/python3.6/site-packages/werkzeug/test.py", line 923, in run_wsgi_app
app_rv = app(environ, start_response)
TypeError: 'RfOdataMetadata' object is not callable
The view function did not return a valid response. The return type must be a string, tuple, Response instance, or WSGI callable, but it was a RfOdataMetadata.
127.0.0.1 - - [24/May/2018 11:12:51] "GET /redfish/v1/%24metadata/ HTTP/1.1" 500 -
After correcting that problem, the $metadata is returned, but with a Content-Type header of text/html
instead of application/xml
.
Also, the simulator is requiring authentication for the $metadata URI access. It should not.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.