| 657 | return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) |
| 658 | |
| 659 | def run(self): |
| 660 | status = self.status() |
| 661 | if 'machineState' in status and 'state' in status['machineState']: |
| 662 | if status['machineState']['state'] == 'Idle': |
| 663 | self.configure() |
| 664 | else: |
| 665 | raise AttributeError("Unknown status response!") |
| 666 | |
| 667 | request = json.dumps({"command": "run"}) |
| 668 | if self.is_function_machine: |
| 669 | return json.loads(core.BNPostWorkflowRequestForFunction(self.handle, request)) |
| 670 | else: |
| 671 | return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) |
| 672 | |
| 673 | def halt(self): |
| 674 | request = json.dumps({"command": "halt"}) |