Manage scheduled task
-
Hello,
How can I managed scheduled tak, view, erase, remove, modify…
Lebrun
-
@lebrun78 Though I haven’t played with the API much yet (Tom is doing most of that) I’d think that DELETE URLs are a bit different - from the simplified API documentation. Have you tried the following yet?
curl -H 'fog-api-token:NWE...MWU=' -H 'fog-user-token:ODc....mNDE=' -X DELETE http://fogus/fog/scheduledtask/86
-
@lebrun78 Do you mean through the GUI or the API? What FOG Version?
-
my production version is 1.4.4.
I have had a look throught the gui (web) ? How could i get the api ? -
@lebrun78 You already have the API. What you need is documentation on how to use it. Here’s some:
https://news.fogproject.org/simplified-api-documentation/
and
https://forums.fogproject.org/topic/10036/api
and
https://forums.fogproject.org/topic/9779/can-i-use-some-kind-of-script-to-create-image-and-ghost-my-lab-machines
#wiki worthy -
@wayne-workman
Thanks,
I can get the scheduled tacks of the host with the id 826 by:curl -H 'fog-api-token:ttt.....WU=' -H 'fog-user-token:ODc4Z.....YjZmNDE=' -X GET http://fogus/fog/scheduledtask -o 826task.json -d '{"hostID":[826]}'
So I get the 826task.json file containing:
{ "count": 1, "scheduledtasks": [ { "id": "86", "name": "Deploy Task", "description": "", "type": "C", "taskType": "1", "minute": "0", "hour": "1", "dayOfMonth": "*", "month": "*", "dayOfWeek": "0", "isGroupTask": "", "hostID": "826", "shutdown": "1", "other1": "", "other2": "-1", "other3": "fog", "other4": "1", "other5": "", "scheduleTime": "0", "isActive": "1", "imageID": "0" } ]
I try to delete the task with
curl -H 'fog-api-token:NWE...MWU=' -H 'fog-user-token:ODc....mNDE=' -X DELETE http://fogus/fog/scheduledtask -d '{"id":[86]}'
But the task is still present… What is my error ?
-
@lebrun78 Though I haven’t played with the API much yet (Tom is doing most of that) I’d think that DELETE URLs are a bit different - from the simplified API documentation. Have you tried the following yet?
curl -H 'fog-api-token:NWE...MWU=' -H 'fog-user-token:ODc....mNDE=' -X DELETE http://fogus/fog/scheduledtask/86
-
Yes it works, thanks,
May be examples are lacking in the documentation ?
-
@lebrun78 said in Manage scheduled task:
May be examples are lacking in the documentation ?
Help us write examples? Post them here.