scrapyd icon indicating copy to clipboard operation
scrapyd copied to clipboard

listjobs.json response does not contain parameters

Open sieira opened this issue 8 years ago • 5 comments

Is there a way to retrieve the parameters of a scheduled task?

Currently

$ curl http://localhost:6800/schedule.json -d project=myproject -d spider=somespider -d setting=DOWNLOAD_DELAY=2 -d arg1=val1

Returns

{"status": "ok",
 "pending": [{"id": "78391cc0fcaf11e1b0090800272a6d06", "spider": "somespider"}]
}

I wonder if there is a way to get:

{"status": "ok",
 "pending": [{
    "id": "78391cc0fcaf11e1b0090800272a6d06",
    "spider": "somespider",
    "setting": {"DOWNLOAD_DELAY": 2},
    "arg1": "val1"
}]
}

sieira avatar Jan 23 '17 16:01 sieira

@sieira, no. This information exists only for pending jobs. I'd say scrapyd is far from providing this feature. Also, I think we shouldn't provide an API for this until we rewrite the webservice to accept parameters in a better format.

Digenis avatar Jan 25 '17 09:01 Digenis

Would you be willing to accept a patch with this enhancement?

  • store the arguments in ScrapyProcessProtocol() (around https://github.com/scrapy/scrapyd/blob/4520c45acc115d0fc766eae30788468a77690433/scrapyd/launcher.py#L44)
  • report the arguments in listjobs.json for pending, running and finished jobs

jabadia avatar Feb 20 '20 11:02 jabadia

Maybe related: #39

jpmckinney avatar Sep 23 '21 23:09 jpmckinney

store the arguments in ScrapyProcessProtocol()

Noting that this was the approach in #254

jpmckinney avatar Sep 24 '21 00:09 jpmckinney

See also comments in PR #272

jpmckinney avatar Sep 24 '21 00:09 jpmckinney