remove deprecated endpoint
@@ -15,12 +15,11 @@ from rest_framework.views import APIView
from accounts.models import User
from agents.models import Agent, AgentHistory
-from agents.serializers import WinAgentSerializer, AgentHistorySerializer
+from agents.serializers import AgentHistorySerializer
from autotasks.models import AutomatedTask
from autotasks.serializers import TaskGOGetSerializer, TaskRunnerPatchSerializer
from checks.models import Check
from checks.serializers import CheckRunnerGetSerializer
-from checks.utils import bytes2human
from logs.models import PendingAction, DebugLog
from software.models import InstalledSoftware
from tacticalrmm.utils import notify_error, reload_nats
@@ -32,54 +31,6 @@ class CheckIn(APIView):
authentication_classes = [TokenAuthentication]
permission_classes = [IsAuthenticated]
- def put(self, request):
- """
- !!! DEPRECATED AS OF AGENT 1.7.0 !!!
- Endpoint be removed in a future release
- """
- agent = get_object_or_404(Agent, agent_id=request.data["agent_id"])
- serializer = WinAgentSerializer(instance=agent, data=request.data, partial=True)
-
- if request.data["func"] == "disks":
- disks = request.data["disks"]
- new = []
- for disk in disks:
- tmp = {}
- for _, _ in disk.items():
- tmp["device"] = disk["device"]
- tmp["fstype"] = disk["fstype"]
- tmp["total"] = bytes2human(disk["total"])
- tmp["used"] = bytes2human(disk["used"])
- tmp["free"] = bytes2human(disk["free"])
- tmp["percent"] = int(disk["percent"])
- new.append(tmp)
-
- serializer.is_valid(raise_exception=True)
- serializer.save(disks=new)
- return Response("ok")
-
- if request.data["func"] == "loggedonuser":
- if request.data["logged_in_username"] != "None":
- serializer.is_valid(raise_exception=True)
- serializer.save(last_logged_in_user=request.data["logged_in_username"])
- return Response("ok")
-
- if request.data["func"] == "software":
- sw = request.data["software"]
-
- if not InstalledSoftware.objects.filter(agent=agent).exists():
- InstalledSoftware(agent=agent, software=sw).save()
- else:
- s = agent.installedsoftware_set.first() # type: ignore
- s.software = sw
- s.save(update_fields=["software"])
-
- return Response("ok")
-
- serializer.is_valid(raise_exception=True)
- serializer.save()
- return Response("ok")
-
# called once during tacticalagent windows service startup
def post(self, request):
agent = get_object_or_404(Agent, agent_id=request.data["agent_id"])
