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(edge_services): add args for List filters #3982

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARGS:
[project-id] Project ID to filter for, only backend stages from this Project will be returned
[bucket-name] Bucket name to filter for, only backend stages from this Bucket will be returned
[bucket-region] Bucket region to filter for, only backend stages with buckets in this region will be returned
[lb-id] Load Balancer ID to filter for, only backend stages with this Load Balancer will be returned

FLAGS:
-h, --help help for list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ USAGE:
scw edge-services pipeline list [arg=value ...]

ARGS:
[order-by] Sort order of pipelines in the response (created_at_asc | created_at_desc | name_asc | name_desc)
[name] Pipeline name to filter for, only pipelines with this string within their name will be returned
[project-id] Project ID to filter for, only pipelines from this Project will be returned
[organization-id] Organization ID to filter for, only pipelines from this Organization will be returned
[order-by] Sort order of pipelines in the response (created_at_asc | created_at_desc | name_asc | name_desc)
[name] Pipeline name to filter for, only pipelines with this string within their name will be returned
[project-id] Project ID to filter for, only pipelines from this Project will be returned
[has-backend-stage-lb] Filter on backend stage, only pipelines with a Load Balancer origin will be returned
[organization-id] Organization ID to filter for, only pipelines from this Organization will be returned

FLAGS:
-h, --help help for list
Expand Down
2 changes: 2 additions & 0 deletions docs/commands/edge-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ scw edge-services backend-stage list [arg=value ...]
| project-id | | Project ID to filter for, only backend stages from this Project will be returned |
| bucket-name | | Bucket name to filter for, only backend stages from this Bucket will be returned |
| bucket-region | | Bucket region to filter for, only backend stages with buckets in this region will be returned |
| lb-id | | Load Balancer ID to filter for, only backend stages with this Load Balancer will be returned |



Expand Down Expand Up @@ -458,6 +459,7 @@ scw edge-services pipeline list [arg=value ...]
| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | Sort order of pipelines in the response |
| name | | Pipeline name to filter for, only pipelines with this string within their name will be returned |
| project-id | | Project ID to filter for, only pipelines from this Project will be returned |
| has-backend-stage-lb | | Filter on backend stage, only pipelines with a Load Balancer origin will be returned |
| organization-id | | Organization ID to filter for, only pipelines from this Organization will be returned |


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.2
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240710142519-7b3cbe4364c1
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240716082911-cef39a9d4ee9
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240710142519-7b3cbe4364c1 h1:VtqzoX75ODZe9Sr7l6wkTX+KOvCA9sjbanGXiyGzrPc=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240710142519-7b3cbe4364c1/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240716082911-cef39a9d4ee9 h1:Zo++qIasET8Dt4xwpmOt4EVgjVo/NhhZgttQfDP7VSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240716082911-cef39a9d4ee9/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
14 changes: 14 additions & 0 deletions internal/namespaces/edge_services/v1alpha1/edge_services_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ func edgeServicesPipelineList() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "has-backend-stage-lb",
Short: `Filter on backend stage, only pipelines with a Load Balancer origin will be returned`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "organization-id",
Short: `Organization ID to filter for, only pipelines from this Organization will be returned`,
Expand Down Expand Up @@ -1049,6 +1056,13 @@ func edgeServicesBackendStageList() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "lb-id",
Short: `Load Balancer ID to filter for, only backend stages with this Load Balancer will be returned`,
Required: false,
Deprecated: false,
Positional: false,
},
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*edge_services.ListBackendStagesRequest)
Expand Down