diff --git a/README.rst b/README.rst index c8e07b3..86a0128 100644 --- a/README.rst +++ b/README.rst @@ -9,9 +9,9 @@ NOTE:: DRAFT - WORK IN PROGRESS - The current Redfish specification revision is 0.96.0a - anything and everything - in this library is subject to change until the DMTF ratifies the Redfish API - standard v1.0. + The current Redfish specification revision is 1.0.0 - Note that the mockup + is still at version 0.99.0a and may not reflect what the standard provides + fully Project Structure @@ -35,7 +35,7 @@ To use the enclosed examples, you will need Python 2.7 (https://www.python.org/downloads/). Note that Python 2.7.9 enforces greater SSL verification requiring server certificates be installed. Parameters to relax the requirements are available in the library, but these configurations -are discouraged due to sec +are discouraged due to security. Python requirements are listed in requirements.txt; additional requirements for running the unit test suite are listed in test-requirements.txt. diff --git a/dmtf/DSP0266_0.96.0a.pdf b/dmtf/DSP0266_0.96.0a.pdf deleted file mode 100644 index 18dba70..0000000 Binary files a/dmtf/DSP0266_0.96.0a.pdf and /dev/null differ diff --git a/dmtf/DSP0266_1.0.0.pdf b/dmtf/DSP0266_1.0.0.pdf new file mode 100644 index 0000000..e45d578 Binary files /dev/null and b/dmtf/DSP0266_1.0.0.pdf differ diff --git a/dmtf/DSP2043_0.96.0a.zip b/dmtf/DSP2043_0.96.0a.zip deleted file mode 100644 index 3c4eeba..0000000 Binary files a/dmtf/DSP2043_0.96.0a.zip and /dev/null differ diff --git a/dmtf/DSP2043_0.99.0a.zip b/dmtf/DSP2043_0.99.0a.zip new file mode 100644 index 0000000..6720855 Binary files /dev/null and b/dmtf/DSP2043_0.99.0a.zip differ diff --git a/dmtf/DSP8010_0.96.0a.zip b/dmtf/DSP8010_0.96.0a.zip deleted file mode 100644 index e721df1..0000000 Binary files a/dmtf/DSP8010_0.96.0a.zip and /dev/null differ diff --git a/dmtf/DSP8010_1.0.0.zip b/dmtf/DSP8010_1.0.0.zip new file mode 100644 index 0000000..005010e Binary files /dev/null and b/dmtf/DSP8010_1.0.0.zip differ diff --git a/dmtf/Dockerfile b/dmtf/Dockerfile index 1017721..fa32aab 100644 --- a/dmtf/Dockerfile +++ b/dmtf/Dockerfile @@ -8,6 +8,6 @@ RUN apt-get update RUN apt-get -y install apache2 unzip sed EXPOSE 80 COPY redfish-setup.sh /tmp/redfish-setup.sh -COPY DSP2043_0.96.0a.zip /tmp/DSP2043_0.96.0a.zip +COPY DSP2043_0.99.0a.zip /tmp/DSP2043_0.99.0a.zip RUN chmod 755 /tmp/redfish-setup.sh CMD /tmp/redfish-setup.sh diff --git a/dmtf/README.rst b/dmtf/README.rst new file mode 100644 index 0000000..9bf58c9 --- /dev/null +++ b/dmtf/README.rst @@ -0,0 +1,30 @@ +DMTF Redfish specification +-------------------------- + +This directory contains the current references from the DMTF on the Redfish +specification (1.0.0 at the time of the writing) + +In order to ease test, the DMTF has published a mockup environment to simulate +a Redfish based system so it is possible to write programs without real Redfish +compliant hardware platform. + +Docker container +---------------- + +In order to help testing python-redfish, this directory provides a script which +you should be able to run on your system (providing you have docker support and +a docker registry) which will create a docker container running the DMTF Redfish +mockup on the port 8000. + +To build your container, just issue: ./buildImage.sh +To launch it, just issue: ./run-redfish-simulator.sh +To use it, just issue: firefox http://localhost:8000/redfish/v1 + +Systems entry point: +http://localhost:8000/redfish/v1/Systems + +Chassis entry point: +http://localhost:8000/redfish/v1/Chassis + +Managers entry point: +http://localhost:8000/redfish/v1/Managers diff --git a/dmtf/buildImage.sh b/dmtf/buildImage.sh index 896e79a..633b886 100755 --- a/dmtf/buildImage.sh +++ b/dmtf/buildImage.sh @@ -1,5 +1,6 @@ #!/bin/bash # Build and tag images +docker rmi redfish-simulator docker build -t "redfish-simulator" . -docker tag redfish-simulator:latest localhost:5000/redfish-simulator +docker tag -f redfish-simulator:latest localhost:5000/redfish-simulator diff --git a/dmtf/redfish-setup.sh b/dmtf/redfish-setup.sh index cd23c68..967be07 100644 --- a/dmtf/redfish-setup.sh +++ b/dmtf/redfish-setup.sh @@ -16,10 +16,11 @@ trap stop_apache HUP INT QUIT KILL TERM # Main cd /var/www/html -unzip -q -o /tmp/DSP2043_0.96.0a.zip -mkdir -p redfish +unzip -q -o /tmp/DSP2043_0.99.0a.zip +chmod 755 DSP2043_0.99.0a +ln -sf DSP2043_0.99.0a redfish cd redfish -ln -sf .. v1 +ln -sf . v1 cd .. ip a #sed -i -e 's/Listen 80/Listen 8000/' /etc/apache2/ports.conf diff --git a/dmtf/run-redfish-simulator.sh b/dmtf/run-redfish-simulator.sh index 0e0764f..78697c6 100755 --- a/dmtf/run-redfish-simulator.sh +++ b/dmtf/run-redfish-simulator.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Build the docker container first +docker build -t localhost:5000/redfish-simulator:latest . # Th -p option needs to be after the run command. No warning is given if before but doesn't work -docker run -d -p 8000:80 --name "redfish-simulator" localhost:5000/redfish-simulator +docker rm "redfish-simulator" +docker run -d -p 8000:80 --name "redfish-simulator" localhost:5000/redfish-simulator:latest +echo "Launch your browser and load http://localhost:8000/redfish/v1" diff --git a/python-redfish.spec b/python-redfish.spec index fd8c4b0..e60f04d 100644 --- a/python-redfish.spec +++ b/python-redfish.spec @@ -7,7 +7,7 @@ Summary: Redfish python library Group: Development/Python License: Apache v2.0 -URL: https://github.com/devananda/python-redfish +URL: https://github.com/devananda/%{name} Source0: %name-%version.tar.gz BuildArch: noarch @@ -29,6 +29,8 @@ system such as defined by http://www.redfishcertification.org %{__python} setup.py install -O1 --skip-build --root %{buildroot} %files +%doc README.rst examples/*.py %dir %{python_sitelib}/redfish -%{python_sitelib}/redfish/* +%{python_sitelib}/redfish/*.py* +%{python_sitelib}/redfish/tests/*.py* %{python_sitelib}/python_redfish* diff --git a/redfish/functions.py b/redfish/functions.py index 9c1b0e0..1de1031 100644 --- a/redfish/functions.py +++ b/redfish/functions.py @@ -33,10 +33,10 @@ class RedfishOperation(connection.RedfishConnection): memberuri = system['links']['Member'][0]['href'] # verify expected type # hint: don't limit to version 0 here as we will rev to 1.0 at some point hopefully with minimal changes -# assert(connection.get_type(system) == 'ComputerSystem.0' or connection.get_type(system) == 'ComputerSystem.1') + # assert(connection.get_type(system) == 'ComputerSystem.0' or connection.get_type(system) == 'ComputerSystem.1') # verify it supports POST -# assert(connection.operation_allowed(headers, 'POST')) + # assert(connection.operation_allowed(headers, 'POST')) action = dict() action['Action'] = 'Reset'