From db8da0ce6d219986cdbec28e87ddcbe3f5efa39f Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Tue, 16 Feb 2016 11:39:17 +0100 Subject: [PATCH 1/3] Add server-type filter for ps -f subcommand --- pkg/commands/ps.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/commands/ps.go b/pkg/commands/ps.go index 3476e7722f..363ba808b3 100644 --- a/pkg/commands/ps.go +++ b/pkg/commands/ps.go @@ -45,7 +45,7 @@ func RunPs(ctx CommandContext, args PsArgs) error { for key, value := range args.Filters { switch key { - case "state", "name", "tags", "image", "ip", "arch": + case "state", "name", "tags", "image", "ip", "arch", "server-type": continue default: logrus.Warnf("Unknown filter: '%s=%s'", key, value) @@ -97,6 +97,10 @@ func RunPs(ctx CommandContext, args PsArgs) error { if value != server.Arch { goto skipServer } + case "server-type": + if value != server.CommercialType { + goto skipServer + } } } From 87abd446d9161cb792d2be71dacbda8b287ecb5e Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Tue, 16 Feb 2016 11:39:26 +0100 Subject: [PATCH 2/3] Update ps helper --- pkg/cli/cmd_ps.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cli/cmd_ps.go b/pkg/cli/cmd_ps.go index d1516b6aaa..9e8dc768dc 100644 --- a/pkg/cli/cmd_ps.go +++ b/pkg/cli/cmd_ps.go @@ -33,6 +33,7 @@ var cmdPs = &Command{ $ scw ps -f image=alpine $ scw ps -f image=UUIDOFIMAGE $ scw ps -f arch=ARCH + $ scw ps -f server-type=COMMERCIALTYPE $ scw ps -f "state=booted image=docker tags=prod" `, } From 7341960467858651dd30bb88c2e35832511e86c8 Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Tue, 16 Feb 2016 11:39:34 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3ae7bfdddd..407d6af321 100644 --- a/README.md +++ b/README.md @@ -604,6 +604,7 @@ Examples: $ scw ps -f image=alpine $ scw ps -f image=UUIDOFIMAGE $ scw ps -f arch=ARCH + $ scw ps -f server-type=COMMERCIALTYPE $ scw ps -f "state=booted image=docker tags=prod" ``` @@ -1158,6 +1159,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address' ### master (unreleased) +* Support of `scw ps -f server-type=COMMERCIALTYPE` ([#280](https://github.com/scaleway/scaleway-cli/issues/280)) * Support of `scw ps -f arch=XXX` ([#278](https://github.com/scaleway/scaleway-cli/issues/278)) * `scw info` Use json fingerprint field exposed by API * Allow to override Region and Architecture when using the helpers to create a new volume from a human size