Skip to content

Commit 04e9c0c

Browse files
authored
feat(block): add tags filter in list snapshots (scaleway#2430)
1 parent f29ed0c commit 04e9c0c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/block/v1alpha1/block_sdk.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,9 @@ type ListSnapshotsRequest struct {
732732

733733
// Name: filter snapshots by their names.
734734
Name *string `json:"-"`
735+
736+
// Tags: filter by tags. Only snapshots with one or more matching tags will be returned.
737+
Tags []string `json:"-"`
735738
}
736739

737740
// ListSnapshotsResponse: list snapshots response.
@@ -1154,6 +1157,7 @@ func (s *API) ListSnapshots(req *ListSnapshotsRequest, opts ...scw.RequestOption
11541157
parameter.AddToQuery(query, "page_size", req.PageSize)
11551158
parameter.AddToQuery(query, "volume_id", req.VolumeID)
11561159
parameter.AddToQuery(query, "name", req.Name)
1160+
parameter.AddToQuery(query, "tags", req.Tags)
11571161

11581162
if fmt.Sprint(req.Zone) == "" {
11591163
return nil, errors.New("field Zone cannot be empty in request")

0 commit comments

Comments
 (0)