Skip to content

Commit

Permalink
Merge pull request #281 from QuentinPerez/f280
Browse files Browse the repository at this point in the history
Add server-type filter
  • Loading branch information
moul committed Feb 16, 2016
2 parents c330c2f + 7341960 commit d2efb2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/cmd_ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
`,
}
Expand Down
6 changes: 5 additions & 1 deletion pkg/commands/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit d2efb2b

Please sign in to comment.