Skip to content

Commit 0d7393b

Browse files
author
Quentin Perez
committed
Add quota informations in scw info
1 parent 10cb117 commit 0d7393b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,8 +1132,9 @@ $ scw inspect myserver | jq '.[0].public_ip.address'
11321132
### master (unreleased)
11331133

11341134
* Added _cs ([#180](https://github.com/scaleway/scaleway-cli/issues/180))
1135-
* Added SCALEWAY_VERBOSE_API to make the API more verbose
1136-
* Support of 'scw _ips' command ... ([#196](https://github.com/scaleway/scaleway-cli/issues/196))
1135+
* Report **quotas** in `scw info` ([#130](https://github.com/scaleway/scaleway-cli/issues/130))
1136+
* Added `SCALEWAY_VERBOSE_API` to make the API more verbose
1137+
* Support of `scw _ips` command ... ([#196](https://github.com/scaleway/scaleway-cli/issues/196))
11371138
* Report **permissions** in `scw info` ([#191](https://github.com/scaleway/scaleway-cli/issues/191))
11381139
* Report **dashboard** statistics in `scw info` ([#177](https://github.com/scaleway/scaleway-cli/issues/177))
11391140
* Support of `scw _userdata name VAR=@/path/to/file` ([#183](https://github.com/scaleway/scaleway-cli/issues/183))

pkg/commands/info.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ func RunInfo(ctx CommandContext, args InfoArgs) error {
5858
fingerprint, err := utils.SSHGetFingerprint(key.Key)
5959
if err != nil {
6060
return err
61-
} else {
62-
fmt.Fprintf(ctx.Stdout, " [%d] %s", id, fingerprint)
6361
}
62+
fmt.Fprintf(ctx.Stdout, " [%d] %s", id, fingerprint)
6463
}
6564
fmt.Fprintf(ctx.Stdout, "\n")
6665
}
@@ -91,5 +90,14 @@ func RunInfo(ctx CommandContext, args InfoArgs) error {
9190
}
9291
}
9392
}
93+
fmt.Fprintf(ctx.Stdout, "\n")
94+
quotas, err := ctx.API.GetQuotas()
95+
if err != nil {
96+
return fmt.Errorf("Unable to get your quotas")
97+
}
98+
fmt.Fprintln(ctx.Stdout, "Quotas:")
99+
for key, value := range quotas.Quotas {
100+
fmt.Fprintf(ctx.Stdout, " %-20s: %d\n", key, value)
101+
}
94102
return nil
95103
}

0 commit comments

Comments
 (0)