前
幾天有人問我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()