Skip to content

Commit 797f7a1

Browse files
authored
feat(account): add ManagedObjectStorages resource limit (#284)
1 parent b33999b commit 797f7a1

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)
88
### Added
99
- Managed Database sub-properties support. E.g., PostgreSQL property `timescaledb` is of type `object` and has `max_background_workers` sub-property.
1010
- Managed Object Storage: add `name` property
11+
- Account: add `ManagedObjectStorages` field to `ResourceLimits`
1112

1213
### Fixed
1314
- Managed Object Storage: omit empty labels slice when creating managed object storage instance

upcloud/account.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ type Account struct {
2020

2121
// ResourceLimits represents an account's resource limits
2222
type ResourceLimits struct {
23-
Cores int `json:"cores,omitempty"`
24-
DetachedFloatingIps int `json:"detached_floating_ips,omitempty"`
25-
Memory int `json:"memory,omitempty"`
26-
NetworkPeerings int `json:"network_peerings,omitempty"`
27-
Networks int `json:"networks,omitempty"`
28-
NTPExcessGiB int `json:"ntp_excess_gib,omitempty"`
29-
PublicIPv4 int `json:"public_ipv4,omitempty"`
30-
PublicIPv6 int `json:"public_ipv6,omitempty"`
31-
StorageHDD int `json:"storage_hdd,omitempty"`
32-
StorageMaxIOPS int `json:"storage_maxiops,omitempty"`
33-
StorageSSD int `json:"storage_ssd,omitempty"`
34-
LoadBalancers int `json:"load_balancers,omitempty"`
23+
Cores int `json:"cores,omitempty"`
24+
DetachedFloatingIps int `json:"detached_floating_ips,omitempty"`
25+
ManagedObjectStorages int `json:"managed_object_storages,omitempty"`
26+
Memory int `json:"memory,omitempty"`
27+
NetworkPeerings int `json:"network_peerings,omitempty"`
28+
Networks int `json:"networks,omitempty"`
29+
NTPExcessGiB int `json:"ntp_excess_gib,omitempty"`
30+
PublicIPv4 int `json:"public_ipv4,omitempty"`
31+
PublicIPv6 int `json:"public_ipv6,omitempty"`
32+
StorageHDD int `json:"storage_hdd,omitempty"`
33+
StorageMaxIOPS int `json:"storage_maxiops,omitempty"`
34+
StorageSSD int `json:"storage_ssd,omitempty"`
35+
LoadBalancers int `json:"load_balancers,omitempty"`
3536
}
3637

3738
// UnmarshalJSON is a custom unmarshaller that deals with

upcloud/account_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func TestUnmarshalAccount(t *testing.T) {
1717
"resource_limits": {
1818
"cores": 200,
1919
"detached_floating_ips": 10,
20+
"managed_object_storages": 7,
2021
"memory": 1048576,
2122
"network_peerings": 100,
2223
"networks": 100,
@@ -39,6 +40,7 @@ func TestUnmarshalAccount(t *testing.T) {
3940
assert.Equal(t, "username", account.UserName)
4041
assert.Equal(t, 200, account.ResourceLimits.Cores)
4142
assert.Equal(t, 10, account.ResourceLimits.DetachedFloatingIps)
43+
assert.Equal(t, 7, account.ResourceLimits.ManagedObjectStorages)
4244
assert.Equal(t, 1048576, account.ResourceLimits.Memory)
4345
assert.Equal(t, 100, account.ResourceLimits.NetworkPeerings)
4446
assert.Equal(t, 100, account.ResourceLimits.Networks)

0 commit comments

Comments
 (0)