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(instance): allow filter by tags in server list #373

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions api/account/v2alpha1/account_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
2 changes: 2 additions & 0 deletions api/baremetal/v1alpha1/baremetal_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
2 changes: 2 additions & 0 deletions api/domain/v2alpha2/domain_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
7 changes: 7 additions & 0 deletions api/instance/v1/instance_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down Expand Up @@ -1413,6 +1415,8 @@ type ListServersRequest struct {
//
// Default value: running
State *ServerState `json:"-"`
// Tags: list servers with these exact tags
Tags []string `json:"-"`
}

// ListServers: list servers
Expand All @@ -1438,6 +1442,9 @@ func (s *API) ListServers(req *ListServersRequest, opts ...scw.RequestOption) (*
parameter.AddToQuery(query, "without_ip", req.WithoutIP)
parameter.AddToQuery(query, "commercial_type", req.CommercialType)
parameter.AddToQuery(query, "state", req.State)
if len(req.Tags) != 0 {
parameter.AddToQuery(query, "tags", strings.Join(req.Tags, ","))
}

if fmt.Sprint(req.Zone) == "" {
return nil, errors.New("field Zone cannot be empty in request")
Expand Down
2 changes: 2 additions & 0 deletions api/k8s/v1/k8s_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
2 changes: 2 additions & 0 deletions api/k8s/v1beta3/k8s_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
2 changes: 2 additions & 0 deletions api/k8s/v1beta4/k8s_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
2 changes: 2 additions & 0 deletions api/lb/v1/lb_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
2 changes: 2 additions & 0 deletions api/marketplace/v1/marketplace_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
2 changes: 2 additions & 0 deletions api/rdb/v1/rdb_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
2 changes: 2 additions & 0 deletions api/registry/v1/registry_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down
2 changes: 2 additions & 0 deletions api/test/v1/test_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"time"

"github.com/scaleway/scaleway-sdk-go/internal/errors"
Expand All @@ -29,6 +30,7 @@ var (
_ http.Header
_ bytes.Reader
_ time.Time
_ = strings.Join

_ scw.ScalewayRequest
_ marshaler.Duration
Expand Down