diff --git a/.claude/rules/app-classes.md b/.claude/rules/app-classes.md index 25257395..e04365e0 100644 --- a/.claude/rules/app-classes.md +++ b/.claude/rules/app-classes.md @@ -65,8 +65,8 @@ Env-scoped read-path controllers (`AlertController`, `AlertRuleController`, `Ale - `AgentEventsController` — GET `/api/v1/environments/{envSlug}/agents/events` (lifecycle events; cursor-paginated, returns `{ data, nextCursor, hasMore }`; order `(timestamp DESC, insert_id DESC)`; cursor is base64url of `"{timestampIso}|{insert_id_uuid}"` — `insert_id` is a stable UUID column used as a same-millisecond tiebreak). - `AgentMetricsController` — GET `/api/v1/environments/{envSlug}/agents/{agentId}/metrics` (JVM/Camel metrics). Rejects cross-env agents (404) as defence-in-depth. - `DiagramRenderController` — GET `/api/v1/environments/{envSlug}/apps/{appSlug}/routes/{routeId}/diagram` (env-scoped lookup). Also GET `/api/v1/diagrams/{contentHash}/render` (flat — content hashes are globally unique). -- `AlertRuleController` — `/api/v1/environments/{envSlug}/alerts/rules`. GET list / POST create / GET `{id}` / PUT `{id}` / DELETE `{id}` / POST `{id}/enable` / POST `{id}/disable` / POST `{id}/render-preview` / POST `{id}/test-evaluate`. OPERATOR+ for mutations, VIEWER+ for reads. CRITICAL: attribute keys in `ExchangeMatchCondition.filter.attributes` are validated at rule-save time against `^[a-zA-Z0-9._-]+$` — they are later inlined into ClickHouse SQL. Webhook validation: verifies `outboundConnectionId` exists and `isAllowedInEnvironment`. Null notification templates default to `""` (NOT NULL constraint). Audit: `ALERT_RULE_CHANGE`. -- `AlertController` — `/api/v1/environments/{envSlug}/alerts`. GET list (inbox filtered by userId/groupIds/roleNames via `InAppInboxQuery`) / GET `/unread-count` / GET `{id}` / POST `{id}/ack` / POST `{id}/read` / POST `/bulk-read`. VIEWER+ for all. Inbox SQL: `? = ANY(target_user_ids) OR target_group_ids && ? OR target_role_names && ?` — requires at least one matching target (no broadcast concept). +- `AlertRuleController` — `/api/v1/environments/{envSlug}/alerts/rules`. GET list / POST create / GET `{id}` / PUT `{id}` / DELETE `{id}` / POST `{id}/enable` / POST `{id}/disable` / POST `{id}/render-preview` / POST `{id}/test-evaluate`. OPERATOR+ for mutations, VIEWER+ for reads. CRITICAL: attribute keys in `ExchangeMatchCondition.filter.attributes` are validated at rule-save time against `^[a-zA-Z0-9._-]+$` — they are later inlined into ClickHouse SQL. `AgentLifecycleCondition` is allowlist-only — the `AgentLifecycleEventType` enum (REGISTERED / RE_REGISTERED / DEREGISTERED / WENT_STALE / WENT_DEAD / RECOVERED) plus the record compact ctor (non-empty `eventTypes`, `withinSeconds ≥ 1`) do the validation; custom agent-emitted event types are tracked in backlog issue #145. Webhook validation: verifies `outboundConnectionId` exists and `isAllowedInEnvironment`. Null notification templates default to `""` (NOT NULL constraint). Audit: `ALERT_RULE_CHANGE`. +- `AlertController` — `/api/v1/environments/{envSlug}/alerts`. GET list (inbox filtered by userId/groupIds/roleNames via `InAppInboxQuery`; optional multi-value `state` + `severity` query params push filtering into PostgreSQL via `listForInbox` with `state::text = ANY(?)` / `severity::text = ANY(?)`) / GET `/unread-count` / GET `{id}` / POST `{id}/ack` / POST `{id}/read` / POST `/bulk-read`. VIEWER+ for all. Inbox SQL: `? = ANY(target_user_ids) OR target_group_ids && ? OR target_role_names && ?` — requires at least one matching target (no broadcast concept). - `AlertSilenceController` — `/api/v1/environments/{envSlug}/alerts/silences`. GET list / POST create / DELETE `{id}`. 422 if `endsAt <= startsAt`. OPERATOR+ for mutations, VIEWER+ for list. Audit: `ALERT_SILENCE_CHANGE`. - `AlertNotificationController` — Dual-path (no class-level prefix). GET `/api/v1/environments/{envSlug}/alerts/{alertId}/notifications` (VIEWER+); POST `/api/v1/alerts/notifications/{id}/retry` (OPERATOR+, flat — notification IDs globally unique). Retry resets attempts to 0 and sets `nextAttemptAt = now`. diff --git a/.claude/rules/core-classes.md b/.claude/rules/core-classes.md index c8dbf304..193e6832 100644 --- a/.claude/rules/core-classes.md +++ b/.claude/rules/core-classes.md @@ -17,7 +17,7 @@ paths: - `CommandType` — enum for command types (config-update, deep-trace, replay, route-control, etc.) - `CommandStatus` — enum for command acknowledgement states - `CommandReply` — record: command execution result from agent -- `AgentEventRecord`, `AgentEventRepository` — event persistence. `AgentEventRepository.queryPage(...)` is cursor-paginated (`AgentEventPage{data, nextCursor, hasMore}`); the legacy non-paginated `query(...)` path is gone. +- `AgentEventRecord`, `AgentEventRepository` — event persistence. `AgentEventRepository.queryPage(...)` is cursor-paginated (`AgentEventPage{data, nextCursor, hasMore}`); the legacy non-paginated `query(...)` path is gone. `AgentEventRepository.findInWindow(env, appSlug, agentId, eventTypes, from, to, limit)` returns matching events ordered by `(timestamp ASC, insert_id ASC)` — consumed by `AgentLifecycleEvaluator`. - `AgentEventPage` — record: `(List data, String nextCursor, boolean hasMore)` returned by `AgentEventRepository.queryPage` - `AgentEventListener` — callback interface for agent events - `RouteStateRegistry` — tracks per-agent route states diff --git a/.claude/rules/ui.md b/.claude/rules/ui.md index f673d9ac..16044b03 100644 --- a/.claude/rules/ui.md +++ b/.claude/rules/ui.md @@ -43,7 +43,7 @@ The UI has 4 main tabs: **Exchanges**, **Dashboard**, **Runtime**, **Deployments - `AllAlertsPage.tsx` — env-wide list with state-chip filter. - `HistoryPage.tsx` — RESOLVED alerts. - `RulesListPage.tsx` — CRUD + enable/disable toggle + env-promotion dropdown (pure UI prefill, no new endpoint). - - `RuleEditor/RuleEditorWizard.tsx` — 5-step wizard (Scope / Condition / Trigger / Notify / Review). `form-state.ts` is the single source of truth (`initialForm` / `toRequest` / `validateStep`). Six condition-form subcomponents under `RuleEditor/condition-forms/`. + - `RuleEditor/RuleEditorWizard.tsx` — 5-step wizard (Scope / Condition / Trigger / Notify / Review). `form-state.ts` is the single source of truth (`initialForm` / `toRequest` / `validateStep`). Seven condition-form subcomponents under `RuleEditor/condition-forms/` — including `AgentLifecycleForm.tsx` (multi-select event-type chips for the six-entry `AgentLifecycleEventType` allowlist + lookback-window input). - `SilencesPage.tsx` — matcher-based create + end-early. - `AlertRow.tsx` shared list row; `alerts-page.module.css` shared styling. - **Components**: diff --git a/CLAUDE.md b/CLAUDE.md index be7b1d8b..d1f05a8c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -71,6 +71,8 @@ PostgreSQL (Flyway): `cameleer-server-app/src/main/resources/db/migration/` - V12 — Alerting tables (alert_rules, alert_rule_targets, alert_instances, alert_notifications, alert_reads, alert_silences) - V13 — alert_instances open-rule unique index (alert_instances_open_rule_uq partial index on rule_id WHERE state IN PENDING/FIRING/ACKNOWLEDGED) - V14 — Repair EXCHANGE_MATCH alert_rules persisted with fireMode=null (sets fireMode=PER_EXCHANGE + perExchangeLingerSeconds=300); paired with stricter `ExchangeMatchCondition` ctor that now rejects null fireMode. +- V15 — Discriminate open-instance uniqueness by `context->'exchange'->>'id'` so EXCHANGE_MATCH/PER_EXCHANGE emits one alert_instance per matching exchange; scalar kinds resolve to `''` and keep one-open-per-rule. +- V16 — Generalise the V15 discriminator to prefer `context->>'_subjectFingerprint'` (falls back to the V15 `exchange.id` expression for legacy rows). Enables AGENT_LIFECYCLE to emit one alert_instance per `(agent, eventType, timestamp)` via a canonical fingerprint in the evaluator firing's context. ClickHouse: `cameleer-server-app/src/main/resources/clickhouse/init.sql` (run idempotently on startup) @@ -98,7 +100,7 @@ When adding, removing, or renaming classes, controllers, endpoints, UI component # GitNexus — Code Intelligence -This project is indexed by GitNexus as **cameleer-server** (8527 symbols, 22174 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. +This project is indexed by GitNexus as **cameleer-server** (8603 symbols, 22281 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. > If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first. diff --git a/cameleer-server-app/src/main/java/com/cameleer/server/app/alerting/eval/AgentLifecycleEvaluator.java b/cameleer-server-app/src/main/java/com/cameleer/server/app/alerting/eval/AgentLifecycleEvaluator.java new file mode 100644 index 00000000..9eb15d6e --- /dev/null +++ b/cameleer-server-app/src/main/java/com/cameleer/server/app/alerting/eval/AgentLifecycleEvaluator.java @@ -0,0 +1,95 @@ +package com.cameleer.server.app.alerting.eval; + +import com.cameleer.server.core.agent.AgentEventRecord; +import com.cameleer.server.core.agent.AgentEventRepository; +import com.cameleer.server.core.alerting.AgentLifecycleCondition; +import com.cameleer.server.core.alerting.AgentLifecycleEventType; +import com.cameleer.server.core.alerting.AlertRule; +import com.cameleer.server.core.alerting.AlertScope; +import com.cameleer.server.core.alerting.ConditionKind; +import com.cameleer.server.core.runtime.EnvironmentRepository; +import org.springframework.stereotype.Component; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Evaluator for {@link AgentLifecycleCondition}. + *

+ * Each matching row in {@code agent_events} produces its own {@link EvalResult.Firing} + * in an {@link EvalResult.Batch}, so every {@code (agent, eventType, timestamp)} + * tuple gets its own {@code AlertInstance} — operationally distinct outages / + * restarts / shutdowns are independently ackable. Deduplication across ticks + * is enforced by {@code alert_instances_open_rule_uq} via the canonical + * {@code _subjectFingerprint} key in the instance context (see V16 migration). + */ +@Component +public class AgentLifecycleEvaluator implements ConditionEvaluator { + + /** Hard cap on rows returned per tick — prevents a flood of stale events from overwhelming the job. */ + private static final int MAX_EVENTS_PER_TICK = 500; + + private final AgentEventRepository eventRepo; + private final EnvironmentRepository envRepo; + + public AgentLifecycleEvaluator(AgentEventRepository eventRepo, EnvironmentRepository envRepo) { + this.eventRepo = eventRepo; + this.envRepo = envRepo; + } + + @Override + public ConditionKind kind() { return ConditionKind.AGENT_LIFECYCLE; } + + @Override + public EvalResult evaluate(AgentLifecycleCondition c, AlertRule rule, EvalContext ctx) { + String envSlug = envRepo.findById(rule.environmentId()) + .map(e -> e.slug()) + .orElse(null); + if (envSlug == null) return EvalResult.Clear.INSTANCE; + + AlertScope scope = c.scope(); + String appSlug = scope != null ? scope.appSlug() : null; + String agentId = scope != null ? scope.agentId() : null; + + List typeNames = c.eventTypes().stream() + .map(AgentLifecycleEventType::name) + .toList(); + + Instant from = ctx.now().minusSeconds(c.withinSeconds()); + Instant to = ctx.now(); + + List matches = eventRepo.findInWindow( + envSlug, appSlug, agentId, typeNames, from, to, MAX_EVENTS_PER_TICK); + + if (matches.isEmpty()) return new EvalResult.Batch(List.of()); + + List firings = new ArrayList<>(matches.size()); + for (AgentEventRecord ev : matches) { + firings.add(toFiring(ev)); + } + return new EvalResult.Batch(firings); + } + + private static EvalResult.Firing toFiring(AgentEventRecord ev) { + String fingerprint = (ev.instanceId() == null ? "" : ev.instanceId()) + + ":" + (ev.eventType() == null ? "" : ev.eventType()) + + ":" + (ev.timestamp() == null ? "0" : Long.toString(ev.timestamp().toEpochMilli())); + + Map context = new LinkedHashMap<>(); + context.put("agent", Map.of( + "id", ev.instanceId() == null ? "" : ev.instanceId(), + "app", ev.applicationId() == null ? "" : ev.applicationId() + )); + context.put("event", Map.of( + "type", ev.eventType() == null ? "" : ev.eventType(), + "timestamp", ev.timestamp() == null ? "" : ev.timestamp().toString(), + "detail", ev.detail() == null ? "" : ev.detail() + )); + context.put("_subjectFingerprint", fingerprint); + + return new EvalResult.Firing(1.0, null, context); + } +} diff --git a/cameleer-server-app/src/main/java/com/cameleer/server/app/alerting/notify/NotificationContextBuilder.java b/cameleer-server-app/src/main/java/com/cameleer/server/app/alerting/notify/NotificationContextBuilder.java index 41f0ce31..50e4db43 100644 --- a/cameleer-server-app/src/main/java/com/cameleer/server/app/alerting/notify/NotificationContextBuilder.java +++ b/cameleer-server-app/src/main/java/com/cameleer/server/app/alerting/notify/NotificationContextBuilder.java @@ -64,6 +64,10 @@ public class NotificationContextBuilder { ctx.put("agent", subtree(instance, "agent.id", "agent.name", "agent.state")); ctx.put("app", subtree(instance, "app.slug", "app.id")); } + case AGENT_LIFECYCLE -> { + ctx.put("agent", subtree(instance, "agent.id", "agent.app")); + ctx.put("event", subtree(instance, "event.type", "event.timestamp", "event.detail")); + } case DEPLOYMENT_STATE -> { ctx.put("deployment", subtree(instance, "deployment.id", "deployment.status")); ctx.put("app", subtree(instance, "app.slug", "app.id")); diff --git a/cameleer-server-app/src/main/java/com/cameleer/server/app/storage/ClickHouseAgentEventRepository.java b/cameleer-server-app/src/main/java/com/cameleer/server/app/storage/ClickHouseAgentEventRepository.java index 817cf2a1..fe4c25c6 100644 --- a/cameleer-server-app/src/main/java/com/cameleer/server/app/storage/ClickHouseAgentEventRepository.java +++ b/cameleer-server-app/src/main/java/com/cameleer/server/app/storage/ClickHouseAgentEventRepository.java @@ -106,4 +106,57 @@ public class ClickHouseAgentEventRepository implements AgentEventRepository { return new AgentEventPage(results, nextCursor, hasMore); } + + @Override + public List findInWindow(String environment, + String applicationId, + String instanceId, + List eventTypes, + Instant fromInclusive, + Instant toExclusive, + int limit) { + if (eventTypes == null || eventTypes.isEmpty()) { + throw new IllegalArgumentException("eventTypes must not be empty"); + } + if (fromInclusive == null || toExclusive == null) { + throw new IllegalArgumentException("from/to must not be null"); + } + + // `event_type IN (?, ?, …)` — one placeholder per type. + String placeholders = String.join(",", java.util.Collections.nCopies(eventTypes.size(), "?")); + var sql = new StringBuilder(SELECT_BASE); + var params = new ArrayList(); + params.add(tenantId); + + if (environment != null) { + sql.append(" AND environment = ?"); + params.add(environment); + } + if (applicationId != null) { + sql.append(" AND application_id = ?"); + params.add(applicationId); + } + if (instanceId != null) { + sql.append(" AND instance_id = ?"); + params.add(instanceId); + } + sql.append(" AND event_type IN (").append(placeholders).append(")"); + params.addAll(eventTypes); + sql.append(" AND timestamp >= ? AND timestamp < ?"); + params.add(Timestamp.from(fromInclusive)); + params.add(Timestamp.from(toExclusive)); + sql.append(" ORDER BY timestamp ASC, insert_id ASC LIMIT ?"); + params.add(limit); + + return jdbc.query(sql.toString(), + (rs, rowNum) -> new AgentEventRecord( + rs.getLong("id"), + rs.getString("instance_id"), + rs.getString("application_id"), + rs.getString("event_type"), + rs.getString("detail"), + rs.getTimestamp("timestamp").toInstant() + ), + params.toArray()); + } } diff --git a/cameleer-server-app/src/main/resources/db/migration/V16__alert_instances_subject_fingerprint.sql b/cameleer-server-app/src/main/resources/db/migration/V16__alert_instances_subject_fingerprint.sql new file mode 100644 index 00000000..c9e27777 --- /dev/null +++ b/cameleer-server-app/src/main/resources/db/migration/V16__alert_instances_subject_fingerprint.sql @@ -0,0 +1,27 @@ +-- V16 — Generalise open-alert_instance uniqueness via `_subjectFingerprint`. +-- +-- V15 discriminated open instances by `context->'exchange'->>'id'` so that +-- EXCHANGE_MATCH / PER_EXCHANGE could emit one instance per exchange. The new +-- AGENT_LIFECYCLE / PER_AGENT condition has the same shape but a different +-- subject key (agentId + eventType + eventTs). Rather than bolt condition-kind +-- knowledge into the index, we introduce a canonical `_subjectFingerprint` +-- field in `context` that every "per-subject" evaluator writes. The index +-- prefers it over the legacy exchange.id discriminator. +-- +-- Precedence in the COALESCE: +-- 1. context->>'_subjectFingerprint' — explicit per-subject key (new) +-- 2. context->'exchange'->>'id' — legacy EXCHANGE_MATCH instances (pre-V16) +-- 3. '' — scalar condition kinds (one open per rule) +-- +-- Existing open PER_EXCHANGE instances keep working because they never set +-- `_subjectFingerprint` but do carry `context.exchange.id`, so the index +-- still discriminates them correctly. +DROP INDEX IF EXISTS alert_instances_open_rule_uq; + +CREATE UNIQUE INDEX alert_instances_open_rule_uq + ON alert_instances (rule_id, (COALESCE( + context->>'_subjectFingerprint', + context->'exchange'->>'id', + ''))) + WHERE rule_id IS NOT NULL + AND state IN ('PENDING','FIRING','ACKNOWLEDGED'); diff --git a/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/eval/AgentLifecycleEvaluatorTest.java b/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/eval/AgentLifecycleEvaluatorTest.java new file mode 100644 index 00000000..a043c0e5 --- /dev/null +++ b/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/eval/AgentLifecycleEvaluatorTest.java @@ -0,0 +1,130 @@ +package com.cameleer.server.app.alerting.eval; + +import com.cameleer.server.core.agent.AgentEventRecord; +import com.cameleer.server.core.agent.AgentEventRepository; +import com.cameleer.server.core.alerting.*; +import com.cameleer.server.core.runtime.Environment; +import com.cameleer.server.core.runtime.EnvironmentRepository; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.time.Instant; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +class AgentLifecycleEvaluatorTest { + + private AgentEventRepository events; + private EnvironmentRepository envRepo; + private AgentLifecycleEvaluator eval; + + private static final UUID ENV_ID = UUID.fromString("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"); + private static final UUID RULE_ID = UUID.fromString("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"); + private static final String ENV_SLUG = "prod"; + private static final Instant NOW = Instant.parse("2026-04-19T10:00:00Z"); + + @BeforeEach + void setUp() { + events = mock(AgentEventRepository.class); + envRepo = mock(EnvironmentRepository.class); + when(envRepo.findById(ENV_ID)).thenReturn(Optional.of( + new Environment(ENV_ID, ENV_SLUG, "Prod", true, true, Map.of(), 5, Instant.EPOCH))); + eval = new AgentLifecycleEvaluator(events, envRepo); + } + + private AlertRule ruleWith(AlertCondition condition) { + return new AlertRule(RULE_ID, ENV_ID, "lifecycle test", null, + AlertSeverity.CRITICAL, true, condition.kind(), condition, + 60, 0, 0, null, null, List.of(), List.of(), + null, null, null, Map.of(), null, null, null, null); + } + + private EvalContext ctx() { return new EvalContext("default", NOW, new TickCache()); } + + @Test + void kindIsAgentLifecycle() { + assertThat(eval.kind()).isEqualTo(ConditionKind.AGENT_LIFECYCLE); + } + + @Test + void emptyWindowYieldsEmptyBatch() { + var condition = new AgentLifecycleCondition( + new AlertScope(null, null, null), + List.of(AgentLifecycleEventType.WENT_DEAD), + 300); + when(events.findInWindow(eq(ENV_SLUG), any(), any(), any(), any(), any(), anyInt())) + .thenReturn(List.of()); + + EvalResult r = eval.evaluate(condition, ruleWith(condition), ctx()); + assertThat(r).isInstanceOf(EvalResult.Batch.class); + assertThat(((EvalResult.Batch) r).firings()).isEmpty(); + } + + @Test + void emitsOneFiringPerEventWithFingerprint() { + Instant ts1 = NOW.minusSeconds(30); + Instant ts2 = NOW.minusSeconds(10); + when(events.findInWindow(eq(ENV_SLUG), any(), any(), any(), any(), any(), anyInt())) + .thenReturn(List.of( + new AgentEventRecord(0, "agent-A", "orders", "WENT_DEAD", "A went dead", ts1), + new AgentEventRecord(0, "agent-B", "orders", "WENT_DEAD", "B went dead", ts2) + )); + + var condition = new AgentLifecycleCondition( + new AlertScope(null, null, null), + List.of(AgentLifecycleEventType.WENT_DEAD), 60); + + EvalResult r = eval.evaluate(condition, ruleWith(condition), ctx()); + var batch = (EvalResult.Batch) r; + assertThat(batch.firings()).hasSize(2); + + var f0 = batch.firings().get(0); + assertThat(f0.context()).containsKey("_subjectFingerprint"); + assertThat((String) f0.context().get("_subjectFingerprint")) + .isEqualTo("agent-A:WENT_DEAD:" + ts1.toEpochMilli()); + @SuppressWarnings("unchecked") + Map agent0 = (Map) f0.context().get("agent"); + assertThat(agent0).containsEntry("id", "agent-A").containsEntry("app", "orders"); + @SuppressWarnings("unchecked") + Map event0 = (Map) f0.context().get("event"); + assertThat(event0).containsEntry("type", "WENT_DEAD"); + + var f1 = batch.firings().get(1); + assertThat((String) f1.context().get("_subjectFingerprint")) + .isEqualTo("agent-B:WENT_DEAD:" + ts2.toEpochMilli()); + } + + @Test + void forwardsScopeFiltersToRepo() { + when(events.findInWindow(eq(ENV_SLUG), eq("orders"), eq("agent-A"), any(), any(), any(), anyInt())) + .thenReturn(List.of()); + var condition = new AgentLifecycleCondition( + new AlertScope("orders", null, "agent-A"), + List.of(AgentLifecycleEventType.REGISTERED), 120); + eval.evaluate(condition, ruleWith(condition), ctx()); + // Mockito `when` matches — verifying no mismatch is enough; stub returns [] + } + + @Test + void clearsWhenEnvIsMissing() { + // envRepo returns empty → should Clear, not throw. + EnvironmentRepository emptyEnvRepo = mock(EnvironmentRepository.class); + when(emptyEnvRepo.findById(ENV_ID)).thenReturn(Optional.empty()); + AgentLifecycleEvaluator localEval = new AgentLifecycleEvaluator(events, emptyEnvRepo); + + var condition = new AgentLifecycleCondition( + new AlertScope(null, null, null), + List.of(AgentLifecycleEventType.WENT_DEAD), 60); + EvalResult r = localEval.evaluate(condition, ruleWith(condition), ctx()); + assertThat(r).isEqualTo(EvalResult.Clear.INSTANCE); + } +} diff --git a/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/notify/NotificationContextBuilderTest.java b/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/notify/NotificationContextBuilderTest.java index a046922c..9d33073e 100644 --- a/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/notify/NotificationContextBuilderTest.java +++ b/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/notify/NotificationContextBuilderTest.java @@ -43,6 +43,10 @@ class NotificationContextBuilderTest { case AGENT_STATE -> new AgentStateCondition( new AlertScope(null, null, null), "DEAD", 0); + case AGENT_LIFECYCLE -> new AgentLifecycleCondition( + new AlertScope(null, null, null), + List.of(AgentLifecycleEventType.WENT_DEAD), + 60); case DEPLOYMENT_STATE -> new DeploymentStateCondition( new AlertScope("my-app", null, null), List.of("FAILED")); diff --git a/cameleer-server-core/src/main/java/com/cameleer/server/core/agent/AgentEventRepository.java b/cameleer-server-core/src/main/java/com/cameleer/server/core/agent/AgentEventRepository.java index 63c09b42..aa710577 100644 --- a/cameleer-server-core/src/main/java/com/cameleer/server/core/agent/AgentEventRepository.java +++ b/cameleer-server-core/src/main/java/com/cameleer/server/core/agent/AgentEventRepository.java @@ -1,6 +1,7 @@ package com.cameleer.server.core.agent; import java.time.Instant; +import java.util.List; public interface AgentEventRepository { @@ -13,4 +14,19 @@ public interface AgentEventRepository { */ AgentEventPage queryPage(String applicationId, String instanceId, String environment, Instant from, Instant to, String cursor, int limit); + + /** + * Inclusive-exclusive window query ordered by (timestamp ASC, instance_id ASC) + * used by the AGENT_LIFECYCLE alert evaluator. {@code eventTypes} is required + * and must be non-empty; the implementation filters via {@code event_type IN (...)}. + * Scope filters ({@code applicationId}, {@code instanceId}) are optional. The + * returned list is capped at {@code limit} rows. + */ + List findInWindow(String environment, + String applicationId, + String instanceId, + List eventTypes, + Instant fromInclusive, + Instant toExclusive, + int limit); } diff --git a/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AgentLifecycleCondition.java b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AgentLifecycleCondition.java new file mode 100644 index 00000000..fa28805a --- /dev/null +++ b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AgentLifecycleCondition.java @@ -0,0 +1,34 @@ +package com.cameleer.server.core.alerting; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * Fires one {@code AlertInstance} per matching {@code agent_events} row in the + * lookback window. Per-subject fire mode (see + * {@link AgentLifecycleEventType}) — each {@code (agent, eventType, timestamp)} + * tuple is independently ackable, driven by a canonical + * {@code _subjectFingerprint} in the instance context and the partial unique + * index on {@code alert_instances}. + */ +public record AgentLifecycleCondition( + AlertScope scope, + List eventTypes, + int withinSeconds +) implements AlertCondition { + + public AgentLifecycleCondition { + if (eventTypes == null || eventTypes.isEmpty()) { + throw new IllegalArgumentException("eventTypes must not be empty"); + } + if (withinSeconds < 1) { + throw new IllegalArgumentException("withinSeconds must be >= 1"); + } + eventTypes = List.copyOf(eventTypes); + } + + @Override + @JsonProperty(value = "kind", access = JsonProperty.Access.READ_ONLY) + public ConditionKind kind() { return ConditionKind.AGENT_LIFECYCLE; } +} diff --git a/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AgentLifecycleEventType.java b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AgentLifecycleEventType.java new file mode 100644 index 00000000..857c6ff8 --- /dev/null +++ b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AgentLifecycleEventType.java @@ -0,0 +1,20 @@ +package com.cameleer.server.core.alerting; + +/** + * Allowlist of agent-lifecycle event types that may appear in an + * {@link AgentLifecycleCondition}. The set matches exactly the events the + * server writes to {@code agent_events} — registration-controller emits + * REGISTERED / RE_REGISTERED / DEREGISTERED, the lifecycle monitor emits + * WENT_STALE / WENT_DEAD / RECOVERED. + *

+ * Custom agent-emitted event types (via {@code POST /api/v1/data/events}) + * are intentionally excluded — see backlog issue #145. + */ +public enum AgentLifecycleEventType { + REGISTERED, + RE_REGISTERED, + DEREGISTERED, + WENT_STALE, + WENT_DEAD, + RECOVERED +} diff --git a/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AlertCondition.java b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AlertCondition.java index 008fd78a..e562dac7 100644 --- a/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AlertCondition.java +++ b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/AlertCondition.java @@ -9,13 +9,15 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; @JsonSubTypes.Type(value = RouteMetricCondition.class, name = "ROUTE_METRIC"), @JsonSubTypes.Type(value = ExchangeMatchCondition.class, name = "EXCHANGE_MATCH"), @JsonSubTypes.Type(value = AgentStateCondition.class, name = "AGENT_STATE"), + @JsonSubTypes.Type(value = AgentLifecycleCondition.class, name = "AGENT_LIFECYCLE"), @JsonSubTypes.Type(value = DeploymentStateCondition.class, name = "DEPLOYMENT_STATE"), @JsonSubTypes.Type(value = LogPatternCondition.class, name = "LOG_PATTERN"), @JsonSubTypes.Type(value = JvmMetricCondition.class, name = "JVM_METRIC") }) public sealed interface AlertCondition permits RouteMetricCondition, ExchangeMatchCondition, AgentStateCondition, - DeploymentStateCondition, LogPatternCondition, JvmMetricCondition { + AgentLifecycleCondition, DeploymentStateCondition, LogPatternCondition, + JvmMetricCondition { @JsonProperty("kind") ConditionKind kind(); diff --git a/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/ConditionKind.java b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/ConditionKind.java index b53585ce..17611a3a 100644 --- a/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/ConditionKind.java +++ b/cameleer-server-core/src/main/java/com/cameleer/server/core/alerting/ConditionKind.java @@ -1,3 +1,11 @@ package com.cameleer.server.core.alerting; -public enum ConditionKind { ROUTE_METRIC, EXCHANGE_MATCH, AGENT_STATE, DEPLOYMENT_STATE, LOG_PATTERN, JVM_METRIC } +public enum ConditionKind { + ROUTE_METRIC, + EXCHANGE_MATCH, + AGENT_STATE, + AGENT_LIFECYCLE, + DEPLOYMENT_STATE, + LOG_PATTERN, + JVM_METRIC +} diff --git a/cameleer-server-core/src/test/java/com/cameleer/server/core/alerting/AlertConditionJsonTest.java b/cameleer-server-core/src/test/java/com/cameleer/server/core/alerting/AlertConditionJsonTest.java index 8ecf85f0..950720a0 100644 --- a/cameleer-server-core/src/test/java/com/cameleer/server/core/alerting/AlertConditionJsonTest.java +++ b/cameleer-server-core/src/test/java/com/cameleer/server/core/alerting/AlertConditionJsonTest.java @@ -101,4 +101,50 @@ class AlertConditionJsonTest { AlertCondition parsed = om.readValue(om.writeValueAsString((AlertCondition) c), AlertCondition.class); assertThat(parsed).isInstanceOf(JvmMetricCondition.class); } + + @Test + void roundtripAgentLifecycle() throws Exception { + var c = new AgentLifecycleCondition( + new AlertScope("orders", null, null), + List.of(AgentLifecycleEventType.WENT_DEAD, AgentLifecycleEventType.DEREGISTERED), + 300); + AlertCondition parsed = om.readValue(om.writeValueAsString((AlertCondition) c), AlertCondition.class); + assertThat(parsed).isInstanceOf(AgentLifecycleCondition.class); + var alc = (AgentLifecycleCondition) parsed; + assertThat(alc.eventTypes()).containsExactly( + AgentLifecycleEventType.WENT_DEAD, AgentLifecycleEventType.DEREGISTERED); + assertThat(alc.withinSeconds()).isEqualTo(300); + assertThat(alc.kind()).isEqualTo(ConditionKind.AGENT_LIFECYCLE); + } + + @Test + void agentLifecycleRejectsEmptyEventTypes() { + assertThatThrownBy(() -> new AgentLifecycleCondition( + new AlertScope(null, null, null), List.of(), 60)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessageContaining("eventTypes"); + } + + @Test + void agentLifecycleRejectsZeroWindow() { + assertThatThrownBy(() -> new AgentLifecycleCondition( + new AlertScope(null, null, null), + List.of(AgentLifecycleEventType.WENT_DEAD), 0)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessageContaining("withinSeconds"); + } + + @Test + void agentLifecycleRejectsUnknownEventTypeOnDeserialization() { + String json = """ + { + "kind": "AGENT_LIFECYCLE", + "scope": {}, + "eventTypes": ["REGISTERED", "BOGUS_EVENT"], + "withinSeconds": 60 + } + """; + assertThatThrownBy(() -> om.readValue(json, AlertCondition.class)) + .hasMessageContaining("BOGUS_EVENT"); + } } diff --git a/ui/src/api/openapi.json b/ui/src/api/openapi.json index e4999b15..d28f7b11 100644 --- a/ui/src/api/openapi.json +++ b/ui/src/api/openapi.json @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"Cameleer Server API","version":"1.0"},"servers":[{"url":"/api/v1","description":"Relative"}],"security":[{"bearer":[]}],"tags":[{"name":"Route Metrics","description":"Route performance metrics (env-scoped)"},{"name":"Database Admin","description":"Database monitoring and management (ADMIN only)"},{"name":"Threshold Admin","description":"Monitoring threshold configuration (ADMIN only)"},{"name":"Agent Commands","description":"Command push endpoints for agent communication"},{"name":"Agent List","description":"List registered agents in an environment"},{"name":"Sensitive Keys Admin","description":"Global sensitive key masking configuration (ADMIN only)"},{"name":"License Admin","description":"License management"},{"name":"Role Admin","description":"Role management (ADMIN only)"},{"name":"RBAC Stats","description":"RBAC statistics (ADMIN only)"},{"name":"OIDC Config Admin","description":"OIDC provider configuration (ADMIN only)"},{"name":"Alerts Inbox","description":"In-app alert inbox, ack and read tracking (env-scoped)"},{"name":"Application Config","description":"Per-application observability configuration (user-facing)"},{"name":"App Management","description":"Application lifecycle and JAR uploads (env-scoped)"},{"name":"Catalog","description":"Unified application catalog"},{"name":"ClickHouse Admin","description":"ClickHouse monitoring and diagnostics (ADMIN only)"},{"name":"Alert Silences","description":"Alert silence management (env-scoped)"},{"name":"Ingestion","description":"Data ingestion endpoints"},{"name":"Group Admin","description":"Group management (ADMIN only)"},{"name":"Usage Analytics","description":"UI usage pattern analytics"},{"name":"Alert Notifications","description":"Outbound webhook notification management"},{"name":"Deployment Management","description":"Deploy, stop, promote, and view logs"},{"name":"Detail","description":"Execution detail and processor snapshot endpoints"},{"name":"Outbound Connections Admin","description":"Admin-managed outbound HTTPS destinations"},{"name":"Agent Config","description":"Agent-authoritative config read (AGENT only)"},{"name":"User Admin","description":"User management (ADMIN only)"},{"name":"Agent Management","description":"Agent registration and lifecycle endpoints"},{"name":"Authentication","description":"Login and token refresh endpoints"},{"name":"Agent Events","description":"Agent lifecycle event log (env-scoped)"},{"name":"Route Catalog","description":"Route catalog and discovery (env-scoped)"},{"name":"Application Logs","description":"Query application logs (env-scoped)"},{"name":"Agent SSE","description":"Server-Sent Events endpoint for agent communication"},{"name":"Search","description":"Transaction search and stats (env-scoped)"},{"name":"Audit Log","description":"Audit log viewer (ADMIN only)"},{"name":"Claim Mapping Admin","description":"Manage OIDC claim-to-role/group mapping rules"},{"name":"Diagrams","description":"Diagram rendering endpoints"},{"name":"Environment Admin","description":"Environment management (ADMIN only)"},{"name":"App Settings","description":"Per-application dashboard settings (ADMIN/OPERATOR)"},{"name":"Alert Rules","description":"Alert rule management (env-scoped)"}],"paths":{"/environments/{envSlug}/apps/{appSlug}/settings":{"get":{"tags":["App Settings"],"summary":"Get settings for an application in this environment (returns defaults if not configured)","operationId":"getByAppId","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppSettings"}}}}}},"put":{"tags":["App Settings"],"summary":"Create or update settings for an application in this environment","operationId":"update","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppSettingsRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppSettings"}}}}}},"delete":{"tags":["App Settings"],"summary":"Delete application settings for this environment (reverts to defaults)","operationId":"delete","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/environments/{envSlug}/apps/{appSlug}/container-config":{"put":{"tags":["App Management"],"summary":"Update container config for this app","operationId":"updateContainerConfig","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}},"required":true},"responses":{"200":{"description":"Container config updated","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Invalid configuration","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"App not found in this environment","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/config":{"get":{"tags":["Application Config"],"summary":"Get application config for this environment","description":"Returns stored config merged with global sensitive keys. Falls back to defaults if no row is persisted yet.","operationId":"getConfig","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Config returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppConfigResponse"}}}}}},"put":{"tags":["Application Config"],"summary":"Update application config for this environment","description":"Saves config and pushes CONFIG_UPDATE to LIVE agents of this application in the given environment","operationId":"updateConfig","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationConfig"}}},"required":true},"responses":{"200":{"description":"Config saved and pushed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConfigUpdateResponse"}}}}}}},"/environments/{envSlug}/alerts/silences/{id}":{"put":{"tags":["Alert Silences"],"operationId":"update_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertSilenceRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertSilenceResponse"}}}}}},"delete":{"tags":["Alert Silences"],"operationId":"delete_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/environments/{envSlug}/alerts/rules/{id}":{"get":{"tags":["Alert Rules"],"operationId":"get","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}},"put":{"tags":["Alert Rules"],"operationId":"update_2","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}},"delete":{"tags":["Alert Rules"],"operationId":"delete_2","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/admin/users/{userId}":{"get":{"tags":["User Admin"],"summary":"Get user by ID with RBAC detail","operationId":"getUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"User found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}},"404":{"description":"User not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}}}},"put":{"tags":["User Admin"],"summary":"Update user display name or email","operationId":"updateUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequest"}}},"required":true},"responses":{"200":{"description":"User updated"},"404":{"description":"User not found"}}},"delete":{"tags":["User Admin"],"summary":"Delete user","operationId":"deleteUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"User deleted"},"409":{"description":"Cannot delete the last admin user"}}}},"/admin/thresholds":{"get":{"tags":["Threshold Admin"],"summary":"Get current threshold configuration","operationId":"getThresholds","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ThresholdConfig"}}}}}},"put":{"tags":["Threshold Admin"],"summary":"Update threshold configuration","operationId":"updateThresholds","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThresholdConfigRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ThresholdConfig"}}}}}}},"/admin/sensitive-keys":{"get":{"tags":["Sensitive Keys Admin"],"summary":"Get global sensitive keys configuration","operationId":"getSensitiveKeys","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SensitiveKeysConfig"}}}}}},"put":{"tags":["Sensitive Keys Admin"],"summary":"Update global sensitive keys configuration","description":"Saves the global sensitive keys. Optionally fans out merged keys to all live agents.","operationId":"updateSensitiveKeys","parameters":[{"name":"pushToAgents","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensitiveKeysRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SensitiveKeysResponse"}}}}}}},"/admin/roles/{id}":{"get":{"tags":["Role Admin"],"summary":"Get role by ID with effective principals","operationId":"getRole","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Role found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RoleDetail"}}}},"404":{"description":"Role not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RoleDetail"}}}}}},"put":{"tags":["Role Admin"],"summary":"Update a custom role","operationId":"updateRole","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleRequest"}}},"required":true},"responses":{"200":{"description":"Role updated"},"403":{"description":"Cannot modify system role"},"404":{"description":"Role not found"}}},"delete":{"tags":["Role Admin"],"summary":"Delete a custom role","operationId":"deleteRole","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Role deleted"},"403":{"description":"Cannot delete system role"},"404":{"description":"Role not found"}}}},"/admin/outbound-connections/{id}":{"get":{"tags":["Outbound Connections Admin"],"operationId":"get_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundConnectionDto"}}}}}},"put":{"tags":["Outbound Connections Admin"],"operationId":"update_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundConnectionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundConnectionDto"}}}}}},"delete":{"tags":["Outbound Connections Admin"],"operationId":"delete_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/admin/oidc":{"get":{"tags":["OIDC Config Admin"],"summary":"Get OIDC configuration","operationId":"getConfig_1","responses":{"200":{"description":"Current OIDC configuration (client_secret masked)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcAdminConfigResponse"}}}}}},"put":{"tags":["OIDC Config Admin"],"summary":"Save OIDC configuration","operationId":"saveConfig","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OidcAdminConfigRequest"}}},"required":true},"responses":{"200":{"description":"Configuration saved","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcAdminConfigResponse"}}}},"400":{"description":"Invalid configuration","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["OIDC Config Admin"],"summary":"Delete OIDC configuration","operationId":"deleteConfig","responses":{"204":{"description":"Configuration deleted"}}}},"/admin/groups/{id}":{"get":{"tags":["Group Admin"],"summary":"Get group by ID with effective roles","operationId":"getGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Group found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/GroupDetail"}}}},"404":{"description":"Group not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/GroupDetail"}}}}}},"put":{"tags":["Group Admin"],"summary":"Update group name or parent","operationId":"updateGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGroupRequest"}}},"required":true},"responses":{"200":{"description":"Group updated"},"404":{"description":"Group not found"},"409":{"description":"Cycle detected in group hierarchy"}}},"delete":{"tags":["Group Admin"],"summary":"Delete group","operationId":"deleteGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Group deleted"},"404":{"description":"Group not found"}}}},"/admin/environments/{envSlug}":{"get":{"tags":["Environment Admin"],"summary":"Get environment by slug","operationId":"getEnvironment","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Environment found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Environment"}}}}}},"put":{"tags":["Environment Admin"],"summary":"Update an environment's mutable fields (displayName, production, enabled)","description":"Slug is immutable after creation and cannot be changed. Any slug field in the request body is ignored.","operationId":"updateEnvironment","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnvironmentRequest"}}},"required":true},"responses":{"200":{"description":"Environment updated","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}},"delete":{"tags":["Environment Admin"],"summary":"Delete an environment","operationId":"deleteEnvironment","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Environment deleted","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Cannot delete default environment","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/environments/{envSlug}/jar-retention":{"put":{"tags":["Environment Admin"],"summary":"Update JAR retention policy for an environment","operationId":"updateJarRetention","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JarRetentionRequest"}}},"required":true},"responses":{"200":{"description":"Retention policy updated","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/environments/{envSlug}/default-container-config":{"put":{"tags":["Environment Admin"],"summary":"Update default container config for an environment","operationId":"updateDefaultContainerConfig","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}},"required":true},"responses":{"200":{"description":"Default container config updated","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Invalid configuration","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/claim-mappings/{id}":{"get":{"tags":["Claim Mapping Admin"],"summary":"Get a claim mapping rule by ID","operationId":"get_2","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClaimMappingRule"}}}}}},"put":{"tags":["Claim Mapping Admin"],"summary":"Update a claim mapping rule","operationId":"update_4","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClaimMappingRule"}}}}}},"delete":{"tags":["Claim Mapping Admin"],"summary":"Delete a claim mapping rule","operationId":"delete_4","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/environments/{envSlug}/executions/search":{"post":{"tags":["Search"],"summary":"Advanced search with all filters","description":"Env from the path overrides any environment field in the body.","operationId":"searchPost","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SearchResultExecutionSummary"}}}}}}},"/environments/{envSlug}/apps":{"get":{"tags":["App Management"],"summary":"List apps in this environment","operationId":"listApps","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"App list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/App"}}}}}}},"post":{"tags":["App Management"],"summary":"Create a new app in this environment","description":"Slug must match ^[a-z0-9][a-z0-9-]{0,63}$ and be unique within the environment. Slug is immutable after creation.","operationId":"createApp","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAppRequest"}}},"required":true},"responses":{"201":{"description":"App created","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Invalid slug, or slug already exists in this environment","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/versions":{"get":{"tags":["App Management"],"summary":"List versions for this app","operationId":"listVersions","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Version list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppVersion"}}}}}}},"post":{"tags":["App Management"],"summary":"Upload a JAR for a new version of this app","operationId":"uploadJar","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"env":{"$ref":"#/components/schemas/Environment"},"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"responses":{"201":{"description":"JAR uploaded and version created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppVersion"}}}},"404":{"description":"App not found in this environment","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppVersion"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments":{"get":{"tags":["Deployment Management"],"summary":"List deployments for this app in this environment","operationId":"listDeployments","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deployment list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Deployment"}}}}}}},"post":{"tags":["Deployment Management"],"summary":"Create and start a new deployment for this app in this environment","operationId":"deploy","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployRequest"}}},"required":true},"responses":{"202":{"description":"Deployment accepted and starting","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments/{deploymentId}/stop":{"post":{"tags":["Deployment Management"],"summary":"Stop a running deployment","operationId":"stop","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deployment stopped","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"404":{"description":"Deployment not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments/{deploymentId}/promote":{"post":{"tags":["Deployment Management"],"summary":"Promote this deployment to a different environment","description":"Target environment is specified by slug in the request body. The same app slug must exist in the target environment (or be created separately first).","operationId":"promote","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteRequest"}}},"required":true},"responses":{"202":{"description":"Promotion accepted and starting","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Deployment or target environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/config/test-expression":{"post":{"tags":["Application Config"],"summary":"Test a tap expression against sample data via a live agent in this environment","operationId":"testExpression","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestExpressionRequest"}}},"required":true},"responses":{"200":{"description":"Expression evaluated successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestExpressionResponse"}}}},"404":{"description":"No live agent available for this application in this environment","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestExpressionResponse"}}}},"504":{"description":"Agent did not respond in time","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestExpressionResponse"}}}}}}},"/environments/{envSlug}/alerts/{id}/read":{"post":{"tags":["Alerts Inbox"],"operationId":"read","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/environments/{envSlug}/alerts/{id}/ack":{"post":{"tags":["Alerts Inbox"],"operationId":"ack","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertDto"}}}}}}},"/environments/{envSlug}/alerts/silences":{"get":{"tags":["Alert Silences"],"operationId":"list","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertSilenceResponse"}}}}}}},"post":{"tags":["Alert Silences"],"operationId":"create","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertSilenceRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertSilenceResponse"}}}}}}},"/environments/{envSlug}/alerts/rules":{"get":{"tags":["Alert Rules"],"operationId":"list_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}}},"post":{"tags":["Alert Rules"],"operationId":"create_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}}},"/environments/{envSlug}/alerts/rules/{id}/test-evaluate":{"post":{"tags":["Alert Rules"],"operationId":"testEvaluate","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestEvaluateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestEvaluateResponse"}}}}}}},"/environments/{envSlug}/alerts/rules/{id}/render-preview":{"post":{"tags":["Alert Rules"],"operationId":"renderPreview","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderPreviewRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RenderPreviewResponse"}}}}}}},"/environments/{envSlug}/alerts/rules/{id}/enable":{"post":{"tags":["Alert Rules"],"operationId":"enable","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}}},"/environments/{envSlug}/alerts/rules/{id}/disable":{"post":{"tags":["Alert Rules"],"operationId":"disable","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}}},"/environments/{envSlug}/alerts/bulk-read":{"post":{"tags":["Alerts Inbox"],"operationId":"bulkRead","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReadRequest"}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/data/metrics":{"post":{"tags":["Ingestion"],"summary":"Ingest agent metrics","description":"Accepts an array of MetricsSnapshot objects","operationId":"ingestMetrics","requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"202":{"description":"Data accepted for processing"},"400":{"description":"Invalid payload"},"503":{"description":"Buffer full, retry later"}}}},"/data/logs":{"post":{"tags":["Ingestion"],"summary":"Ingest application log entries","description":"Accepts a batch of log entries from an agent. Entries are buffered and flushed periodically.","operationId":"ingestLogs","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogEntry"}}}},"required":true},"responses":{"202":{"description":"Logs accepted for indexing"}}}},"/data/executions":{"post":{"tags":["Ingestion"],"summary":"Ingest execution chunk","operationId":"ingestChunks","requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/data/events":{"post":{"tags":["Ingestion"],"summary":"Ingest agent events","operationId":"ingestEvents","requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/data/diagrams":{"post":{"tags":["Ingestion"],"summary":"Ingest route diagram data","description":"Accepts a single RouteGraph or an array of RouteGraphs","operationId":"ingestDiagrams","requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"202":{"description":"Data accepted for processing"}}}},"/auth/refresh":{"post":{"tags":["Authentication"],"summary":"Refresh access token","operationId":"refresh","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Token refreshed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}},"401":{"description":"Invalid refresh token","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/auth/oidc/callback":{"post":{"tags":["Authentication"],"summary":"Exchange OIDC authorization code for JWTs","operationId":"callback","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallbackRequest"}}},"required":true},"responses":{"200":{"description":"Authentication successful","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}},"401":{"description":"OIDC authentication failed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Account not provisioned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"OIDC not configured or disabled","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}}}}},"/auth/login":{"post":{"tags":["Authentication"],"summary":"Login with local credentials","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Login successful","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}},"401":{"description":"Invalid credentials","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Account locked due to too many failed attempts","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}}}}},"/alerts/notifications/{id}/retry":{"post":{"tags":["Alert Notifications"],"operationId":"retry","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertNotificationDto"}}}}}}},"/agents/{id}/replay":{"post":{"tags":["Agent Commands"],"summary":"Replay an exchange on a specific agent (synchronous)","description":"Sends a replay command and waits for the agent to complete the replay. Returns the replay result including status, replayExchangeId, and duration.","operationId":"replayExchange","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayRequest"}}},"required":true},"responses":{"200":{"description":"Replay completed (check status for success/failure)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ReplayResponse"}}}},"404":{"description":"Agent not found or not connected","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ReplayResponse"}}}},"504":{"description":"Agent did not respond in time","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ReplayResponse"}}}}}}},"/agents/{id}/refresh":{"post":{"tags":["Agent Management"],"summary":"Refresh access token","description":"Issues a new access JWT from a valid refresh token","operationId":"refresh_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRefreshRequest"}}},"required":true},"responses":{"200":{"description":"New access token issued","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRefreshResponse"}}}},"401":{"description":"Invalid or expired refresh token","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRefreshResponse"}}}},"404":{"description":"Agent not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRefreshResponse"}}}}}}},"/agents/{id}/heartbeat":{"post":{"tags":["Agent Management"],"summary":"Agent heartbeat ping","description":"Updates the agent's last heartbeat timestamp. Auto-registers the agent if not in registry (e.g. after server restart).","operationId":"heartbeat","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatRequest"}}}},"responses":{"200":{"description":"Heartbeat accepted"}}}},"/agents/{id}/deregister":{"post":{"tags":["Agent Management"],"summary":"Deregister agent","description":"Removes the agent from the registry. Called by agents during graceful shutdown.","operationId":"deregister","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent deregistered"},"404":{"description":"Agent not registered"}}}},"/agents/{id}/commands":{"post":{"tags":["Agent Commands"],"summary":"Send command to a specific agent","description":"Sends a command to the specified agent via SSE","operationId":"sendCommand","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandRequest"}}},"required":true},"responses":{"202":{"description":"Command accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandSingleResponse"}}}},"400":{"description":"Invalid command payload","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandSingleResponse"}}}},"404":{"description":"Agent not registered","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandSingleResponse"}}}}}}},"/agents/{id}/commands/{commandId}/ack":{"post":{"tags":["Agent Commands"],"summary":"Acknowledge command receipt","description":"Agent acknowledges that it has received and processed a command, with result status and message","operationId":"acknowledgeCommand","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commandId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAckRequest"}}}},"responses":{"200":{"description":"Command acknowledged"},"404":{"description":"Command not found"}}}},"/agents/register":{"post":{"tags":["Agent Management"],"summary":"Register an agent","description":"Registers a new agent or re-registers an existing one. Requires bootstrap token in Authorization header.","operationId":"register","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistrationRequest"}}},"required":true},"responses":{"200":{"description":"Agent registered successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRegistrationResponse"}}}},"400":{"description":"Invalid registration payload","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid bootstrap token","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRegistrationResponse"}}}}}}},"/agents/groups/{group}/commands":{"post":{"tags":["Agent Commands"],"summary":"Send command to all agents in a group","description":"Sends a command to all LIVE agents in the specified group and waits for responses","operationId":"sendGroupCommand","parameters":[{"name":"group","in":"path","required":true,"schema":{"type":"string"}},{"name":"environment","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandRequest"}}},"required":true},"responses":{"200":{"description":"Commands dispatched and responses collected","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandGroupResponse"}}}},"400":{"description":"Invalid command payload","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandGroupResponse"}}}}}}},"/agents/commands":{"post":{"tags":["Agent Commands"],"summary":"Broadcast command to all live agents","description":"Sends a command to all agents currently in LIVE state","operationId":"broadcastCommand","parameters":[{"name":"environment","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandRequest"}}},"required":true},"responses":{"202":{"description":"Commands accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandBroadcastResponse"}}}},"400":{"description":"Invalid command payload","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandBroadcastResponse"}}}}}}},"/admin/users":{"get":{"tags":["User Admin"],"summary":"List all users with RBAC detail","operationId":"listUsers","responses":{"200":{"description":"User list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserDetail"}}}}}}},"post":{"tags":["User Admin"],"summary":"Create a local user","operationId":"createUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequest"}}},"required":true},"responses":{"200":{"description":"User created","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Disabled in OIDC mode","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/users/{userId}/roles/{roleId}":{"post":{"tags":["User Admin"],"summary":"Assign a role to a user","operationId":"assignRoleToUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Role assigned"},"404":{"description":"User or role not found"}}},"delete":{"tags":["User Admin"],"summary":"Remove a role from a user","operationId":"removeRoleFromUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Role removed"}}}},"/admin/users/{userId}/password":{"post":{"tags":["User Admin"],"summary":"Reset user password","operationId":"resetPassword","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPasswordRequest"}}},"required":true},"responses":{"204":{"description":"Password reset"},"400":{"description":"Disabled in OIDC mode or policy violation"}}}},"/admin/users/{userId}/groups/{groupId}":{"post":{"tags":["User Admin"],"summary":"Add a user to a group","operationId":"addUserToGroup","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User added to group"}}},"delete":{"tags":["User Admin"],"summary":"Remove a user from a group","operationId":"removeUserFromGroup","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"User removed from group"}}}},"/admin/roles":{"get":{"tags":["Role Admin"],"summary":"List all roles (system and custom)","operationId":"listRoles","responses":{"200":{"description":"Role list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleDetail"}}}}}}},"post":{"tags":["Role Admin"],"summary":"Create a custom role","operationId":"createRole","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoleRequest"}}},"required":true},"responses":{"200":{"description":"Role created","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string","format":"uuid"}}}}}}}},"/admin/outbound-connections":{"get":{"tags":["Outbound Connections Admin"],"operationId":"list_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutboundConnectionDto"}}}}}}},"post":{"tags":["Outbound Connections Admin"],"operationId":"create_2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundConnectionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundConnectionDto"}}}}}}},"/admin/outbound-connections/{id}/test":{"post":{"tags":["Outbound Connections Admin"],"operationId":"test","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundConnectionTestResult"}}}}}}},"/admin/oidc/test":{"post":{"tags":["OIDC Config Admin"],"summary":"Test OIDC provider connectivity","operationId":"testConnection","responses":{"200":{"description":"Provider reachable","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcTestResult"}}}},"400":{"description":"Provider unreachable or misconfigured","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/license":{"get":{"tags":["License Admin"],"summary":"Get current license info","operationId":"getCurrent","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/LicenseInfo"}}}}}},"post":{"tags":["License Admin"],"summary":"Update license token at runtime","operationId":"update_5","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLicenseRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/groups":{"get":{"tags":["Group Admin"],"summary":"List all groups with hierarchy and effective roles","operationId":"listGroups","responses":{"200":{"description":"Group list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupDetail"}}}}}}},"post":{"tags":["Group Admin"],"summary":"Create a new group","operationId":"createGroup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupRequest"}}},"required":true},"responses":{"200":{"description":"Group created","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string","format":"uuid"}}}}}}}},"/admin/groups/{id}/roles/{roleId}":{"post":{"tags":["Group Admin"],"summary":"Assign a role to a group","operationId":"assignRoleToGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Role assigned to group"},"404":{"description":"Group not found"}}},"delete":{"tags":["Group Admin"],"summary":"Remove a role from a group","operationId":"removeRoleFromGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Role removed from group"},"404":{"description":"Group not found"}}}},"/admin/environments":{"get":{"tags":["Environment Admin"],"summary":"List all environments","operationId":"listEnvironments","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Environment"}}}}}}},"post":{"tags":["Environment Admin"],"summary":"Create a new environment","operationId":"createEnvironment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnvironmentRequest"}}},"required":true},"responses":{"201":{"description":"Environment created","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Invalid slug or slug already exists","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/database/queries/{pid}/kill":{"post":{"tags":["Database Admin"],"summary":"Terminate a query by PID","operationId":"killQuery","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK"}}}},"/admin/claim-mappings":{"get":{"tags":["Claim Mapping Admin"],"summary":"List all claim mapping rules","operationId":"list_3","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClaimMappingRule"}}}}}}},"post":{"tags":["Claim Mapping Admin"],"summary":"Create a claim mapping rule","operationId":"create_3","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClaimMappingRule"}}}}}}},"/admin/claim-mappings/test":{"post":{"tags":["Claim Mapping Admin"],"summary":"Test claim mapping rules against a set of claims (accepts unsaved rules)","operationId":"test_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestResponse"}}}}}}},"/executions/{executionId}":{"get":{"tags":["Detail"],"summary":"Get execution detail with nested processor tree","operationId":"getDetail","parameters":[{"name":"executionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Execution detail found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ExecutionDetail"}}}},"404":{"description":"Execution not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ExecutionDetail"}}}}}}},"/executions/{executionId}/processors/{index}/snapshot":{"get":{"tags":["Detail"],"summary":"Get exchange snapshot for a specific processor by index","operationId":"getProcessorSnapshot","parameters":[{"name":"executionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Snapshot data","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"404":{"description":"Snapshot not found","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/executions/{executionId}/processors/by-seq/{seq}/snapshot":{"get":{"tags":["Detail"],"summary":"Get exchange snapshot for a processor by seq number","operationId":"processorSnapshotBySeq","parameters":[{"name":"executionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"seq","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Snapshot data","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"404":{"description":"Snapshot not found","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/executions/{executionId}/processors/by-id/{processorId}/snapshot":{"get":{"tags":["Detail"],"summary":"Get exchange snapshot for a specific processor by processorId","operationId":"processorSnapshotById","parameters":[{"name":"executionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"processorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Snapshot data","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"404":{"description":"Snapshot not found","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/environments/{envSlug}/stats":{"get":{"tags":["Search"],"summary":"Aggregate execution stats (P99 latency, active count, SLA compliance)","operationId":"stats","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"routeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ExecutionStats"}}}}}}},"/environments/{envSlug}/stats/timeseries":{"get":{"tags":["Search"],"summary":"Bucketed time-series stats over a time window","operationId":"timeseries","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"buckets","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":24}},{"name":"routeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatsTimeseries"}}}}}}},"/environments/{envSlug}/stats/timeseries/by-route":{"get":{"tags":["Search"],"summary":"Timeseries grouped by route for an application","operationId":"timeseriesByRoute","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"buckets","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":24}},{"name":"application","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/StatsTimeseries"}}}}}}}},"/environments/{envSlug}/stats/timeseries/by-app":{"get":{"tags":["Search"],"summary":"Timeseries grouped by application","operationId":"timeseriesByApp","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"buckets","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":24}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/StatsTimeseries"}}}}}}}},"/environments/{envSlug}/stats/punchcard":{"get":{"tags":["Search"],"summary":"Transaction punchcard: weekday x hour grid (rolling 7 days)","operationId":"punchcard","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PunchcardCell"}}}}}}}},"/environments/{envSlug}/routes":{"get":{"tags":["Route Catalog"],"summary":"Get route catalog for this environment","description":"Returns all applications with their routes, agents, and health status — filtered to this environment","operationId":"getCatalog","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Catalog returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppCatalogEntry"}}}}}}}},"/environments/{envSlug}/routes/metrics":{"get":{"tags":["Route Metrics"],"summary":"Get route metrics for this environment","description":"Returns aggregated performance metrics per route for the given time window. Optional appId filter narrows to a single application.","operationId":"getMetrics","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"appId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Metrics returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RouteMetrics"}}}}}}}},"/environments/{envSlug}/routes/metrics/processors":{"get":{"tags":["Route Metrics"],"summary":"Get processor metrics for this environment","description":"Returns aggregated performance metrics per processor for the given route and time window","operationId":"getProcessorMetrics","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"routeId","in":"query","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Metrics returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorMetrics"}}}}}}}},"/environments/{envSlug}/logs":{"get":{"tags":["Application Logs"],"summary":"Search application log entries in this environment","description":"Cursor-paginated log search scoped to the env in the path. Supports free-text search, multi-level filtering, and optional application/agent scoping.","operationId":"searchLogs","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"query","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}},{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"exchangeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"logger","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":100}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"desc"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/LogSearchPageResponse"}}}}}}},"/environments/{envSlug}/executions":{"get":{"tags":["Search"],"summary":"Search executions with basic filters (env from path)","operationId":"searchGet","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"timeFrom","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"timeTo","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"correlationId","in":"query","required":false,"schema":{"type":"string"}},{"name":"text","in":"query","required":false,"schema":{"type":"string"}},{"name":"routeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"processorType","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":50}},{"name":"sortField","in":"query","required":false,"schema":{"type":"string"}},{"name":"sortDir","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SearchResultExecutionSummary"}}}}}}},"/environments/{envSlug}/errors/top":{"get":{"tags":["Search"],"summary":"Top N errors with velocity trend","operationId":"topErrors","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}},{"name":"routeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":5}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TopError"}}}}}}}},"/environments/{envSlug}/config":{"get":{"tags":["Application Config"],"summary":"List application configs in this environment","operationId":"listConfigs","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"Configs returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApplicationConfig"}}}}}}}},"/environments/{envSlug}/attributes/keys":{"get":{"tags":["Search"],"summary":"Distinct attribute key names for this environment","operationId":"attributeKeys","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/environments/{envSlug}/apps/{appSlug}":{"get":{"tags":["App Management"],"summary":"Get app by env + slug","operationId":"getApp","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"App found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/App"}}}},"404":{"description":"App not found in this environment","content":{"*/*":{"schema":{"$ref":"#/components/schemas/App"}}}}}},"delete":{"tags":["App Management"],"summary":"Delete this app","operationId":"deleteApp","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"App deleted"}}}},"/environments/{envSlug}/apps/{appSlug}/routes/{routeId}/diagram":{"get":{"tags":["Diagrams"],"summary":"Find the latest diagram for this app's route in this environment","description":"Resolves agents in this env for this app, then looks up the latest diagram for the route they reported. Env scope prevents a dev route from returning a prod diagram.","operationId":"findByAppAndRoute","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"routeId","in":"path","required":true,"schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","default":"LR"}}],"responses":{"200":{"description":"Diagram layout returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DiagramLayout"}}}},"404":{"description":"No diagram found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DiagramLayout"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/processor-routes":{"get":{"tags":["Application Config"],"summary":"Get processor to route mapping for this environment","description":"Returns a map of processorId → routeId for all processors seen in this application + environment","operationId":"getProcessorRouteMapping","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Mapping returned","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments/{deploymentId}":{"get":{"tags":["Deployment Management"],"summary":"Get deployment by ID","operationId":"getDeployment","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deployment found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"404":{"description":"Deployment not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments/{deploymentId}/logs":{"get":{"tags":["Deployment Management"],"summary":"Get container logs for this deployment","operationId":"getLogs","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Logs returned","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}},"404":{"description":"Deployment not found or no container","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/environments/{envSlug}/app-settings":{"get":{"tags":["App Settings"],"summary":"List application settings in this environment","operationId":"getAll","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppSettings"}}}}}}}},"/environments/{envSlug}/alerts":{"get":{"tags":["Alerts Inbox"],"operationId":"list_4","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":50}},{"name":"state","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","enum":["PENDING","FIRING","ACKNOWLEDGED","RESOLVED"]}}},{"name":"severity","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","enum":["CRITICAL","WARNING","INFO"]}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertDto"}}}}}}}},"/environments/{envSlug}/alerts/{id}":{"get":{"tags":["Alerts Inbox"],"operationId":"get_3","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertDto"}}}}}}},"/environments/{envSlug}/alerts/{alertId}/notifications":{"get":{"tags":["Alert Notifications"],"operationId":"listForInstance","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"alertId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertNotificationDto"}}}}}}}},"/environments/{envSlug}/alerts/unread-count":{"get":{"tags":["Alerts Inbox"],"operationId":"unreadCount","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnreadCountResponse"}}}}}}},"/environments/{envSlug}/agents":{"get":{"tags":["Agent List"],"summary":"List all agents in this environment","description":"Returns registered agents with runtime metrics, optionally filtered by status and/or application","operationId":"listAgents","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentInstanceResponse"}}}}},"400":{"description":"Invalid status filter","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/environments/{envSlug}/agents/{agentId}/metrics":{"get":{"tags":["agent-metrics-controller"],"operationId":"getMetrics_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"names","in":"query","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"buckets","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":60}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","default":"gauge"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentMetricsResponse"}}}}}}},"/environments/{envSlug}/agents/events":{"get":{"tags":["Agent Events"],"summary":"Query agent events in this environment","description":"Cursor-paginated. Returns newest first. Pass nextCursor back as ?cursor= for the next page.","operationId":"getEvents","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appId","in":"query","required":false,"schema":{"type":"string"}},{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":50}}],"responses":{"200":{"description":"Event page returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentEventPageResponse"}}}}}}},"/diagrams/{contentHash}/render":{"get":{"tags":["Diagrams"],"summary":"Render a route diagram by content hash","description":"Returns SVG (default) or JSON layout based on Accept header. Content hashes are globally unique, so this endpoint is intentionally flat (no env).","operationId":"renderDiagram","parameters":[{"name":"contentHash","in":"path","required":true,"schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","default":"LR"}}],"responses":{"200":{"description":"Diagram rendered successfully","content":{"image/svg+xml":{"schema":{"type":"string"}},"application/json":{"schema":{"$ref":"#/components/schemas/DiagramLayout"}}}},"404":{"description":"Diagram not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/catalog":{"get":{"tags":["Catalog"],"summary":"Get unified catalog","description":"Returns all applications (managed + unmanaged) with live agent data, routes, and deployment status","operationId":"getCatalog_1","parameters":[{"name":"environment","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Catalog returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CatalogApp"}}}}}}}},"/auth/oidc/config":{"get":{"tags":["Authentication"],"summary":"Get OIDC config for SPA login flow","operationId":"getConfig_2","responses":{"200":{"description":"OIDC configuration","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcPublicConfigResponse"}}}},"404":{"description":"OIDC not configured or disabled","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcPublicConfigResponse"}}}},"500":{"description":"Failed to retrieve OIDC provider metadata","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/auth/me":{"get":{"tags":["Authentication"],"summary":"Get current user details","operationId":"me","responses":{"200":{"description":"Current user details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}},"401":{"description":"Not authenticated","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}}}}},"/agents/{id}/events":{"get":{"tags":["Agent SSE"],"summary":"Open SSE event stream","description":"Opens a Server-Sent Events stream for the specified agent. Commands (config-update, deep-trace, replay) are pushed as events. Ping keepalive comments sent every 15 seconds.","operationId":"events","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Last-Event-ID","in":"header","description":"Last received event ID (no replay, acknowledged only)","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"SSE stream opened","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/SseEmitter"}}}},"404":{"description":"Agent not registered and cannot be auto-registered","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/SseEmitter"}}}}}}},"/agents/config":{"get":{"tags":["Agent Config"],"summary":"Get application config for the calling agent","description":"Resolves (application, environment) from the agent's JWT + registry. Prefers the registry entry (heartbeat-authoritative); falls back to the JWT env claim. Returns 404 if neither identifies a valid agent.","operationId":"getConfigForAgent","responses":{"200":{"description":"Config returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppConfigResponse"}}}},"404":{"description":"Calling agent could not be resolved","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppConfigResponse"}}}}}}},"/admin/usage":{"get":{"tags":["Usage Analytics"],"summary":"Query usage statistics","description":"Returns aggregated API usage stats grouped by endpoint, user, or hour","operationId":"getUsage","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"username","in":"query","required":false,"schema":{"type":"string"}},{"name":"groupBy","in":"query","required":false,"schema":{"type":"string","default":"endpoint"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UsageStats"}}}}}}}},"/admin/rbac/stats":{"get":{"tags":["RBAC Stats"],"summary":"Get RBAC statistics for the dashboard","operationId":"getStats","responses":{"200":{"description":"RBAC stats returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RbacStats"}}}}}}},"/admin/outbound-connections/{id}/usage":{"get":{"tags":["Outbound Connections Admin"],"operationId":"usage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"type":"string","format":"uuid"}}}}}}}},"/admin/database/tables":{"get":{"tags":["Database Admin"],"summary":"Get table sizes and row counts","operationId":"getTables","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TableSizeResponse"}}}}}}}},"/admin/database/status":{"get":{"tags":["Database Admin"],"summary":"Get database connection status and version","operationId":"getStatus","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DatabaseStatusResponse"}}}}}}},"/admin/database/queries":{"get":{"tags":["Database Admin"],"summary":"Get active queries","operationId":"getQueries","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActiveQueryResponse"}}}}}}}},"/admin/database/pool":{"get":{"tags":["Database Admin"],"summary":"Get HikariCP connection pool stats","operationId":"getPool","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConnectionPoolResponse"}}}}}}},"/admin/clickhouse/tables":{"get":{"tags":["ClickHouse Admin"],"summary":"List ClickHouse tables with sizes","operationId":"getTables_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClickHouseTableInfo"}}}}}}}},"/admin/clickhouse/status":{"get":{"tags":["ClickHouse Admin"],"summary":"ClickHouse cluster status","operationId":"getStatus_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClickHouseStatusResponse"}}}}}}},"/admin/clickhouse/queries":{"get":{"tags":["ClickHouse Admin"],"summary":"Active ClickHouse queries","operationId":"getQueries_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClickHouseQueryInfo"}}}}}}}},"/admin/clickhouse/pipeline":{"get":{"tags":["ClickHouse Admin"],"summary":"Search indexer pipeline statistics","operationId":"getPipeline","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IndexerPipelineResponse"}}}}}}},"/admin/clickhouse/performance":{"get":{"tags":["ClickHouse Admin"],"summary":"ClickHouse storage and performance metrics","operationId":"getPerformance","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClickHousePerformanceResponse"}}}}}}},"/admin/audit":{"get":{"tags":["Audit Log"],"summary":"Search audit log entries with pagination","operationId":"getAuditLog","parameters":[{"name":"username","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"timestamp"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","default":"desc"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":25}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuditLogPageResponse"}}}}}}},"/catalog/{applicationId}":{"delete":{"tags":["Catalog"],"summary":"Dismiss application and purge all data","operationId":"dismissApplication","parameters":[{"name":"applicationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Application dismissed"},"409":{"description":"Cannot dismiss — live agents connected"}}}}},"components":{"schemas":{"Environment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"displayName":{"type":"string"},"production":{"type":"boolean"},"enabled":{"type":"boolean"},"defaultContainerConfig":{"type":"object","additionalProperties":{"type":"object"}},"jarRetentionCount":{"type":"integer","format":"int32"},"createdAt":{"type":"string","format":"date-time"}}},"AppSettingsRequest":{"type":"object","description":"Per-application dashboard settings","properties":{"slaThresholdMs":{"type":"integer","format":"int32","description":"SLA duration threshold in milliseconds","minimum":1},"healthErrorWarn":{"type":"number","format":"double","description":"Error rate % threshold for warning (yellow) health dot","maximum":100,"minimum":0},"healthErrorCrit":{"type":"number","format":"double","description":"Error rate % threshold for critical (red) health dot","maximum":100,"minimum":0},"healthSlaWarn":{"type":"number","format":"double","description":"SLA compliance % threshold for warning (yellow) health dot","maximum":100,"minimum":0},"healthSlaCrit":{"type":"number","format":"double","description":"SLA compliance % threshold for critical (red) health dot","maximum":100,"minimum":0}},"required":["healthErrorCrit","healthErrorWarn","healthSlaCrit","healthSlaWarn","slaThresholdMs"]},"AppSettings":{"type":"object","properties":{"applicationId":{"type":"string"},"environment":{"type":"string"},"slaThresholdMs":{"type":"integer","format":"int32"},"healthErrorWarn":{"type":"number","format":"double"},"healthErrorCrit":{"type":"number","format":"double"},"healthSlaWarn":{"type":"number","format":"double"},"healthSlaCrit":{"type":"number","format":"double"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ApplicationConfig":{"type":"object","properties":{"application":{"type":"string"},"environment":{"type":"string"},"version":{"type":"integer","format":"int32"},"updatedAt":{"type":"string","format":"date-time"},"engineLevel":{"type":"string"},"payloadCaptureMode":{"type":"string"},"metricsEnabled":{"type":"boolean"},"samplingRate":{"type":"number","format":"double"},"tracedProcessors":{"type":"object","additionalProperties":{"type":"string"}},"applicationLogLevel":{"type":"string"},"taps":{"type":"array","items":{"$ref":"#/components/schemas/TapDefinition"}},"tapVersion":{"type":"integer","format":"int32"},"routeRecording":{"type":"object","additionalProperties":{"type":"boolean"}},"compressSuccess":{"type":"boolean"},"agentLogLevel":{"type":"string"},"routeSamplingRates":{"type":"object","additionalProperties":{"type":"number","format":"double"}},"sensitiveKeys":{"type":"array","items":{"type":"string"}}}},"TapDefinition":{"type":"object","properties":{"tapId":{"type":"string"},"processorId":{"type":"string"},"target":{"type":"string"},"expression":{"type":"string"},"language":{"type":"string"},"attributeName":{"type":"string"},"attributeType":{"type":"string"},"enabled":{"type":"boolean"},"version":{"type":"integer","format":"int32"}}},"AgentResponse":{"type":"object","properties":{"agentId":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}}},"CommandGroupResponse":{"type":"object","properties":{"success":{"type":"boolean"},"total":{"type":"integer","format":"int32"},"responded":{"type":"integer","format":"int32"},"responses":{"type":"array","items":{"$ref":"#/components/schemas/AgentResponse"}},"timedOut":{"type":"array","items":{"type":"string"}}}},"ConfigUpdateResponse":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/ApplicationConfig"},"pushResult":{"$ref":"#/components/schemas/CommandGroupResponse"}}},"AlertSilenceRequest":{"type":"object","properties":{"matcher":{"$ref":"#/components/schemas/SilenceMatcher"},"reason":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"}},"required":["endsAt","matcher","startsAt"]},"SilenceMatcher":{"type":"object","properties":{"ruleId":{"type":"string","format":"uuid"},"appSlug":{"type":"string"},"routeId":{"type":"string"},"agentId":{"type":"string"},"severity":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"wildcard":{"type":"boolean"}}},"AlertSilenceResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"matcher":{"$ref":"#/components/schemas/SilenceMatcher"},"reason":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"AgentStateCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"state":{"type":"string"},"forSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"AlertCondition":{"type":"object","discriminator":{"propertyName":"kind"},"properties":{"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"]}}},"AlertRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"severity":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"conditionKind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"]},"condition":{"oneOf":[{"$ref":"#/components/schemas/AgentStateCondition"},{"$ref":"#/components/schemas/DeploymentStateCondition"},{"$ref":"#/components/schemas/ExchangeMatchCondition"},{"$ref":"#/components/schemas/JvmMetricCondition"},{"$ref":"#/components/schemas/LogPatternCondition"},{"$ref":"#/components/schemas/RouteMetricCondition"}]},"evaluationIntervalSeconds":{"type":"integer","format":"int32"},"forDurationSeconds":{"type":"integer","format":"int32"},"reNotifyMinutes":{"type":"integer","format":"int32"},"notificationTitleTmpl":{"type":"string"},"notificationMessageTmpl":{"type":"string"},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookBindingRequest"}},"targets":{"type":"array","items":{"$ref":"#/components/schemas/AlertRuleTarget"}}},"required":["condition","conditionKind","severity"]},"AlertRuleTarget":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ruleId":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["USER","GROUP","ROLE"]},"targetId":{"type":"string"}}},"AlertScope":{"type":"object","properties":{"appSlug":{"type":"string"},"routeId":{"type":"string"},"agentId":{"type":"string"}}},"DeploymentStateCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"states":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"ExchangeFilter":{"type":"object","properties":{"status":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}}}},"ExchangeMatchCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"filter":{"$ref":"#/components/schemas/ExchangeFilter"},"fireMode":{"type":"string","enum":["PER_EXCHANGE","COUNT_IN_WINDOW"]},"threshold":{"type":"integer","format":"int32"},"windowSeconds":{"type":"integer","format":"int32"},"perExchangeLingerSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"JvmMetricCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"metric":{"type":"string"},"aggregation":{"type":"string","enum":["MAX","MIN","AVG","LATEST"]},"comparator":{"type":"string","enum":["GT","GTE","LT","LTE","EQ"]},"threshold":{"type":"number","format":"double"},"windowSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"LogPatternCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"level":{"type":"string"},"pattern":{"type":"string"},"threshold":{"type":"integer","format":"int32"},"windowSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"RouteMetricCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"metric":{"type":"string","enum":["ERROR_RATE","AVG_DURATION_MS","P99_LATENCY_MS","THROUGHPUT","ERROR_COUNT"]},"comparator":{"type":"string","enum":["GT","GTE","LT","LTE","EQ"]},"threshold":{"type":"number","format":"double"},"windowSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"WebhookBindingRequest":{"type":"object","properties":{"outboundConnectionId":{"type":"string","format":"uuid"},"bodyOverride":{"type":"string"},"headerOverrides":{"type":"object","additionalProperties":{"type":"string"}}},"required":["outboundConnectionId"]},"AlertRuleResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"enabled":{"type":"boolean"},"conditionKind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"]},"condition":{"oneOf":[{"$ref":"#/components/schemas/AgentStateCondition"},{"$ref":"#/components/schemas/DeploymentStateCondition"},{"$ref":"#/components/schemas/ExchangeMatchCondition"},{"$ref":"#/components/schemas/JvmMetricCondition"},{"$ref":"#/components/schemas/LogPatternCondition"},{"$ref":"#/components/schemas/RouteMetricCondition"}]},"evaluationIntervalSeconds":{"type":"integer","format":"int32"},"forDurationSeconds":{"type":"integer","format":"int32"},"reNotifyMinutes":{"type":"integer","format":"int32"},"notificationTitleTmpl":{"type":"string"},"notificationMessageTmpl":{"type":"string"},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookBindingResponse"}},"targets":{"type":"array","items":{"$ref":"#/components/schemas/AlertRuleTarget"}},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"}}},"WebhookBindingResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"outboundConnectionId":{"type":"string","format":"uuid"},"bodyOverride":{"type":"string"},"headerOverrides":{"type":"object","additionalProperties":{"type":"string"}}}},"UpdateUserRequest":{"type":"object","properties":{"displayName":{"type":"string"},"email":{"type":"string"}}},"DatabaseThresholdsRequest":{"type":"object","description":"Database monitoring thresholds","properties":{"connectionPoolWarning":{"type":"integer","format":"int32","description":"Connection pool usage warning threshold (percentage)","maximum":100,"minimum":0},"connectionPoolCritical":{"type":"integer","format":"int32","description":"Connection pool usage critical threshold (percentage)","maximum":100,"minimum":0},"queryDurationWarning":{"type":"number","format":"double","description":"Query duration warning threshold (seconds)"},"queryDurationCritical":{"type":"number","format":"double","description":"Query duration critical threshold (seconds)"}}},"ThresholdConfigRequest":{"type":"object","description":"Threshold configuration for admin monitoring","properties":{"database":{"$ref":"#/components/schemas/DatabaseThresholdsRequest"}},"required":["database"]},"DatabaseThresholds":{"type":"object","properties":{"connectionPoolWarning":{"type":"integer","format":"int32"},"connectionPoolCritical":{"type":"integer","format":"int32"},"queryDurationWarning":{"type":"number","format":"double"},"queryDurationCritical":{"type":"number","format":"double"}}},"ThresholdConfig":{"type":"object","properties":{"database":{"$ref":"#/components/schemas/DatabaseThresholds"}}},"SensitiveKeysRequest":{"type":"object","description":"Global sensitive keys configuration","properties":{"keys":{"type":"array","description":"List of key names or glob patterns to mask","items":{"type":"string"}}},"required":["keys"]},"SensitiveKeysResponse":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"}},"pushResult":{"$ref":"#/components/schemas/CommandGroupResponse"}}},"UpdateRoleRequest":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string"}}},"Basic":{"allOf":[{"$ref":"#/components/schemas/OutboundAuth"},{"type":"object","properties":{"username":{"type":"string"},"passwordCiphertext":{"type":"string"}}}]},"Bearer":{"allOf":[{"$ref":"#/components/schemas/OutboundAuth"},{"type":"object","properties":{"tokenCiphertext":{"type":"string"}}}]},"None":{"allOf":[{"$ref":"#/components/schemas/OutboundAuth"}]},"OutboundAuth":{"type":"object"},"OutboundConnectionRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"minLength":0},"description":{"type":"string","maxLength":2000,"minLength":0},"url":{"type":"string","minLength":1,"pattern":"^https://.+"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"defaultHeaders":{"type":"object","additionalProperties":{"type":"string"}},"defaultBodyTmpl":{"type":"string"},"tlsTrustMode":{"type":"string","enum":["SYSTEM_DEFAULT","TRUST_ALL","TRUST_PATHS"]},"tlsCaPemPaths":{"type":"array","items":{"type":"string"}},"hmacSecret":{"type":"string"},"auth":{"oneOf":[{"$ref":"#/components/schemas/Basic"},{"$ref":"#/components/schemas/Bearer"},{"$ref":"#/components/schemas/None"}]},"allowedEnvironmentIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["auth","method","tlsTrustMode"]},"OutboundConnectionDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"defaultHeaders":{"type":"object","additionalProperties":{"type":"string"}},"defaultBodyTmpl":{"type":"string"},"tlsTrustMode":{"type":"string","enum":["SYSTEM_DEFAULT","TRUST_ALL","TRUST_PATHS"]},"tlsCaPemPaths":{"type":"array","items":{"type":"string"}},"hmacSecretSet":{"type":"boolean"},"authKind":{"type":"string","enum":["NONE","BEARER","BASIC"]},"allowedEnvironmentIds":{"type":"array","items":{"type":"string","format":"uuid"}},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"}}},"OidcAdminConfigRequest":{"type":"object","description":"OIDC configuration update request","properties":{"enabled":{"type":"boolean"},"issuerUri":{"type":"string"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"rolesClaim":{"type":"string"},"defaultRoles":{"type":"array","items":{"type":"string"}},"autoSignup":{"type":"boolean"},"displayNameClaim":{"type":"string"},"userIdClaim":{"type":"string"},"audience":{"type":"string"},"additionalScopes":{"type":"array","items":{"type":"string"}}}},"ErrorResponse":{"type":"object","description":"Error response","properties":{"message":{"type":"string"}},"required":["message"]},"OidcAdminConfigResponse":{"type":"object","description":"OIDC configuration for admin management","properties":{"configured":{"type":"boolean"},"enabled":{"type":"boolean"},"issuerUri":{"type":"string"},"clientId":{"type":"string"},"clientSecretSet":{"type":"boolean"},"rolesClaim":{"type":"string"},"defaultRoles":{"type":"array","items":{"type":"string"}},"autoSignup":{"type":"boolean"},"displayNameClaim":{"type":"string"},"userIdClaim":{"type":"string"},"audience":{"type":"string"},"additionalScopes":{"type":"array","items":{"type":"string"}}}},"UpdateGroupRequest":{"type":"object","properties":{"name":{"type":"string"},"parentGroupId":{"type":"string","format":"uuid"}}},"UpdateEnvironmentRequest":{"type":"object","properties":{"displayName":{"type":"string"},"production":{"type":"boolean"},"enabled":{"type":"boolean"}}},"JarRetentionRequest":{"type":"object","properties":{"jarRetentionCount":{"type":"integer","format":"int32"}}},"CreateRuleRequest":{"type":"object","properties":{"claim":{"type":"string"},"matchType":{"type":"string"},"matchValue":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"},"priority":{"type":"integer","format":"int32"}}},"ClaimMappingRule":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"claim":{"type":"string"},"matchType":{"type":"string"},"matchValue":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"},"priority":{"type":"integer","format":"int32"},"createdAt":{"type":"string","format":"date-time"}}},"SearchRequest":{"type":"object","properties":{"status":{"type":"string"},"timeFrom":{"type":"string","format":"date-time"},"timeTo":{"type":"string","format":"date-time"},"durationMin":{"type":"integer","format":"int64"},"durationMax":{"type":"integer","format":"int64"},"correlationId":{"type":"string"},"text":{"type":"string"},"textInBody":{"type":"string"},"textInHeaders":{"type":"string"},"textInErrors":{"type":"string"},"routeId":{"type":"string"},"instanceId":{"type":"string"},"processorType":{"type":"string"},"applicationId":{"type":"string"},"instanceIds":{"type":"array","items":{"type":"string"}},"offset":{"type":"integer","format":"int32"},"limit":{"type":"integer","format":"int32"},"sortField":{"type":"string"},"sortDir":{"type":"string"},"environment":{"type":"string"}}},"ExecutionSummary":{"type":"object","properties":{"executionId":{"type":"string"},"routeId":{"type":"string"},"instanceId":{"type":"string"},"applicationId":{"type":"string"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"durationMs":{"type":"integer","format":"int64"},"correlationId":{"type":"string"},"errorMessage":{"type":"string"},"diagramContentHash":{"type":"string"},"highlight":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}},"hasTraceData":{"type":"boolean"},"isReplay":{"type":"boolean"}},"required":["applicationId","attributes","correlationId","diagramContentHash","durationMs","endTime","errorMessage","executionId","hasTraceData","highlight","instanceId","isReplay","routeId","startTime","status"]},"SearchResultExecutionSummary":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionSummary"}},"total":{"type":"integer","format":"int64"},"offset":{"type":"integer","format":"int32"},"limit":{"type":"integer","format":"int32"}},"required":["data","limit","offset","total"]},"CreateAppRequest":{"type":"object","properties":{"slug":{"type":"string"},"displayName":{"type":"string"}}},"AppVersion":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"appId":{"type":"string","format":"uuid"},"version":{"type":"integer","format":"int32"},"jarPath":{"type":"string"},"jarChecksum":{"type":"string"},"jarFilename":{"type":"string"},"jarSizeBytes":{"type":"integer","format":"int64"},"detectedRuntimeType":{"type":"string"},"detectedMainClass":{"type":"string"},"uploadedAt":{"type":"string","format":"date-time"}}},"DeployRequest":{"type":"object","properties":{"appVersionId":{"type":"string","format":"uuid"}}},"Deployment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"appId":{"type":"string","format":"uuid"},"appVersionId":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["STOPPED","STARTING","RUNNING","DEGRADED","STOPPING","FAILED"]},"targetState":{"type":"string"},"deploymentStrategy":{"type":"string"},"replicaStates":{"type":"array","items":{"type":"object","additionalProperties":{"type":"object"}}},"deployStage":{"type":"string"},"containerId":{"type":"string"},"containerName":{"type":"string"},"errorMessage":{"type":"string"},"resolvedConfig":{"type":"object","additionalProperties":{"type":"object"}},"deployedAt":{"type":"string","format":"date-time"},"stoppedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"PromoteRequest":{"type":"object","properties":{"targetEnvironment":{"type":"string"}}},"TestExpressionRequest":{"type":"object","properties":{"expression":{"type":"string"},"language":{"type":"string"},"body":{"type":"string"},"target":{"type":"string"}}},"TestExpressionResponse":{"type":"object","properties":{"result":{"type":"string"},"error":{"type":"string"}}},"AlertDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ruleId":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"state":{"type":"string","enum":["PENDING","FIRING","ACKNOWLEDGED","RESOLVED"]},"severity":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"title":{"type":"string"},"message":{"type":"string"},"firedAt":{"type":"string","format":"date-time"},"ackedAt":{"type":"string","format":"date-time"},"ackedBy":{"type":"string"},"resolvedAt":{"type":"string","format":"date-time"},"silenced":{"type":"boolean"},"currentValue":{"type":"number","format":"double"},"threshold":{"type":"number","format":"double"},"context":{"type":"object","additionalProperties":{"type":"object"}}}},"TestEvaluateRequest":{"type":"object"},"TestEvaluateResponse":{"type":"object","properties":{"resultKind":{"type":"string"},"detail":{"type":"string"}}},"RenderPreviewRequest":{"type":"object","properties":{"context":{"type":"object","additionalProperties":{"type":"object"}}}},"RenderPreviewResponse":{"type":"object","properties":{"title":{"type":"string"},"message":{"type":"string"}}},"BulkReadRequest":{"type":"object","properties":{"instanceIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["instanceIds"]},"LogEntry":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"level":{"type":"string"},"loggerName":{"type":"string"},"message":{"type":"string"},"threadName":{"type":"string"},"stackTrace":{"type":"string"},"mdc":{"type":"object","additionalProperties":{"type":"string"}},"source":{"type":"string"}}},"RefreshRequest":{"type":"object","properties":{"refreshToken":{"type":"string"}}},"AuthTokenResponse":{"type":"object","description":"JWT token pair","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"displayName":{"type":"string"},"idToken":{"type":"string","description":"OIDC id_token for end-session logout (only present after OIDC login)"}},"required":["accessToken","displayName","refreshToken"]},"CallbackRequest":{"type":"object","properties":{"code":{"type":"string"},"redirectUri":{"type":"string"}}},"LoginRequest":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}},"AlertNotificationDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"alertInstanceId":{"type":"string","format":"uuid"},"webhookId":{"type":"string","format":"uuid"},"outboundConnectionId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["PENDING","DELIVERED","FAILED"]},"attempts":{"type":"integer","format":"int32"},"nextAttemptAt":{"type":"string","format":"date-time"},"lastResponseStatus":{"type":"integer","format":"int32"},"lastResponseSnippet":{"type":"string"},"deliveredAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"ReplayRequest":{"type":"object","description":"Request to replay an exchange on an agent","properties":{"routeId":{"type":"string","description":"Camel route ID to replay on"},"body":{"type":"string","description":"Message body for the replayed exchange"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Message headers for the replayed exchange"},"originalExchangeId":{"type":"string","description":"Exchange ID of the original execution being replayed (for audit trail)"}},"required":["routeId"]},"ReplayResponse":{"type":"object","description":"Result of a replay command","properties":{"status":{"type":"string","description":"Replay outcome: SUCCESS or FAILURE"},"message":{"type":"string","description":"Human-readable result message"},"data":{"type":"string","description":"Structured result data from the agent (JSON)"}}},"AgentRefreshRequest":{"type":"object","description":"Agent token refresh request","properties":{"refreshToken":{"type":"string"}},"required":["refreshToken"]},"AgentRefreshResponse":{"type":"object","description":"Refreshed access and refresh tokens","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["accessToken","refreshToken"]},"HeartbeatRequest":{"type":"object","properties":{"routeStates":{"type":"object","additionalProperties":{"type":"string"}},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"environmentId":{"type":"string"}}},"CommandRequest":{"type":"object","description":"Command to send to agent(s)","properties":{"type":{"type":"string","description":"Command type: config-update, deep-trace, or replay"},"payload":{"type":"object","description":"Command payload JSON"}},"required":["type"]},"CommandSingleResponse":{"type":"object","description":"Result of sending a command to a single agent","properties":{"commandId":{"type":"string"},"status":{"type":"string"}},"required":["commandId","status"]},"CommandAckRequest":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"},"data":{"type":"string"}}},"AgentRegistrationRequest":{"type":"object","description":"Agent registration payload","properties":{"instanceId":{"type":"string"},"applicationId":{"type":"string","default":"default"},"environmentId":{"type":"string","default":"default"},"version":{"type":"string"},"routeIds":{"type":"array","items":{"type":"string"}},"capabilities":{"type":"object","additionalProperties":{"type":"object"}}},"required":["instanceId"]},"AgentRegistrationResponse":{"type":"object","description":"Agent registration result with JWT tokens and SSE endpoint","properties":{"instanceId":{"type":"string"},"sseEndpoint":{"type":"string"},"heartbeatIntervalMs":{"type":"integer","format":"int64"},"serverPublicKey":{"type":"string"},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["accessToken","instanceId","refreshToken","serverPublicKey","sseEndpoint"]},"CommandBroadcastResponse":{"type":"object","description":"Result of broadcasting a command to multiple agents","properties":{"commandIds":{"type":"array","items":{"type":"string"}},"targetCount":{"type":"integer","format":"int32"}},"required":["commandIds"]},"CreateUserRequest":{"type":"object","properties":{"username":{"type":"string"},"displayName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"}}},"SetPasswordRequest":{"type":"object","properties":{"password":{"type":"string","minLength":1}}},"CreateRoleRequest":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string"}}},"OutboundConnectionTestResult":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"latencyMs":{"type":"integer","format":"int64"},"responseSnippet":{"type":"string"},"tlsProtocol":{"type":"string"},"tlsCipherSuite":{"type":"string"},"peerCertificateSubject":{"type":"string"},"peerCertificateExpiresAtEpochMs":{"type":"integer","format":"int64"},"error":{"type":"string"}}},"OidcTestResult":{"type":"object","description":"OIDC provider connectivity test result","properties":{"status":{"type":"string"},"authorizationEndpoint":{"type":"string"}},"required":["authorizationEndpoint","status"]},"UpdateLicenseRequest":{"type":"object","properties":{"token":{"type":"string"}}},"CreateGroupRequest":{"type":"object","properties":{"name":{"type":"string"},"parentGroupId":{"type":"string","format":"uuid"}}},"CreateEnvironmentRequest":{"type":"object","properties":{"slug":{"type":"string"},"displayName":{"type":"string"},"production":{"type":"boolean"}}},"TestRequest":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/TestRuleRequest"}},"claims":{"type":"object","additionalProperties":{"type":"object"}}}},"TestRuleRequest":{"type":"object","properties":{"id":{"type":"string"},"claim":{"type":"string"},"matchType":{"type":"string"},"matchValue":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"},"priority":{"type":"integer","format":"int32"}}},"MatchedRuleResponse":{"type":"object","properties":{"ruleId":{"type":"string"},"priority":{"type":"integer","format":"int32"},"claim":{"type":"string"},"matchType":{"type":"string"},"matchValue":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"}}},"TestResponse":{"type":"object","properties":{"matchedRules":{"type":"array","items":{"$ref":"#/components/schemas/MatchedRuleResponse"}},"effectiveRoles":{"type":"array","items":{"type":"string"}},"effectiveGroups":{"type":"array","items":{"type":"string"}},"fallback":{"type":"boolean"}}},"ExecutionDetail":{"type":"object","properties":{"executionId":{"type":"string"},"routeId":{"type":"string"},"instanceId":{"type":"string"},"applicationId":{"type":"string"},"environment":{"type":"string"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"durationMs":{"type":"integer","format":"int64"},"correlationId":{"type":"string"},"exchangeId":{"type":"string"},"errorMessage":{"type":"string"},"errorStackTrace":{"type":"string"},"diagramContentHash":{"type":"string"},"processors":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorNode"}},"inputBody":{"type":"string"},"outputBody":{"type":"string"},"inputHeaders":{"type":"string"},"outputHeaders":{"type":"string"},"inputProperties":{"type":"string"},"outputProperties":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}},"errorType":{"type":"string"},"errorCategory":{"type":"string"},"rootCauseType":{"type":"string"},"rootCauseMessage":{"type":"string"},"traceId":{"type":"string"},"spanId":{"type":"string"}},"required":["applicationId","attributes","correlationId","diagramContentHash","durationMs","endTime","environment","errorCategory","errorMessage","errorStackTrace","errorType","exchangeId","executionId","inputBody","inputHeaders","inputProperties","instanceId","outputBody","outputHeaders","outputProperties","processors","rootCauseMessage","rootCauseType","routeId","spanId","startTime","status","traceId"]},"ProcessorNode":{"type":"object","properties":{"processorId":{"type":"string"},"processorType":{"type":"string"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"durationMs":{"type":"integer","format":"int64"},"errorMessage":{"type":"string"},"errorStackTrace":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}},"iteration":{"type":"integer","format":"int32"},"iterationSize":{"type":"integer","format":"int32"},"loopIndex":{"type":"integer","format":"int32"},"loopSize":{"type":"integer","format":"int32"},"splitIndex":{"type":"integer","format":"int32"},"splitSize":{"type":"integer","format":"int32"},"multicastIndex":{"type":"integer","format":"int32"},"resolvedEndpointUri":{"type":"string"},"errorType":{"type":"string"},"errorCategory":{"type":"string"},"rootCauseType":{"type":"string"},"rootCauseMessage":{"type":"string"},"errorHandlerType":{"type":"string"},"circuitBreakerState":{"type":"string"},"fallbackTriggered":{"type":"boolean"},"filterMatched":{"type":"boolean"},"duplicateMessage":{"type":"boolean"},"hasTraceData":{"type":"boolean"},"children":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorNode"}}},"required":["attributes","children","circuitBreakerState","duplicateMessage","durationMs","endTime","errorCategory","errorHandlerType","errorMessage","errorStackTrace","errorType","fallbackTriggered","filterMatched","hasTraceData","iteration","iterationSize","loopIndex","loopSize","multicastIndex","processorId","processorType","resolvedEndpointUri","rootCauseMessage","rootCauseType","splitIndex","splitSize","startTime","status"]},"ExecutionStats":{"type":"object","properties":{"totalCount":{"type":"integer","format":"int64"},"failedCount":{"type":"integer","format":"int64"},"avgDurationMs":{"type":"integer","format":"int64"},"p99LatencyMs":{"type":"integer","format":"int64"},"activeCount":{"type":"integer","format":"int64"},"totalToday":{"type":"integer","format":"int64"},"prevTotalCount":{"type":"integer","format":"int64"},"prevFailedCount":{"type":"integer","format":"int64"},"prevAvgDurationMs":{"type":"integer","format":"int64"},"prevP99LatencyMs":{"type":"integer","format":"int64"},"slaCompliance":{"type":"number","format":"double"}},"required":["activeCount","avgDurationMs","failedCount","p99LatencyMs","prevAvgDurationMs","prevFailedCount","prevP99LatencyMs","prevTotalCount","slaCompliance","totalCount","totalToday"]},"StatsTimeseries":{"type":"object","properties":{"buckets":{"type":"array","items":{"$ref":"#/components/schemas/TimeseriesBucket"}}},"required":["buckets"]},"TimeseriesBucket":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"totalCount":{"type":"integer","format":"int64"},"failedCount":{"type":"integer","format":"int64"},"avgDurationMs":{"type":"integer","format":"int64"},"p99DurationMs":{"type":"integer","format":"int64"},"activeCount":{"type":"integer","format":"int64"}},"required":["activeCount","avgDurationMs","failedCount","p99DurationMs","time","totalCount"]},"PunchcardCell":{"type":"object","properties":{"weekday":{"type":"integer","format":"int32"},"hour":{"type":"integer","format":"int32"},"totalCount":{"type":"integer","format":"int64"},"failedCount":{"type":"integer","format":"int64"}}},"AgentSummary":{"type":"object","description":"Summary of an agent instance for sidebar display","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"tps":{"type":"number","format":"double"}},"required":["id","name","status","tps"]},"AppCatalogEntry":{"type":"object","description":"Application catalog entry with routes and agents","properties":{"appId":{"type":"string"},"routes":{"type":"array","items":{"$ref":"#/components/schemas/RouteSummary"}},"agents":{"type":"array","items":{"$ref":"#/components/schemas/AgentSummary"}},"agentCount":{"type":"integer","format":"int32"},"health":{"type":"string"},"exchangeCount":{"type":"integer","format":"int64"}},"required":["agentCount","agents","appId","exchangeCount","health","routes"]},"RouteSummary":{"type":"object","description":"Summary of a route within an application","properties":{"routeId":{"type":"string"},"exchangeCount":{"type":"integer","format":"int64"},"lastSeen":{"type":"string","format":"date-time"},"fromEndpointUri":{"type":"string","description":"The from() endpoint URI, e.g. 'direct:processOrder'"},"routeState":{"type":"string","description":"Operational state of the route: stopped, suspended, or null (started/default)"}},"required":["exchangeCount","fromEndpointUri","lastSeen","routeId","routeState"]},"RouteMetrics":{"type":"object","description":"Aggregated route performance metrics","properties":{"routeId":{"type":"string"},"appId":{"type":"string"},"exchangeCount":{"type":"integer","format":"int64"},"successRate":{"type":"number","format":"double"},"avgDurationMs":{"type":"number","format":"double"},"p99DurationMs":{"type":"number","format":"double"},"errorRate":{"type":"number","format":"double"},"throughputPerSec":{"type":"number","format":"double"},"sparkline":{"type":"array","items":{"type":"number","format":"double"}},"slaCompliance":{"type":"number","format":"double"}},"required":["appId","avgDurationMs","errorRate","exchangeCount","p99DurationMs","routeId","slaCompliance","sparkline","successRate","throughputPerSec"]},"ProcessorMetrics":{"type":"object","properties":{"processorId":{"type":"string"},"processorType":{"type":"string"},"routeId":{"type":"string"},"appId":{"type":"string"},"totalCount":{"type":"integer","format":"int64"},"failedCount":{"type":"integer","format":"int64"},"avgDurationMs":{"type":"number","format":"double"},"p99DurationMs":{"type":"number","format":"double"},"errorRate":{"type":"number","format":"double"}},"required":["appId","avgDurationMs","errorRate","failedCount","p99DurationMs","processorId","processorType","routeId","totalCount"]},"LogEntryResponse":{"type":"object","description":"Application log entry","properties":{"timestamp":{"type":"string","description":"Log timestamp (ISO-8601)"},"level":{"type":"string","description":"Log level (INFO, WARN, ERROR, DEBUG, TRACE)"},"loggerName":{"type":"string","description":"Logger name"},"message":{"type":"string","description":"Log message"},"threadName":{"type":"string","description":"Thread name"},"stackTrace":{"type":"string","description":"Stack trace (if present)"},"exchangeId":{"type":"string","description":"Camel exchange ID (if present)"},"instanceId":{"type":"string","description":"Agent instance ID"},"application":{"type":"string","description":"Application ID"},"mdc":{"type":"object","additionalProperties":{"type":"string"},"description":"MDC context map"},"source":{"type":"string","description":"Log source: app or agent"}}},"LogSearchPageResponse":{"type":"object","description":"Log search response with cursor pagination and level counts","properties":{"data":{"type":"array","description":"Log entries for the current page","items":{"$ref":"#/components/schemas/LogEntryResponse"}},"nextCursor":{"type":"string","description":"Cursor for next page (null if no more results)"},"hasMore":{"type":"boolean","description":"Whether more results exist beyond this page"},"levelCounts":{"type":"object","additionalProperties":{"type":"integer","format":"int64"},"description":"Count of logs per level (unaffected by level filter)"}}},"TopError":{"type":"object","properties":{"errorType":{"type":"string"},"routeId":{"type":"string"},"processorId":{"type":"string"},"count":{"type":"integer","format":"int64"},"velocity":{"type":"number","format":"double"},"trend":{"type":"string"},"lastSeen":{"type":"string","format":"date-time"}}},"App":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"slug":{"type":"string"},"displayName":{"type":"string"},"containerConfig":{"type":"object","additionalProperties":{"type":"object"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"DiagramLayout":{"type":"object","properties":{"width":{"type":"number","format":"double"},"height":{"type":"number","format":"double"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/PositionedNode"}},"edges":{"type":"array","items":{"$ref":"#/components/schemas/PositionedEdge"}}}},"PositionedEdge":{"type":"object","properties":{"sourceId":{"type":"string"},"targetId":{"type":"string"},"label":{"type":"string"},"points":{"type":"array","items":{"type":"array","items":{"type":"number","format":"double"}}}}},"PositionedNode":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"x":{"type":"number","format":"double"},"y":{"type":"number","format":"double"},"width":{"type":"number","format":"double"},"height":{"type":"number","format":"double"},"endpointUri":{"type":"string"}}},"AppConfigResponse":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/ApplicationConfig"},"globalSensitiveKeys":{"type":"array","items":{"type":"string"}},"mergedSensitiveKeys":{"type":"array","items":{"type":"string"}}}},"UnreadCountResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64"},"bySeverity":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}}}},"AgentInstanceResponse":{"type":"object","description":"Agent instance summary with runtime metrics","properties":{"instanceId":{"type":"string"},"displayName":{"type":"string"},"applicationId":{"type":"string"},"environmentId":{"type":"string"},"status":{"type":"string"},"routeIds":{"type":"array","items":{"type":"string"}},"registeredAt":{"type":"string","format":"date-time"},"lastHeartbeat":{"type":"string","format":"date-time"},"version":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"tps":{"type":"number","format":"double"},"errorRate":{"type":"number","format":"double"},"activeRoutes":{"type":"integer","format":"int32"},"totalRoutes":{"type":"integer","format":"int32"},"uptimeSeconds":{"type":"integer","format":"int64"},"cpuUsage":{"type":"number","format":"double","description":"Recent average CPU usage (0.0–1.0), -1 if unavailable"}},"required":["activeRoutes","applicationId","capabilities","cpuUsage","displayName","environmentId","errorRate","instanceId","lastHeartbeat","registeredAt","routeIds","status","totalRoutes","tps","uptimeSeconds","version"]},"AgentMetricsResponse":{"type":"object","properties":{"metrics":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/MetricBucket"}}}},"required":["metrics"]},"MetricBucket":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"value":{"type":"number","format":"double"}},"required":["time","value"]},"AgentEventPageResponse":{"type":"object","description":"Cursor-paginated agent event list","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentEventResponse"}},"nextCursor":{"type":"string"},"hasMore":{"type":"boolean"}}},"AgentEventResponse":{"type":"object","description":"Agent lifecycle event","properties":{"id":{"type":"integer","format":"int64"},"instanceId":{"type":"string"},"applicationId":{"type":"string"},"eventType":{"type":"string"},"detail":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}},"required":["applicationId","detail","eventType","id","instanceId","timestamp"]},"CatalogApp":{"type":"object","description":"Unified catalog entry combining app records with live agent data","properties":{"slug":{"type":"string","description":"Application slug (universal identifier)"},"displayName":{"type":"string","description":"Display name"},"managed":{"type":"boolean","description":"True if a managed App record exists in the database"},"environmentSlug":{"type":"string","description":"Environment slug"},"health":{"type":"string","description":"Composite health: deployment status + agent health"},"healthTooltip":{"type":"string","description":"Human-readable tooltip explaining the health state"},"agentCount":{"type":"integer","format":"int32","description":"Number of connected agents"},"routes":{"type":"array","description":"Live routes from agents","items":{"$ref":"#/components/schemas/RouteSummary"}},"agents":{"type":"array","description":"Connected agent summaries","items":{"$ref":"#/components/schemas/AgentSummary"}},"exchangeCount":{"type":"integer","format":"int64","description":"Total exchange count from ClickHouse"},"deployment":{"$ref":"#/components/schemas/DeploymentSummary","description":"Active deployment info, null if no deployment"}}},"DeploymentSummary":{"type":"object","properties":{"status":{"type":"string"},"replicas":{"type":"string"},"version":{"type":"integer","format":"int32"}}},"OidcPublicConfigResponse":{"type":"object","description":"OIDC configuration for SPA login flow","properties":{"issuer":{"type":"string"},"clientId":{"type":"string"},"authorizationEndpoint":{"type":"string"},"endSessionEndpoint":{"type":"string","description":"Present if the provider supports RP-initiated logout"},"resource":{"type":"string","description":"RFC 8707 resource indicator for the authorization request"},"additionalScopes":{"type":"array","description":"Additional scopes to request beyond openid email profile","items":{"type":"string"}}},"required":["authorizationEndpoint","clientId","issuer"]},"GroupSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"RoleSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"system":{"type":"boolean"},"source":{"type":"string"}}},"UserDetail":{"type":"object","properties":{"userId":{"type":"string"},"provider":{"type":"string"},"email":{"type":"string"},"displayName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"directRoles":{"type":"array","items":{"$ref":"#/components/schemas/RoleSummary"}},"directGroups":{"type":"array","items":{"$ref":"#/components/schemas/GroupSummary"}},"effectiveRoles":{"type":"array","items":{"$ref":"#/components/schemas/RoleSummary"}},"effectiveGroups":{"type":"array","items":{"$ref":"#/components/schemas/GroupSummary"}}}},"SseEmitter":{"type":"object","properties":{"timeout":{"type":"integer","format":"int64"}}},"UsageStats":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"integer","format":"int64"},"avgDurationMs":{"type":"integer","format":"int64"}}},"SensitiveKeysConfig":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"}}}},"RoleDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string"},"system":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"assignedGroups":{"type":"array","items":{"$ref":"#/components/schemas/GroupSummary"}},"directUsers":{"type":"array","items":{"$ref":"#/components/schemas/UserSummary"}},"effectivePrincipals":{"type":"array","items":{"$ref":"#/components/schemas/UserSummary"}}}},"UserSummary":{"type":"object","properties":{"userId":{"type":"string"},"displayName":{"type":"string"},"provider":{"type":"string"}}},"RbacStats":{"type":"object","properties":{"userCount":{"type":"integer","format":"int32"},"activeUserCount":{"type":"integer","format":"int32"},"groupCount":{"type":"integer","format":"int32"},"maxGroupDepth":{"type":"integer","format":"int32"},"roleCount":{"type":"integer","format":"int32"}}},"LicenseInfo":{"type":"object","properties":{"tier":{"type":"string"},"features":{"type":"array","items":{"type":"string","enum":["topology","lineage","correlation","debugger","replay"]},"uniqueItems":true},"limits":{"type":"object","additionalProperties":{"type":"integer","format":"int32"}},"issuedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"expired":{"type":"boolean"}}},"GroupDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"parentGroupId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"directRoles":{"type":"array","items":{"$ref":"#/components/schemas/RoleSummary"}},"effectiveRoles":{"type":"array","items":{"$ref":"#/components/schemas/RoleSummary"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/UserSummary"}},"childGroups":{"type":"array","items":{"$ref":"#/components/schemas/GroupSummary"}}}},"TableSizeResponse":{"type":"object","description":"Table size and row count information","properties":{"tableName":{"type":"string","description":"Table name"},"rowCount":{"type":"integer","format":"int64","description":"Approximate row count"},"dataSize":{"type":"string","description":"Human-readable data size"},"indexSize":{"type":"string","description":"Human-readable index size"},"dataSizeBytes":{"type":"integer","format":"int64","description":"Data size in bytes"},"indexSizeBytes":{"type":"integer","format":"int64","description":"Index size in bytes"}}},"DatabaseStatusResponse":{"type":"object","description":"Database connection and version status","properties":{"connected":{"type":"boolean","description":"Whether the database is reachable"},"version":{"type":"string","description":"PostgreSQL version string"},"host":{"type":"string","description":"Database host"},"schema":{"type":"string","description":"Current schema"}}},"ActiveQueryResponse":{"type":"object","description":"Currently running database query","properties":{"pid":{"type":"integer","format":"int32","description":"Backend process ID"},"durationSeconds":{"type":"number","format":"double","description":"Query duration in seconds"},"state":{"type":"string","description":"Backend state (active, idle, etc.)"},"query":{"type":"string","description":"SQL query text"}}},"ConnectionPoolResponse":{"type":"object","description":"HikariCP connection pool statistics","properties":{"activeConnections":{"type":"integer","format":"int32","description":"Number of currently active connections"},"idleConnections":{"type":"integer","format":"int32","description":"Number of idle connections"},"pendingThreads":{"type":"integer","format":"int32","description":"Number of threads waiting for a connection"},"maxWaitMs":{"type":"integer","format":"int64","description":"Maximum wait time in milliseconds"},"maxPoolSize":{"type":"integer","format":"int32","description":"Maximum pool size"}}},"ClickHouseTableInfo":{"type":"object","description":"ClickHouse table information","properties":{"name":{"type":"string"},"engine":{"type":"string"},"rowCount":{"type":"integer","format":"int64"},"dataSize":{"type":"string"},"dataSizeBytes":{"type":"integer","format":"int64"},"partitionCount":{"type":"integer","format":"int32"}}},"ClickHouseStatusResponse":{"type":"object","description":"ClickHouse cluster status","properties":{"reachable":{"type":"boolean"},"version":{"type":"string"},"uptime":{"type":"string"},"host":{"type":"string"}}},"ClickHouseQueryInfo":{"type":"object","description":"Active ClickHouse query information","properties":{"queryId":{"type":"string"},"elapsedSeconds":{"type":"number","format":"double"},"memory":{"type":"string"},"readRows":{"type":"integer","format":"int64"},"query":{"type":"string"}}},"IndexerPipelineResponse":{"type":"object","description":"Search indexer pipeline statistics","properties":{"queueDepth":{"type":"integer","format":"int32"},"maxQueueSize":{"type":"integer","format":"int32"},"failedCount":{"type":"integer","format":"int64"},"indexedCount":{"type":"integer","format":"int64"},"debounceMs":{"type":"integer","format":"int64"},"indexingRate":{"type":"number","format":"double"},"lastIndexedAt":{"type":"string","format":"date-time"}}},"ClickHousePerformanceResponse":{"type":"object","description":"ClickHouse storage and performance metrics","properties":{"diskSize":{"type":"string"},"uncompressedSize":{"type":"string"},"compressionRatio":{"type":"number","format":"double"},"totalRows":{"type":"integer","format":"int64"},"partCount":{"type":"integer","format":"int32"},"memoryUsage":{"type":"string"},"currentQueries":{"type":"integer","format":"int32"}}},"AuditLogPageResponse":{"type":"object","description":"Paginated audit log entries","properties":{"items":{"type":"array","description":"Audit log entries","items":{"$ref":"#/components/schemas/AuditRecord"}},"totalCount":{"type":"integer","format":"int64","description":"Total number of matching entries"},"page":{"type":"integer","format":"int32","description":"Current page number (0-based)"},"pageSize":{"type":"integer","format":"int32","description":"Page size"},"totalPages":{"type":"integer","format":"int32","description":"Total number of pages"}}},"AuditRecord":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"timestamp":{"type":"string","format":"date-time"},"username":{"type":"string"},"action":{"type":"string"},"category":{"type":"string","enum":["INFRA","AUTH","USER_MGMT","CONFIG","RBAC","AGENT","OUTBOUND_CONNECTION_CHANGE","OUTBOUND_HTTP_TRUST_CHANGE","ALERT_RULE_CHANGE","ALERT_SILENCE_CHANGE"]},"target":{"type":"string"},"detail":{"type":"object","additionalProperties":{"type":"object"}},"result":{"type":"string","enum":["SUCCESS","FAILURE"]},"ipAddress":{"type":"string"},"userAgent":{"type":"string"}}}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}}} \ No newline at end of file +{"openapi":"3.1.0","info":{"title":"Cameleer Server API","version":"1.0"},"servers":[{"url":"/api/v1","description":"Relative"}],"security":[{"bearer":[]}],"tags":[{"name":"Route Metrics","description":"Route performance metrics (env-scoped)"},{"name":"Database Admin","description":"Database monitoring and management (ADMIN only)"},{"name":"Threshold Admin","description":"Monitoring threshold configuration (ADMIN only)"},{"name":"Agent Commands","description":"Command push endpoints for agent communication"},{"name":"Agent List","description":"List registered agents in an environment"},{"name":"Sensitive Keys Admin","description":"Global sensitive key masking configuration (ADMIN only)"},{"name":"License Admin","description":"License management"},{"name":"Role Admin","description":"Role management (ADMIN only)"},{"name":"RBAC Stats","description":"RBAC statistics (ADMIN only)"},{"name":"OIDC Config Admin","description":"OIDC provider configuration (ADMIN only)"},{"name":"Alerts Inbox","description":"In-app alert inbox, ack and read tracking (env-scoped)"},{"name":"Application Config","description":"Per-application observability configuration (user-facing)"},{"name":"App Management","description":"Application lifecycle and JAR uploads (env-scoped)"},{"name":"Catalog","description":"Unified application catalog"},{"name":"ClickHouse Admin","description":"ClickHouse monitoring and diagnostics (ADMIN only)"},{"name":"Alert Silences","description":"Alert silence management (env-scoped)"},{"name":"Ingestion","description":"Data ingestion endpoints"},{"name":"Group Admin","description":"Group management (ADMIN only)"},{"name":"Usage Analytics","description":"UI usage pattern analytics"},{"name":"Alert Notifications","description":"Outbound webhook notification management"},{"name":"Deployment Management","description":"Deploy, stop, promote, and view logs"},{"name":"Detail","description":"Execution detail and processor snapshot endpoints"},{"name":"Outbound Connections Admin","description":"Admin-managed outbound HTTPS destinations"},{"name":"Agent Config","description":"Agent-authoritative config read (AGENT only)"},{"name":"User Admin","description":"User management (ADMIN only)"},{"name":"Agent Management","description":"Agent registration and lifecycle endpoints"},{"name":"Authentication","description":"Login and token refresh endpoints"},{"name":"Agent Events","description":"Agent lifecycle event log (env-scoped)"},{"name":"Route Catalog","description":"Route catalog and discovery (env-scoped)"},{"name":"Application Logs","description":"Query application logs (env-scoped)"},{"name":"Agent SSE","description":"Server-Sent Events endpoint for agent communication"},{"name":"Search","description":"Transaction search and stats (env-scoped)"},{"name":"Audit Log","description":"Audit log viewer (ADMIN only)"},{"name":"Claim Mapping Admin","description":"Manage OIDC claim-to-role/group mapping rules"},{"name":"Diagrams","description":"Diagram rendering endpoints"},{"name":"Environment Admin","description":"Environment management (ADMIN only)"},{"name":"App Settings","description":"Per-application dashboard settings (ADMIN/OPERATOR)"},{"name":"Alert Rules","description":"Alert rule management (env-scoped)"}],"paths":{"/environments/{envSlug}/apps/{appSlug}/settings":{"get":{"tags":["App Settings"],"summary":"Get settings for an application in this environment (returns defaults if not configured)","operationId":"getByAppId","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppSettings"}}}}}},"put":{"tags":["App Settings"],"summary":"Create or update settings for an application in this environment","operationId":"update","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppSettingsRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppSettings"}}}}}},"delete":{"tags":["App Settings"],"summary":"Delete application settings for this environment (reverts to defaults)","operationId":"delete","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/environments/{envSlug}/apps/{appSlug}/container-config":{"put":{"tags":["App Management"],"summary":"Update container config for this app","operationId":"updateContainerConfig","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}},"required":true},"responses":{"200":{"description":"Container config updated","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Invalid configuration","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"App not found in this environment","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/config":{"get":{"tags":["Application Config"],"summary":"Get application config for this environment","description":"Returns stored config merged with global sensitive keys. Falls back to defaults if no row is persisted yet.","operationId":"getConfig","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Config returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppConfigResponse"}}}}}},"put":{"tags":["Application Config"],"summary":"Update application config for this environment","description":"Saves config and pushes CONFIG_UPDATE to LIVE agents of this application in the given environment","operationId":"updateConfig","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationConfig"}}},"required":true},"responses":{"200":{"description":"Config saved and pushed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConfigUpdateResponse"}}}}}}},"/environments/{envSlug}/alerts/silences/{id}":{"put":{"tags":["Alert Silences"],"operationId":"update_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertSilenceRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertSilenceResponse"}}}}}},"delete":{"tags":["Alert Silences"],"operationId":"delete_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/environments/{envSlug}/alerts/rules/{id}":{"get":{"tags":["Alert Rules"],"operationId":"get","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}},"put":{"tags":["Alert Rules"],"operationId":"update_2","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}},"delete":{"tags":["Alert Rules"],"operationId":"delete_2","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/admin/users/{userId}":{"get":{"tags":["User Admin"],"summary":"Get user by ID with RBAC detail","operationId":"getUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"User found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}},"404":{"description":"User not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}}}},"put":{"tags":["User Admin"],"summary":"Update user display name or email","operationId":"updateUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequest"}}},"required":true},"responses":{"200":{"description":"User updated"},"404":{"description":"User not found"}}},"delete":{"tags":["User Admin"],"summary":"Delete user","operationId":"deleteUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"User deleted"},"409":{"description":"Cannot delete the last admin user"}}}},"/admin/thresholds":{"get":{"tags":["Threshold Admin"],"summary":"Get current threshold configuration","operationId":"getThresholds","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ThresholdConfig"}}}}}},"put":{"tags":["Threshold Admin"],"summary":"Update threshold configuration","operationId":"updateThresholds","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThresholdConfigRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ThresholdConfig"}}}}}}},"/admin/sensitive-keys":{"get":{"tags":["Sensitive Keys Admin"],"summary":"Get global sensitive keys configuration","operationId":"getSensitiveKeys","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SensitiveKeysConfig"}}}}}},"put":{"tags":["Sensitive Keys Admin"],"summary":"Update global sensitive keys configuration","description":"Saves the global sensitive keys. Optionally fans out merged keys to all live agents.","operationId":"updateSensitiveKeys","parameters":[{"name":"pushToAgents","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensitiveKeysRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SensitiveKeysResponse"}}}}}}},"/admin/roles/{id}":{"get":{"tags":["Role Admin"],"summary":"Get role by ID with effective principals","operationId":"getRole","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Role found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RoleDetail"}}}},"404":{"description":"Role not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RoleDetail"}}}}}},"put":{"tags":["Role Admin"],"summary":"Update a custom role","operationId":"updateRole","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleRequest"}}},"required":true},"responses":{"200":{"description":"Role updated"},"403":{"description":"Cannot modify system role"},"404":{"description":"Role not found"}}},"delete":{"tags":["Role Admin"],"summary":"Delete a custom role","operationId":"deleteRole","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Role deleted"},"403":{"description":"Cannot delete system role"},"404":{"description":"Role not found"}}}},"/admin/outbound-connections/{id}":{"get":{"tags":["Outbound Connections Admin"],"operationId":"get_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundConnectionDto"}}}}}},"put":{"tags":["Outbound Connections Admin"],"operationId":"update_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundConnectionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundConnectionDto"}}}}}},"delete":{"tags":["Outbound Connections Admin"],"operationId":"delete_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/admin/oidc":{"get":{"tags":["OIDC Config Admin"],"summary":"Get OIDC configuration","operationId":"getConfig_1","responses":{"200":{"description":"Current OIDC configuration (client_secret masked)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcAdminConfigResponse"}}}}}},"put":{"tags":["OIDC Config Admin"],"summary":"Save OIDC configuration","operationId":"saveConfig","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OidcAdminConfigRequest"}}},"required":true},"responses":{"200":{"description":"Configuration saved","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcAdminConfigResponse"}}}},"400":{"description":"Invalid configuration","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["OIDC Config Admin"],"summary":"Delete OIDC configuration","operationId":"deleteConfig","responses":{"204":{"description":"Configuration deleted"}}}},"/admin/groups/{id}":{"get":{"tags":["Group Admin"],"summary":"Get group by ID with effective roles","operationId":"getGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Group found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/GroupDetail"}}}},"404":{"description":"Group not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/GroupDetail"}}}}}},"put":{"tags":["Group Admin"],"summary":"Update group name or parent","operationId":"updateGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGroupRequest"}}},"required":true},"responses":{"200":{"description":"Group updated"},"404":{"description":"Group not found"},"409":{"description":"Cycle detected in group hierarchy"}}},"delete":{"tags":["Group Admin"],"summary":"Delete group","operationId":"deleteGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Group deleted"},"404":{"description":"Group not found"}}}},"/admin/environments/{envSlug}":{"get":{"tags":["Environment Admin"],"summary":"Get environment by slug","operationId":"getEnvironment","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Environment found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Environment"}}}}}},"put":{"tags":["Environment Admin"],"summary":"Update an environment's mutable fields (displayName, production, enabled)","description":"Slug is immutable after creation and cannot be changed. Any slug field in the request body is ignored.","operationId":"updateEnvironment","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnvironmentRequest"}}},"required":true},"responses":{"200":{"description":"Environment updated","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}},"delete":{"tags":["Environment Admin"],"summary":"Delete an environment","operationId":"deleteEnvironment","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Environment deleted","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Cannot delete default environment","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/environments/{envSlug}/jar-retention":{"put":{"tags":["Environment Admin"],"summary":"Update JAR retention policy for an environment","operationId":"updateJarRetention","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JarRetentionRequest"}}},"required":true},"responses":{"200":{"description":"Retention policy updated","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/environments/{envSlug}/default-container-config":{"put":{"tags":["Environment Admin"],"summary":"Update default container config for an environment","operationId":"updateDefaultContainerConfig","parameters":[{"name":"envSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object"}}}},"required":true},"responses":{"200":{"description":"Default container config updated","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Invalid configuration","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/claim-mappings/{id}":{"get":{"tags":["Claim Mapping Admin"],"summary":"Get a claim mapping rule by ID","operationId":"get_2","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClaimMappingRule"}}}}}},"put":{"tags":["Claim Mapping Admin"],"summary":"Update a claim mapping rule","operationId":"update_4","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClaimMappingRule"}}}}}},"delete":{"tags":["Claim Mapping Admin"],"summary":"Delete a claim mapping rule","operationId":"delete_4","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/environments/{envSlug}/executions/search":{"post":{"tags":["Search"],"summary":"Advanced search with all filters","description":"Env from the path overrides any environment field in the body.","operationId":"searchPost","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SearchResultExecutionSummary"}}}}}}},"/environments/{envSlug}/apps":{"get":{"tags":["App Management"],"summary":"List apps in this environment","operationId":"listApps","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"App list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/App"}}}}}}},"post":{"tags":["App Management"],"summary":"Create a new app in this environment","description":"Slug must match ^[a-z0-9][a-z0-9-]{0,63}$ and be unique within the environment. Slug is immutable after creation.","operationId":"createApp","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAppRequest"}}},"required":true},"responses":{"201":{"description":"App created","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Invalid slug, or slug already exists in this environment","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/versions":{"get":{"tags":["App Management"],"summary":"List versions for this app","operationId":"listVersions","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Version list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppVersion"}}}}}}},"post":{"tags":["App Management"],"summary":"Upload a JAR for a new version of this app","operationId":"uploadJar","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"env":{"$ref":"#/components/schemas/Environment"},"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"responses":{"201":{"description":"JAR uploaded and version created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppVersion"}}}},"404":{"description":"App not found in this environment","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppVersion"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments":{"get":{"tags":["Deployment Management"],"summary":"List deployments for this app in this environment","operationId":"listDeployments","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deployment list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Deployment"}}}}}}},"post":{"tags":["Deployment Management"],"summary":"Create and start a new deployment for this app in this environment","operationId":"deploy","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployRequest"}}},"required":true},"responses":{"202":{"description":"Deployment accepted and starting","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments/{deploymentId}/stop":{"post":{"tags":["Deployment Management"],"summary":"Stop a running deployment","operationId":"stop","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deployment stopped","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"404":{"description":"Deployment not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments/{deploymentId}/promote":{"post":{"tags":["Deployment Management"],"summary":"Promote this deployment to a different environment","description":"Target environment is specified by slug in the request body. The same app slug must exist in the target environment (or be created separately first).","operationId":"promote","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteRequest"}}},"required":true},"responses":{"202":{"description":"Promotion accepted and starting","content":{"*/*":{"schema":{"type":"object"}}}},"404":{"description":"Deployment or target environment not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/config/test-expression":{"post":{"tags":["Application Config"],"summary":"Test a tap expression against sample data via a live agent in this environment","operationId":"testExpression","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestExpressionRequest"}}},"required":true},"responses":{"200":{"description":"Expression evaluated successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestExpressionResponse"}}}},"404":{"description":"No live agent available for this application in this environment","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestExpressionResponse"}}}},"504":{"description":"Agent did not respond in time","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestExpressionResponse"}}}}}}},"/environments/{envSlug}/alerts/{id}/read":{"post":{"tags":["Alerts Inbox"],"operationId":"read","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/environments/{envSlug}/alerts/{id}/ack":{"post":{"tags":["Alerts Inbox"],"operationId":"ack","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertDto"}}}}}}},"/environments/{envSlug}/alerts/silences":{"get":{"tags":["Alert Silences"],"operationId":"list","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertSilenceResponse"}}}}}}},"post":{"tags":["Alert Silences"],"operationId":"create","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertSilenceRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertSilenceResponse"}}}}}}},"/environments/{envSlug}/alerts/rules":{"get":{"tags":["Alert Rules"],"operationId":"list_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}}},"post":{"tags":["Alert Rules"],"operationId":"create_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}}},"/environments/{envSlug}/alerts/rules/{id}/test-evaluate":{"post":{"tags":["Alert Rules"],"operationId":"testEvaluate","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestEvaluateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestEvaluateResponse"}}}}}}},"/environments/{envSlug}/alerts/rules/{id}/render-preview":{"post":{"tags":["Alert Rules"],"operationId":"renderPreview","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderPreviewRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RenderPreviewResponse"}}}}}}},"/environments/{envSlug}/alerts/rules/{id}/enable":{"post":{"tags":["Alert Rules"],"operationId":"enable","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}}},"/environments/{envSlug}/alerts/rules/{id}/disable":{"post":{"tags":["Alert Rules"],"operationId":"disable","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}}}}},"/environments/{envSlug}/alerts/bulk-read":{"post":{"tags":["Alerts Inbox"],"operationId":"bulkRead","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReadRequest"}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/data/metrics":{"post":{"tags":["Ingestion"],"summary":"Ingest agent metrics","description":"Accepts an array of MetricsSnapshot objects","operationId":"ingestMetrics","requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"202":{"description":"Data accepted for processing"},"400":{"description":"Invalid payload"},"503":{"description":"Buffer full, retry later"}}}},"/data/logs":{"post":{"tags":["Ingestion"],"summary":"Ingest application log entries","description":"Accepts a batch of log entries from an agent. Entries are buffered and flushed periodically.","operationId":"ingestLogs","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogEntry"}}}},"required":true},"responses":{"202":{"description":"Logs accepted for indexing"}}}},"/data/executions":{"post":{"tags":["Ingestion"],"summary":"Ingest execution chunk","operationId":"ingestChunks","requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/data/events":{"post":{"tags":["Ingestion"],"summary":"Ingest agent events","operationId":"ingestEvents","requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/data/diagrams":{"post":{"tags":["Ingestion"],"summary":"Ingest route diagram data","description":"Accepts a single RouteGraph or an array of RouteGraphs","operationId":"ingestDiagrams","requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"202":{"description":"Data accepted for processing"}}}},"/auth/refresh":{"post":{"tags":["Authentication"],"summary":"Refresh access token","operationId":"refresh","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Token refreshed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}},"401":{"description":"Invalid refresh token","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/auth/oidc/callback":{"post":{"tags":["Authentication"],"summary":"Exchange OIDC authorization code for JWTs","operationId":"callback","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallbackRequest"}}},"required":true},"responses":{"200":{"description":"Authentication successful","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}},"401":{"description":"OIDC authentication failed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Account not provisioned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"OIDC not configured or disabled","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}}}}},"/auth/login":{"post":{"tags":["Authentication"],"summary":"Login with local credentials","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Login successful","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}},"401":{"description":"Invalid credentials","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Account locked due to too many failed attempts","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}}}}},"/alerts/notifications/{id}/retry":{"post":{"tags":["Alert Notifications"],"operationId":"retry","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertNotificationDto"}}}}}}},"/agents/{id}/replay":{"post":{"tags":["Agent Commands"],"summary":"Replay an exchange on a specific agent (synchronous)","description":"Sends a replay command and waits for the agent to complete the replay. Returns the replay result including status, replayExchangeId, and duration.","operationId":"replayExchange","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayRequest"}}},"required":true},"responses":{"200":{"description":"Replay completed (check status for success/failure)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ReplayResponse"}}}},"404":{"description":"Agent not found or not connected","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ReplayResponse"}}}},"504":{"description":"Agent did not respond in time","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ReplayResponse"}}}}}}},"/agents/{id}/refresh":{"post":{"tags":["Agent Management"],"summary":"Refresh access token","description":"Issues a new access JWT from a valid refresh token","operationId":"refresh_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRefreshRequest"}}},"required":true},"responses":{"200":{"description":"New access token issued","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRefreshResponse"}}}},"401":{"description":"Invalid or expired refresh token","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRefreshResponse"}}}},"404":{"description":"Agent not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRefreshResponse"}}}}}}},"/agents/{id}/heartbeat":{"post":{"tags":["Agent Management"],"summary":"Agent heartbeat ping","description":"Updates the agent's last heartbeat timestamp. Auto-registers the agent if not in registry (e.g. after server restart).","operationId":"heartbeat","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatRequest"}}}},"responses":{"200":{"description":"Heartbeat accepted"}}}},"/agents/{id}/deregister":{"post":{"tags":["Agent Management"],"summary":"Deregister agent","description":"Removes the agent from the registry. Called by agents during graceful shutdown.","operationId":"deregister","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent deregistered"},"404":{"description":"Agent not registered"}}}},"/agents/{id}/commands":{"post":{"tags":["Agent Commands"],"summary":"Send command to a specific agent","description":"Sends a command to the specified agent via SSE","operationId":"sendCommand","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandRequest"}}},"required":true},"responses":{"202":{"description":"Command accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandSingleResponse"}}}},"400":{"description":"Invalid command payload","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandSingleResponse"}}}},"404":{"description":"Agent not registered","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandSingleResponse"}}}}}}},"/agents/{id}/commands/{commandId}/ack":{"post":{"tags":["Agent Commands"],"summary":"Acknowledge command receipt","description":"Agent acknowledges that it has received and processed a command, with result status and message","operationId":"acknowledgeCommand","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commandId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAckRequest"}}}},"responses":{"200":{"description":"Command acknowledged"},"404":{"description":"Command not found"}}}},"/agents/register":{"post":{"tags":["Agent Management"],"summary":"Register an agent","description":"Registers a new agent or re-registers an existing one. Requires bootstrap token in Authorization header.","operationId":"register","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistrationRequest"}}},"required":true},"responses":{"200":{"description":"Agent registered successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRegistrationResponse"}}}},"400":{"description":"Invalid registration payload","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid bootstrap token","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentRegistrationResponse"}}}}}}},"/agents/groups/{group}/commands":{"post":{"tags":["Agent Commands"],"summary":"Send command to all agents in a group","description":"Sends a command to all LIVE agents in the specified group and waits for responses","operationId":"sendGroupCommand","parameters":[{"name":"group","in":"path","required":true,"schema":{"type":"string"}},{"name":"environment","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandRequest"}}},"required":true},"responses":{"200":{"description":"Commands dispatched and responses collected","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandGroupResponse"}}}},"400":{"description":"Invalid command payload","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandGroupResponse"}}}}}}},"/agents/commands":{"post":{"tags":["Agent Commands"],"summary":"Broadcast command to all live agents","description":"Sends a command to all agents currently in LIVE state","operationId":"broadcastCommand","parameters":[{"name":"environment","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandRequest"}}},"required":true},"responses":{"202":{"description":"Commands accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandBroadcastResponse"}}}},"400":{"description":"Invalid command payload","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandBroadcastResponse"}}}}}}},"/admin/users":{"get":{"tags":["User Admin"],"summary":"List all users with RBAC detail","operationId":"listUsers","responses":{"200":{"description":"User list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserDetail"}}}}}}},"post":{"tags":["User Admin"],"summary":"Create a local user","operationId":"createUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequest"}}},"required":true},"responses":{"200":{"description":"User created","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Disabled in OIDC mode","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/users/{userId}/roles/{roleId}":{"post":{"tags":["User Admin"],"summary":"Assign a role to a user","operationId":"assignRoleToUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Role assigned"},"404":{"description":"User or role not found"}}},"delete":{"tags":["User Admin"],"summary":"Remove a role from a user","operationId":"removeRoleFromUser","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Role removed"}}}},"/admin/users/{userId}/password":{"post":{"tags":["User Admin"],"summary":"Reset user password","operationId":"resetPassword","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPasswordRequest"}}},"required":true},"responses":{"204":{"description":"Password reset"},"400":{"description":"Disabled in OIDC mode or policy violation"}}}},"/admin/users/{userId}/groups/{groupId}":{"post":{"tags":["User Admin"],"summary":"Add a user to a group","operationId":"addUserToGroup","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User added to group"}}},"delete":{"tags":["User Admin"],"summary":"Remove a user from a group","operationId":"removeUserFromGroup","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"User removed from group"}}}},"/admin/roles":{"get":{"tags":["Role Admin"],"summary":"List all roles (system and custom)","operationId":"listRoles","responses":{"200":{"description":"Role list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleDetail"}}}}}}},"post":{"tags":["Role Admin"],"summary":"Create a custom role","operationId":"createRole","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoleRequest"}}},"required":true},"responses":{"200":{"description":"Role created","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string","format":"uuid"}}}}}}}},"/admin/outbound-connections":{"get":{"tags":["Outbound Connections Admin"],"operationId":"list_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutboundConnectionDto"}}}}}}},"post":{"tags":["Outbound Connections Admin"],"operationId":"create_2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundConnectionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundConnectionDto"}}}}}}},"/admin/outbound-connections/{id}/test":{"post":{"tags":["Outbound Connections Admin"],"operationId":"test","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundConnectionTestResult"}}}}}}},"/admin/oidc/test":{"post":{"tags":["OIDC Config Admin"],"summary":"Test OIDC provider connectivity","operationId":"testConnection","responses":{"200":{"description":"Provider reachable","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcTestResult"}}}},"400":{"description":"Provider unreachable or misconfigured","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/license":{"get":{"tags":["License Admin"],"summary":"Get current license info","operationId":"getCurrent","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/LicenseInfo"}}}}}},"post":{"tags":["License Admin"],"summary":"Update license token at runtime","operationId":"update_5","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLicenseRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/groups":{"get":{"tags":["Group Admin"],"summary":"List all groups with hierarchy and effective roles","operationId":"listGroups","responses":{"200":{"description":"Group list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupDetail"}}}}}}},"post":{"tags":["Group Admin"],"summary":"Create a new group","operationId":"createGroup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupRequest"}}},"required":true},"responses":{"200":{"description":"Group created","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string","format":"uuid"}}}}}}}},"/admin/groups/{id}/roles/{roleId}":{"post":{"tags":["Group Admin"],"summary":"Assign a role to a group","operationId":"assignRoleToGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Role assigned to group"},"404":{"description":"Group not found"}}},"delete":{"tags":["Group Admin"],"summary":"Remove a role from a group","operationId":"removeRoleFromGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Role removed from group"},"404":{"description":"Group not found"}}}},"/admin/environments":{"get":{"tags":["Environment Admin"],"summary":"List all environments","operationId":"listEnvironments","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Environment"}}}}}}},"post":{"tags":["Environment Admin"],"summary":"Create a new environment","operationId":"createEnvironment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnvironmentRequest"}}},"required":true},"responses":{"201":{"description":"Environment created","content":{"*/*":{"schema":{"type":"object"}}}},"400":{"description":"Invalid slug or slug already exists","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/admin/database/queries/{pid}/kill":{"post":{"tags":["Database Admin"],"summary":"Terminate a query by PID","operationId":"killQuery","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK"}}}},"/admin/claim-mappings":{"get":{"tags":["Claim Mapping Admin"],"summary":"List all claim mapping rules","operationId":"list_3","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClaimMappingRule"}}}}}}},"post":{"tags":["Claim Mapping Admin"],"summary":"Create a claim mapping rule","operationId":"create_3","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClaimMappingRule"}}}}}}},"/admin/claim-mappings/test":{"post":{"tags":["Claim Mapping Admin"],"summary":"Test claim mapping rules against a set of claims (accepts unsaved rules)","operationId":"test_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TestResponse"}}}}}}},"/executions/{executionId}":{"get":{"tags":["Detail"],"summary":"Get execution detail with nested processor tree","operationId":"getDetail","parameters":[{"name":"executionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Execution detail found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ExecutionDetail"}}}},"404":{"description":"Execution not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ExecutionDetail"}}}}}}},"/executions/{executionId}/processors/{index}/snapshot":{"get":{"tags":["Detail"],"summary":"Get exchange snapshot for a specific processor by index","operationId":"getProcessorSnapshot","parameters":[{"name":"executionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Snapshot data","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"404":{"description":"Snapshot not found","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/executions/{executionId}/processors/by-seq/{seq}/snapshot":{"get":{"tags":["Detail"],"summary":"Get exchange snapshot for a processor by seq number","operationId":"processorSnapshotBySeq","parameters":[{"name":"executionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"seq","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Snapshot data","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"404":{"description":"Snapshot not found","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/executions/{executionId}/processors/by-id/{processorId}/snapshot":{"get":{"tags":["Detail"],"summary":"Get exchange snapshot for a specific processor by processorId","operationId":"processorSnapshotById","parameters":[{"name":"executionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"processorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Snapshot data","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"404":{"description":"Snapshot not found","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/environments/{envSlug}/stats":{"get":{"tags":["Search"],"summary":"Aggregate execution stats (P99 latency, active count, SLA compliance)","operationId":"stats","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"routeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ExecutionStats"}}}}}}},"/environments/{envSlug}/stats/timeseries":{"get":{"tags":["Search"],"summary":"Bucketed time-series stats over a time window","operationId":"timeseries","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"buckets","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":24}},{"name":"routeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatsTimeseries"}}}}}}},"/environments/{envSlug}/stats/timeseries/by-route":{"get":{"tags":["Search"],"summary":"Timeseries grouped by route for an application","operationId":"timeseriesByRoute","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"buckets","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":24}},{"name":"application","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/StatsTimeseries"}}}}}}}},"/environments/{envSlug}/stats/timeseries/by-app":{"get":{"tags":["Search"],"summary":"Timeseries grouped by application","operationId":"timeseriesByApp","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"buckets","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":24}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/StatsTimeseries"}}}}}}}},"/environments/{envSlug}/stats/punchcard":{"get":{"tags":["Search"],"summary":"Transaction punchcard: weekday x hour grid (rolling 7 days)","operationId":"punchcard","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PunchcardCell"}}}}}}}},"/environments/{envSlug}/routes":{"get":{"tags":["Route Catalog"],"summary":"Get route catalog for this environment","description":"Returns all applications with their routes, agents, and health status — filtered to this environment","operationId":"getCatalog","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Catalog returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppCatalogEntry"}}}}}}}},"/environments/{envSlug}/routes/metrics":{"get":{"tags":["Route Metrics"],"summary":"Get route metrics for this environment","description":"Returns aggregated performance metrics per route for the given time window. Optional appId filter narrows to a single application.","operationId":"getMetrics","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"appId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Metrics returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RouteMetrics"}}}}}}}},"/environments/{envSlug}/routes/metrics/processors":{"get":{"tags":["Route Metrics"],"summary":"Get processor metrics for this environment","description":"Returns aggregated performance metrics per processor for the given route and time window","operationId":"getProcessorMetrics","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"routeId","in":"query","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Metrics returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorMetrics"}}}}}}}},"/environments/{envSlug}/logs":{"get":{"tags":["Application Logs"],"summary":"Search application log entries in this environment","description":"Cursor-paginated log search scoped to the env in the path. Supports free-text search, multi-level filtering, and optional application/agent scoping.","operationId":"searchLogs","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"query","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}},{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"exchangeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"logger","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":100}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"desc"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/LogSearchPageResponse"}}}}}}},"/environments/{envSlug}/executions":{"get":{"tags":["Search"],"summary":"Search executions with basic filters (env from path)","operationId":"searchGet","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"timeFrom","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"timeTo","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"correlationId","in":"query","required":false,"schema":{"type":"string"}},{"name":"text","in":"query","required":false,"schema":{"type":"string"}},{"name":"routeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"processorType","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":50}},{"name":"sortField","in":"query","required":false,"schema":{"type":"string"}},{"name":"sortDir","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SearchResultExecutionSummary"}}}}}}},"/environments/{envSlug}/errors/top":{"get":{"tags":["Search"],"summary":"Top N errors with velocity trend","operationId":"topErrors","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}},{"name":"routeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":5}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TopError"}}}}}}}},"/environments/{envSlug}/config":{"get":{"tags":["Application Config"],"summary":"List application configs in this environment","operationId":"listConfigs","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"Configs returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApplicationConfig"}}}}}}}},"/environments/{envSlug}/attributes/keys":{"get":{"tags":["Search"],"summary":"Distinct attribute key names for this environment","operationId":"attributeKeys","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/environments/{envSlug}/apps/{appSlug}":{"get":{"tags":["App Management"],"summary":"Get app by env + slug","operationId":"getApp","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"App found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/App"}}}},"404":{"description":"App not found in this environment","content":{"*/*":{"schema":{"$ref":"#/components/schemas/App"}}}}}},"delete":{"tags":["App Management"],"summary":"Delete this app","operationId":"deleteApp","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"App deleted"}}}},"/environments/{envSlug}/apps/{appSlug}/routes/{routeId}/diagram":{"get":{"tags":["Diagrams"],"summary":"Find the latest diagram for this app's route in this environment","description":"Resolves agents in this env for this app, then looks up the latest diagram for the route they reported. Env scope prevents a dev route from returning a prod diagram.","operationId":"findByAppAndRoute","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"routeId","in":"path","required":true,"schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","default":"LR"}}],"responses":{"200":{"description":"Diagram layout returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DiagramLayout"}}}},"404":{"description":"No diagram found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DiagramLayout"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/processor-routes":{"get":{"tags":["Application Config"],"summary":"Get processor to route mapping for this environment","description":"Returns a map of processorId → routeId for all processors seen in this application + environment","operationId":"getProcessorRouteMapping","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Mapping returned","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments/{deploymentId}":{"get":{"tags":["Deployment Management"],"summary":"Get deployment by ID","operationId":"getDeployment","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deployment found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}},"404":{"description":"Deployment not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Deployment"}}}}}}},"/environments/{envSlug}/apps/{appSlug}/deployments/{deploymentId}/logs":{"get":{"tags":["Deployment Management"],"summary":"Get container logs for this deployment","operationId":"getLogs","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Logs returned","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}},"404":{"description":"Deployment not found or no container","content":{"*/*":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/environments/{envSlug}/app-settings":{"get":{"tags":["App Settings"],"summary":"List application settings in this environment","operationId":"getAll","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppSettings"}}}}}}}},"/environments/{envSlug}/alerts":{"get":{"tags":["Alerts Inbox"],"operationId":"list_4","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":50}},{"name":"state","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","enum":["PENDING","FIRING","ACKNOWLEDGED","RESOLVED"]}}},{"name":"severity","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","enum":["CRITICAL","WARNING","INFO"]}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertDto"}}}}}}}},"/environments/{envSlug}/alerts/{id}":{"get":{"tags":["Alerts Inbox"],"operationId":"get_3","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertDto"}}}}}}},"/environments/{envSlug}/alerts/{alertId}/notifications":{"get":{"tags":["Alert Notifications"],"operationId":"listForInstance","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"alertId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertNotificationDto"}}}}}}}},"/environments/{envSlug}/alerts/unread-count":{"get":{"tags":["Alerts Inbox"],"operationId":"unreadCount","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UnreadCountResponse"}}}}}}},"/environments/{envSlug}/agents":{"get":{"tags":["Agent List"],"summary":"List all agents in this environment","description":"Returns registered agents with runtime metrics, optionally filtered by status and/or application","operationId":"listAgents","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"application","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent list returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentInstanceResponse"}}}}},"400":{"description":"Invalid status filter","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/environments/{envSlug}/agents/{agentId}/metrics":{"get":{"tags":["agent-metrics-controller"],"operationId":"getMetrics_1","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"names","in":"query","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"buckets","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":60}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","default":"gauge"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentMetricsResponse"}}}}}}},"/environments/{envSlug}/agents/events":{"get":{"tags":["Agent Events"],"summary":"Query agent events in this environment","description":"Cursor-paginated. Returns newest first. Pass nextCursor back as ?cursor= for the next page.","operationId":"getEvents","parameters":[{"name":"env","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Environment"}},{"name":"appId","in":"query","required":false,"schema":{"type":"string"}},{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":50}}],"responses":{"200":{"description":"Event page returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AgentEventPageResponse"}}}}}}},"/diagrams/{contentHash}/render":{"get":{"tags":["Diagrams"],"summary":"Render a route diagram by content hash","description":"Returns SVG (default) or JSON layout based on Accept header. Content hashes are globally unique, so this endpoint is intentionally flat (no env).","operationId":"renderDiagram","parameters":[{"name":"contentHash","in":"path","required":true,"schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","default":"LR"}}],"responses":{"200":{"description":"Diagram rendered successfully","content":{"image/svg+xml":{"schema":{"type":"string"}},"application/json":{"schema":{"$ref":"#/components/schemas/DiagramLayout"}}}},"404":{"description":"Diagram not found","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/catalog":{"get":{"tags":["Catalog"],"summary":"Get unified catalog","description":"Returns all applications (managed + unmanaged) with live agent data, routes, and deployment status","operationId":"getCatalog_1","parameters":[{"name":"environment","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Catalog returned","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CatalogApp"}}}}}}}},"/auth/oidc/config":{"get":{"tags":["Authentication"],"summary":"Get OIDC config for SPA login flow","operationId":"getConfig_2","responses":{"200":{"description":"OIDC configuration","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcPublicConfigResponse"}}}},"404":{"description":"OIDC not configured or disabled","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OidcPublicConfigResponse"}}}},"500":{"description":"Failed to retrieve OIDC provider metadata","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/auth/me":{"get":{"tags":["Authentication"],"summary":"Get current user details","operationId":"me","responses":{"200":{"description":"Current user details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}},"401":{"description":"Not authenticated","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}}}}},"/agents/{id}/events":{"get":{"tags":["Agent SSE"],"summary":"Open SSE event stream","description":"Opens a Server-Sent Events stream for the specified agent. Commands (config-update, deep-trace, replay) are pushed as events. Ping keepalive comments sent every 15 seconds.","operationId":"events","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Last-Event-ID","in":"header","description":"Last received event ID (no replay, acknowledged only)","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"SSE stream opened","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/SseEmitter"}}}},"404":{"description":"Agent not registered and cannot be auto-registered","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/SseEmitter"}}}}}}},"/agents/config":{"get":{"tags":["Agent Config"],"summary":"Get application config for the calling agent","description":"Resolves (application, environment) from the agent's JWT + registry. Prefers the registry entry (heartbeat-authoritative); falls back to the JWT env claim. Returns 404 if neither identifies a valid agent.","operationId":"getConfigForAgent","responses":{"200":{"description":"Config returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppConfigResponse"}}}},"404":{"description":"Calling agent could not be resolved","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AppConfigResponse"}}}}}}},"/admin/usage":{"get":{"tags":["Usage Analytics"],"summary":"Query usage statistics","description":"Returns aggregated API usage stats grouped by endpoint, user, or hour","operationId":"getUsage","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"username","in":"query","required":false,"schema":{"type":"string"}},{"name":"groupBy","in":"query","required":false,"schema":{"type":"string","default":"endpoint"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UsageStats"}}}}}}}},"/admin/rbac/stats":{"get":{"tags":["RBAC Stats"],"summary":"Get RBAC statistics for the dashboard","operationId":"getStats","responses":{"200":{"description":"RBAC stats returned","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RbacStats"}}}}}}},"/admin/outbound-connections/{id}/usage":{"get":{"tags":["Outbound Connections Admin"],"operationId":"usage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"type":"string","format":"uuid"}}}}}}}},"/admin/database/tables":{"get":{"tags":["Database Admin"],"summary":"Get table sizes and row counts","operationId":"getTables","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TableSizeResponse"}}}}}}}},"/admin/database/status":{"get":{"tags":["Database Admin"],"summary":"Get database connection status and version","operationId":"getStatus","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DatabaseStatusResponse"}}}}}}},"/admin/database/queries":{"get":{"tags":["Database Admin"],"summary":"Get active queries","operationId":"getQueries","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActiveQueryResponse"}}}}}}}},"/admin/database/pool":{"get":{"tags":["Database Admin"],"summary":"Get HikariCP connection pool stats","operationId":"getPool","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConnectionPoolResponse"}}}}}}},"/admin/clickhouse/tables":{"get":{"tags":["ClickHouse Admin"],"summary":"List ClickHouse tables with sizes","operationId":"getTables_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClickHouseTableInfo"}}}}}}}},"/admin/clickhouse/status":{"get":{"tags":["ClickHouse Admin"],"summary":"ClickHouse cluster status","operationId":"getStatus_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClickHouseStatusResponse"}}}}}}},"/admin/clickhouse/queries":{"get":{"tags":["ClickHouse Admin"],"summary":"Active ClickHouse queries","operationId":"getQueries_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClickHouseQueryInfo"}}}}}}}},"/admin/clickhouse/pipeline":{"get":{"tags":["ClickHouse Admin"],"summary":"Search indexer pipeline statistics","operationId":"getPipeline","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/IndexerPipelineResponse"}}}}}}},"/admin/clickhouse/performance":{"get":{"tags":["ClickHouse Admin"],"summary":"ClickHouse storage and performance metrics","operationId":"getPerformance","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClickHousePerformanceResponse"}}}}}}},"/admin/audit":{"get":{"tags":["Audit Log"],"summary":"Search audit log entries with pagination","operationId":"getAuditLog","parameters":[{"name":"username","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"timestamp"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","default":"desc"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":25}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AuditLogPageResponse"}}}}}}},"/catalog/{applicationId}":{"delete":{"tags":["Catalog"],"summary":"Dismiss application and purge all data","operationId":"dismissApplication","parameters":[{"name":"applicationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Application dismissed"},"409":{"description":"Cannot dismiss — live agents connected"}}}}},"components":{"schemas":{"Environment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"displayName":{"type":"string"},"production":{"type":"boolean"},"enabled":{"type":"boolean"},"defaultContainerConfig":{"type":"object","additionalProperties":{"type":"object"}},"jarRetentionCount":{"type":"integer","format":"int32"},"createdAt":{"type":"string","format":"date-time"}}},"AppSettingsRequest":{"type":"object","description":"Per-application dashboard settings","properties":{"slaThresholdMs":{"type":"integer","format":"int32","description":"SLA duration threshold in milliseconds","minimum":1},"healthErrorWarn":{"type":"number","format":"double","description":"Error rate % threshold for warning (yellow) health dot","maximum":100,"minimum":0},"healthErrorCrit":{"type":"number","format":"double","description":"Error rate % threshold for critical (red) health dot","maximum":100,"minimum":0},"healthSlaWarn":{"type":"number","format":"double","description":"SLA compliance % threshold for warning (yellow) health dot","maximum":100,"minimum":0},"healthSlaCrit":{"type":"number","format":"double","description":"SLA compliance % threshold for critical (red) health dot","maximum":100,"minimum":0}},"required":["healthErrorCrit","healthErrorWarn","healthSlaCrit","healthSlaWarn","slaThresholdMs"]},"AppSettings":{"type":"object","properties":{"applicationId":{"type":"string"},"environment":{"type":"string"},"slaThresholdMs":{"type":"integer","format":"int32"},"healthErrorWarn":{"type":"number","format":"double"},"healthErrorCrit":{"type":"number","format":"double"},"healthSlaWarn":{"type":"number","format":"double"},"healthSlaCrit":{"type":"number","format":"double"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ApplicationConfig":{"type":"object","properties":{"application":{"type":"string"},"environment":{"type":"string"},"version":{"type":"integer","format":"int32"},"updatedAt":{"type":"string","format":"date-time"},"engineLevel":{"type":"string"},"payloadCaptureMode":{"type":"string"},"metricsEnabled":{"type":"boolean"},"samplingRate":{"type":"number","format":"double"},"tracedProcessors":{"type":"object","additionalProperties":{"type":"string"}},"applicationLogLevel":{"type":"string"},"taps":{"type":"array","items":{"$ref":"#/components/schemas/TapDefinition"}},"tapVersion":{"type":"integer","format":"int32"},"routeRecording":{"type":"object","additionalProperties":{"type":"boolean"}},"compressSuccess":{"type":"boolean"},"agentLogLevel":{"type":"string"},"routeSamplingRates":{"type":"object","additionalProperties":{"type":"number","format":"double"}},"sensitiveKeys":{"type":"array","items":{"type":"string"}}}},"TapDefinition":{"type":"object","properties":{"tapId":{"type":"string"},"processorId":{"type":"string"},"target":{"type":"string"},"expression":{"type":"string"},"language":{"type":"string"},"attributeName":{"type":"string"},"attributeType":{"type":"string"},"enabled":{"type":"boolean"},"version":{"type":"integer","format":"int32"}}},"AgentResponse":{"type":"object","properties":{"agentId":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}}},"CommandGroupResponse":{"type":"object","properties":{"success":{"type":"boolean"},"total":{"type":"integer","format":"int32"},"responded":{"type":"integer","format":"int32"},"responses":{"type":"array","items":{"$ref":"#/components/schemas/AgentResponse"}},"timedOut":{"type":"array","items":{"type":"string"}}}},"ConfigUpdateResponse":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/ApplicationConfig"},"pushResult":{"$ref":"#/components/schemas/CommandGroupResponse"}}},"AlertSilenceRequest":{"type":"object","properties":{"matcher":{"$ref":"#/components/schemas/SilenceMatcher"},"reason":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"}},"required":["endsAt","matcher","startsAt"]},"SilenceMatcher":{"type":"object","properties":{"ruleId":{"type":"string","format":"uuid"},"appSlug":{"type":"string"},"routeId":{"type":"string"},"agentId":{"type":"string"},"severity":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"wildcard":{"type":"boolean"}}},"AlertSilenceResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"matcher":{"$ref":"#/components/schemas/SilenceMatcher"},"reason":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"AgentLifecycleCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"eventTypes":{"type":"array","items":{"type":"string","enum":["REGISTERED","RE_REGISTERED","DEREGISTERED","WENT_STALE","WENT_DEAD","RECOVERED"]}},"withinSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"AgentStateCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"state":{"type":"string"},"forSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"AlertCondition":{"type":"object","discriminator":{"propertyName":"kind"},"properties":{"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"]}}},"AlertRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"severity":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"conditionKind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"]},"condition":{"oneOf":[{"$ref":"#/components/schemas/AgentLifecycleCondition"},{"$ref":"#/components/schemas/AgentStateCondition"},{"$ref":"#/components/schemas/DeploymentStateCondition"},{"$ref":"#/components/schemas/ExchangeMatchCondition"},{"$ref":"#/components/schemas/JvmMetricCondition"},{"$ref":"#/components/schemas/LogPatternCondition"},{"$ref":"#/components/schemas/RouteMetricCondition"}]},"evaluationIntervalSeconds":{"type":"integer","format":"int32"},"forDurationSeconds":{"type":"integer","format":"int32"},"reNotifyMinutes":{"type":"integer","format":"int32"},"notificationTitleTmpl":{"type":"string"},"notificationMessageTmpl":{"type":"string"},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookBindingRequest"}},"targets":{"type":"array","items":{"$ref":"#/components/schemas/AlertRuleTarget"}}},"required":["condition","conditionKind","severity"]},"AlertRuleTarget":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ruleId":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["USER","GROUP","ROLE"]},"targetId":{"type":"string"}}},"AlertScope":{"type":"object","properties":{"appSlug":{"type":"string"},"routeId":{"type":"string"},"agentId":{"type":"string"}}},"DeploymentStateCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"states":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"ExchangeFilter":{"type":"object","properties":{"status":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}}}},"ExchangeMatchCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"filter":{"$ref":"#/components/schemas/ExchangeFilter"},"fireMode":{"type":"string","enum":["PER_EXCHANGE","COUNT_IN_WINDOW"]},"threshold":{"type":"integer","format":"int32"},"windowSeconds":{"type":"integer","format":"int32"},"perExchangeLingerSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"JvmMetricCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"metric":{"type":"string"},"aggregation":{"type":"string","enum":["MAX","MIN","AVG","LATEST"]},"comparator":{"type":"string","enum":["GT","GTE","LT","LTE","EQ"]},"threshold":{"type":"number","format":"double"},"windowSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"LogPatternCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"level":{"type":"string"},"pattern":{"type":"string"},"threshold":{"type":"integer","format":"int32"},"windowSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"RouteMetricCondition":{"allOf":[{"$ref":"#/components/schemas/AlertCondition"},{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/AlertScope"},"metric":{"type":"string","enum":["ERROR_RATE","AVG_DURATION_MS","P99_LATENCY_MS","THROUGHPUT","ERROR_COUNT"]},"comparator":{"type":"string","enum":["GT","GTE","LT","LTE","EQ"]},"threshold":{"type":"number","format":"double"},"windowSeconds":{"type":"integer","format":"int32"},"kind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"],"readOnly":true}}}]},"WebhookBindingRequest":{"type":"object","properties":{"outboundConnectionId":{"type":"string","format":"uuid"},"bodyOverride":{"type":"string"},"headerOverrides":{"type":"object","additionalProperties":{"type":"string"}}},"required":["outboundConnectionId"]},"AlertRuleResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"enabled":{"type":"boolean"},"conditionKind":{"type":"string","enum":["ROUTE_METRIC","EXCHANGE_MATCH","AGENT_STATE","AGENT_LIFECYCLE","DEPLOYMENT_STATE","LOG_PATTERN","JVM_METRIC"]},"condition":{"oneOf":[{"$ref":"#/components/schemas/AgentLifecycleCondition"},{"$ref":"#/components/schemas/AgentStateCondition"},{"$ref":"#/components/schemas/DeploymentStateCondition"},{"$ref":"#/components/schemas/ExchangeMatchCondition"},{"$ref":"#/components/schemas/JvmMetricCondition"},{"$ref":"#/components/schemas/LogPatternCondition"},{"$ref":"#/components/schemas/RouteMetricCondition"}]},"evaluationIntervalSeconds":{"type":"integer","format":"int32"},"forDurationSeconds":{"type":"integer","format":"int32"},"reNotifyMinutes":{"type":"integer","format":"int32"},"notificationTitleTmpl":{"type":"string"},"notificationMessageTmpl":{"type":"string"},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookBindingResponse"}},"targets":{"type":"array","items":{"$ref":"#/components/schemas/AlertRuleTarget"}},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"}}},"WebhookBindingResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"outboundConnectionId":{"type":"string","format":"uuid"},"bodyOverride":{"type":"string"},"headerOverrides":{"type":"object","additionalProperties":{"type":"string"}}}},"UpdateUserRequest":{"type":"object","properties":{"displayName":{"type":"string"},"email":{"type":"string"}}},"DatabaseThresholdsRequest":{"type":"object","description":"Database monitoring thresholds","properties":{"connectionPoolWarning":{"type":"integer","format":"int32","description":"Connection pool usage warning threshold (percentage)","maximum":100,"minimum":0},"connectionPoolCritical":{"type":"integer","format":"int32","description":"Connection pool usage critical threshold (percentage)","maximum":100,"minimum":0},"queryDurationWarning":{"type":"number","format":"double","description":"Query duration warning threshold (seconds)"},"queryDurationCritical":{"type":"number","format":"double","description":"Query duration critical threshold (seconds)"}}},"ThresholdConfigRequest":{"type":"object","description":"Threshold configuration for admin monitoring","properties":{"database":{"$ref":"#/components/schemas/DatabaseThresholdsRequest"}},"required":["database"]},"DatabaseThresholds":{"type":"object","properties":{"connectionPoolWarning":{"type":"integer","format":"int32"},"connectionPoolCritical":{"type":"integer","format":"int32"},"queryDurationWarning":{"type":"number","format":"double"},"queryDurationCritical":{"type":"number","format":"double"}}},"ThresholdConfig":{"type":"object","properties":{"database":{"$ref":"#/components/schemas/DatabaseThresholds"}}},"SensitiveKeysRequest":{"type":"object","description":"Global sensitive keys configuration","properties":{"keys":{"type":"array","description":"List of key names or glob patterns to mask","items":{"type":"string"}}},"required":["keys"]},"SensitiveKeysResponse":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"}},"pushResult":{"$ref":"#/components/schemas/CommandGroupResponse"}}},"UpdateRoleRequest":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string"}}},"Basic":{"allOf":[{"$ref":"#/components/schemas/OutboundAuth"},{"type":"object","properties":{"username":{"type":"string"},"passwordCiphertext":{"type":"string"}}}]},"Bearer":{"allOf":[{"$ref":"#/components/schemas/OutboundAuth"},{"type":"object","properties":{"tokenCiphertext":{"type":"string"}}}]},"None":{"allOf":[{"$ref":"#/components/schemas/OutboundAuth"}]},"OutboundAuth":{"type":"object"},"OutboundConnectionRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"minLength":0},"description":{"type":"string","maxLength":2000,"minLength":0},"url":{"type":"string","minLength":1,"pattern":"^https://.+"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"defaultHeaders":{"type":"object","additionalProperties":{"type":"string"}},"defaultBodyTmpl":{"type":"string"},"tlsTrustMode":{"type":"string","enum":["SYSTEM_DEFAULT","TRUST_ALL","TRUST_PATHS"]},"tlsCaPemPaths":{"type":"array","items":{"type":"string"}},"hmacSecret":{"type":"string"},"auth":{"oneOf":[{"$ref":"#/components/schemas/Basic"},{"$ref":"#/components/schemas/Bearer"},{"$ref":"#/components/schemas/None"}]},"allowedEnvironmentIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["auth","method","tlsTrustMode"]},"OutboundConnectionDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"defaultHeaders":{"type":"object","additionalProperties":{"type":"string"}},"defaultBodyTmpl":{"type":"string"},"tlsTrustMode":{"type":"string","enum":["SYSTEM_DEFAULT","TRUST_ALL","TRUST_PATHS"]},"tlsCaPemPaths":{"type":"array","items":{"type":"string"}},"hmacSecretSet":{"type":"boolean"},"authKind":{"type":"string","enum":["NONE","BEARER","BASIC"]},"allowedEnvironmentIds":{"type":"array","items":{"type":"string","format":"uuid"}},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"}}},"OidcAdminConfigRequest":{"type":"object","description":"OIDC configuration update request","properties":{"enabled":{"type":"boolean"},"issuerUri":{"type":"string"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"rolesClaim":{"type":"string"},"defaultRoles":{"type":"array","items":{"type":"string"}},"autoSignup":{"type":"boolean"},"displayNameClaim":{"type":"string"},"userIdClaim":{"type":"string"},"audience":{"type":"string"},"additionalScopes":{"type":"array","items":{"type":"string"}}}},"ErrorResponse":{"type":"object","description":"Error response","properties":{"message":{"type":"string"}},"required":["message"]},"OidcAdminConfigResponse":{"type":"object","description":"OIDC configuration for admin management","properties":{"configured":{"type":"boolean"},"enabled":{"type":"boolean"},"issuerUri":{"type":"string"},"clientId":{"type":"string"},"clientSecretSet":{"type":"boolean"},"rolesClaim":{"type":"string"},"defaultRoles":{"type":"array","items":{"type":"string"}},"autoSignup":{"type":"boolean"},"displayNameClaim":{"type":"string"},"userIdClaim":{"type":"string"},"audience":{"type":"string"},"additionalScopes":{"type":"array","items":{"type":"string"}}}},"UpdateGroupRequest":{"type":"object","properties":{"name":{"type":"string"},"parentGroupId":{"type":"string","format":"uuid"}}},"UpdateEnvironmentRequest":{"type":"object","properties":{"displayName":{"type":"string"},"production":{"type":"boolean"},"enabled":{"type":"boolean"}}},"JarRetentionRequest":{"type":"object","properties":{"jarRetentionCount":{"type":"integer","format":"int32"}}},"CreateRuleRequest":{"type":"object","properties":{"claim":{"type":"string"},"matchType":{"type":"string"},"matchValue":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"},"priority":{"type":"integer","format":"int32"}}},"ClaimMappingRule":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"claim":{"type":"string"},"matchType":{"type":"string"},"matchValue":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"},"priority":{"type":"integer","format":"int32"},"createdAt":{"type":"string","format":"date-time"}}},"SearchRequest":{"type":"object","properties":{"status":{"type":"string"},"timeFrom":{"type":"string","format":"date-time"},"timeTo":{"type":"string","format":"date-time"},"durationMin":{"type":"integer","format":"int64"},"durationMax":{"type":"integer","format":"int64"},"correlationId":{"type":"string"},"text":{"type":"string"},"textInBody":{"type":"string"},"textInHeaders":{"type":"string"},"textInErrors":{"type":"string"},"routeId":{"type":"string"},"instanceId":{"type":"string"},"processorType":{"type":"string"},"applicationId":{"type":"string"},"instanceIds":{"type":"array","items":{"type":"string"}},"offset":{"type":"integer","format":"int32"},"limit":{"type":"integer","format":"int32"},"sortField":{"type":"string"},"sortDir":{"type":"string"},"environment":{"type":"string"}}},"ExecutionSummary":{"type":"object","properties":{"executionId":{"type":"string"},"routeId":{"type":"string"},"instanceId":{"type":"string"},"applicationId":{"type":"string"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"durationMs":{"type":"integer","format":"int64"},"correlationId":{"type":"string"},"errorMessage":{"type":"string"},"diagramContentHash":{"type":"string"},"highlight":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}},"hasTraceData":{"type":"boolean"},"isReplay":{"type":"boolean"}},"required":["applicationId","attributes","correlationId","diagramContentHash","durationMs","endTime","errorMessage","executionId","hasTraceData","highlight","instanceId","isReplay","routeId","startTime","status"]},"SearchResultExecutionSummary":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionSummary"}},"total":{"type":"integer","format":"int64"},"offset":{"type":"integer","format":"int32"},"limit":{"type":"integer","format":"int32"}},"required":["data","limit","offset","total"]},"CreateAppRequest":{"type":"object","properties":{"slug":{"type":"string"},"displayName":{"type":"string"}}},"AppVersion":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"appId":{"type":"string","format":"uuid"},"version":{"type":"integer","format":"int32"},"jarPath":{"type":"string"},"jarChecksum":{"type":"string"},"jarFilename":{"type":"string"},"jarSizeBytes":{"type":"integer","format":"int64"},"detectedRuntimeType":{"type":"string"},"detectedMainClass":{"type":"string"},"uploadedAt":{"type":"string","format":"date-time"}}},"DeployRequest":{"type":"object","properties":{"appVersionId":{"type":"string","format":"uuid"}}},"Deployment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"appId":{"type":"string","format":"uuid"},"appVersionId":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["STOPPED","STARTING","RUNNING","DEGRADED","STOPPING","FAILED"]},"targetState":{"type":"string"},"deploymentStrategy":{"type":"string"},"replicaStates":{"type":"array","items":{"type":"object","additionalProperties":{"type":"object"}}},"deployStage":{"type":"string"},"containerId":{"type":"string"},"containerName":{"type":"string"},"errorMessage":{"type":"string"},"resolvedConfig":{"type":"object","additionalProperties":{"type":"object"}},"deployedAt":{"type":"string","format":"date-time"},"stoppedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"PromoteRequest":{"type":"object","properties":{"targetEnvironment":{"type":"string"}}},"TestExpressionRequest":{"type":"object","properties":{"expression":{"type":"string"},"language":{"type":"string"},"body":{"type":"string"},"target":{"type":"string"}}},"TestExpressionResponse":{"type":"object","properties":{"result":{"type":"string"},"error":{"type":"string"}}},"AlertDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ruleId":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"state":{"type":"string","enum":["PENDING","FIRING","ACKNOWLEDGED","RESOLVED"]},"severity":{"type":"string","enum":["CRITICAL","WARNING","INFO"]},"title":{"type":"string"},"message":{"type":"string"},"firedAt":{"type":"string","format":"date-time"},"ackedAt":{"type":"string","format":"date-time"},"ackedBy":{"type":"string"},"resolvedAt":{"type":"string","format":"date-time"},"silenced":{"type":"boolean"},"currentValue":{"type":"number","format":"double"},"threshold":{"type":"number","format":"double"},"context":{"type":"object","additionalProperties":{"type":"object"}}}},"TestEvaluateRequest":{"type":"object"},"TestEvaluateResponse":{"type":"object","properties":{"resultKind":{"type":"string"},"detail":{"type":"string"}}},"RenderPreviewRequest":{"type":"object","properties":{"context":{"type":"object","additionalProperties":{"type":"object"}}}},"RenderPreviewResponse":{"type":"object","properties":{"title":{"type":"string"},"message":{"type":"string"}}},"BulkReadRequest":{"type":"object","properties":{"instanceIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["instanceIds"]},"LogEntry":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"level":{"type":"string"},"loggerName":{"type":"string"},"message":{"type":"string"},"threadName":{"type":"string"},"stackTrace":{"type":"string"},"mdc":{"type":"object","additionalProperties":{"type":"string"}},"source":{"type":"string"}}},"RefreshRequest":{"type":"object","properties":{"refreshToken":{"type":"string"}}},"AuthTokenResponse":{"type":"object","description":"JWT token pair","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"displayName":{"type":"string"},"idToken":{"type":"string","description":"OIDC id_token for end-session logout (only present after OIDC login)"}},"required":["accessToken","displayName","refreshToken"]},"CallbackRequest":{"type":"object","properties":{"code":{"type":"string"},"redirectUri":{"type":"string"}}},"LoginRequest":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}},"AlertNotificationDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"alertInstanceId":{"type":"string","format":"uuid"},"webhookId":{"type":"string","format":"uuid"},"outboundConnectionId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["PENDING","DELIVERED","FAILED"]},"attempts":{"type":"integer","format":"int32"},"nextAttemptAt":{"type":"string","format":"date-time"},"lastResponseStatus":{"type":"integer","format":"int32"},"lastResponseSnippet":{"type":"string"},"deliveredAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"ReplayRequest":{"type":"object","description":"Request to replay an exchange on an agent","properties":{"routeId":{"type":"string","description":"Camel route ID to replay on"},"body":{"type":"string","description":"Message body for the replayed exchange"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Message headers for the replayed exchange"},"originalExchangeId":{"type":"string","description":"Exchange ID of the original execution being replayed (for audit trail)"}},"required":["routeId"]},"ReplayResponse":{"type":"object","description":"Result of a replay command","properties":{"status":{"type":"string","description":"Replay outcome: SUCCESS or FAILURE"},"message":{"type":"string","description":"Human-readable result message"},"data":{"type":"string","description":"Structured result data from the agent (JSON)"}}},"AgentRefreshRequest":{"type":"object","description":"Agent token refresh request","properties":{"refreshToken":{"type":"string"}},"required":["refreshToken"]},"AgentRefreshResponse":{"type":"object","description":"Refreshed access and refresh tokens","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["accessToken","refreshToken"]},"HeartbeatRequest":{"type":"object","properties":{"routeStates":{"type":"object","additionalProperties":{"type":"string"}},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"environmentId":{"type":"string"}}},"CommandRequest":{"type":"object","description":"Command to send to agent(s)","properties":{"type":{"type":"string","description":"Command type: config-update, deep-trace, or replay"},"payload":{"type":"object","description":"Command payload JSON"}},"required":["type"]},"CommandSingleResponse":{"type":"object","description":"Result of sending a command to a single agent","properties":{"commandId":{"type":"string"},"status":{"type":"string"}},"required":["commandId","status"]},"CommandAckRequest":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"},"data":{"type":"string"}}},"AgentRegistrationRequest":{"type":"object","description":"Agent registration payload","properties":{"instanceId":{"type":"string"},"applicationId":{"type":"string","default":"default"},"environmentId":{"type":"string","default":"default"},"version":{"type":"string"},"routeIds":{"type":"array","items":{"type":"string"}},"capabilities":{"type":"object","additionalProperties":{"type":"object"}}},"required":["instanceId"]},"AgentRegistrationResponse":{"type":"object","description":"Agent registration result with JWT tokens and SSE endpoint","properties":{"instanceId":{"type":"string"},"sseEndpoint":{"type":"string"},"heartbeatIntervalMs":{"type":"integer","format":"int64"},"serverPublicKey":{"type":"string"},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["accessToken","instanceId","refreshToken","serverPublicKey","sseEndpoint"]},"CommandBroadcastResponse":{"type":"object","description":"Result of broadcasting a command to multiple agents","properties":{"commandIds":{"type":"array","items":{"type":"string"}},"targetCount":{"type":"integer","format":"int32"}},"required":["commandIds"]},"CreateUserRequest":{"type":"object","properties":{"username":{"type":"string"},"displayName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"}}},"SetPasswordRequest":{"type":"object","properties":{"password":{"type":"string","minLength":1}}},"CreateRoleRequest":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string"}}},"OutboundConnectionTestResult":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"latencyMs":{"type":"integer","format":"int64"},"responseSnippet":{"type":"string"},"tlsProtocol":{"type":"string"},"tlsCipherSuite":{"type":"string"},"peerCertificateSubject":{"type":"string"},"peerCertificateExpiresAtEpochMs":{"type":"integer","format":"int64"},"error":{"type":"string"}}},"OidcTestResult":{"type":"object","description":"OIDC provider connectivity test result","properties":{"status":{"type":"string"},"authorizationEndpoint":{"type":"string"}},"required":["authorizationEndpoint","status"]},"UpdateLicenseRequest":{"type":"object","properties":{"token":{"type":"string"}}},"CreateGroupRequest":{"type":"object","properties":{"name":{"type":"string"},"parentGroupId":{"type":"string","format":"uuid"}}},"CreateEnvironmentRequest":{"type":"object","properties":{"slug":{"type":"string"},"displayName":{"type":"string"},"production":{"type":"boolean"}}},"TestRequest":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/TestRuleRequest"}},"claims":{"type":"object","additionalProperties":{"type":"object"}}}},"TestRuleRequest":{"type":"object","properties":{"id":{"type":"string"},"claim":{"type":"string"},"matchType":{"type":"string"},"matchValue":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"},"priority":{"type":"integer","format":"int32"}}},"MatchedRuleResponse":{"type":"object","properties":{"ruleId":{"type":"string"},"priority":{"type":"integer","format":"int32"},"claim":{"type":"string"},"matchType":{"type":"string"},"matchValue":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"}}},"TestResponse":{"type":"object","properties":{"matchedRules":{"type":"array","items":{"$ref":"#/components/schemas/MatchedRuleResponse"}},"effectiveRoles":{"type":"array","items":{"type":"string"}},"effectiveGroups":{"type":"array","items":{"type":"string"}},"fallback":{"type":"boolean"}}},"ExecutionDetail":{"type":"object","properties":{"executionId":{"type":"string"},"routeId":{"type":"string"},"instanceId":{"type":"string"},"applicationId":{"type":"string"},"environment":{"type":"string"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"durationMs":{"type":"integer","format":"int64"},"correlationId":{"type":"string"},"exchangeId":{"type":"string"},"errorMessage":{"type":"string"},"errorStackTrace":{"type":"string"},"diagramContentHash":{"type":"string"},"processors":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorNode"}},"inputBody":{"type":"string"},"outputBody":{"type":"string"},"inputHeaders":{"type":"string"},"outputHeaders":{"type":"string"},"inputProperties":{"type":"string"},"outputProperties":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}},"errorType":{"type":"string"},"errorCategory":{"type":"string"},"rootCauseType":{"type":"string"},"rootCauseMessage":{"type":"string"},"traceId":{"type":"string"},"spanId":{"type":"string"}},"required":["applicationId","attributes","correlationId","diagramContentHash","durationMs","endTime","environment","errorCategory","errorMessage","errorStackTrace","errorType","exchangeId","executionId","inputBody","inputHeaders","inputProperties","instanceId","outputBody","outputHeaders","outputProperties","processors","rootCauseMessage","rootCauseType","routeId","spanId","startTime","status","traceId"]},"ProcessorNode":{"type":"object","properties":{"processorId":{"type":"string"},"processorType":{"type":"string"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"durationMs":{"type":"integer","format":"int64"},"errorMessage":{"type":"string"},"errorStackTrace":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}},"iteration":{"type":"integer","format":"int32"},"iterationSize":{"type":"integer","format":"int32"},"loopIndex":{"type":"integer","format":"int32"},"loopSize":{"type":"integer","format":"int32"},"splitIndex":{"type":"integer","format":"int32"},"splitSize":{"type":"integer","format":"int32"},"multicastIndex":{"type":"integer","format":"int32"},"resolvedEndpointUri":{"type":"string"},"errorType":{"type":"string"},"errorCategory":{"type":"string"},"rootCauseType":{"type":"string"},"rootCauseMessage":{"type":"string"},"errorHandlerType":{"type":"string"},"circuitBreakerState":{"type":"string"},"fallbackTriggered":{"type":"boolean"},"filterMatched":{"type":"boolean"},"duplicateMessage":{"type":"boolean"},"hasTraceData":{"type":"boolean"},"children":{"type":"array","items":{"$ref":"#/components/schemas/ProcessorNode"}}},"required":["attributes","children","circuitBreakerState","duplicateMessage","durationMs","endTime","errorCategory","errorHandlerType","errorMessage","errorStackTrace","errorType","fallbackTriggered","filterMatched","hasTraceData","iteration","iterationSize","loopIndex","loopSize","multicastIndex","processorId","processorType","resolvedEndpointUri","rootCauseMessage","rootCauseType","splitIndex","splitSize","startTime","status"]},"ExecutionStats":{"type":"object","properties":{"totalCount":{"type":"integer","format":"int64"},"failedCount":{"type":"integer","format":"int64"},"avgDurationMs":{"type":"integer","format":"int64"},"p99LatencyMs":{"type":"integer","format":"int64"},"activeCount":{"type":"integer","format":"int64"},"totalToday":{"type":"integer","format":"int64"},"prevTotalCount":{"type":"integer","format":"int64"},"prevFailedCount":{"type":"integer","format":"int64"},"prevAvgDurationMs":{"type":"integer","format":"int64"},"prevP99LatencyMs":{"type":"integer","format":"int64"},"slaCompliance":{"type":"number","format":"double"}},"required":["activeCount","avgDurationMs","failedCount","p99LatencyMs","prevAvgDurationMs","prevFailedCount","prevP99LatencyMs","prevTotalCount","slaCompliance","totalCount","totalToday"]},"StatsTimeseries":{"type":"object","properties":{"buckets":{"type":"array","items":{"$ref":"#/components/schemas/TimeseriesBucket"}}},"required":["buckets"]},"TimeseriesBucket":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"totalCount":{"type":"integer","format":"int64"},"failedCount":{"type":"integer","format":"int64"},"avgDurationMs":{"type":"integer","format":"int64"},"p99DurationMs":{"type":"integer","format":"int64"},"activeCount":{"type":"integer","format":"int64"}},"required":["activeCount","avgDurationMs","failedCount","p99DurationMs","time","totalCount"]},"PunchcardCell":{"type":"object","properties":{"weekday":{"type":"integer","format":"int32"},"hour":{"type":"integer","format":"int32"},"totalCount":{"type":"integer","format":"int64"},"failedCount":{"type":"integer","format":"int64"}}},"AgentSummary":{"type":"object","description":"Summary of an agent instance for sidebar display","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"tps":{"type":"number","format":"double"}},"required":["id","name","status","tps"]},"AppCatalogEntry":{"type":"object","description":"Application catalog entry with routes and agents","properties":{"appId":{"type":"string"},"routes":{"type":"array","items":{"$ref":"#/components/schemas/RouteSummary"}},"agents":{"type":"array","items":{"$ref":"#/components/schemas/AgentSummary"}},"agentCount":{"type":"integer","format":"int32"},"health":{"type":"string"},"exchangeCount":{"type":"integer","format":"int64"}},"required":["agentCount","agents","appId","exchangeCount","health","routes"]},"RouteSummary":{"type":"object","description":"Summary of a route within an application","properties":{"routeId":{"type":"string"},"exchangeCount":{"type":"integer","format":"int64"},"lastSeen":{"type":"string","format":"date-time"},"fromEndpointUri":{"type":"string","description":"The from() endpoint URI, e.g. 'direct:processOrder'"},"routeState":{"type":"string","description":"Operational state of the route: stopped, suspended, or null (started/default)"}},"required":["exchangeCount","fromEndpointUri","lastSeen","routeId","routeState"]},"RouteMetrics":{"type":"object","description":"Aggregated route performance metrics","properties":{"routeId":{"type":"string"},"appId":{"type":"string"},"exchangeCount":{"type":"integer","format":"int64"},"successRate":{"type":"number","format":"double"},"avgDurationMs":{"type":"number","format":"double"},"p99DurationMs":{"type":"number","format":"double"},"errorRate":{"type":"number","format":"double"},"throughputPerSec":{"type":"number","format":"double"},"sparkline":{"type":"array","items":{"type":"number","format":"double"}},"slaCompliance":{"type":"number","format":"double"}},"required":["appId","avgDurationMs","errorRate","exchangeCount","p99DurationMs","routeId","slaCompliance","sparkline","successRate","throughputPerSec"]},"ProcessorMetrics":{"type":"object","properties":{"processorId":{"type":"string"},"processorType":{"type":"string"},"routeId":{"type":"string"},"appId":{"type":"string"},"totalCount":{"type":"integer","format":"int64"},"failedCount":{"type":"integer","format":"int64"},"avgDurationMs":{"type":"number","format":"double"},"p99DurationMs":{"type":"number","format":"double"},"errorRate":{"type":"number","format":"double"}},"required":["appId","avgDurationMs","errorRate","failedCount","p99DurationMs","processorId","processorType","routeId","totalCount"]},"LogEntryResponse":{"type":"object","description":"Application log entry","properties":{"timestamp":{"type":"string","description":"Log timestamp (ISO-8601)"},"level":{"type":"string","description":"Log level (INFO, WARN, ERROR, DEBUG, TRACE)"},"loggerName":{"type":"string","description":"Logger name"},"message":{"type":"string","description":"Log message"},"threadName":{"type":"string","description":"Thread name"},"stackTrace":{"type":"string","description":"Stack trace (if present)"},"exchangeId":{"type":"string","description":"Camel exchange ID (if present)"},"instanceId":{"type":"string","description":"Agent instance ID"},"application":{"type":"string","description":"Application ID"},"mdc":{"type":"object","additionalProperties":{"type":"string"},"description":"MDC context map"},"source":{"type":"string","description":"Log source: app or agent"}}},"LogSearchPageResponse":{"type":"object","description":"Log search response with cursor pagination and level counts","properties":{"data":{"type":"array","description":"Log entries for the current page","items":{"$ref":"#/components/schemas/LogEntryResponse"}},"nextCursor":{"type":"string","description":"Cursor for next page (null if no more results)"},"hasMore":{"type":"boolean","description":"Whether more results exist beyond this page"},"levelCounts":{"type":"object","additionalProperties":{"type":"integer","format":"int64"},"description":"Count of logs per level (unaffected by level filter)"}}},"TopError":{"type":"object","properties":{"errorType":{"type":"string"},"routeId":{"type":"string"},"processorId":{"type":"string"},"count":{"type":"integer","format":"int64"},"velocity":{"type":"number","format":"double"},"trend":{"type":"string"},"lastSeen":{"type":"string","format":"date-time"}}},"App":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"environmentId":{"type":"string","format":"uuid"},"slug":{"type":"string"},"displayName":{"type":"string"},"containerConfig":{"type":"object","additionalProperties":{"type":"object"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"DiagramLayout":{"type":"object","properties":{"width":{"type":"number","format":"double"},"height":{"type":"number","format":"double"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/PositionedNode"}},"edges":{"type":"array","items":{"$ref":"#/components/schemas/PositionedEdge"}}}},"PositionedEdge":{"type":"object","properties":{"sourceId":{"type":"string"},"targetId":{"type":"string"},"label":{"type":"string"},"points":{"type":"array","items":{"type":"array","items":{"type":"number","format":"double"}}}}},"PositionedNode":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"x":{"type":"number","format":"double"},"y":{"type":"number","format":"double"},"width":{"type":"number","format":"double"},"height":{"type":"number","format":"double"},"endpointUri":{"type":"string"}}},"AppConfigResponse":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/ApplicationConfig"},"globalSensitiveKeys":{"type":"array","items":{"type":"string"}},"mergedSensitiveKeys":{"type":"array","items":{"type":"string"}}}},"UnreadCountResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64"},"bySeverity":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}}}},"AgentInstanceResponse":{"type":"object","description":"Agent instance summary with runtime metrics","properties":{"instanceId":{"type":"string"},"displayName":{"type":"string"},"applicationId":{"type":"string"},"environmentId":{"type":"string"},"status":{"type":"string"},"routeIds":{"type":"array","items":{"type":"string"}},"registeredAt":{"type":"string","format":"date-time"},"lastHeartbeat":{"type":"string","format":"date-time"},"version":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"tps":{"type":"number","format":"double"},"errorRate":{"type":"number","format":"double"},"activeRoutes":{"type":"integer","format":"int32"},"totalRoutes":{"type":"integer","format":"int32"},"uptimeSeconds":{"type":"integer","format":"int64"},"cpuUsage":{"type":"number","format":"double","description":"Recent average CPU usage (0.0–1.0), -1 if unavailable"}},"required":["activeRoutes","applicationId","capabilities","cpuUsage","displayName","environmentId","errorRate","instanceId","lastHeartbeat","registeredAt","routeIds","status","totalRoutes","tps","uptimeSeconds","version"]},"AgentMetricsResponse":{"type":"object","properties":{"metrics":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/MetricBucket"}}}},"required":["metrics"]},"MetricBucket":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"value":{"type":"number","format":"double"}},"required":["time","value"]},"AgentEventPageResponse":{"type":"object","description":"Cursor-paginated agent event list","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentEventResponse"}},"nextCursor":{"type":"string"},"hasMore":{"type":"boolean"}}},"AgentEventResponse":{"type":"object","description":"Agent lifecycle event","properties":{"id":{"type":"integer","format":"int64"},"instanceId":{"type":"string"},"applicationId":{"type":"string"},"eventType":{"type":"string"},"detail":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}},"required":["applicationId","detail","eventType","id","instanceId","timestamp"]},"CatalogApp":{"type":"object","description":"Unified catalog entry combining app records with live agent data","properties":{"slug":{"type":"string","description":"Application slug (universal identifier)"},"displayName":{"type":"string","description":"Display name"},"managed":{"type":"boolean","description":"True if a managed App record exists in the database"},"environmentSlug":{"type":"string","description":"Environment slug"},"health":{"type":"string","description":"Composite health: deployment status + agent health"},"healthTooltip":{"type":"string","description":"Human-readable tooltip explaining the health state"},"agentCount":{"type":"integer","format":"int32","description":"Number of connected agents"},"routes":{"type":"array","description":"Live routes from agents","items":{"$ref":"#/components/schemas/RouteSummary"}},"agents":{"type":"array","description":"Connected agent summaries","items":{"$ref":"#/components/schemas/AgentSummary"}},"exchangeCount":{"type":"integer","format":"int64","description":"Total exchange count from ClickHouse"},"deployment":{"$ref":"#/components/schemas/DeploymentSummary","description":"Active deployment info, null if no deployment"}}},"DeploymentSummary":{"type":"object","properties":{"status":{"type":"string"},"replicas":{"type":"string"},"version":{"type":"integer","format":"int32"}}},"OidcPublicConfigResponse":{"type":"object","description":"OIDC configuration for SPA login flow","properties":{"issuer":{"type":"string"},"clientId":{"type":"string"},"authorizationEndpoint":{"type":"string"},"endSessionEndpoint":{"type":"string","description":"Present if the provider supports RP-initiated logout"},"resource":{"type":"string","description":"RFC 8707 resource indicator for the authorization request"},"additionalScopes":{"type":"array","description":"Additional scopes to request beyond openid email profile","items":{"type":"string"}}},"required":["authorizationEndpoint","clientId","issuer"]},"GroupSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"RoleSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"system":{"type":"boolean"},"source":{"type":"string"}}},"UserDetail":{"type":"object","properties":{"userId":{"type":"string"},"provider":{"type":"string"},"email":{"type":"string"},"displayName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"directRoles":{"type":"array","items":{"$ref":"#/components/schemas/RoleSummary"}},"directGroups":{"type":"array","items":{"$ref":"#/components/schemas/GroupSummary"}},"effectiveRoles":{"type":"array","items":{"$ref":"#/components/schemas/RoleSummary"}},"effectiveGroups":{"type":"array","items":{"$ref":"#/components/schemas/GroupSummary"}}}},"SseEmitter":{"type":"object","properties":{"timeout":{"type":"integer","format":"int64"}}},"UsageStats":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"integer","format":"int64"},"avgDurationMs":{"type":"integer","format":"int64"}}},"SensitiveKeysConfig":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"}}}},"RoleDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string"},"system":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"assignedGroups":{"type":"array","items":{"$ref":"#/components/schemas/GroupSummary"}},"directUsers":{"type":"array","items":{"$ref":"#/components/schemas/UserSummary"}},"effectivePrincipals":{"type":"array","items":{"$ref":"#/components/schemas/UserSummary"}}}},"UserSummary":{"type":"object","properties":{"userId":{"type":"string"},"displayName":{"type":"string"},"provider":{"type":"string"}}},"RbacStats":{"type":"object","properties":{"userCount":{"type":"integer","format":"int32"},"activeUserCount":{"type":"integer","format":"int32"},"groupCount":{"type":"integer","format":"int32"},"maxGroupDepth":{"type":"integer","format":"int32"},"roleCount":{"type":"integer","format":"int32"}}},"LicenseInfo":{"type":"object","properties":{"tier":{"type":"string"},"features":{"type":"array","items":{"type":"string","enum":["topology","lineage","correlation","debugger","replay"]},"uniqueItems":true},"limits":{"type":"object","additionalProperties":{"type":"integer","format":"int32"}},"issuedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"expired":{"type":"boolean"}}},"GroupDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"parentGroupId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"directRoles":{"type":"array","items":{"$ref":"#/components/schemas/RoleSummary"}},"effectiveRoles":{"type":"array","items":{"$ref":"#/components/schemas/RoleSummary"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/UserSummary"}},"childGroups":{"type":"array","items":{"$ref":"#/components/schemas/GroupSummary"}}}},"TableSizeResponse":{"type":"object","description":"Table size and row count information","properties":{"tableName":{"type":"string","description":"Table name"},"rowCount":{"type":"integer","format":"int64","description":"Approximate row count"},"dataSize":{"type":"string","description":"Human-readable data size"},"indexSize":{"type":"string","description":"Human-readable index size"},"dataSizeBytes":{"type":"integer","format":"int64","description":"Data size in bytes"},"indexSizeBytes":{"type":"integer","format":"int64","description":"Index size in bytes"}}},"DatabaseStatusResponse":{"type":"object","description":"Database connection and version status","properties":{"connected":{"type":"boolean","description":"Whether the database is reachable"},"version":{"type":"string","description":"PostgreSQL version string"},"host":{"type":"string","description":"Database host"},"schema":{"type":"string","description":"Current schema"}}},"ActiveQueryResponse":{"type":"object","description":"Currently running database query","properties":{"pid":{"type":"integer","format":"int32","description":"Backend process ID"},"durationSeconds":{"type":"number","format":"double","description":"Query duration in seconds"},"state":{"type":"string","description":"Backend state (active, idle, etc.)"},"query":{"type":"string","description":"SQL query text"}}},"ConnectionPoolResponse":{"type":"object","description":"HikariCP connection pool statistics","properties":{"activeConnections":{"type":"integer","format":"int32","description":"Number of currently active connections"},"idleConnections":{"type":"integer","format":"int32","description":"Number of idle connections"},"pendingThreads":{"type":"integer","format":"int32","description":"Number of threads waiting for a connection"},"maxWaitMs":{"type":"integer","format":"int64","description":"Maximum wait time in milliseconds"},"maxPoolSize":{"type":"integer","format":"int32","description":"Maximum pool size"}}},"ClickHouseTableInfo":{"type":"object","description":"ClickHouse table information","properties":{"name":{"type":"string"},"engine":{"type":"string"},"rowCount":{"type":"integer","format":"int64"},"dataSize":{"type":"string"},"dataSizeBytes":{"type":"integer","format":"int64"},"partitionCount":{"type":"integer","format":"int32"}}},"ClickHouseStatusResponse":{"type":"object","description":"ClickHouse cluster status","properties":{"reachable":{"type":"boolean"},"version":{"type":"string"},"uptime":{"type":"string"},"host":{"type":"string"}}},"ClickHouseQueryInfo":{"type":"object","description":"Active ClickHouse query information","properties":{"queryId":{"type":"string"},"elapsedSeconds":{"type":"number","format":"double"},"memory":{"type":"string"},"readRows":{"type":"integer","format":"int64"},"query":{"type":"string"}}},"IndexerPipelineResponse":{"type":"object","description":"Search indexer pipeline statistics","properties":{"queueDepth":{"type":"integer","format":"int32"},"maxQueueSize":{"type":"integer","format":"int32"},"failedCount":{"type":"integer","format":"int64"},"indexedCount":{"type":"integer","format":"int64"},"debounceMs":{"type":"integer","format":"int64"},"indexingRate":{"type":"number","format":"double"},"lastIndexedAt":{"type":"string","format":"date-time"}}},"ClickHousePerformanceResponse":{"type":"object","description":"ClickHouse storage and performance metrics","properties":{"diskSize":{"type":"string"},"uncompressedSize":{"type":"string"},"compressionRatio":{"type":"number","format":"double"},"totalRows":{"type":"integer","format":"int64"},"partCount":{"type":"integer","format":"int32"},"memoryUsage":{"type":"string"},"currentQueries":{"type":"integer","format":"int32"}}},"AuditLogPageResponse":{"type":"object","description":"Paginated audit log entries","properties":{"items":{"type":"array","description":"Audit log entries","items":{"$ref":"#/components/schemas/AuditRecord"}},"totalCount":{"type":"integer","format":"int64","description":"Total number of matching entries"},"page":{"type":"integer","format":"int32","description":"Current page number (0-based)"},"pageSize":{"type":"integer","format":"int32","description":"Page size"},"totalPages":{"type":"integer","format":"int32","description":"Total number of pages"}}},"AuditRecord":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"timestamp":{"type":"string","format":"date-time"},"username":{"type":"string"},"action":{"type":"string"},"category":{"type":"string","enum":["INFRA","AUTH","USER_MGMT","CONFIG","RBAC","AGENT","OUTBOUND_CONNECTION_CHANGE","OUTBOUND_HTTP_TRUST_CHANGE","ALERT_RULE_CHANGE","ALERT_SILENCE_CHANGE"]},"target":{"type":"string"},"detail":{"type":"object","additionalProperties":{"type":"object"}},"result":{"type":"string","enum":["SUCCESS","FAILURE"]},"ipAddress":{"type":"string"},"userAgent":{"type":"string"}}}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}}} \ No newline at end of file diff --git a/ui/src/api/schema.d.ts b/ui/src/api/schema.d.ts index 55270541..d49d32f8 100644 --- a/ui/src/api/schema.d.ts +++ b/ui/src/api/schema.d.ts @@ -2221,6 +2221,16 @@ export interface components { /** Format: date-time */ createdAt?: string; }; + AgentLifecycleCondition: { + kind: "AgentLifecycleCondition"; + } & (Omit & { + scope?: components["schemas"]["AlertScope"]; + eventTypes?: ("REGISTERED" | "RE_REGISTERED" | "DEREGISTERED" | "WENT_STALE" | "WENT_DEAD" | "RECOVERED")[]; + /** Format: int32 */ + withinSeconds?: number; + /** @enum {string} */ + readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + }); AgentStateCondition: { kind: "AgentStateCondition"; } & (Omit & { @@ -2229,11 +2239,11 @@ export interface components { /** Format: int32 */ forSeconds?: number; /** @enum {string} */ - readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; }); AlertCondition: { /** @enum {string} */ - kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; }; AlertRuleRequest: { name?: string; @@ -2241,8 +2251,8 @@ export interface components { /** @enum {string} */ severity: "CRITICAL" | "WARNING" | "INFO"; /** @enum {string} */ - conditionKind: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; - condition: components["schemas"]["AgentStateCondition"] | components["schemas"]["DeploymentStateCondition"] | components["schemas"]["ExchangeMatchCondition"] | components["schemas"]["JvmMetricCondition"] | components["schemas"]["LogPatternCondition"] | components["schemas"]["RouteMetricCondition"]; + conditionKind: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + condition: components["schemas"]["AgentLifecycleCondition"] | components["schemas"]["AgentStateCondition"] | components["schemas"]["DeploymentStateCondition"] | components["schemas"]["ExchangeMatchCondition"] | components["schemas"]["JvmMetricCondition"] | components["schemas"]["LogPatternCondition"] | components["schemas"]["RouteMetricCondition"]; /** Format: int32 */ evaluationIntervalSeconds?: number; /** Format: int32 */ @@ -2274,7 +2284,7 @@ export interface components { scope?: components["schemas"]["AlertScope"]; states?: string[]; /** @enum {string} */ - readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; }); ExchangeFilter: { status?: string; @@ -2296,7 +2306,7 @@ export interface components { /** Format: int32 */ perExchangeLingerSeconds?: number; /** @enum {string} */ - readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; }); JvmMetricCondition: { kind: "JvmMetricCondition"; @@ -2312,7 +2322,7 @@ export interface components { /** Format: int32 */ windowSeconds?: number; /** @enum {string} */ - readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; }); LogPatternCondition: { kind: "LogPatternCondition"; @@ -2325,7 +2335,7 @@ export interface components { /** Format: int32 */ windowSeconds?: number; /** @enum {string} */ - readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; }); RouteMetricCondition: { kind: "RouteMetricCondition"; @@ -2340,7 +2350,7 @@ export interface components { /** Format: int32 */ windowSeconds?: number; /** @enum {string} */ - readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + readonly kind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; }); WebhookBindingRequest: { /** Format: uuid */ @@ -2361,8 +2371,8 @@ export interface components { severity?: "CRITICAL" | "WARNING" | "INFO"; enabled?: boolean; /** @enum {string} */ - conditionKind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; - condition?: components["schemas"]["AgentStateCondition"] | components["schemas"]["DeploymentStateCondition"] | components["schemas"]["ExchangeMatchCondition"] | components["schemas"]["JvmMetricCondition"] | components["schemas"]["LogPatternCondition"] | components["schemas"]["RouteMetricCondition"]; + conditionKind?: "ROUTE_METRIC" | "EXCHANGE_MATCH" | "AGENT_STATE" | "AGENT_LIFECYCLE" | "DEPLOYMENT_STATE" | "LOG_PATTERN" | "JVM_METRIC"; + condition?: components["schemas"]["AgentLifecycleCondition"] | components["schemas"]["AgentStateCondition"] | components["schemas"]["DeploymentStateCondition"] | components["schemas"]["ExchangeMatchCondition"] | components["schemas"]["JvmMetricCondition"] | components["schemas"]["LogPatternCondition"] | components["schemas"]["RouteMetricCondition"]; /** Format: int32 */ evaluationIntervalSeconds?: number; /** Format: int32 */ diff --git a/ui/src/components/MustacheEditor/alert-variables.ts b/ui/src/components/MustacheEditor/alert-variables.ts index 5886495b..634656de 100644 --- a/ui/src/components/MustacheEditor/alert-variables.ts +++ b/ui/src/components/MustacheEditor/alert-variables.ts @@ -42,6 +42,16 @@ export const ALERT_VARIABLES: AlertVariable[] = [ { path: 'app.id', type: 'uuid', description: 'App UUID', sampleValue: '33333333-...', availableForKinds: ['ROUTE_METRIC', 'EXCHANGE_MATCH', 'AGENT_STATE', 'DEPLOYMENT_STATE', 'LOG_PATTERN', 'JVM_METRIC'], mayBeNull: true }, + // AGENT_LIFECYCLE — agent + event subtree (distinct from AGENT_STATE's agent.* leaves) + { path: 'agent.app', type: 'string', description: 'Agent app slug', sampleValue: 'orders', + availableForKinds: ['AGENT_LIFECYCLE'] }, + { path: 'event.type', type: 'string', description: 'Lifecycle event type', sampleValue: 'WENT_DEAD', + availableForKinds: ['AGENT_LIFECYCLE'] }, + { path: 'event.timestamp', type: 'Instant', description: 'When the event happened', sampleValue: '2026-04-20T14:33:10Z', + availableForKinds: ['AGENT_LIFECYCLE'] }, + { path: 'event.detail', type: 'string', description: 'Free-text event detail', sampleValue: 'orders-0 STALE -> DEAD', + availableForKinds: ['AGENT_LIFECYCLE'], mayBeNull: true }, + // ROUTE_METRIC + EXCHANGE_MATCH share route.* { path: 'route.id', type: 'string', description: 'Route ID', sampleValue: 'route-1', availableForKinds: ['ROUTE_METRIC', 'EXCHANGE_MATCH'] }, @@ -56,7 +66,7 @@ export const ALERT_VARIABLES: AlertVariable[] = [ // AGENT_STATE + JVM_METRIC share agent.id/name; AGENT_STATE adds agent.state { path: 'agent.id', type: 'string', description: 'Agent instance ID', sampleValue: 'prod-orders-0', - availableForKinds: ['AGENT_STATE', 'JVM_METRIC'] }, + availableForKinds: ['AGENT_STATE', 'AGENT_LIFECYCLE', 'JVM_METRIC'] }, { path: 'agent.name', type: 'string', description: 'Agent display name', sampleValue: 'orders-0', availableForKinds: ['AGENT_STATE', 'JVM_METRIC'] }, { path: 'agent.state', type: 'string', description: 'Agent state', sampleValue: 'DEAD', diff --git a/ui/src/pages/Alerts/RuleEditor/ConditionStep.tsx b/ui/src/pages/Alerts/RuleEditor/ConditionStep.tsx index 2d5c21f6..12f17881 100644 --- a/ui/src/pages/Alerts/RuleEditor/ConditionStep.tsx +++ b/ui/src/pages/Alerts/RuleEditor/ConditionStep.tsx @@ -3,6 +3,7 @@ import type { FormState } from './form-state'; import { RouteMetricForm } from './condition-forms/RouteMetricForm'; import { ExchangeMatchForm } from './condition-forms/ExchangeMatchForm'; import { AgentStateForm } from './condition-forms/AgentStateForm'; +import { AgentLifecycleForm } from './condition-forms/AgentLifecycleForm'; import { DeploymentStateForm } from './condition-forms/DeploymentStateForm'; import { LogPatternForm } from './condition-forms/LogPatternForm'; import { JvmMetricForm } from './condition-forms/JvmMetricForm'; @@ -23,6 +24,13 @@ export function ConditionStep({ form, setForm }: { form: FormState; setForm: (f: base.perExchangeLingerSeconds = 300; base.filter = {}; } + if (kind === 'AGENT_LIFECYCLE') { + // Sensible defaults so a rule can be saved without touching every sub-field. + // WENT_DEAD is the most "alert-worthy" event out of the six; a 5-minute + // window matches the registry's STALE→DEAD cadence + slack for tick jitter. + base.eventTypes = ['WENT_DEAD']; + base.withinSeconds = 300; + } setForm({ ...form, conditionKind: kind, @@ -42,6 +50,7 @@ export function ConditionStep({ form, setForm }: { form: FormState; setForm: (f: {form.conditionKind === 'ROUTE_METRIC' && } {form.conditionKind === 'EXCHANGE_MATCH' && } {form.conditionKind === 'AGENT_STATE' && } + {form.conditionKind === 'AGENT_LIFECYCLE' && } {form.conditionKind === 'DEPLOYMENT_STATE' && } {form.conditionKind === 'LOG_PATTERN' && } {form.conditionKind === 'JVM_METRIC' && } diff --git a/ui/src/pages/Alerts/RuleEditor/condition-forms/AgentLifecycleForm.tsx b/ui/src/pages/Alerts/RuleEditor/condition-forms/AgentLifecycleForm.tsx new file mode 100644 index 00000000..6074575e --- /dev/null +++ b/ui/src/pages/Alerts/RuleEditor/condition-forms/AgentLifecycleForm.tsx @@ -0,0 +1,72 @@ +import { FormField, Input } from '@cameleer/design-system'; +import type { FormState } from '../form-state'; +import { + AGENT_LIFECYCLE_EVENT_TYPE_OPTIONS, + type AgentLifecycleEventType, +} from '../../enums'; + +/** + * Form for `AGENT_LIFECYCLE` conditions. Users pick one or more event types + * (allowlist only) and a lookback window in seconds. The evaluator queries + * `agent_events` with those filters; each matching row produces its own + * {@code AlertInstance}. + */ +export function AgentLifecycleForm({ form, setForm }: { form: FormState; setForm: (f: FormState) => void }) { + const c = form.condition as Record; + const selected = new Set( + Array.isArray(c.eventTypes) ? (c.eventTypes as AgentLifecycleEventType[]) : [], + ); + + const patch = (p: Record) => + setForm({ + ...form, + condition: { ...(form.condition as Record), ...p } as FormState['condition'], + }); + + const toggle = (t: AgentLifecycleEventType) => { + const next = new Set(selected); + if (next.has(t)) next.delete(t); else next.add(t); + patch({ eventTypes: [...next] }); + }; + + return ( + <> + +

+ {AGENT_LIFECYCLE_EVENT_TYPE_OPTIONS.map((opt) => { + const active = selected.has(opt.value); + return ( + + ); + })} +
+ + + patch({ withinSeconds: Number(e.target.value) })} + /> + + + ); +} diff --git a/ui/src/pages/Alerts/RuleEditor/form-state.ts b/ui/src/pages/Alerts/RuleEditor/form-state.ts index 120c70af..18f25cb5 100644 --- a/ui/src/pages/Alerts/RuleEditor/form-state.ts +++ b/ui/src/pages/Alerts/RuleEditor/form-state.ts @@ -160,6 +160,13 @@ export function validateStep(step: WizardStep, f: FormState): string[] { if (c.windowSeconds == null) errs.push('Window (seconds) is required for COUNT_IN_WINDOW.'); } } + if (f.conditionKind === 'AGENT_LIFECYCLE') { + const c = f.condition as Record; + const types = Array.isArray(c.eventTypes) ? (c.eventTypes as string[]) : []; + if (types.length === 0) errs.push('Pick at least one event type.'); + const within = c.withinSeconds as number | undefined; + if (within == null || within < 1) errs.push('Lookback window must be \u2265 1 second.'); + } } if (step === 'trigger') { if (f.evaluationIntervalSeconds < 5) errs.push('Evaluation interval must be \u2265 5 s.'); diff --git a/ui/src/pages/Alerts/enums.test.ts b/ui/src/pages/Alerts/enums.test.ts index 0e5f2584..7b12c906 100644 --- a/ui/src/pages/Alerts/enums.test.ts +++ b/ui/src/pages/Alerts/enums.test.ts @@ -7,6 +7,7 @@ import { JVM_AGGREGATION_OPTIONS, EXCHANGE_FIRE_MODE_OPTIONS, TARGET_KIND_OPTIONS, + AGENT_LIFECYCLE_EVENT_TYPE_OPTIONS, } from './enums'; /** @@ -25,12 +26,24 @@ describe('alerts/enums option arrays', () => { { value: 'ROUTE_METRIC', label: 'Route metric (error rate, latency, throughput)' }, { value: 'EXCHANGE_MATCH', label: 'Exchange match (specific failures)' }, { value: 'AGENT_STATE', label: 'Agent state (DEAD / STALE)' }, + { value: 'AGENT_LIFECYCLE', label: 'Agent lifecycle (register / restart / stale / dead)' }, { value: 'DEPLOYMENT_STATE', label: 'Deployment state (FAILED / DEGRADED)' }, { value: 'LOG_PATTERN', label: 'Log pattern (count of matching logs)' }, { value: 'JVM_METRIC', label: 'JVM metric (heap, GC, inflight)' }, ]); }); + it('AGENT_LIFECYCLE_EVENT_TYPE_OPTIONS', () => { + expect(AGENT_LIFECYCLE_EVENT_TYPE_OPTIONS).toEqual([ + { value: 'WENT_STALE', label: 'Went stale (heartbeat missed)' }, + { value: 'WENT_DEAD', label: 'Went dead (extended silence)' }, + { value: 'RECOVERED', label: 'Recovered (stale → live)' }, + { value: 'REGISTERED', label: 'Registered (first check-in)' }, + { value: 'RE_REGISTERED', label: 'Re-registered (app restart)' }, + { value: 'DEREGISTERED', label: 'Deregistered (graceful shutdown)' }, + ]); + }); + it('SEVERITY_OPTIONS', () => { expect(SEVERITY_OPTIONS).toEqual([ { value: 'CRITICAL', label: 'Critical' }, diff --git a/ui/src/pages/Alerts/enums.ts b/ui/src/pages/Alerts/enums.ts index 585141ae..16a7c759 100644 --- a/ui/src/pages/Alerts/enums.ts +++ b/ui/src/pages/Alerts/enums.ts @@ -44,6 +44,13 @@ export type RouteMetric = 'ERROR_RATE' | 'AVG_DURATION_MS' | 'P99_LATENCY_M export type Comparator = 'GT' | 'GTE' | 'LT' | 'LTE' | 'EQ'; export type JvmAggregation = 'MAX' | 'MIN' | 'AVG' | 'LATEST'; export type ExchangeFireMode = 'PER_EXCHANGE' | 'COUNT_IN_WINDOW'; +export type AgentLifecycleEventType = + | 'REGISTERED' + | 'RE_REGISTERED' + | 'DEREGISTERED' + | 'WENT_STALE' + | 'WENT_DEAD' + | 'RECOVERED'; export interface Option { value: T; label: string } @@ -73,6 +80,7 @@ const CONDITION_KIND_LABELS: Record = { ROUTE_METRIC: 'Route metric (error rate, latency, throughput)', EXCHANGE_MATCH: 'Exchange match (specific failures)', AGENT_STATE: 'Agent state (DEAD / STALE)', + AGENT_LIFECYCLE: 'Agent lifecycle (register / restart / stale / dead)', DEPLOYMENT_STATE: 'Deployment state (FAILED / DEGRADED)', LOG_PATTERN: 'Log pattern (count of matching logs)', JVM_METRIC: 'JVM metric (heap, GC, inflight)', @@ -114,6 +122,15 @@ const EXCHANGE_FIRE_MODE_LABELS: Record = { COUNT_IN_WINDOW: 'Threshold: N matches in window', }; +const AGENT_LIFECYCLE_EVENT_TYPE_LABELS: Record = { + WENT_STALE: 'Went stale (heartbeat missed)', + WENT_DEAD: 'Went dead (extended silence)', + RECOVERED: 'Recovered (stale → live)', + REGISTERED: 'Registered (first check-in)', + RE_REGISTERED: 'Re-registered (app restart)', + DEREGISTERED: 'Deregistered (graceful shutdown)', +}; + const TARGET_KIND_LABELS: Record = { USER: 'User', GROUP: 'Group', @@ -147,3 +164,5 @@ export const COMPARATOR_OPTIONS: Option[] = toOptions export const JVM_AGGREGATION_OPTIONS: Option[] = toOptions(JVM_AGGREGATION_LABELS, JVM_AGGREGATION_HIDDEN); export const EXCHANGE_FIRE_MODE_OPTIONS: Option[] = toOptions(EXCHANGE_FIRE_MODE_LABELS); export const TARGET_KIND_OPTIONS: Option[] = toOptions(TARGET_KIND_LABELS); +export const AGENT_LIFECYCLE_EVENT_TYPE_OPTIONS: Option[] = + toOptions(AGENT_LIFECYCLE_EVENT_TYPE_LABELS);