blob: f6e7226b52086711089f21c15b4a2dc0c97d64ec [file] [log] [blame]
Patrick Williamsb19c34c2017-03-27 14:52:28 -05001#!/bin/env python
2
3import requests
4
5class BMC:
6 def __init__(self, server):
7 self.url = "https://{0}/".format(server)
8 self.session = requests.Session()
9 self.login()
10
11 def login(self):
12 r = self.session.post(self.url + 'login',
13 json={ 'data': [ 'root', '0penBmc']},
14 verify=False)
15 j = r.json()
16 if j['status'] != 'ok':
17 raise Exception("Failed to login: \n" + r.text)
18
19
20
21s = BMC(server="w50.aus.stglabs.ibm.com")