Git Product home page Git Product logo

redfish-profile-simulator's People

Contributors

billdodd avatar cshia avatar jautor avatar mraineri avatar pwvancil avatar rp- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redfish-profile-simulator's Issues

How to perform PATCH

Hello

How to perform patch operation on the service?
Can you please provide the procedure?

Thanks.

redfishProfileSimulator error?

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 -

RedfishExtensions instead of Redfish in index.html ?

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

redfish/v1/Systems does not work

Hi,

I ran the Redfish Profile Simulator (RPS).
I ran the Redfish Interop Validator (RIV) on it.

Result:

/redfish/v1/Systems does not exist in $metadata so RPS returns :

{ "@odata.id": "/redfish/v1/Systems" }

instead of its /MockupData/.../Systems/index.json file.

Expected result

`
{
"@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."
}

`

possible issue

line 45 of resource.py

image

component Systems is not in $metadata components

What did I miss?

Regards,
Francine

Failed to get the some resources under ComputerSystem from the Redfish-Profile-Simulator

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)

Problems with /redfish/v1/$metadata

While investigating DMTF/Redfish-Service-Validator#234 I found a few of issues with the handling of /redfish/v1/$metadata in the simulator.

  1. Doing a GET on /redfish/v1/$metadata results in a failure with this exception callstack:
[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 -
  1. After correcting that problem, the $metadata is returned, but with a Content-Type header of text/html instead of application/xml.

  2. Also, the simulator is requiring authentication for the $metadata URI access. It should not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.