feat: declareService — persist a host service via the new RPC
Some checks failed
Security / Security check (push) Failing after 1s

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-07-22 23:56:03 +02:00
parent a0c5725578
commit 70f04af438
5 changed files with 233 additions and 0 deletions

View file

@ -423,6 +423,25 @@ class HubClient {
return r.services;
}
/// Declare a host service in the operator config (`services:`).
/// Returns whether a daemon restart is required for it to take
/// effect (true today services are read at start). Throws
/// ALREADY_EXISTS when the name is taken.
Future<bool> declareService({
required String name,
required String endpoint,
String healthPath = '',
List<String> tags = const [],
}) async {
final r = await _admin.declareService(pb.DeclareServiceRequest(
name: name,
endpoint: endpoint,
healthPath: healthPath,
tags: tags,
));
return r.restartRequired;
}
/// Compare local hub version vs. release-channel manifest.
/// Network failures land in `manifestReachable=false` rather
/// than as exceptions Studio renders that case as a quiet