From cd2f25af740541698ac584948270ffe5d0278ea2 Mon Sep 17 00:00:00 2001 From: Piotr Piotrowski Date: Fri, 12 Jan 2024 12:59:18 +0100 Subject: [PATCH] [ADDED] Return account reservations on AccountInfo (#1511) Signed-off-by: Piotr Piotrowski --- jetstream/jetstream.go | 21 ++++++++++++++------- jsm.go | 12 +++++++----- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/jetstream/jetstream.go b/jetstream/jetstream.go index e98332da8..0e4c1eec1 100644 --- a/jetstream/jetstream.go +++ b/jetstream/jetstream.go @@ -112,13 +112,20 @@ type ( // AccountInfo contains info about the JetStream usage from the current account. AccountInfo struct { - Memory uint64 `json:"memory"` - Store uint64 `json:"storage"` - Streams int `json:"streams"` - Consumers int `json:"consumers"` - Domain string `json:"domain"` - API APIStats `json:"api"` - Limits AccountLimits `json:"limits"` + Tier + Domain string `json:"domain"` + API APIStats `json:"api"` + Tiers map[string]Tier `json:"tiers"` + } + + Tier struct { + Memory uint64 `json:"memory"` + Store uint64 `json:"storage"` + ReservedMemory uint64 `json:"reserved_memory"` + ReservedStore uint64 `json:"reserved_storage"` + Streams int `json:"streams"` + Consumers int `json:"consumers"` + Limits AccountLimits `json:"limits"` } // APIStats reports on API calls to JetStream for this account. diff --git a/jsm.go b/jsm.go index 212c7c020..8f724726b 100644 --- a/jsm.go +++ b/jsm.go @@ -252,11 +252,13 @@ type AccountInfo struct { } type Tier struct { - Memory uint64 `json:"memory"` - Store uint64 `json:"storage"` - Streams int `json:"streams"` - Consumers int `json:"consumers"` - Limits AccountLimits `json:"limits"` + Memory uint64 `json:"memory"` + Store uint64 `json:"storage"` + ReservedMemory uint64 `json:"reserved_memory"` + ReservedStore uint64 `json:"reserved_storage"` + Streams int `json:"streams"` + Consumers int `json:"consumers"` + Limits AccountLimits `json:"limits"` } // APIStats reports on API calls to JetStream for this account.