Skip to content

feat(lb): publish flexible ip tags feature #2068

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

Merged
merged 1 commit into from
May 3, 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
23 changes: 23 additions & 0 deletions api/lb/v1/lb_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,9 @@ type IP struct {
// Reverse: reverse DNS (domain name) of the IP address.
Reverse string `json:"reverse"`

// Tags: IP tags.
Tags []string `json:"tags"`

// Deprecated: Region: the region the IP address is in.
Region *scw.Region `json:"region,omitempty"`

Expand Down Expand Up @@ -1877,6 +1880,9 @@ type CreateIPRequest struct {

// IsIPv6: if true, creates a Flexible IP with an ipv6 address.
IsIPv6 bool `json:"is_ipv6"`

// Tags: list of tags for the IP.
Tags []string `json:"tags"`
}

// CreateLBRequest: create lb request.
Expand Down Expand Up @@ -2398,6 +2404,9 @@ type ListIPsRequest struct {
// IPType: IP type to filter for.
// Default value: all
IPType ListIPsRequestIPType `json:"-"`

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

// ListIPsResponse: list i ps response.
Expand Down Expand Up @@ -3066,6 +3075,9 @@ type UpdateIPRequest struct {

// LBID: ID of the server on which to attach the flexible IP.
LBID *string `json:"lb_id,omitempty"`

// Tags: list of tags for the IP.
Tags *[]string `json:"tags,omitempty"`
}

// UpdateLBRequest: update lb request.
Expand Down Expand Up @@ -3394,6 +3406,9 @@ type ZonedAPICreateIPRequest struct {

// IsIPv6: if true, creates a Flexible IP with an ipv6 address.
IsIPv6 bool `json:"is_ipv6"`

// Tags: list of tags for the IP.
Tags []string `json:"tags"`
}

// ZonedAPICreateLBRequest: zoned api create lb request.
Expand Down Expand Up @@ -3769,6 +3784,9 @@ type ZonedAPIListIPsRequest struct {
// IPType: IP type to filter for.
// Default value: all
IPType ListIPsRequestIPType `json:"-"`

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

// ZonedAPIListLBPrivateNetworksRequest: zoned api list lb private networks request.
Expand Down Expand Up @@ -4253,6 +4271,9 @@ type ZonedAPIUpdateIPRequest struct {

// LBID: ID of the server on which to attach the flexible IP.
LBID *string `json:"lb_id,omitempty"`

// Tags: list of tags for the IP.
Tags *[]string `json:"tags,omitempty"`
}

// ZonedAPIUpdateLBRequest: zoned api update lb request.
Expand Down Expand Up @@ -4572,6 +4593,7 @@ func (s *ZonedAPI) ListIPs(req *ZonedAPIListIPsRequest, opts ...scw.RequestOptio
parameter.AddToQuery(query, "organization_id", req.OrganizationID)
parameter.AddToQuery(query, "project_id", req.ProjectID)
parameter.AddToQuery(query, "ip_type", req.IPType)
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 @@ -6533,6 +6555,7 @@ func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIPsR
parameter.AddToQuery(query, "organization_id", req.OrganizationID)
parameter.AddToQuery(query, "project_id", req.ProjectID)
parameter.AddToQuery(query, "ip_type", req.IPType)
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