MCPcopy Create free account
hub / github.com/WebODM/WebODM / post

Method post

coreplugins/cesiumion/api_views.py:280–305  ·  view source on GitHub ↗
(self, request, pk=None)

Source from the content-addressed store, hash-verified

278
279class RefreshIonTaskView(TaskView):
280 def post(self, request, pk=None):
281 serializer = UpdateIonAssets(data=request.data)
282 serializer.is_valid(raise_exception=True)
283
284 task = self.get_and_check_task(request, pk)
285 token = serializer.validated_data["token"]
286 headers = {"Authorization": f"Bearer {token}"}
287
288 is_updated = False
289 # ion cleanup check
290 for asset_type in AssetType:
291 asset_info = get_asset_info(task.id, asset_type)
292 ion_id = asset_info["id"]
293 if ion_id is None:
294 continue
295 res = requests.get(f"{ION_API_URL}/assets/{ion_id}", headers=headers)
296 if res.status_code != 200:
297 del_asset_info(task.id, asset_type)
298 is_updated = True
299
300 # dead task cleanup
301 for asset_type in get_processing_assets(task.id):
302 del_asset_info(task.id, asset_type)
303 is_updated = True
304
305 return Response({"updated": is_updated}, status=status.HTTP_200_OK)
306
307
308class ClearErrorsTaskView(TaskView):

Callers

nothing calls this directly

Calls 6

UpdateIonAssetsClass · 0.85
get_asset_infoFunction · 0.85
del_asset_infoFunction · 0.85
get_processing_assetsFunction · 0.85
get_and_check_taskMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected