Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, host, login_account, login_password):
try:
self.redfish_client = redfish_client(base_url=host, \
username=login_account, password=login_password, \
default_prefix="/redfish/v1")
except:
raise
self.redfish_client.login(auth=AuthMethod.SESSION)
self.SYSTEMS_RESOURCES = self.ex1_get_resource_directory()
self.MESSAGE_REGISTRIES = self.ex2_get_base_registry()
def __init__(self, host, login_account, login_password):
try:
self.redfish_client = redfish_client(base_url=host, \
username=login_account, password=login_password, \
default_prefix="/redfish/v1")
except:
raise
self.redfish_client.login(auth=AuthMethod.SESSION)
self.SYSTEMS_RESOURCES = self.ex1_get_resource_directory()
self.MESSAGE_REGISTRIES = self.ex2_get_base_registry()
# Copyright Notice:
# Copyright 2016-2019 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
import sys
import redfish
# When running remotely connect using the address, account name,
# and password to send https requests
login_host = "https://192.168.1.100"
login_account = "admin"
login_password = "password"
## Create a REDFISH object
REDFISH_OBJ = redfish.redfish_client(base_url=login_host, username=login_account, \
password=login_password, default_prefix='/redfish/v1')
# Login into the server and create a session
REDFISH_OBJ.login(auth="session")
# Do a GET on a given path
response = REDFISH_OBJ.get("/redfish/v1/systems/1", None)
# Print out the response
sys.stdout.write("%s\n" % response)
# Logout of the current session
REDFISH_OBJ.logout()
def __init__(self, host, login_account, login_password):
try:
self.redfish_client = redfish_client(base_url=host, \
username=login_account, password=login_password, \
default_prefix="/redfish/v1")
except:
raise
self.redfish_client.login(auth=AuthMethod.SESSION)
self.SYSTEMS_RESOURCES = self.ex1_get_resource_directory()
self.MESSAGE_REGISTRIES = self.ex2_get_base_registry()
def __init__(self, host, token):
try:
self.redfish_client = redfish_client(base_url=host,
sessionkey=token,
default_prefix="/redfish/v1")
except:
raise
self.typepath = redfish.ris.tpdefs.Typesandpathdefines()
self.typepath.getgen(url=host, logger=LOGGER)
self.typepath.defs.redfishchange()
self.SYSTEMS_RESOURCES = self.ex1_get_resource_directory()
self.MESSAGE_REGISTRIES = self.ex2_get_base_registry()
def __init__(self, host, token):
try:
self.redfish_client = redfish_client(base_url=host,
sessionkey=token,
default_prefix="/redfish/v1")
except:
raise
self.typepath = redfish.ris.tpdefs.Typesandpathdefines()
self.typepath.getgen(url=host, logger=LOGGER)
self.typepath.defs.redfishchange()
self.SYSTEMS_RESOURCES = self.ex1_get_resource_directory()
self.MESSAGE_REGISTRIES = self.ex2_get_base_registry()
def __init__(self, host, login_account, login_password):
try:
self.redfish_client = redfish_client(base_url=host, \
username=login_account, password=login_password, \
default_prefix="/redfish/v1")
except:
raise
self.redfish_client.login(auth=AuthMethod.SESSION)
self.SYSTEMS_RESOURCES = self.ex1_get_resource_directory()
self.MESSAGE_REGISTRIES = self.ex2_get_base_registry()
# Copyright Notice:
# Copyright 2016-2019 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
import sys
import redfish
# When running remotely connect using the address, account name,
# and password to send https requests
login_host = "https://192.168.1.100"
login_account = "admin"
login_password = "password"
## Create a REDFISH object
with redfish.redfish_client(base_url=login_host, username=login_account, password=login_password) as REDFISH_OBJ:
# Do a GET on a given path
response = REDFISH_OBJ.get("/redfish/v1/systems/1", None)
# Print out the response
sys.stdout.write("%s\n" % response)
def __init__(self, host, login_account, login_password):
try:
self.redfish_client = redfish_client(base_url=host, \
username=login_account, password=login_password, \
default_prefix="/redfish/v1")
except:
raise
self.redfish_client.login(auth=AuthMethod.SESSION)
self.SYSTEMS_RESOURCES = self.ex1_get_resource_directory()
self.MESSAGE_REGISTRIES = self.ex2_get_base_registry()
def __init__(self, host, login_account, login_password):
try:
self.redfish_client = redfish_client(base_url=host, \
username=login_account, password=login_password, \
default_prefix="/redfish/v1")
except:
raise
self.redfish_client.login(auth=AuthMethod.SESSION)
self.SYSTEMS_RESOURCES = self.ex1_get_resource_directory()
self.MESSAGE_REGISTRIES = self.ex2_get_base_registry()