Ed Tanous | 9b243a4 | 2018-08-03 14:33:10 -0700 | [diff] [blame] | 1 | import json |
| 2 | import ssl |
| 3 | import websocket |
| 4 | |
| 5 | websocket.enableTrace(True) |
| 6 | |
| 7 | ws = websocket.create_connection('wss://10.243.48.93:18080/subscribe', |
| 8 | sslopt={"cert_reqs": ssl.CERT_NONE}, |
| 9 | cookie="XSRF-TOKEN=m0KhYNbxFmUEI4Sr1I22; SESSION=0mdwzoQy3gggQxW3vrEw") |
| 10 | request = json.dumps({ |
| 11 | "paths": ["/xyz/openbmc_project/logging", "/xyz/openbmc_project/sensors"], |
| 12 | "interfaces": ["xyz.openbmc_project.Logging.Entry", "xyz.openbmc_project.Sensor.Value"] |
| 13 | }) |
| 14 | |
| 15 | ws.send(request) |
| 16 | print("Sent") |
| 17 | print("Receiving...") |
| 18 | while True: |
| 19 | result = ws.recv() |
| 20 | print("Received '%s'" % result) |
| 21 | ws.close() |