mapbox / tilesets-cli

CLI for interacting with the Mapbox Tilesets API and Mapbox Tiling Service
https://docs.mapbox.com/mapbox-tiling-service
BSD 2-Clause "Simplified" License
125 stars 27 forks source link

Add limit option to jobs command #74

Closed dianeschulze closed 4 years ago

dianeschulze commented 4 years ago

Adds an optional --limit flag to the tilesets jobs command. This flag accepts values from 1 to 500 and defaults to 100.

Relevant API docs: https://docs.mapbox.com/api/maps/#list-information-about-all-jobs-for-a-tileset

Helptext:

$ tilesets jobs --help
Usage: tilesets jobs [OPTIONS] TILESET

  View all jobs for a particular tileset.

  Only supports tilesets created with the Mapbox Tiling Service.

  tilesets jobs <tileset_id>

Options:
  -s, --stage TEXT       job stage
  --limit INTEGER RANGE  The maximum number of results to return, from 1 to
                         500 (default 100)
  -t, --token TEXT       Mapbox access token
  --indent INTEGER       Indent for JSON output
  --help                 Show this message and exit.

Usage:

$ tilesets jobs username.tileset --limit 4
$ tilesets jobs username.tileset --stage success --limit 1
dianeschulze commented 4 years ago

@Gerdie thanks for the review!

we're holding off on implementing start?

Right, this PR doesn't implement a start option (which is also not implemented for any other commands).