from settings import *
from on_http_redfish_1_0 import Configuration, ApiClient

HOST_IP = RACKHD_HOST
HOST_PORT = RACKHD_HOST_PORT
HOST_PORT_AUTH = RACKHD_HOST_PORT_AUTH

config = Configuration()
config.host = 'http://{0}:{1}'.format(HOST_IP, HOST_PORT)
config.host_authed = 'https://{0}:{1}'.format(HOST_IP, HOST_PORT_AUTH)
config.verify_ssl = False
config.debug = False
config.logger_format = LOGFORMAT
config.api_root = '/redfish/v1'
config.api_client = ApiClient(host=config.host + config.api_root)
config.auth_enabled = False
for key, elem in config.logger.iteritems():
    elem.setLevel(LOGLEVELS[LOGGER_LVL])
from on_http_redfish_1_0 import \
    ApiClient, \
    Configuration, \
    RedfishvApi as redfish
from json import loads, dumps

config = Configuration()
config.host = 'http://localhost:8080/redfish/v1'
config.verify_ssl = False
config.api_client = ApiClient(host=config.host)
config.debug = False
api_client = config.api_client


def get_data():
    return loads(api_client.last_response.data)


def pprint():
    print dumps(get_data(), \
                sort_keys=True, \
                indent=4, \
                separators=(',', ': ')).decode('string-escape')


def getServiceRoot():
    redfish().get_service_root()
    pprint()


def listChassis():
示例#3
0
from settings import *
from on_http_redfish_1_0 import Configuration, ApiClient

config = Configuration()
config.host = "http://{0}:{1}/redfish/v1".format(HOST_IP, HOST_PORT)
config.verify_ssl = False
config.api_client = ApiClient(host=config.host)
config.debug = False
config.logger_format = LOGFORMAT
for key, elem in config.logger.iteritems():
    elem.setLevel(LOGLEVELS[LOGGER_LVL])
示例#4
0
from settings import *
from on_http_redfish_1_0 import Configuration, ApiClient

config = Configuration()
config.host = 'http://{0}:{1}/redfish/v1'.format(HOST_IP, HOST_PORT)
config.verify_ssl = False
config.api_client = ApiClient(host=config.host)
config.debug = False
config.logger_format = LOGFORMAT
for key, elem in config.logger.iteritems():
    elem.setLevel(LOGLEVELS[LOGGER_LVL])
from settings import * 
from on_http_redfish_1_0 import Configuration, ApiClient

config = Configuration() 
config.host = 'http://{0}:{1}'.format(HOST_IP,HOST_PORT)
config.host_authed = 'https://{0}:{1}'.format(HOST_IP, HOST_PORT_AUTH)
config.verify_ssl = False
config.debug = False
config.logger_format = LOGFORMAT
config.api_root = '/redfish/v1'
config.api_client = ApiClient(host=config.host + config.api_root)
config.auth_enabled = False
for key,elem in config.logger.iteritems():
    elem.setLevel(LOGLEVELS[LOGGER_LVL])