python redfish操作


幾天有人問我redfish操作。有個客戶說在瀏覽器輸入redfish api無法打開。一般是用postman軟件進行操作,記得在setting中關閉ssl。其實可以通過python也可以相關操作,這樣更貼近上層應用

 

import redfish

login_host="https://10.93.20.10"
login_account="ADMIN"
login_password="ADMIN"
REDFISH_OBJ = redfish.redfish_client(base_url=login_host, username=login_account, password=login_password, default_prefix='/redfish/v1')
REDFISH_OBJ.login(auth="session")
response = REDFISH_OBJ.get("/redfish/v1/Systems/1", None)
print(response)
REDFISH_OBJ.logout()

  

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM