(self, data)
| 706 | } |
| 707 | |
| 708 | def updateBoxrouterData(self, data): |
| 709 | if self.cloud_enabled(): |
| 710 | try: |
| 711 | if data: |
| 712 | r = requests.put("%s/astrobox/%s/update-boxrouter-data" % (self.apiHost, self.boxId), |
| 713 | data=json.dumps(data), |
| 714 | auth=self.hmacAuth, |
| 715 | headers={'Content-Type': 'application/json'} |
| 716 | ) |
| 717 | |
| 718 | if r.status_code == 200: |
| 719 | return r.json() |
| 720 | if r.status_code == 400: |
| 721 | self._logger.error("Bad updateBoxrouterData request (400). Response: %s" % r.text) |
| 722 | if r.status_code == 404: |
| 723 | self._logger.error("Request updateBoxrouterData not found (404). Response: %s" % r.text) |
| 724 | except Exception as e: |
| 725 | self._logger.error("Failed to send updateBoxrouterData request: %s" % e) |
| 726 | return False |
| 727 | |
| 728 | def callFleetInfo(self): |
| 729 | if networkManager().isOnline(): |
no test coverage detected