Skip to content

Commit b34ecf5

Browse files
authored
feat(instance): Add private_network filter on ListServers (#567)
1 parent 00656aa commit b34ecf5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

api/instance/v1/instance_sdk.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,8 @@ type ListServersRequest struct {
15421542
State *ServerState `json:"-"`
15431543
// Tags: list servers with these exact tags
15441544
Tags []string `json:"-"`
1545+
// PrivateNetwork: list servers in this Private Network
1546+
PrivateNetwork *string `json:"-"`
15451547
}
15461548

15471549
// ListServers: list all servers
@@ -1571,6 +1573,7 @@ func (s *API) ListServers(req *ListServersRequest, opts ...scw.RequestOption) (*
15711573
if len(req.Tags) != 0 {
15721574
parameter.AddToQuery(query, "tags", strings.Join(req.Tags, ","))
15731575
}
1576+
parameter.AddToQuery(query, "private_network", req.PrivateNetwork)
15741577

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

api/vpc/v1/vpc_sdk.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ type GetPrivateNetworkRequest struct {
255255
PrivateNetworkID string `json:"-"`
256256
}
257257

258+
// GetPrivateNetwork: get a private network
258259
func (s *API) GetPrivateNetwork(req *GetPrivateNetworkRequest, opts ...scw.RequestOption) (*PrivateNetwork, error) {
259260
var err error
260261

0 commit comments

Comments
 (0)