Skip to content

Commit 0a0a63d

Browse files
authored
feat(account): add managed object storages resource limit (#284)
1 parent 7ead31c commit 0a0a63d

3 files changed

Lines changed: 37 additions & 29 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Support for storage encryption to storage `create`, `clone`, `show`, and `list` commands as well as server `create` and `show` commands.
13+
- _Managed object storages_ field to human readable output of `account show`.
1314

1415
### Removed
1516

internal/commands/account/show.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ func (s *showCommand) ExecuteWithoutArguments(exec commands.Executor) (output.Ou
4848
Key: "detached_floating_ips",
4949
Value: account.ResourceLimits.DetachedFloatingIps,
5050
},
51+
{
52+
Title: "Load balancers:",
53+
Key: "load_balancers",
54+
Value: account.ResourceLimits.LoadBalancers,
55+
},
56+
{
57+
Title: "Managed object storages:",
58+
Key: "managed_object_storages",
59+
Value: account.ResourceLimits.ManagedObjectStorages,
60+
},
5161
{
5262
Title: "Memory:",
5363
Key: "memory",
@@ -93,11 +103,6 @@ func (s *showCommand) ExecuteWithoutArguments(exec commands.Executor) (output.Ou
93103
Key: "storage_ssd",
94104
Value: account.ResourceLimits.StorageSSD,
95105
},
96-
{
97-
Title: "Load balancers:",
98-
Key: "load_balancers",
99-
Value: account.ResourceLimits.LoadBalancers,
100-
},
101106
},
102107
},
103108
},

internal/commands/account/show_test.go

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ func TestShowCommand(t *testing.T) {
2020
Credits: 12345,
2121
UserName: "upctl_test",
2222
ResourceLimits: upcloud.ResourceLimits{
23-
Cores: 100,
24-
DetachedFloatingIps: 10,
25-
Memory: 307200,
26-
NetworkPeerings: 100,
27-
Networks: 100,
28-
NTPExcessGiB: 20000,
29-
PublicIPv4: 0,
30-
PublicIPv6: 100,
31-
StorageHDD: 10240,
32-
StorageMaxIOPS: 10240,
33-
StorageSSD: 10240,
34-
LoadBalancers: 50,
23+
Cores: 100,
24+
DetachedFloatingIps: 10,
25+
ManagedObjectStorages: 20,
26+
Memory: 307200,
27+
NetworkPeerings: 100,
28+
Networks: 100,
29+
NTPExcessGiB: 20000,
30+
PublicIPv4: 0,
31+
PublicIPv6: 100,
32+
StorageHDD: 10240,
33+
StorageMaxIOPS: 10240,
34+
StorageSSD: 10240,
35+
LoadBalancers: 50,
3536
},
3637
}
3738

@@ -40,18 +41,19 @@ func TestShowCommand(t *testing.T) {
4041
Credits: €123.45
4142
4243
Resource Limits:
43-
Cores: 100
44-
Detached Floating IPs: 10
45-
Memory: 307200
46-
Network peerings: 100
47-
Networks: 100
48-
NTP excess GiB: 20000
49-
Public IPv4: 0
50-
Public IPv6: 100
51-
Storage HDD: 10240
52-
Storage MaxIOPS: 10240
53-
Storage SSD: 10240
54-
Load balancers: 50
44+
Cores: 100
45+
Detached Floating IPs: 10
46+
Load balancers: 50
47+
Managed object storages: 20
48+
Memory: 307200
49+
Network peerings: 100
50+
Networks: 100
51+
NTP excess GiB: 20000
52+
Public IPv4: 0
53+
Public IPv6: 100
54+
Storage HDD: 10240
55+
Storage MaxIOPS: 10240
56+
Storage SSD: 10240
5557
5658
`
5759

0 commit comments

Comments
 (0)