def _send_hook(self, action): source = None destination = None if action in ('move', 'copy'): # if provider can't intra_move or copy, then the celery task will take care of logging if not getattr(self.provider, 'can_intra_' + action)(self.dest_provider, self.path): return source = LogPayload(self.resource, self.provider, path=self.path) destination = LogPayload( self.dest_resource, self.dest_provider, metadata=self.dest_meta, ) elif action in ('create', 'create_folder', 'update'): source = LogPayload(self.resource, self.provider, metadata=self.metadata) elif action in ('delete', 'download_file', 'download_zip'): source = LogPayload(self.resource, self.provider, path=self.path) else: return remote_logging.log_file_action(action, source=source, destination=destination, api_version='v1', request=remote_logging._serialize_request(self.request), bytes_downloaded=self.bytes_downloaded, bytes_uploaded=self.bytes_uploaded,)
def _send_hook(self, action): source = None destination = None if action in ('move', 'copy'): # if provider can't intra_move or copy, then the celery task will take care of logging if not getattr(self.provider, 'can_intra_' + action)( self.dest_provider, self.path): return source = LogPayload(self.resource, self.provider, path=self.path) destination = LogPayload( self.dest_resource, self.dest_provider, metadata=self.dest_meta, ) elif action in ('create', 'create_folder', 'update'): source = LogPayload(self.resource, self.provider, metadata=self.metadata) elif action in ('delete', 'download_file', 'download_zip'): source = LogPayload(self.resource, self.provider, path=self.path) else: return remote_logging.log_file_action( action, source=source, destination=destination, api_version='v1', request=remote_logging._serialize_request(self.request), bytes_downloaded=self.bytes_downloaded, bytes_uploaded=self.bytes_uploaded, )
def _send_hook(self, action, metadata): source = LogPayload(self.json['source']['nid'], self.source_provider, path=self.json['source']['path']) destination = LogPayload(self.json['destination']['nid'], self.destination_provider, metadata=metadata) remote_logging.log_file_action(action, source=source, destination=destination, api_version='v0', request=remote_logging._serialize_request(self.request), bytes_downloaded=self.bytes_downloaded, bytes_uploaded=self.bytes_uploaded)
def _send_hook(self, action, metadata=None, path=None): source = LogPayload(self.arguments["nid"], self.provider, metadata=metadata, path=path) remote_logging.log_file_action( action, source=source, api_version="v0", request=remote_logging._serialize_request(self.request), bytes_downloaded=self.bytes_downloaded, bytes_uploaded=self.bytes_uploaded, )
def _send_hook(self, action, metadata=None, path=None): source = LogPayload(self.arguments['nid'], self.provider, metadata=metadata, path=path) remote_logging.log_file_action( action, source=source, api_version='v0', request=remote_logging._serialize_request(self.request), bytes_downloaded=self.bytes_downloaded, bytes_uploaded=self.bytes_uploaded)
def _send_hook(self, action, metadata): source = LogPayload(self.json["source"]["nid"], self.source_provider, path=self.json["source"]["path"]) destination = LogPayload(self.json["destination"]["nid"], self.destination_provider, metadata=metadata) remote_logging.log_file_action( action, source=source, destination=destination, api_version="v0", request=remote_logging._serialize_request(self.request), bytes_downloaded=self.bytes_downloaded, bytes_uploaded=self.bytes_uploaded, )
def _send_hook(self, action, metadata): source = LogPayload(self.json['source']['nid'], self.source_provider, path=self.json['source']['path']) destination = LogPayload(self.json['destination']['nid'], self.destination_provider, metadata=metadata) remote_logging.log_file_action( action, source=source, destination=destination, api_version='v0', request=remote_logging._serialize_request(self.request), bytes_downloaded=self.bytes_downloaded, bytes_uploaded=self.bytes_uploaded)