Skip to content

Commit a49fad6

Browse files
authored
feat(lb): add tags filter when listing lbs (#2027)
1 parent a69b0a7 commit a49fad6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

api/lb/v1/lb_sdk.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,6 +2538,9 @@ type ListLBsRequest struct {
25382538

25392539
// ProjectID: project ID to filter for, only Load Balancers from this Project will be returned.
25402540
ProjectID *string `json:"-"`
2541+
2542+
// Tags: filter by tag, only Load Balancers with one or more matching tags will be returned.
2543+
Tags []string `json:"-"`
25412544
}
25422545

25432546
// ListLBsResponse: list l bs response.
@@ -3822,6 +3825,9 @@ type ZonedAPIListLBsRequest struct {
38223825

38233826
// ProjectID: project ID to filter for, only Load Balancers from this Project will be returned.
38243827
ProjectID *string `json:"-"`
3828+
3829+
// Tags: filter by tag, only Load Balancers with one or more matching tags will be returned.
3830+
Tags []string `json:"-"`
38253831
}
38263832

38273833
// ZonedAPIListRoutesRequest: zoned api list routes request.
@@ -4342,6 +4348,7 @@ func (s *ZonedAPI) ListLBs(req *ZonedAPIListLBsRequest, opts ...scw.RequestOptio
43424348
parameter.AddToQuery(query, "page", req.Page)
43434349
parameter.AddToQuery(query, "organization_id", req.OrganizationID)
43444350
parameter.AddToQuery(query, "project_id", req.ProjectID)
4351+
parameter.AddToQuery(query, "tags", req.Tags)
43454352

43464353
if fmt.Sprint(req.Zone) == "" {
43474354
return nil, errors.New("field Zone cannot be empty in request")
@@ -6302,6 +6309,7 @@ func (s *API) ListLBs(req *ListLBsRequest, opts ...scw.RequestOption) (*ListLBsR
63026309
parameter.AddToQuery(query, "page", req.Page)
63036310
parameter.AddToQuery(query, "organization_id", req.OrganizationID)
63046311
parameter.AddToQuery(query, "project_id", req.ProjectID)
6312+
parameter.AddToQuery(query, "tags", req.Tags)
63056313

63066314
if fmt.Sprint(req.Region) == "" {
63076315
return nil, errors.New("field Region cannot be empty in request")

0 commit comments

Comments
 (0)