@@ -28,23 +28,29 @@ type GetStoragesRequest struct {
2828 Type string
2929 // If specified, only storages marked as favorite will be retrieved
3030 Favorite bool
31+
32+ Filters []QueryFilter
3133}
3234
3335// RequestURL implements the Request interface
3436func (r * GetStoragesRequest ) RequestURL () string {
37+ url := "/storage"
3538 if r .Access != "" {
36- return fmt .Sprintf ("/storage/ %s" , r .Access )
39+ url = fmt .Sprintf ("%s/ %s" , url , r .Access )
3740 }
3841
3942 if r .Type != "" {
40- return fmt .Sprintf ("/storage/ %s" , r .Type )
43+ url = fmt .Sprintf ("%s/ %s" , url , r .Type )
4144 }
4245
4346 if r .Favorite {
44- return "/storage /favorite"
47+ url = url + " /favorite"
4548 }
4649
47- return "/storage"
50+ if len (r .Filters ) == 0 {
51+ return url
52+ }
53+ return fmt .Sprintf ("%s?%s" , url , encodeQueryFilters (r .Filters ))
4854}
4955
5056// GetStorageDetailsRequest represents a request for retrieving details about a piece of storage
@@ -64,6 +70,7 @@ type CreateStorageRequest struct {
6470 Title string `json:"title,omitempty"`
6571 Zone string `json:"zone"`
6672 BackupRule * upcloud.BackupRule `json:"backup_rule,omitempty"`
73+ Labels []upcloud.Label `json:"labels,omitempty"`
6774}
6875
6976// RequestURL implements the Request interface
@@ -90,6 +97,7 @@ type ModifyStorageRequest struct {
9097 Title string `json:"title,omitempty"`
9198 Size int `json:"size,omitempty,string"`
9299 BackupRule * upcloud.BackupRule `json:"backup_rule,omitempty"`
100+ Labels * []upcloud.Label `json:"labels,omitempty"`
93101}
94102
95103// MarshalJSON is a custom marshaller that deals with
0 commit comments