Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add paging parameters to `object-storage bucket list` command.

## [3.31.0] - 2026-03-17

### Added
Expand Down
8 changes: 8 additions & 0 deletions internal/commands/objectstorage/bucket/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import (
"github.com/UpCloudLtd/upcloud-cli/v3/internal/commands"
"github.com/UpCloudLtd/upcloud-cli/v3/internal/completion"
"github.com/UpCloudLtd/upcloud-cli/v3/internal/output"
"github.com/UpCloudLtd/upcloud-cli/v3/internal/paging"
"github.com/UpCloudLtd/upcloud-cli/v3/internal/resolver"
"github.com/UpCloudLtd/upcloud-go-api/v8/upcloud/request"
"github.com/spf13/pflag"
)

// ListCommand creates the 'objectstorage bucket list' command
Expand All @@ -26,13 +28,18 @@ type listCommand struct {
*commands.BaseCommand
completion.ObjectStorage
resolver.CachingObjectStorage
paging.PageParameters
}

// InitCommand implements Command.InitCommand
func (s *listCommand) InitCommand() {
s.Cobra().Long = commands.WrapLongDescription(`List buckets in a managed object storage service

Lists all buckets in the specified managed object storage service, showing their names and total size in bytes.`)

fs := &pflag.FlagSet{}
s.ConfigureFlags(fs)
s.AddFlags(fs)
}

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

req := &request.GetManagedObjectStorageBucketMetricsRequest{
ServiceUUID: serviceUUID,
Page: s.Page(),
}

res, err := svc.GetManagedObjectStorageBucketMetrics(exec.Context(), req)
Expand Down
Loading