Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lb): add tags filter when listing lbs #2027

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/lb/v1/lb_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,9 @@ type ListLBsRequest struct {

// ProjectID: project ID to filter for, only Load Balancers from this Project will be returned.
ProjectID *string `json:"-"`

// Tags: filter by tag, only Load Balancers with one or more matching tags will be returned.
Tags []string `json:"-"`
}

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

// ProjectID: project ID to filter for, only Load Balancers from this Project will be returned.
ProjectID *string `json:"-"`

// Tags: filter by tag, only Load Balancers with one or more matching tags will be returned.
Tags []string `json:"-"`
}

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

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

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