feat: handle pagination in bucket list (#307)

This commit is contained in:
Daniel Moran
2021-10-15 15:14:59 -07:00
committed by GitHub
parent d92bede8d3
commit 6fda4cceed
4 changed files with 165 additions and 7 deletions

View File

@ -156,6 +156,22 @@ func newBucketListCmd() cli.Command {
EnvVar: "INFLUX_ORG",
Destination: &params.OrgName,
},
&cli.IntFlag{
Name: "limit",
Usage: "Total number of buckets to fetch from the server, or 0 to return all buckets",
Destination: &params.Limit,
},
&cli.IntFlag{
Name: "offset",
Usage: "Number of buckets to skip over in the list",
Destination: &params.Offset,
},
&cli.IntFlag{
Name: "page-size",
Usage: "Number of buckets to fetch per request to the server",
Value: 20,
Destination: &params.PageSize,
},
),
Action: func(ctx *cli.Context) error {
api := getAPI(ctx)