Printjobs limited to 25 jobs ?

46 views
Skip to first unread message

Jasper Cuvelier

unread,
Apr 26, 2016, 11:07:02 AM4/26/16
to Google Apps Manager

Hi!

I ran 

gam print printjobs printerid [printerid] todrive

I get a correct result, but the CSV is limited to the 25 last printjobs. 
When I check at google.com/cloudprint I can see a whole lot more printjobs, but I can't download them as a CSV file. 
We would like to see who's printing what, you see...

Ross Scroggs

unread,
Apr 26, 2016, 2:15:49 PM4/26/16
to google-ap...@googlegroups.com
Jasper,

The cloudprint API defaults to showing 25 print jobs. I've added two arguments to gam print printjobs and gam printjob <PrinterID> fetch that allow selecting a range of print jobs.

gam print printjobs ... offset <Integer> limit <Integer>

gam printjob <PrinterId> fetch ... offset <Integer> limit <Integer>


offset defaults to 0 and must be >= 0; limit defaults to 25 and must be >= 1.

To see the first 10 print jobs for a printer: gam print printjobs printer <PrinterId> limit 10
To see the next 20 print jobs for that printer: gam print printjobs printer <PrinterId> offset 10 limit 20

I have submitted a pull request to Jay for this change, in the meantime you can try it out here: https://github.com/taers232c/GAM/releases/tag/v3.66

Ross

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/bd58e7bd-bfdb-4efb-a6e3-549b7f5a855d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Jasper Cuvelier

unread,
Apr 26, 2016, 2:22:59 PM4/26/16
to google-ap...@googlegroups.com
Hi Ross

Thanks for your reply! I'll try this and get back to you. 

Jasper
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/WkBE-Wvnus0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.


--
Met vriendelijke groeten

Jasper Cuvelier
ICT-coördinator
Scholengemeenschap Meulebeke-Pittem
0486 755 476
http://www.sgmeulebekepittem.be

Jay Lee

unread,
Apr 26, 2016, 2:43:15 PM4/26/16
to google-ap...@googlegroups.com
@Ross: should just be possible to loop the jobs.list() request incrementing offset each time. limit can probably be set to something larger like 100 safely.

Jay


For more options, visit https://groups.google.com/d/optout.
--

Jay Lee

Ross Scroggs

unread,
Apr 26, 2016, 3:11:40 PM4/26/16
to google-ap...@googlegroups.com
Jay,

Good idea, I'm working on it now.

Ross


For more options, visit https://groups.google.com/d/optout.



--

Ross Scroggs

unread,
Apr 26, 2016, 6:26:49 PM4/26/16
to google-ap...@googlegroups.com
Jasper/Jay,

I've updated my previous note.

The cloudprint API defaults to showing 25 print jobs. I've added two arguments to gam print printjobs and gam printjob <PrinterID> fetch that allow retrieving a range of print jobs.

gam print printjobs ... offset <Integer> limit <Integer>

gam printjob <PrinterId> fetch ... offset <Integer> limit <Integer>


offset defaults to 0 and must be >= 0; limit defaults to 25 and must be >= 0.

To see the first 10 print jobs for a printer: gam print printjobs printer <PrinterId> limit 10
To see the next 20 print jobs for that printer: gam print printjobs printer <PrinterId> offset 10 limit 20

Set limit to 0 to retrieve all print jobs. Internally, the print jobs are accessed in chunks of 25.

Ross
--

Jasper Cuvelier

unread,
Apr 27, 2016, 2:50:38 AM4/27/16
to google-ap...@googlegroups.com
Ross/Jay,

Thanks a lot. Worked perfectly with 3.66.

gam print printjobs printer <printerId> offset 0 limit 0 todrive ==> Neatly gets all printjobs for that printer.

Another timesaver! I'm a daily user of GAM and I wouldn't have a clue how to decently do my job if I hadn't have GAM.
Thanks!

Jasper


Met vriendelijke groeten

Jasper Cuvelier

ICT-coördinator
Scholengemeenschap Meulebeke-Pittem
0486 755 476


 


Alberto Martínez

unread,
Apr 27, 2016, 3:17:56 AM4/27/16
to google-ap...@googlegroups.com
Set limit to 0 to retrieve all print jobs. Internally, the print jobs are accessed in chunks of 25.

If you are going to fetch all print jobs it is worth to ask for a bigger chunk. It's faster that way.


@Ross: should just be possible to loop the jobs.list() request incrementing offset each time. limit can probably be set to something larger like 100 safely.

I would ask for the maximum, myself.


2016-04-27 0:26 GMT+02:00 Ross Scroggs <ross.s...@gmail.com>:

For more options, visit https://groups.google.com/d/optout.



--
Alberto Martínez Setién
Middleware
Comunicación y Sistemas
Servicio Informático
Universidad de Deusto
Avda. de las Universidades, 24
48007 - Bilbao (SPAIN)
Phone: +34 94 413 90 00 Ext. 2684
Fax: +34 94 413 91 01

Ross Scroggs

unread,
Apr 27, 2016, 10:34:14 AM4/27/16
to google-ap...@googlegroups.com
Jasper/Jay,

Latest update.

gam print printjobs ... offset <Number> limit <Number> maxresults <Number>
gam printjob <PrinterId> fetch ... offset <Number> limit <Number maxresults <Number>

offset specifies the number of print jobs to skip before retrieving; defaults to 0.
limit specifies the maximum number of print jobs to retrieve; defaults to 25, set limit to 0 to retrieve all print jobs.
maxresults specifies the number of print jobs to retrieve in each API call; defaults to 100, range is 1 to 1000.

Ross

Jay Lee

unread,
Apr 27, 2016, 10:35:44 AM4/27/16
to google-ap...@googlegroups.com
offset and limit should go away as command line options and we can just use sane default of 100 for limit.

Jay


For more options, visit https://groups.google.com/d/optout.
--

Jay Lee

Ross Scroggs

unread,
Apr 27, 2016, 1:49:38 PM4/27/16
to google-ap...@googlegroups.com
Jasper/Jay,

Latest update: offset and maxresults arguments dropped.

gam print printjobs ... limit <Number>
gam printjob <PrinterId> fetch ... limit <Number>

limit specifies the maximum number of print jobs to retrieve; defaults to 25, set limit to 0 to retrieve all print jobs.

print jobs are retrieved in batches of 100.

Ross



For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages