Skip to content

Commit 11cde5c

Browse files
authored
feat(objsto): add paging parameters to bucket list command (#721)
1 parent 0b5bc66 commit 11cde5c

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
if: ${{ always() }}
5353
steps:
5454
- name: Install upctl
55-
uses: UpCloudLtd/upcloud-cli-action@0b74850ba423d7d254b75518a31f19bd19aa839c # v1.0.0
55+
uses: UpCloudLtd/upcloud-cli-action@431cd636a879b137a92c291f6c72f68e8c01b738 # v1.0.1
5656
with:
5757
username: ${{ secrets.UPCLOUD_USERNAME }}
5858
password: ${{ secrets.UPCLOUD_PASSWORD }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add paging parameters to `object-storage bucket list` command.
13+
1014
## [3.31.0] - 2026-03-17
1115

1216
### Added

internal/commands/objectstorage/bucket/list.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import (
66
"github.com/UpCloudLtd/upcloud-cli/v3/internal/commands"
77
"github.com/UpCloudLtd/upcloud-cli/v3/internal/completion"
88
"github.com/UpCloudLtd/upcloud-cli/v3/internal/output"
9+
"github.com/UpCloudLtd/upcloud-cli/v3/internal/paging"
910
"github.com/UpCloudLtd/upcloud-cli/v3/internal/resolver"
1011
"github.com/UpCloudLtd/upcloud-go-api/v8/upcloud/request"
12+
"github.com/spf13/pflag"
1113
)
1214

1315
// ListCommand creates the 'objectstorage bucket list' command
@@ -26,13 +28,18 @@ type listCommand struct {
2628
*commands.BaseCommand
2729
completion.ObjectStorage
2830
resolver.CachingObjectStorage
31+
paging.PageParameters
2932
}
3033

3134
// InitCommand implements Command.InitCommand
3235
func (s *listCommand) InitCommand() {
3336
s.Cobra().Long = commands.WrapLongDescription(`List buckets in a managed object storage service
3437
3538
Lists all buckets in the specified managed object storage service, showing their names and total size in bytes.`)
39+
40+
fs := &pflag.FlagSet{}
41+
s.ConfigureFlags(fs)
42+
s.AddFlags(fs)
3643
}
3744

3845
// Execute implements commands.MultipleArgumentCommand
@@ -44,6 +51,7 @@ func (s *listCommand) Execute(exec commands.Executor, serviceUUID string) (outpu
4451

4552
req := &request.GetManagedObjectStorageBucketMetricsRequest{
4653
ServiceUUID: serviceUUID,
54+
Page: s.Page(),
4755
}
4856

4957
res, err := svc.GetManagedObjectStorageBucketMetrics(exec.Context(), req)

0 commit comments

Comments
 (0)