Skip to content

Commit

Permalink
Adapting operator to new bucket list API change
Browse files Browse the repository at this point in the history
Adapting operator to new bucket list API change

Signed-off-by: jackyalbo <[email protected]>
  • Loading branch information
jackyalbo committed Nov 11, 2024
1 parent 87b1023 commit 066a328
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/bucket/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func RunStatus(cmd *cobra.Command, args []string) {
func RunList(cmd *cobra.Command, args []string) {
log := util.Logger()
nbClient := system.GetNBClient()
list, err := nbClient.ListBucketsAPI()
list, err := nbClient.ListBucketsAPI(nb.ListBucketsParams{})
if err != nil {
log.Fatal(err)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/nb/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Client interface {
SetNamespaceStoreInfo(NamespaceStoreInfo) error

ListAccountsAPI(ListAccountsParams) (ListAccountsReply, error)
ListBucketsAPI() (ListBucketsReply, error)
ListBucketsAPI(ListBucketsParams) (ListBucketsReply, error)
ListHostsAPI(ListHostsParams) (ListHostsReply, error)

CreateAuthAPI(CreateAuthParams) (CreateAuthReply, error)
Expand Down Expand Up @@ -146,8 +146,8 @@ func (c *RPCClient) ListAccountsAPI(params ListAccountsParams) (ListAccountsRepl
}

// ListBucketsAPI calls bucket_api.list_buckets()
func (c *RPCClient) ListBucketsAPI() (ListBucketsReply, error) {
req := &RPCMessage{API: "bucket_api", Method: "list_buckets"}
func (c *RPCClient) ListBucketsAPI(params ListBucketsParams) (ListBucketsReply, error) {
req := &RPCMessage{API: "bucket_api", Method: "list_buckets", Params: params}
res := &struct {
RPCMessage `json:",inline"`
Reply ListBucketsReply `json:"reply"`
Expand Down
6 changes: 6 additions & 0 deletions pkg/nb/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ type ListAccountsReply struct {
Accounts []*AccountInfo `json:"accounts"`
}

// ListBcuketsParams is the params to account_api.list_buckets()
type ListBucketsParams struct {
ContinuationToken *string `json:"continuation_token,omitempty"`
MaxBuckets *int `json:"max_buckets,omitempty"`
}

// ListBucketsReply is the reply of bucket_api.list_buckets()
type ListBucketsReply struct {
Buckets []struct {
Expand Down

0 comments on commit 066a328

Please sign in to comment.