Page 1 of 1

creating custom job

Posted: Tue Oct 10, 2017 11:43 am
by lulu116
hello
I'm trying to create a job for a custom command.
I copied the example from the docs and customize it :
myjob.json :
{
"job":
{
"name" : "Myjob",
"user_name" : "dev",
"host_name" : "s003",
"blocks":[
{
"name" : "mytest",
"tasks_name" : "frames @#@-@#@",
"service" : "generic",
"parser" : "generic",
"frame_first" : 798,
"frame_last" : 1000,
"frames_per_task" : 10,
"frames_inc" : 1,
"command" : "myscript.pl -f @#@ @#@",
"working_directory" : "/work/Projects/Myproject",
"files" : ["/work/Projects/Myproject/output/test.@####@.png"]
}
]
}
}

when I test it :
>afcmd json myjob.json

I have this message :
AFERROR: Invalid job 'Myjob'[0]:
Block 'mytest'[0]: Zero tasks number.

from reading the doc I thought I don't need to specify a task block
I tried to add "numeric" : true, in the block but always the same message.
I used the generic service and generic parser.

what am I doing wrong?
luc

Re: creating custom job

Posted: Tue Oct 10, 2017 4:32 pm
by lulu116
I had to add
"flags": 1,
in the blocks section to make it work.

Re: creating custom job

Posted: Sat Oct 14, 2017 8:40 am
by timurhai
Hi.
Better to use Python API:
http://cgru.info/afanasy/api#python
It designed to help to construct a valid job json object and to send it.