Update to Redfish 1.0.0 (official)

- Update Redfish spec and schema to version 1.0.0
- Update Redfish simulator to version 0.99.0a
- Comply with Redfish 1.0.0 by changing remaining refs from /rest/v1 to /redfish/v1
- Adds a README to explain how to use the Docker container to launch the
  DMTF Redfish mockup in order to test without hardware
- Update spec file for local usage
This commit is contained in:
Bruno Cornec 2015-08-19 12:04:05 +02:00 committed by Bruno Cornec
parent f3bf31d83f
commit 56c9f0a910
14 changed files with 52 additions and 14 deletions

View File

@ -9,9 +9,9 @@ NOTE::
DRAFT - WORK IN PROGRESS DRAFT - WORK IN PROGRESS
The current Redfish specification revision is 0.96.0a - anything and everything The current Redfish specification revision is 1.0.0 - Note that the mockup
in this library is subject to change until the DMTF ratifies the Redfish API is still at version 0.99.0a and may not reflect what the standard provides
standard v1.0. fully
Project Structure 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 (https://www.python.org/downloads/). Note that Python 2.7.9 enforces greater
SSL verification requiring server certificates be installed. Parameters to SSL verification requiring server certificates be installed. Parameters to
relax the requirements are available in the library, but these configurations 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 Python requirements are listed in requirements.txt; additional requirements for
running the unit test suite are listed in test-requirements.txt. running the unit test suite are listed in test-requirements.txt.

Binary file not shown.

BIN
dmtf/DSP0266_1.0.0.pdf Normal file

Binary file not shown.

Binary file not shown.

BIN
dmtf/DSP2043_0.99.0a.zip Normal file

Binary file not shown.

Binary file not shown.

BIN
dmtf/DSP8010_1.0.0.zip Normal file

Binary file not shown.

View File

@ -8,6 +8,6 @@ RUN apt-get update
RUN apt-get -y install apache2 unzip sed RUN apt-get -y install apache2 unzip sed
EXPOSE 80 EXPOSE 80
COPY redfish-setup.sh /tmp/redfish-setup.sh 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 RUN chmod 755 /tmp/redfish-setup.sh
CMD /tmp/redfish-setup.sh CMD /tmp/redfish-setup.sh

30
dmtf/README.rst Normal file
View File

@ -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

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
# Build and tag images # Build and tag images
docker rmi redfish-simulator
docker build -t "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

View File

@ -16,10 +16,11 @@ trap stop_apache HUP INT QUIT KILL TERM
# Main # Main
cd /var/www/html cd /var/www/html
unzip -q -o /tmp/DSP2043_0.96.0a.zip unzip -q -o /tmp/DSP2043_0.99.0a.zip
mkdir -p redfish chmod 755 DSP2043_0.99.0a
ln -sf DSP2043_0.99.0a redfish
cd redfish cd redfish
ln -sf .. v1 ln -sf . v1
cd .. cd ..
ip a ip a
#sed -i -e 's/Listen 80/Listen 8000/' /etc/apache2/ports.conf #sed -i -e 's/Listen 80/Listen 8000/' /etc/apache2/ports.conf

View File

@ -1,4 +1,8 @@
#!/bin/bash #!/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 # 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"

View File

@ -7,7 +7,7 @@ Summary: Redfish python library
Group: Development/Python Group: Development/Python
License: Apache v2.0 License: Apache v2.0
URL: https://github.com/devananda/python-redfish URL: https://github.com/devananda/%{name}
Source0: %name-%version.tar.gz Source0: %name-%version.tar.gz
BuildArch: noarch BuildArch: noarch
@ -29,6 +29,8 @@ system such as defined by http://www.redfishcertification.org
%{__python} setup.py install -O1 --skip-build --root %{buildroot} %{__python} setup.py install -O1 --skip-build --root %{buildroot}
%files %files
%doc README.rst examples/*.py
%dir %{python_sitelib}/redfish %dir %{python_sitelib}/redfish
%{python_sitelib}/redfish/* %{python_sitelib}/redfish/*.py*
%{python_sitelib}/redfish/tests/*.py*
%{python_sitelib}/python_redfish* %{python_sitelib}/python_redfish*

View File

@ -33,10 +33,10 @@ class RedfishOperation(connection.RedfishConnection):
memberuri = system['links']['Member'][0]['href'] memberuri = system['links']['Member'][0]['href']
# verify expected type # 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 # 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 # verify it supports POST
# assert(connection.operation_allowed(headers, 'POST')) # assert(connection.operation_allowed(headers, 'POST'))
action = dict() action = dict()
action['Action'] = 'Reset' action['Action'] = 'Reset'