Checks the api endpoint to check if the async job progress
(self)
| 173 | self.completion_percentage = 0.0 |
| 174 | |
| 175 | def _request_status(self): |
| 176 | """ Checks the api endpoint to check if the async job progress """ |
| 177 | if self.item_id: |
| 178 | return True |
| 179 | |
| 180 | response = self.con.naive_request(self.monitor_url, method="get") |
| 181 | if not response: |
| 182 | return False |
| 183 | |
| 184 | data = response.json() |
| 185 | |
| 186 | self.status = data.get('status', 'inProgress') |
| 187 | self.completion_percentage = data.get(self._cc('percentageComplete'), |
| 188 | 0) |
| 189 | self.item_id = data.get(self._cc('resourceId'), None) |
| 190 | |
| 191 | return self.item_id is not None |
| 192 | |
| 193 | def check_status(self, delay=0): |
| 194 | """ Checks the api endpoint in a loop |
no test coverage detected