diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e91907e..b6e424d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/) ### Added - Managed Database sub-properties support. E.g., PostgreSQL property `timescaledb` is of type `object` and has `max_background_workers` sub-property. - Managed Object Storage: add `name` property +- Account: add `ManagedObjectStorages` field to `ResourceLimits` ### Fixed - Managed Object Storage: omit empty labels slice when creating managed object storage instance diff --git a/upcloud/account.go b/upcloud/account.go index d168c2f9..347017f7 100644 --- a/upcloud/account.go +++ b/upcloud/account.go @@ -20,18 +20,19 @@ type Account struct { // ResourceLimits represents an account's resource limits type ResourceLimits struct { - Cores int `json:"cores,omitempty"` - DetachedFloatingIps int `json:"detached_floating_ips,omitempty"` - Memory int `json:"memory,omitempty"` - NetworkPeerings int `json:"network_peerings,omitempty"` - Networks int `json:"networks,omitempty"` - NTPExcessGiB int `json:"ntp_excess_gib,omitempty"` - PublicIPv4 int `json:"public_ipv4,omitempty"` - PublicIPv6 int `json:"public_ipv6,omitempty"` - StorageHDD int `json:"storage_hdd,omitempty"` - StorageMaxIOPS int `json:"storage_maxiops,omitempty"` - StorageSSD int `json:"storage_ssd,omitempty"` - LoadBalancers int `json:"load_balancers,omitempty"` + Cores int `json:"cores,omitempty"` + DetachedFloatingIps int `json:"detached_floating_ips,omitempty"` + ManagedObjectStorages int `json:"managed_object_storages,omitempty"` + Memory int `json:"memory,omitempty"` + NetworkPeerings int `json:"network_peerings,omitempty"` + Networks int `json:"networks,omitempty"` + NTPExcessGiB int `json:"ntp_excess_gib,omitempty"` + PublicIPv4 int `json:"public_ipv4,omitempty"` + PublicIPv6 int `json:"public_ipv6,omitempty"` + StorageHDD int `json:"storage_hdd,omitempty"` + StorageMaxIOPS int `json:"storage_maxiops,omitempty"` + StorageSSD int `json:"storage_ssd,omitempty"` + LoadBalancers int `json:"load_balancers,omitempty"` } // UnmarshalJSON is a custom unmarshaller that deals with diff --git a/upcloud/account_test.go b/upcloud/account_test.go index c843bdc6..8f6207af 100644 --- a/upcloud/account_test.go +++ b/upcloud/account_test.go @@ -17,6 +17,7 @@ func TestUnmarshalAccount(t *testing.T) { "resource_limits": { "cores": 200, "detached_floating_ips": 10, + "managed_object_storages": 7, "memory": 1048576, "network_peerings": 100, "networks": 100, @@ -39,6 +40,7 @@ func TestUnmarshalAccount(t *testing.T) { assert.Equal(t, "username", account.UserName) assert.Equal(t, 200, account.ResourceLimits.Cores) assert.Equal(t, 10, account.ResourceLimits.DetachedFloatingIps) + assert.Equal(t, 7, account.ResourceLimits.ManagedObjectStorages) assert.Equal(t, 1048576, account.ResourceLimits.Memory) assert.Equal(t, 100, account.ResourceLimits.NetworkPeerings) assert.Equal(t, 100, account.ResourceLimits.Networks)