Merge 'dev' into 'main'

This commit is contained in:
stSolo
2022-10-03 16:56:47 +03:00
parent 6271fa6d45
commit 5fd450382c
400 changed files with 14394 additions and 13407 deletions

View File

@@ -0,0 +1,34 @@
package disks
import (
"context"
"encoding/json"
"net/http"
)
type SearchRequest struct {
AccountID uint64 `url:"accountId,omitempty"`
Name string `url:"name,omitempty"`
ShowAll bool `url:"show_all,omitempty"`
Page uint64 `url:"page,omitempty"`
Size uint64 `url:"size,omitempty"`
}
func (d Disks) Search(ctx context.Context, req SearchRequest) (ListDisks, error) {
url := "/cloudbroker/disks/search"
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return nil, err
}
diskList := ListDisks{}
err = json.Unmarshal(res, &diskList)
if err != nil {
return nil, err
}
return diskList, nil
}