so I have large json, with list of task id's
which I want to delete in bulk
API is doable
how about the sdk? how do I provide a list of tasks id's to for deletion
from the cleanup example:
for task in tasks:
try:
deleted_task = Task.get_task(task_id=task.id)
deleted_task.delete(
how do I set tasks
, while coming from known list of task id's
For the SDK you have to provide it one by one so you'd have to iterate over the list
thanks @<1523701070390366208:profile|CostlyOstrich36>
I've done this successfully using the API already
as for the sdk option - in which format should I provide the list of tasks/projects to the sdk?
foronly_fields=["id", "name","created","status_changed","status", "user"],
:
output example
{'id': '02a3f5929cf246138994c9243a692219', 'name': 'docfm_v7_safe_32gpu80g_11Jan24_4w', 'created': datetime.datetime(2024, 1, 11, 9, 54, 33, 406000, tzinfo=tzutc()), 'status_changed': datetime.datetime(2024, 1, 11, 10, 33, 42, 951000, tzinfo=tzutc()), 'status': <TaskStatusEnum.stopped: 'stopped'>, 'user': 'a33e22b207c8aca5cbfddd5d94b9d8f2'}
what I did is in order to review it, and match project names, I convert it to:
{
"Task ID": "356a47d592f647a3aa187e2047443eb0",
"Name": "docfm_v7_safe_32gpu80g_11Jan24_4w",
"User": "a33e22b207c8aca5cbfddd5d94b9d8f2",
"Project": "1c02916ceba84b15a1ecb6686d93a4d1",
"Status": "stopped",
"Created": "2024-01-11 10:34:34.190000+00:00",
"Last Changed": "2024-01-11 15:45:39.677000+00:00"
},