Code Monkey home page Code Monkey logo

redfish-client-python's Introduction

Redfish API client

This repository contains minimalistic python client for Redfish API.

Quickstart

The simplest and safest way of playing with this client is to install it into dedicated virtual environment:

$ virtualenv venv && . venv/bin/activate
(venv) $ pip install redfish-client

Now we can start the interactive python interpreter and interact with the api:

(venv) $ python
>>> import redfish_client
>>> import json
>>> root = redfish_client.connect(
...   "redfish.address", "username", "password"
... )
>>> print(json.dumps(root.raw, indent=2, sort_keys=True))
{
  "@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot",
  "@odata.etag": "W/\"bb7f4494b922dde991a940cc8251e8fc\"",
  "@odata.id": "/redfish/v1",
  "@odata.type": "#ServiceRoot.v1_2_0.ServiceRoot",
  "AccountService": {
    "@odata.id": "/redfish/v1/AccountService/"
  },
  # More content here
  "UpdateService": {
    "@odata.id": "/redfish/v1/UpdateService/"
  }
}
>>> system = root.Systems.Members[0]
>>> print(json.dumps(system.raw, indent=2, sort_keys=True))
{
  "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
  "@odata.etag": "W/\"788f9827a97be1a4c8cbe9c085ef4d8b\"",
  "@odata.id": "/redfish/v1/Systems/1/",
  "@odata.type": "#ComputerSystem.v1_4_0.ComputerSystem",
  # More content here
  "SystemType": "Physical",
  "UUID": "REMOVED_FROM_MOCK"
}
>>> print(system.SystemType)
Physical

redfish-client-python's People

Watchers

 avatar  avatar

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.