Skip to content

Commit

Permalink
feat(instance): added field private_networks for ListServersRequest (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Jul 24, 2023
1 parent 1ed69ad commit 36a2219
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/instance/v1/instance_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1999,6 +1999,8 @@ type ListServersRequest struct {
// Order: define the order of the returned servers.
// Default value: creation_date_desc
Order ListServersRequestOrder `json:"-"`
// PrivateNetworks: list Instances from the given Private Networks (use commas to separate them).
PrivateNetworks []string `json:"-"`
}

// ListServers: list all Instances.
Expand Down Expand Up @@ -2031,6 +2033,9 @@ func (s *API) ListServers(req *ListServersRequest, opts ...scw.RequestOption) (*
}
parameter.AddToQuery(query, "private_network", req.PrivateNetwork)
parameter.AddToQuery(query, "order", req.Order)
if len(req.PrivateNetworks) != 0 {
parameter.AddToQuery(query, "private_networks", strings.Join(req.PrivateNetworks, ","))
}

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

0 comments on commit 36a2219

Please sign in to comment.