From 1661b48aca16ca8ade370b21c8245c67b5a296f0 Mon Sep 17 00:00:00 2001 From: "R.I.Pienaar" Date: Tue, 19 Aug 2025 14:14:08 +0200 Subject: [PATCH] Support offline assets Offline assets will appear in the existing "missing" list for older tools and newer tools can access reasons in the new offline fields. Stream info will error. Supports https://github.com/nats-io/nats-server/pull/7158 Signed-off-by: R.I.Pienaar --- api/consumers.go | 5 +++-- api/streams.go | 5 +++-- schema_source/jetstream/api/v1/consumer_list_response.json | 7 +++++++ schema_source/jetstream/api/v1/stream_list_response.json | 7 +++++++ schemas/jetstream/api/v1/consumer_list_response.json | 7 +++++++ schemas/jetstream/api/v1/stream_list_response.json | 7 +++++++ 6 files changed, 34 insertions(+), 4 deletions(-) diff --git a/api/consumers.go b/api/consumers.go index 1981e5de..bff62e63 100644 --- a/api/consumers.go +++ b/api/consumers.go @@ -156,8 +156,9 @@ type JSApiConsumerListRequest struct { type JSApiConsumerListResponse struct { JSApiResponse JSApiIterableResponse - Consumers []*ConsumerInfo `json:"consumers"` - Missing []string `json:"missing,omitempty"` + Consumers []*ConsumerInfo `json:"consumers"` + Missing []string `json:"missing,omitempty"` + Offline map[string]string `json:"offline,omitempty"` } // io.nats.jetstream.api.v1.consumer_leader_stepdown_request diff --git a/api/streams.go b/api/streams.go index 279e976e..6b065fa9 100644 --- a/api/streams.go +++ b/api/streams.go @@ -107,8 +107,9 @@ type JSApiStreamNamesResponse struct { type JSApiStreamListResponse struct { JSApiResponse JSApiIterableResponse - Streams []*StreamInfo `json:"streams"` - Missing []string `json:"missing,omitempty"` + Streams []*StreamInfo `json:"streams"` + Missing []string `json:"missing,omitempty"` + Offline map[string]string `json:"offline,omitempty"` } // io.nats.jetstream.api.v1.stream_list_request diff --git a/schema_source/jetstream/api/v1/consumer_list_response.json b/schema_source/jetstream/api/v1/consumer_list_response.json index fceee278..7aa0542d 100644 --- a/schema_source/jetstream/api/v1/consumer_list_response.json +++ b/schema_source/jetstream/api/v1/consumer_list_response.json @@ -29,6 +29,13 @@ "type": "array", "items": { "type": "string" + }, + "offline": { + "description": "List of streams that are offline and reasons for being offline", + "type": "object", + "additionalProperties": { + "type": "string" + } } } } diff --git a/schema_source/jetstream/api/v1/stream_list_response.json b/schema_source/jetstream/api/v1/stream_list_response.json index b2d997f5..2ac9ee10 100644 --- a/schema_source/jetstream/api/v1/stream_list_response.json +++ b/schema_source/jetstream/api/v1/stream_list_response.json @@ -31,6 +31,13 @@ "items": { "type": "string" } + }, + "offline": { + "description": "List of streams that are offline and reasons for being offline", + "type": "object", + "additionalProperties": { + "type": "string" + } } } } diff --git a/schemas/jetstream/api/v1/consumer_list_response.json b/schemas/jetstream/api/v1/consumer_list_response.json index 06c1cd53..b196e328 100644 --- a/schemas/jetstream/api/v1/consumer_list_response.json +++ b/schemas/jetstream/api/v1/consumer_list_response.json @@ -650,6 +650,13 @@ "type": "array", "items": { "type": "string" + }, + "offline": { + "description": "List of streams that are offline and reasons for being offline", + "type": "object", + "additionalProperties": { + "type": "string" + } } } } diff --git a/schemas/jetstream/api/v1/stream_list_response.json b/schemas/jetstream/api/v1/stream_list_response.json index b71dbc2a..2048f2f9 100644 --- a/schemas/jetstream/api/v1/stream_list_response.json +++ b/schemas/jetstream/api/v1/stream_list_response.json @@ -972,6 +972,13 @@ "items": { "type": "string" } + }, + "offline": { + "description": "List of streams that are offline and reasons for being offline", + "type": "object", + "additionalProperties": { + "type": "string" + } } } }