Beispiel #1
0
import os
import sys
import json
from openapi.endpoint import fsim, restapi, FailedResponse
from openapi.redfish import roobject
from examples.utils import print_me, print_array
ipaddr = '100.96.27.77'
ipaddr = '100.96.26.136'

# endpoint = restapi(ipaddr, auth=('root', 'calvin'))
endpoint = fsim(ipaddr, os.path.join('..', '..', 'dell'))
redfish = endpoint.fetch('/redfish/v1')
chassis = redfish.Chassis

for ch in chassis.Members:
    if chassis.Members[ch].Assembly is None:
        continue
    print(" =================== Assembly ======================")
    for assembly in chassis.Members[ch].Assembly.Assemblies:
        print(
            print_array(
                chassis.Members[ch].Assembly.Assemblies[assembly].Properties(
                    exclude=['Metrics', 'Links'])))

for ch in chassis.Members:
    print("=================={0}=================".format(ch))
    print("Chassis[{0}].Manufacturer:{1}".format(
        ch, chassis.Members[ch].Manufacturer))
    print("Chassis[{0}].Name:{1}".format(ch, chassis.Members[ch].Name))
    print("Chassis[{0}].Model:{1}".format(ch, chassis.Members[ch].Model))
    print("Chassis[{0}].ChassisType:{1}".format(
Beispiel #2
0
 def __init__(self, ipaddr, creds, simdir):
     self.ipaddr = ipaddr
     self.simdir = simdir
     self.source = restapi(ipaddr, creds)
     #self.source = omerest(ipaddr, creds)
     self.target = fsim(ipaddr, simdir)