adobe-platform / go-metronome

A Go-based metronome client
Apache License 2.0
3 stars 4 forks source link

Support undocumented Metronome API functions #1

Closed f4tq closed 7 years ago

f4tq commented 7 years ago

This PR revolves around the undocumented Metronome api that will give us immediate job status.

Unfortunately, I had to change the interface signature of RunLs to return a pointer to a Job structure instead of the previous []*JobStatus.
The undocumented api adds 4 structures to the Job JSON structure which I made into pointers, adding omitempty so the normal API works.

Before, run-now type long lasting Metronone jobs, like a server, are the only type to return a job status - because it's ACTIVE. All others jobs - normal transient - wouldn't before unless you queried just when they ran.

Now all the status shows up. A job with crontab like */2 * * * * now has 100s of items.

Thankfully, there is a _timestamp parameter that can be used to filter from an epoch time to limit the results.

Obviously, the success/failure status list can get long especially for a job the runs */2 * * * * etc. I did not expose the _timestamp through the Metronome interface though with the hope that Mesosphere fixes this.

Here are the specific items in this PR: