def METHOD_NAME(self, serializer):
    action = serializer.validated_data["action"]
    node = self.get_object()
    if action == "refresh_cache" and node is None:
        task = self.refresh_nodes_cache()
        self.set_serializer_data(serializer, task)
        return
    if action == "refresh":
        task = update_node_assets_hardware_info_manual(node)
    else:
        task = test_node_assets_connectivity_manual(node)
    self.set_serializer_data(serializer, task)