Skip to content

2.0.2 tagging #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [2.0.2] - 2018-09-07
- Added handling for bad or dummy delete requests when logging out of a service

## [2.0.1] - 2018-05-25
- Adjusting setup.py to contain correct information

Expand Down
32 changes: 28 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
python-redfish-library
==============

.. image:: https://travis-ci.org/DMTF/python-redfish-library.svg?branch=master
:target: https://travis-ci.org/DMTF/python-redfish-library
.. image:: https://img.shields.io/pypi/v/redfish.svg?maxAge=2592000
Expand All @@ -16,18 +17,21 @@ python-redfish-library

.. contents:: :depth: 1


Description
----------

REST (Representational State Transfer) is a web based software architectural style consisting of a set of constraints that focuses on a system's resources. The Redfish library performs the basic HTTPS operations GET, POST, PUT, PATCH and DELETE on resources using the HATEOAS (Hypermedia as the Engine of Application State) Redfish architecture. API clients allow you to manage and interact with the system through a fixed URL and several URIs. Go to the `wiki <../../wiki>`_ for more details.


Installing
----------

.. code-block:: console

pip install redfish


Building from zip file source
~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -37,16 +41,22 @@ Building from zip file source
cd dist
pip install python-redfish-library-x.x.x.zip


Requirements
----------

Ensure the system does not have the OpenStack "python-redfish" module installed on the target system. This module is using a conflicting package name that this library already uses. The module in question can be found here: https://pypi.org/project/python-redfish/


Usage
----------

A set of examples is provided under the examples directory of this project. In addition to the directives present in this paragraph, you will find valuable implementation tips and tricks in those examples.


Import the relevant python module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For a Redfish compliant application import the relevant python module.

For Redfish compliant application:
Expand All @@ -55,34 +65,42 @@ Import the relevant python module

import redfish


Create a Redfish Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Redfish Objects contain 3 parameters: the target secured URL (i.e. "https://IP" or "https://X.Y.Z.T"), an user name and its password.
To crete a Redfish Object, call the redfish_client method:
.. code-block:: python

REDFISH_OBJ = redfish.redfish_client(base_url=login_host, username=login_account, \
password=login_password, default_prefix='/redfish/v1')


Login to the server
~~~~~~~~~~~~~~~~~~~~~~~~~

The login operation is performed when creating the REDFISH_OBJ. You can continue with a basic authentication, but it would less secure.

.. code-block:: python

REDFISH_OBJ.login(auth="session")


Perform a GET operation
~~~~~~~~~~~~~~~~~~~~~~~~~

A simple GET operation can be performed to obtain the data present in any valid path.
An example of rawget operation on the path "/redfish/v1/systems/1 is shown below:

.. code-block:: python

response = REDFISH_OBJ.get("/redfish/v1/systems/1", None)


Logout the created session
~~~~~~~~~~~~~~~~~~~~~~~~~

Make sure you logout every session you create as it will remain alive until it times out.

.. code-block:: python
Expand All @@ -91,6 +109,7 @@ Logout the created session

A logout deletes the current sesssion from the system. The redfish_client object destructor includes a logout statement.


Contributing
----------

Expand All @@ -100,15 +119,20 @@ Contributing
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

History

Release Process
----------

* 01/12/2017: Initial Commit
* 07/28/2017: Release of v2.0.0
1. Update `CHANGELOG.md` with the list of changes since the last release
2. Update the `__version__` variable in `src/redfish/__init__.py`, and `setup.py` to reflect the new library version
3. Push changes to Github
4. Create a new release in Github
5. Push the new library version to pypi.org


Copyright and License
---------------------

Copyright Notice:
Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
Copyright 2016-2018 DMTF. All rights reserved.
License: BSD 3-Clause License. For full text see link: `https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md <https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md>`_
2 changes: 1 addition & 1 deletion examples/quickstart.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart_rmc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
from setuptools import setup, find_packages
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()

setup(name='redfish',
version='2.0.1',
version='2.0.2',
description='Redfish Python Library',
long_description=long_description,
author = 'DMTF, https://www.dmtf.org/standards/feedback',
license='BSD 3-clause "New" or "Revised License"',
classifiers=[
'Development Status :: 3 - Alpha',
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Topic :: Communications'
Expand Down
2 changes: 1 addition & 1 deletion src/redfish/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
2 changes: 1 addition & 1 deletion src/redfish/rest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
2 changes: 1 addition & 1 deletion src/redfish/rest/v1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
2 changes: 1 addition & 1 deletion src/redfish/ris/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
2 changes: 1 addition & 1 deletion src/redfish/ris/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
2 changes: 1 addition & 1 deletion src/redfish/ris/ris.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
2 changes: 1 addition & 1 deletion src/redfish/ris/rmc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
2 changes: 1 addition & 1 deletion src/redfish/ris/rmc_helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down
2 changes: 1 addition & 1 deletion src/redfish/ris/sharedtypes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
###

Expand Down