Skip to content

Commit 7df331f

Browse files
feat(instance): add order field in list servers (#1923)
Co-authored-by: Rémy Léone <[email protected]>
1 parent c5c4712 commit 7df331f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

cmd/scw/testdata/test-all-usage-instance-server-list-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ARGS:
2727
[state] List servers in this state (running | stopped | stopped in place | starting | stopping | locked)
2828
[tags.{index}] List servers with these exact tags
2929
[private-network] List servers in this Private Network
30+
[order] Define the order of the returned servers (creation_date_desc | creation_date_asc | modification_date_desc | modification_date_asc)
3031
[organization-id] List only servers of this organization ID
3132
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1)
3233

docs/commands/instance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,7 @@ scw instance server list [arg=value ...]
14981498
| state | One of: `running`, `stopped`, `stopped in place`, `starting`, `stopping`, `locked` | List servers in this state |
14991499
| tags.{index} | | List servers with these exact tags |
15001500
| private-network | | List servers in this Private Network |
1501+
| order | One of: `creation_date_desc`, `creation_date_asc`, `modification_date_desc`, `modification_date_asc` | Define the order of the returned servers |
15011502
| organization-id | | List only servers of this organization ID |
15021503
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config |
15031504

internal/namespaces/instance/v1/instance_cli.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,14 @@ func instanceServerList() *core.Command {
429429
Deprecated: false,
430430
Positional: false,
431431
},
432+
{
433+
Name: "order",
434+
Short: `Define the order of the returned servers`,
435+
Required: false,
436+
Deprecated: false,
437+
Positional: false,
438+
EnumValues: []string{"creation_date_desc", "creation_date_asc", "modification_date_desc", "modification_date_asc"},
439+
},
432440
{
433441
Name: "organization",
434442
Short: `List only servers of this organization ID`,

0 commit comments

Comments
 (0)