Skip to content

Commit a1f2cc0

Browse files
authored
chore(account): update ResourceLimits struct (#270)
1 parent 5e08766 commit a1f2cc0

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44
See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)
55

66
## [Unreleased]
7+
### Added
8+
- account: `NetworkPeerings`, `NTPExcessGiB`, `StorageMaxIOPS`, and `LoadBalancers` fields to the `ResourceLimits` struct.
79

810
## [6.8.1]
911
### Changed

upcloud/account.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ type ResourceLimits struct {
2323
Cores int `json:"cores,omitempty"`
2424
DetachedFloatingIps int `json:"detached_floating_ips,omitempty"`
2525
Memory int `json:"memory,omitempty"`
26+
NetworkPeerings int `json:"network_peerings,omitempty"`
2627
Networks int `json:"networks,omitempty"`
28+
NTPExcessGiB int `json:"ntp_excess_gib,omitempty"`
2729
PublicIPv4 int `json:"public_ipv4,omitempty"`
2830
PublicIPv6 int `json:"public_ipv6,omitempty"`
2931
StorageHDD int `json:"storage_hdd,omitempty"`
32+
StorageMaxIOPS int `json:"storage_maxiops,omitempty"`
3033
StorageSSD int `json:"storage_ssd,omitempty"`
34+
LoadBalancers int `json:"load_balancers,omitempty"`
3135
}
3236

3337
// UnmarshalJSON is a custom unmarshaller that deals with

upcloud/account_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ func TestUnmarshalAccount(t *testing.T) {
1818
"cores": 200,
1919
"detached_floating_ips": 10,
2020
"memory": 1048576,
21+
"network_peerings": 100,
2122
"networks": 100,
23+
"ntp_excess_gib": 20000,
2224
"public_ipv4": 100,
2325
"public_ipv6": 100,
2426
"storage_hdd": 10240,
25-
"storage_ssd": 10240
27+
"storage_maxiops": 10240,
28+
"storage_ssd": 10240,
29+
"load_balancers": 50
2630
}
2731
}
2832
}
@@ -36,11 +40,15 @@ func TestUnmarshalAccount(t *testing.T) {
3640
assert.Equal(t, 200, account.ResourceLimits.Cores)
3741
assert.Equal(t, 10, account.ResourceLimits.DetachedFloatingIps)
3842
assert.Equal(t, 1048576, account.ResourceLimits.Memory)
43+
assert.Equal(t, 100, account.ResourceLimits.NetworkPeerings)
3944
assert.Equal(t, 100, account.ResourceLimits.Networks)
45+
assert.Equal(t, 20000, account.ResourceLimits.NTPExcessGiB)
4046
assert.Equal(t, 100, account.ResourceLimits.PublicIPv4)
4147
assert.Equal(t, 100, account.ResourceLimits.PublicIPv6)
4248
assert.Equal(t, 10240, account.ResourceLimits.StorageHDD)
49+
assert.Equal(t, 10240, account.ResourceLimits.StorageMaxIOPS)
4350
assert.Equal(t, 10240, account.ResourceLimits.StorageSSD)
51+
assert.Equal(t, 50, account.ResourceLimits.LoadBalancers)
4452
}
4553

4654
// TestMarshalAccount tests that Account objects marshal correctly

0 commit comments

Comments
 (0)