Hi Kaya, The best way to form proper JSON is to create a job with the UI and export its JSON, and use that as a model. Thanks, Karl
On Thu, Nov 28, 2019 at 3:05 AM Kayak28 <kaya.ota....@gmail.com> wrote: > Hello, Community Members: > > I have a question about the form of JSON when I call a job-creation API. > I would like to use the following API. > jobs POST Create a job {"job":*<job_object>*} {"job_id":*<job_identifier>* > } *OR* {"error":*<error_text>*} > > The URL I should send with curl POST command is: > http://localhost:8345/mcf-api-services/json/jobs. > > My question is what is the correct format for job_object? > I have tried the following JSON to create a job, but ended in "400: Bad > JSON: null" > The following JSON should crate a job with WEB-repository and Filesystem > Output. > If anyone knows what JSON I should send to create a job in MCF, please let > me know. > I would really appreciate any of your help. > > {"job": > {"_children_":[ > {"_type_":"id", > "_value_":"1574926560999"}, > {"_type_":"description", > "_value_":"test_job1-1"}, > {"_type_":"repository_connection", > "_value_":"web-repo"}, > { "_type_":"document_specification", > "_children_":[ > {"_type_":"seeds", > "_value_":"https:\/\/dummy-web-host-mcf.herokuapp.com\/"}, > {"_type_":"includes", > "_value_":".*"}, > {"_type_":"includesindex","_value_":".*"}, > {"_type_":"limittoseeds", > "_value_":"","_attribute_value":"true"}, > {"_type_":"excludes","_value_":""}, > {"_type_":"excludesindex","_value_":""}, > {"_type_":"excludescontentindex","_value_":""} > ]}, > {"_type_":"pipelinestage", > "_children_": > [ > {"_type_":"stage_id", > "_value_":"0"}, > {"_type_":"stage_isoutput", > "_value_":"true"}, > {"_type_":"stage_connectionname", > "_value_":"sample_out"}, > {"_type_":"stage_specification", > "rootpath": > {"_attribute_ROOTPATH":"\/home\/vagrant\/out\/", > "_value_":""}} > ]}, > {"_type_":"start_mode", > "_value_":"manual"}, > {"_type_":"run_mode", > "_value_":"scan once"}, > {"_type_":"hopcount_mode", > "_value_":"accurate"}, > {"_type_":"priority", > "_value_":"5"}, > {"_type_":"recrawl_interval","_value_":"86400000"}, > {"_type_":"max_recrawl_interval","_value_":"infinite"} > {"_type_":"expiration_interval","_value_":"infinite"}, > {"_type_":"reseed_interval","_value_":"3600000"}, > {"_type_":"schedule", > "_children_":[ > {"_type_":"requestminimum","_value_":"false"}, > {"_type_":"timezone","_value_":"Japan"}, > {"_type_":"dayofweek","value":"0"} > ]} > ]}} > > Sincerely, > Kaya Ota > >