diff --git a/foxglove_data_platform/client.py b/foxglove_data_platform/client.py index c020a6d..dd6caa6 100644 --- a/foxglove_data_platform/client.py +++ b/foxglove_data_platform/client.py @@ -577,6 +577,12 @@ def delete_import(self, *, device_id: Optional[str] = None, import_id: str): ) json_or_raise(response) + def delete_recording(self, *, recording_id: str): + response = requests.delete( + self.__url__(f"/v1/recordings/{recording_id}"), headers=self.__headers + ) + json_or_raise(response) + def get_imports( self, *, diff --git a/tests/test_recordings.py b/tests/test_recordings.py index dee3b1d..600d482 100644 --- a/tests/test_recordings.py +++ b/tests/test_recordings.py @@ -10,6 +10,21 @@ fake = Faker() +@responses.activate +def test_delete_recording(): + recording_id = fake.uuid4() + responses.add( + responses.DELETE, + api_url(f"/v1/recordings/{recording_id}"), + json={"success": True, "id": recording_id}, + ) + client = Client("test") + try: + client.delete_recording(recording_id=recording_id) + except: + assert False + + @responses.activate def test_get_recordings(): device_id = fake.uuid4()