diff --git a/go.mod b/go.mod
index a05b895..2d76bbf 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/flashcatcloud/flashduty-cli
go 1.25.1
require (
- github.com/flashcatcloud/go-flashduty v0.15.3
+ github.com/flashcatcloud/go-flashduty v0.15.4
github.com/mattn/go-runewidth v0.0.29
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
diff --git a/go.sum b/go.sum
index bc67339..a018110 100644
--- a/go.sum
+++ b/go.sum
@@ -1,8 +1,8 @@
github.com/clipperhouse/uax29/v2 v2.2.0 h1:ChwIKnQN3kcZteTXMgb1wztSgaU+ZemkgWdohwgs8tY=
github.com/clipperhouse/uax29/v2 v2.2.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
-github.com/flashcatcloud/go-flashduty v0.15.3 h1:NKxAupco3bE5GuToAYt5DHtdWg/gdwcwfguyenc/umI=
-github.com/flashcatcloud/go-flashduty v0.15.3/go.mod h1:YpHiTYXR5NXBI/rGRZfUy537XMkhdCkwA8NW1QoRHwk=
+github.com/flashcatcloud/go-flashduty v0.15.4 h1:Bp7OnOd3dO0BmG2ystR7ycRRCJCwqyEEtonixWzzC3Q=
+github.com/flashcatcloud/go-flashduty v0.15.4/go.mod h1:YpHiTYXR5NXBI/rGRZfUy537XMkhdCkwA8NW1QoRHwk=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/mattn/go-runewidth v0.0.29 h1:3oGF3R/S2N9DQ3ptftzVIvg2eicmojCzlwBEmqEPDfQ=
diff --git a/internal/cli/gen_support_test.go b/internal/cli/gen_support_test.go
index 39bda16..a1a26d4 100644
--- a/internal/cli/gen_support_test.go
+++ b/internal/cli/gen_support_test.go
@@ -287,44 +287,6 @@ func TestPrintGenericResultShortenedRowStaysUTF8(t *testing.T) {
}
}
-// TestMemberNotifyDryRunPrintsWholeEmail pins that a notify dry run is a
-// plain object, not a list page: an email past the structured-output limit
-// comes back whole, with every recipient outcome, instead of failing on the
-// list bound.
-func TestMemberNotifyDryRunPrintsWholeEmail(t *testing.T) {
- html := "
" + strings.Repeat("report line ", 5000) + "
"
- for _, format := range []string{"json", "toon"} {
- t.Run(format, func(t *testing.T) {
- saveAndResetGlobals(t)
- stub := newGFStub(t)
- stub.data = map[string]any{
- "recipients": []any{
- map[string]any{"person_id": 5068740052131, "status": "accepted"},
- map[string]any{"person_id": 5068740052132, "status": "skipped", "reason": "no_email"},
- },
- "html": html,
- }
-
- out, stderrText, err := execCommandSplit("member", "notify",
- "--subject", "Daily report", "--html", "report
", "--dry-run", "--output-format", format)
- if err != nil {
- t.Fatalf("execCommandSplit: %v", err)
- }
- if len(out) < compactListOutputLimit || !strings.Contains(out, strings.Repeat("report line ", 5000)) {
- t.Errorf("%s dry run lost part of the email: %d bytes", format, len(out))
- }
- for _, want := range []string{"5068740052131", "5068740052132", "no_email"} {
- if !strings.Contains(out, want) {
- t.Errorf("%s dry run lost recipient outcome %q", format, want)
- }
- }
- if strings.Contains(out, "truncated") || strings.Contains(stderrText, "note:") {
- t.Errorf("%s dry run must not be reduced, stderr:\n%s", format, stderrText)
- }
- })
- }
-}
-
// TestPrintGenericResultCompleteEnvelopeUnmarked guards the marker's negative
// case: a page that fits carries no truncated/emitted_rows keys — the marker
// means "this page was reduced", not "this command supports reduction".
diff --git a/internal/cli/zz_generated_alert_rules.go b/internal/cli/zz_generated_alert_rules.go
index ddf2dc9..f80d104 100644
--- a/internal/cli/zz_generated_alert_rules.go
+++ b/internal/cli/zz_generated_alert_rules.go
@@ -188,114 +188,6 @@ Response fields ('data' is a TOP-LEVEL array of these row objects — pipe 'jq '
return cmd
}
-func genAlertRulesReadExportCmd() *cobra.Command {
- var dataJSON string
- var fIDs []int
- cmd := &cobra.Command{
- Use: "rule-export",
- Short: "Export alert rules",
- Long: `Export alert rules.
-
-Export the configuration of selected alert rules as a portable JSON array, compatible with 'POST /monit/rule/import'.
-
-API: POST /monit/rule/export (monit-rule-read-export)
-
-Request fields:
- --ids []int (required) — Rule IDs.
-
-Response fields ('data' is a TOP-LEVEL array of these row objects — pipe 'jq '.[]'', NOT '.items[]'):
- - annotations (object) — Custom annotation key-value pairs attached to alert events; keys must not start with '$' (reserved for query field references).
- - cron_pattern (string) (required) — Evaluation schedule as a 6-field cron expression (seconds included) or '@every ' (an integral number of seconds, at least 1s); 'CRON_TZ='/'TZ=' prefixes are rejected — set the timezone in 'timezone' instead.
- - debug_log_enabled (boolean) (required) — Whether to emit debug logs for this rule's evaluations; enable when troubleshooting.
- - delay_seconds (integer) — Query time offset in seconds: each evaluation reads data as of 'schedule time − delay_seconds' to tolerate ingestion lag; '0' means no offset.
- - description (string) — Rule description in the format given by 'description_type', shown with alert events.
- - description_type (string) — Format of 'description', 'text' or 'markdown'; treated as 'text' when omitted. [text, markdown]
- - ds_ids (array) — Datasource ID list, merged with 'ds_list'; references by ID and is therefore immune to datasource renames.
- - ds_list (array) — Datasource name list with wildcard support; merged with 'ds_ids' to decide which datasources the rule monitors — must be maintained by hand if a datasource is renamed.
- - ds_type (string) (required) — Datasource type ident, e.g. 'prometheus'; must be a datasource type ('ident') that exists in the import target environment.
- - enabled (boolean) (required) — Whether the rule is enabled; rules imported as disabled are not evaluated.
- - enabled_times (array) — Effective time windows; each entry has 'days' (0–6, 0 = Sunday) and 'stime'/'etime' ('HH:MM'), interpreted in the rule's 'timezone'; an empty list disables the rule.
- - days (array) — Days of week, 0 = Sunday.
- - etime (string) — End time, e.g. '18:00'.
- - stime (string) — Start time, e.g. '09:00'.
- - labels (object) — Custom label key-value pairs attached to alert events produced by this rule.
- - name (string) (required) — Rule name, up to 128 characters when imported.
- - repeat_interval (integer) — Interval in seconds between repeated notifications for a firing alert; values below 1 fall back to the default of 3600.
- - repeat_total (integer) — Maximum number of repeated notifications for the same alert; values below 1 fall back to the default of 3.
- - rule_configs (object) — Rule evaluation configuration.
- - check_anydata (object) — Any-data check configuration. Fires when the query returns any data rows.
- - alerting_check_times (integer) — Number of consecutive evaluations that must satisfy the condition before alerting; minimum 1.
- - enabled (boolean) — Whether any-data checking is enabled: any returned data row triggers an alert.
- - push_recovery_event (boolean) — Whether to push a recovery event notification when the alert resolves.
- - recovery (object) — Recovery condition for any-data check. If omitted or 'mode' is empty, treated as 'nodata'.
- - args (object) — Datasource-specific options for the recovery query, same convention as 'queries[].args'; required for Elasticsearch datasources when 'mode' is 'ql'.
- - condition (string) — Recovery expression. Required when 'mode' is 'ql'.
- - mode (string) — 'nodata' = recover when the query returns no data; 'ql' = recover when the 'condition' expression evaluates to true. When 'mode' is 'ql', only a single query ('name=A') is permitted. [nodata, ql]
- - recovery_check_times (integer) — Number of consecutive evaluations that must satisfy the recovery condition before resolving; minimum 1.
- - severity (string) — Severity of any-data alert events; case-sensitive. [Critical, Warning, Info]
- - check_nodata (object) — No-data check configuration.
- - alert_on_empty_result (boolean) — Whether to trigger an alert when every query returns an empty result.
- - alert_on_empty_result_severity (string) — Severity of empty-result alerts, case-sensitive; only effective when 'alert_on_empty_result' is enabled. [Critical, Warning, Info]
- - alerting_check_times (integer) — Number of consecutive evaluations that must satisfy the condition before alerting; minimum 1.
- - enabled (boolean) — Whether no-data checking is enabled: a previously-seen series that stops returning data triggers an alert.
- - push_recovery_event (boolean) — Whether to push a recovery event notification when the alert resolves.
- - recovery_check_times (integer) — Number of consecutive evaluations that must satisfy the recovery condition before resolving; minimum 1.
- - resolve_timeout (integer) — Auto-resolve after N seconds.
- - severity (string) — Severity of no-data alert events; case-sensitive. [Critical, Warning, Info]
- - check_threshold (object) — Threshold check configuration.
- - alerting_check_times (integer) — Number of consecutive evaluations that must satisfy the condition before alerting; minimum 1.
- - critical (string) — Critical threshold expression referencing query results via '$' or '$.', e.g. '$A > 90'; at least one severity must be configured.
- - enabled (boolean) — Whether threshold checking is enabled.
- - info (string) — Info threshold expression, same syntax as 'critical'.
- - push_recovery_event (boolean) — Whether to push a recovery event notification when the alert resolves.
- - recovery (object) — Recovery evaluation configuration for threshold checks.
- - args (object) — Datasource-specific extra parameters for the recovery query, using the same '. ' key convention as query 'args'. Omitted when empty.
- - condition (string) — Recovery condition expression; required when 'mode' is 'threshold' or 'ql', and must be empty for 'invert'.
- - mode (string) — Recovery mode: 'invert' = resolve when the alert expression no longer holds ('condition' stays empty); 'threshold' = resolve when the 'condition' threshold expression holds; 'ql' = resolve when the 'condition' query expression evaluates true. [invert, threshold, ql]
- - value_fields (array) — Numeric result fields the recovery 'condition' references as '$A.'; same semantics as the query's 'value_fields'. Omitted when empty.
- - recovery_check_times (integer) — Number of consecutive evaluations that must satisfy the recovery condition before resolving; minimum 1.
- - warning (string) — Warning threshold expression, same syntax as 'critical'.
- - queries (array) (required) — Query list with at least one entry; each needs a unique 'name' ('R' and '__all__' are reserved) and a non-empty, non-duplicate 'expr'.
- - args (object) — Datasource-specific query options keyed by the '.' convention (e.g. 'es.type', 'tencent_cls.limit'); most datasources need none.
- - expr (string) — Query expression.
- - label_fields (array) — Result fields that become alert event labels — identical label sets collapse into one alert; must not overlap 'value_fields'; applies to table-shaped results (SQL/ES-style datasources).
- - name (string) — Query identifier (letter, e.g. 'A'). The name 'R' is reserved and must not be used.
- - value_fields (array) — Numeric result fields used in threshold evaluation (referenced as '$A.' in threshold expressions); required for threshold checks unless the datasource is 'prometheus'/'loki'/'victorialogs'; field names must not contain '.'.
- - relate_queries (array) — Optional auxiliary queries whose results are attached to alert events as context. Each entry must have a unique 'name' (not duplicating any query name) and a non-empty 'expr'.
- - args (object) — Datasource-specific options for the auxiliary query, same convention as 'queries[].args'.
- - expr (string) — Query expression.
- - name (string) — Relate-query identifier.
- - timezone (string) — Timezone in which the rule executes. IANA timezone name; defaults to 'Asia/Shanghai'.
-`,
- Example: ` flashduty monit rule-export --data '{"ids":[50001]}'`,
- RunE: func(cmd *cobra.Command, args []string) error {
- return runCommand(cmd, args, func(ctx *RunContext) error {
- body, err := genAssembleBody(dataJSON, func(body map[string]any) error {
- if cmd.Flags().Changed("ids") {
- body["ids"] = fIDs
- }
- return nil
- })
- if err != nil {
- return err
- }
- req := new(flashduty.RuleIDsRequest)
- if err := genBindBody(body, req); err != nil {
- return err
- }
- out, _, err := ctx.Client.AlertRules.ReadExport(cmdContext(ctx.Cmd), req)
- if err != nil {
- return err
- }
- return printGenericResult(ctx, out)
- })
- },
- }
- cmd.Flags().IntSliceVar(&fIDs, "ids", nil, "Rule IDs. (required)")
- cmd.Flags().StringVar(&dataJSON, "data", "", "Full request body as JSON; positional arguments and typed flags override its fields. Accepts inline JSON, or - to read stdin.")
- return cmd
-}
-
func genAlertRulesReadInfoV2Cmd() *cobra.Command {
var dataJSON string
var fID int64
@@ -337,8 +229,18 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le
- dashboard (object) — Configuration for the 'dashboard' kind; required when 'kind' is 'dashboard'.
- dashboard_id (string) (required) — Target dashboard ID; must be a canonical UUIDv7.
- target_id (string) — Panel ID inside the dashboard; must be a canonical UUIDv7. Optional.
- - variable_bindings (object) — Dashboard variable bindings, keyed by dashboard variable name.
- - kind (string) (required) — Entry type; currently only 'dashboard' is supported. [dashboard]
+ - variables (object) (required) — Dashboard variable values, keyed by variable name. Values may reference event labels through '{{ }}' templates; defaults to an empty object.
+ - kind (string) (required) — Entry kind: 'dashboard' opens a dashboard panel, 'query' opens an Explore query. It decides whether 'dashboard' or 'query' must be supplied; supplying the other one is rejected. [dashboard, query]
+ - query (object) — Configuration for the 'query' kind; required when 'kind' is 'query', and rejected when 'kind' is 'dashboard'.
+ - datasource_id (integer) (required) — Data source the query runs against. (1-9007199254740991)
+ - query (object) (required) — Query payload.
+ - args (object) (required) — Named query arguments; defaults to an empty object. Values are passed through verbatim and must not contain '{{ }}' templates.
+ - expr (string) (required) — Query expression in the target data source's language. May reference event labels through '{{ }}' templates.
+ - min_step_seconds (integer) — Minimum step, in seconds. Only accepted when 'mode' is 'range', and must be greater than zero; omit or pass null to let the server decide. (1-9007199254740)
+ - mode (string) (required) — Evaluation mode: 'instant' evaluates at a single timestamp, 'range' evaluates a stepped series, 'window' returns raw rows inside a time window. [instant, range, window]
+ - time_range (object) (required) — Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor.
+ - after_seconds (integer) (required) — Seconds to look forward from the event time, so behaviour after the event stays visible. (0-9007199254740)
+ - before_seconds (integer) (required) — Seconds to look back from the event time. (0-9007199254740)
- labels (object) — Custom labels.
- name (string) (required) — Rule name. Must be unique within the folder and at most 128 characters.
- repeat_interval (integer) — Notification repeat interval in seconds. Values below 1 fall back to the default 3600.
@@ -573,8 +475,18 @@ Request fields:
- dashboard (object) — Configuration for the 'dashboard' kind; required when 'kind' is 'dashboard'.
- dashboard_id (string) (required) — Target dashboard ID; must be a canonical UUIDv7.
- target_id (string) — Panel ID inside the dashboard; must be a canonical UUIDv7. Optional.
- - variable_bindings (object) — Dashboard variable bindings, keyed by dashboard variable name.
- - kind (string) (required) — Entry type; currently only 'dashboard' is supported. [dashboard]
+ - variables (object) (required) — Dashboard variable values, keyed by variable name. Values may reference event labels through '{{ }}' templates; defaults to an empty object.
+ - kind (string) (required) — Entry kind: 'dashboard' opens a dashboard panel, 'query' opens an Explore query. It decides whether 'dashboard' or 'query' must be supplied; supplying the other one is rejected. [dashboard, query]
+ - query (object) — Configuration for the 'query' kind; required when 'kind' is 'query', and rejected when 'kind' is 'dashboard'.
+ - datasource_id (integer) (required) — Data source the query runs against. (1-9007199254740991)
+ - query (object) (required) — Query payload.
+ - args (object) (required) — Named query arguments; defaults to an empty object. Values are passed through verbatim and must not contain '{{ }}' templates.
+ - expr (string) (required) — Query expression in the target data source's language. May reference event labels through '{{ }}' templates.
+ - min_step_seconds (integer) — Minimum step, in seconds. Only accepted when 'mode' is 'range', and must be greater than zero; omit or pass null to let the server decide. (1-9007199254740)
+ - mode (string) (required) — Evaluation mode: 'instant' evaluates at a single timestamp, 'range' evaluates a stepped series, 'window' returns raw rows inside a time window. [instant, range, window]
+ - time_range (object) (required) — Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor.
+ - after_seconds (integer) (required) — Seconds to look forward from the event time, so behaviour after the event stays visible. (0-9007199254740)
+ - before_seconds (integer) (required) — Seconds to look back from the event time. (0-9007199254740)
labels (object, via --data) — Custom labels.
rule_configs (object, via --data) (required) — Detection configuration: query list plus trigger/recovery conditions. See 'AlertRuleConfigsV2'.
- check_anydata (object) — Any-data check configuration: fires when a query returns any data row. See 'AlertRuleAnyDataV2'.
@@ -648,8 +560,18 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le
- dashboard (object) — Configuration for the 'dashboard' kind; required when 'kind' is 'dashboard'.
- dashboard_id (string) (required) — Target dashboard ID; must be a canonical UUIDv7.
- target_id (string) — Panel ID inside the dashboard; must be a canonical UUIDv7. Optional.
- - variable_bindings (object) — Dashboard variable bindings, keyed by dashboard variable name.
- - kind (string) (required) — Entry type; currently only 'dashboard' is supported. [dashboard]
+ - variables (object) (required) — Dashboard variable values, keyed by variable name. Values may reference event labels through '{{ }}' templates; defaults to an empty object.
+ - kind (string) (required) — Entry kind: 'dashboard' opens a dashboard panel, 'query' opens an Explore query. It decides whether 'dashboard' or 'query' must be supplied; supplying the other one is rejected. [dashboard, query]
+ - query (object) — Configuration for the 'query' kind; required when 'kind' is 'query', and rejected when 'kind' is 'dashboard'.
+ - datasource_id (integer) (required) — Data source the query runs against. (1-9007199254740991)
+ - query (object) (required) — Query payload.
+ - args (object) (required) — Named query arguments; defaults to an empty object. Values are passed through verbatim and must not contain '{{ }}' templates.
+ - expr (string) (required) — Query expression in the target data source's language. May reference event labels through '{{ }}' templates.
+ - min_step_seconds (integer) — Minimum step, in seconds. Only accepted when 'mode' is 'range', and must be greater than zero; omit or pass null to let the server decide. (1-9007199254740)
+ - mode (string) (required) — Evaluation mode: 'instant' evaluates at a single timestamp, 'range' evaluates a stepped series, 'window' returns raw rows inside a time window. [instant, range, window]
+ - time_range (object) (required) — Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor.
+ - after_seconds (integer) (required) — Seconds to look forward from the event time, so behaviour after the event stays visible. (0-9007199254740)
+ - before_seconds (integer) (required) — Seconds to look back from the event time. (0-9007199254740)
- labels (object) — Custom labels.
- name (string) (required) — Rule name. Must be unique within the folder and at most 128 characters.
- repeat_interval (integer) — Notification repeat interval in seconds. Values below 1 fall back to the default 3600.
@@ -1067,46 +989,6 @@ Response fields ('data' is a TOP-LEVEL array of these row objects — pipe 'jq '
return cmd
}
-func genAlertRulesWriteImportCmd() *cobra.Command {
- var dataJSON string
- cmd := &cobra.Command{
- Use: "rule-import",
- Short: "Import alert rules",
- Long: `Import alert rules.
-
-Import one or more alert rules from a JSON array. Returns the result for each rule, indicating success or failure.
-
-API: POST /monit/rule/import (monit-rule-write-import)
-
-Response fields ('data' is a TOP-LEVEL array of these row objects — pipe 'jq '.[]'', NOT '.items[]'):
- - message (string) (required) — Empty on success, error message on failure.
- - name (string) (required) — Rule name.
-`,
- Example: ` flashduty monit rule-import --data '[{"cron_pattern":"0 * * * * *","ds_list":["prometheus*"],"ds_type":"prometheus","enabled":true,"folder_id":100,"name":"CPU High","rule_configs":{"queries":[{"expr":"avg(cpu_usage_idle) \u003c 10","name":"A"}]}}]'`,
- RunE: func(cmd *cobra.Command, args []string) error {
- return runCommand(cmd, args, func(ctx *RunContext) error {
- body, err := genAssembleBody(dataJSON, func(body map[string]any) error {
- return nil
- })
- if err != nil {
- return err
- }
- req := new(flashduty.RuleImportRequest)
- if err := genBindBody(body, req); err != nil {
- return err
- }
- out, _, err := ctx.Client.AlertRules.WriteImport(cmdContext(ctx.Cmd), req)
- if err != nil {
- return err
- }
- return printGenericResult(ctx, out)
- })
- },
- }
- cmd.Flags().StringVar(&dataJSON, "data", "", "Full request body as JSON; positional arguments and typed flags override its fields. Accepts inline JSON, or - to read stdin.")
- return cmd
-}
-
func genAlertRulesWriteMoveCmd() *cobra.Command {
var dataJSON string
var fDestFolderID int64
@@ -1228,8 +1110,18 @@ Request fields:
- dashboard (object) — Configuration for the 'dashboard' kind; required when 'kind' is 'dashboard'.
- dashboard_id (string) (required) — Target dashboard ID; must be a canonical UUIDv7.
- target_id (string) — Panel ID inside the dashboard; must be a canonical UUIDv7. Optional.
- - variable_bindings (object) — Dashboard variable bindings, keyed by dashboard variable name.
- - kind (string) (required) — Entry type; currently only 'dashboard' is supported. [dashboard]
+ - variables (object) (required) — Dashboard variable values, keyed by variable name. Values may reference event labels through '{{ }}' templates; defaults to an empty object.
+ - kind (string) (required) — Entry kind: 'dashboard' opens a dashboard panel, 'query' opens an Explore query. It decides whether 'dashboard' or 'query' must be supplied; supplying the other one is rejected. [dashboard, query]
+ - query (object) — Configuration for the 'query' kind; required when 'kind' is 'query', and rejected when 'kind' is 'dashboard'.
+ - datasource_id (integer) (required) — Data source the query runs against. (1-9007199254740991)
+ - query (object) (required) — Query payload.
+ - args (object) (required) — Named query arguments; defaults to an empty object. Values are passed through verbatim and must not contain '{{ }}' templates.
+ - expr (string) (required) — Query expression in the target data source's language. May reference event labels through '{{ }}' templates.
+ - min_step_seconds (integer) — Minimum step, in seconds. Only accepted when 'mode' is 'range', and must be greater than zero; omit or pass null to let the server decide. (1-9007199254740)
+ - mode (string) (required) — Evaluation mode: 'instant' evaluates at a single timestamp, 'range' evaluates a stepped series, 'window' returns raw rows inside a time window. [instant, range, window]
+ - time_range (object) (required) — Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor.
+ - after_seconds (integer) (required) — Seconds to look forward from the event time, so behaviour after the event stays visible. (0-9007199254740)
+ - before_seconds (integer) (required) — Seconds to look back from the event time. (0-9007199254740)
labels (object, via --data) — Custom labels.
rule_configs (object, via --data) (required) — Detection configuration: query list plus trigger/recovery conditions. See 'AlertRuleConfigsV2'.
- check_anydata (object) — Any-data check configuration: fires when a query returns any data row. See 'AlertRuleAnyDataV2'.
@@ -1303,8 +1195,18 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le
- dashboard (object) — Configuration for the 'dashboard' kind; required when 'kind' is 'dashboard'.
- dashboard_id (string) (required) — Target dashboard ID; must be a canonical UUIDv7.
- target_id (string) — Panel ID inside the dashboard; must be a canonical UUIDv7. Optional.
- - variable_bindings (object) — Dashboard variable bindings, keyed by dashboard variable name.
- - kind (string) (required) — Entry type; currently only 'dashboard' is supported. [dashboard]
+ - variables (object) (required) — Dashboard variable values, keyed by variable name. Values may reference event labels through '{{ }}' templates; defaults to an empty object.
+ - kind (string) (required) — Entry kind: 'dashboard' opens a dashboard panel, 'query' opens an Explore query. It decides whether 'dashboard' or 'query' must be supplied; supplying the other one is rejected. [dashboard, query]
+ - query (object) — Configuration for the 'query' kind; required when 'kind' is 'query', and rejected when 'kind' is 'dashboard'.
+ - datasource_id (integer) (required) — Data source the query runs against. (1-9007199254740991)
+ - query (object) (required) — Query payload.
+ - args (object) (required) — Named query arguments; defaults to an empty object. Values are passed through verbatim and must not contain '{{ }}' templates.
+ - expr (string) (required) — Query expression in the target data source's language. May reference event labels through '{{ }}' templates.
+ - min_step_seconds (integer) — Minimum step, in seconds. Only accepted when 'mode' is 'range', and must be greater than zero; omit or pass null to let the server decide. (1-9007199254740)
+ - mode (string) (required) — Evaluation mode: 'instant' evaluates at a single timestamp, 'range' evaluates a stepped series, 'window' returns raw rows inside a time window. [instant, range, window]
+ - time_range (object) (required) — Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor.
+ - after_seconds (integer) (required) — Seconds to look forward from the event time, so behaviour after the event stays visible. (0-9007199254740)
+ - before_seconds (integer) (required) — Seconds to look back from the event time. (0-9007199254740)
- labels (object) — Custom labels.
- name (string) (required) — Rule name. Must be unique within the folder and at most 128 characters.
- repeat_interval (integer) — Notification repeat interval in seconds. Values below 1 fall back to the default 3600.
@@ -1494,14 +1396,12 @@ func registerGeneratedAlertRules(root *cobra.Command) {
genAddLeaf(gMonit, genAlertRulesReadAuditsCmd())
genAddLeaf(gMonit, genAlertRulesReadCounterChannelCmd())
genAddLeaf(gMonit, genAlertRulesReadCounterTotalCmd())
- genAddLeaf(gMonit, genAlertRulesReadExportCmd())
genAddLeaf(gMonit, genAlertRulesReadInfoV2Cmd())
genAddLeaf(gMonit, genAlertRulesReadListCmd())
genAddLeaf(gMonit, genAlertRulesWriteCreateV2Cmd())
genAddLeaf(gMonit, genAlertRulesWriteDeleteCmd())
genAddLeaf(gMonit, genAlertRulesWriteDeleteBatchCmd())
genAddLeaf(gMonit, genAlertRulesWriteFieldsUpdateCmd())
- genAddLeaf(gMonit, genAlertRulesWriteImportCmd())
genAddLeaf(gMonit, genAlertRulesWriteMoveCmd())
genAddLeaf(gMonit, genAlertRulesWriteUpdateV2Cmd())
}
diff --git a/internal/cli/zz_generated_alerts.go b/internal/cli/zz_generated_alerts.go
index 7f3d411..281da42 100644
--- a/internal/cli/zz_generated_alerts.go
+++ b/internal/cli/zz_generated_alerts.go
@@ -281,6 +281,7 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[];
- has_next_page (boolean) — Whether a next page exists.
- items (array) — Alert feed records on the current page.
- account_id (integer) (required) — Account ID.
+ - agent_session_id (string) — AI SRE session that produced the entry. Omitted when no agent wrote it.
- created_at (string) (required) — Creation timestamp in Unix epoch milliseconds. CLI '--json' renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.
- creator_id (integer) (required) — Member ID of the creator. 0 for system-generated entries.
- deleted_at (string) — Soft-delete time, Unix epoch milliseconds. Omitted when not deleted. CLI '--json' renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.
@@ -307,6 +308,7 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[];
- ref_id (string) (required) — ObjectID of the alert this entry references.
- type (string) (required) — Alert activity feed entry type. Each value identifies one alert lifecycle event; the matching 'detail' payload shape is determined by this field. | Type | Meaning | |---|---| | 'a_new' | Alert triggered by an incoming event. | | 'a_update' | Alert severity or status changed on an incoming event. | | 'a_comm' | Comment added on the alert. | | 'a_merge' | Alert merged into an incident. | | 'a_m_silence' | Alert muted by a silence rule. | | 'a_m_inhibit' | Alert muted by an inhibit rule. | | 'a_m_flapping' | Alert muted by flapping detection (historical data only; no longer produced). | | 'a_ack' | Alert acknowledged (historical data only; alert-level acknowledgement has been removed). | | 'a_unack' | Alert acknowledgement revoked (historical data only). | | 'a_close' | Alert closed (historical data only; no longer produced). | [a_new, a_update, a_comm, a_merge, a_m_silence, a_m_inhibit, a_m_flapping, a_ack, a_unack, a_close]
- updated_at (string) (required) — Last update timestamp in Unix epoch milliseconds. CLI '--json' renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.
+ - via (string) — Surface that wrote the entry on a user's behalf; currently only 'ai_sre'. Omitted when a user created the entry directly.
`,
Args: requireBodyFieldOrExactArg("alert_id", "alert-id"),
Example: ` flashduty alert feed --data '{"alert_id":"663a1b2c3d4e5f6789abcdef","asc":false,"limit":20}'`,
diff --git a/internal/cli/zz_generated_applications.go b/internal/cli/zz_generated_applications.go
index 4ed818f..bb60b19 100644
--- a/internal/cli/zz_generated_applications.go
+++ b/internal/cli/zz_generated_applications.go
@@ -49,6 +49,9 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le
- url (string) (required) — HTTP or HTTPS URL template. '${var}' tokens are resolved from the RUM event context.
- no_geo (boolean) — If 'true', geographic location is not inferred from IP.
- no_ip (boolean) — If 'true', IP addresses are not collected.
+ - repositories (array) — Linked source code repositories, in order; the first entry is the primary repository. Linking grants no access by itself: AI sessions can only read repositories granted to the account's GitHub App installations.
+ - repo (string) (required) — GitHub repository in 'owner/name' form.
+ - subdir (string) — Directory holding the application inside the repository, relative to the repository root. '.' is the repository root; an empty value is saved as '.'.
- status (string) — Application status. One of 'enabled' (active, receiving data), 'disabled' (deactivated), 'deleted' (soft-delete marker; every query filters it out, so it never actually appears in responses). [enabled, disabled, deleted]
- team_id (integer) — Owning team ID.
- tracing (object) — APM tracing integration configuration.
@@ -134,6 +137,9 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[];
- url (string) (required) — HTTP or HTTPS URL template. '${var}' tokens are resolved from the RUM event context.
- no_geo (boolean) — If 'true', geographic location is not inferred from IP.
- no_ip (boolean) — If 'true', IP addresses are not collected.
+ - repositories (array) — Linked source code repositories, in order; the first entry is the primary repository. Linking grants no access by itself: AI sessions can only read repositories granted to the account's GitHub App installations.
+ - repo (string) (required) — GitHub repository in 'owner/name' form.
+ - subdir (string) — Directory holding the application inside the repository, relative to the repository root. '.' is the repository root; an empty value is saved as '.'.
- status (string) — Application status. One of 'enabled' (active, receiving data), 'disabled' (deactivated), 'deleted' (soft-delete marker; every query filters it out, so it never actually appears in responses). [enabled, disabled, deleted]
- team_id (integer) — Owning team ID.
- tracing (object) — APM tracing integration configuration.
@@ -234,6 +240,9 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[];
- url (string) (required) — HTTP or HTTPS URL template. '${var}' tokens are resolved from the RUM event context.
- no_geo (boolean) — If 'true', geographic location is not inferred from IP.
- no_ip (boolean) — If 'true', IP addresses are not collected.
+ - repositories (array) — Linked source code repositories, in order; the first entry is the primary repository. Linking grants no access by itself: AI sessions can only read repositories granted to the account's GitHub App installations.
+ - repo (string) (required) — GitHub repository in 'owner/name' form.
+ - subdir (string) — Directory holding the application inside the repository, relative to the repository root. '.' is the repository root; an empty value is saved as '.'.
- status (string) — Application status. One of 'enabled' (active, receiving data), 'disabled' (deactivated), 'deleted' (soft-delete marker; every query filters it out, so it never actually appears in responses). [enabled, disabled, deleted]
- team_id (integer) — Owning team ID.
- tracing (object) — APM tracing integration configuration.
@@ -801,6 +810,9 @@ Request fields:
- id (string) — Stable client-side identifier for this external system.
- name (string) (required) — Display name of the external system.
- url (string) (required) — HTTP or HTTPS URL template. '${var}' tokens are resolved from the RUM event context.
+ repositories (array, via --data) — Source code repositories to link, in order; the first entry is the primary repository. At most 10 entries.
+ - repo (string) (required) — GitHub repository in 'owner/name' form.
+ - subdir (string) — Directory holding the application inside the repository, relative to the repository root. '.' is the repository root; an empty value is saved as '.'.
tracing (object, via --data) — Optional APM tracing integration configuration.
- enabled (boolean) (required) — Whether tracing integration is enabled.
- endpoint (string) (required) — Trace endpoint URL (http or https).
@@ -958,6 +970,9 @@ Request fields:
- id (string) — Stable client-side identifier for this external system.
- name (string) (required) — Display name of the external system.
- url (string) (required) — HTTP or HTTPS URL template. '${var}' tokens are resolved from the RUM event context.
+ repositories (array, via --data) — Replaces the linked source code repositories when present; an empty array removes all links, and omitting the field leaves them unchanged. At most 10 entries.
+ - repo (string) (required) — GitHub repository in 'owner/name' form.
+ - subdir (string) — Directory holding the application inside the repository, relative to the repository root. '.' is the repository root; an empty value is saved as '.'.
tracing (object, via --data) — APM tracing integration configuration. Omit to leave unchanged.
- enabled (boolean) (required) — Whether tracing integration is enabled.
- endpoint (string) (required) — Trace endpoint URL (http or https).
diff --git a/internal/cli/zz_generated_audit_logs.go b/internal/cli/zz_generated_audit_logs.go
index 8d4305a..675d21a 100644
--- a/internal/cli/zz_generated_audit_logs.go
+++ b/internal/cli/zz_generated_audit_logs.go
@@ -85,7 +85,7 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[];
- body (string) (required) — JSON-encoded request body. Bodies containing sensitive fields are base64url-encoded instead; bodies over 10 KB are replaced by a truncation placeholder.
- created_at (string) (required) — Timestamp of the operation in Unix epoch milliseconds. CLI '--json' renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.
- credential_id (integer) (required) — ID of the credential (the app key ID) when 'credential_type' is 'app_key'; 0 otherwise.
- - credential_type (string) (required) — Credential type used for the call. 'app_key' when authenticated with an app key; empty string for member sessions.
+ - credential_type (string) (required) — Credential type used for the call. 'app_key' for a long-lived console app key, 'ephemeral_app_key' for a short-lived key issued to AI SRE, and an empty string for member sessions.
- ip (string) (required) — Client IP address of the caller.
- is_dangerous (boolean) (required) — True if this is flagged as a high-risk operation.
- is_write (boolean) (required) — True for mutating operations; false for read-only ones.
diff --git a/internal/cli/zz_generated_automations.go b/internal/cli/zz_generated_automations.go
index f733203..f8b9de1 100644
--- a/internal/cli/zz_generated_automations.go
+++ b/internal/cli/zz_generated_automations.go
@@ -105,7 +105,7 @@ API: POST /safari/automation/rule/list (automation-rule-read-list)
Request fields:
--page int — Page number, 1-based.
- --limit int — Page size.
+ --limit int — Page size. Values below 1 fall back to 20; values above 200 are capped at 200. (max 200)
--search-after-ctx string
--enabled bool — Filter by enabled state: 'true' returns only enabled rules, 'false' only disabled; omit or pass null for no filter.
--include-person bool — Compatibility field; when scope is empty and this is false, behaves like team scope.
@@ -189,7 +189,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le
},
}
cmd.Flags().Int64Var(&fP, "page", 0, "Page number, 1-based.")
- cmd.Flags().Int64Var(&fLimit, "limit", 0, "Page size.")
+ cmd.Flags().Int64Var(&fLimit, "limit", 0, "Page size. Values below 1 fall back to 20; values above 200 are capped at 200. (max 200)")
cmd.Flags().StringVar(&fSearchAfterCtx, "search-after-ctx", "", "Request field ")
cmd.Flags().BoolVar(&fEnabled, "enabled", false, "Filter by enabled state: 'true' returns only enabled rules, 'false' only disabled; omit or pass null for no filter.")
cmd.Flags().BoolVar(&fIncludePerson, "include-person", false, "Compatibility field; when scope is empty and this is false, behaves like team scope.")
diff --git a/internal/cli/zz_generated_incidents.go b/internal/cli/zz_generated_incidents.go
index a45f8c3..da51970 100644
--- a/internal/cli/zz_generated_incidents.go
+++ b/internal/cli/zz_generated_incidents.go
@@ -3406,10 +3406,12 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[];
- items (array) (required) — War room records.
- account_id (integer) (required) — Account ID.
- chat_id (string) (required) — Chat/group ID on the IM side.
+ - chat_name (string) (required) — Display name of the group chat on the IM side.
- created_at (string) (required) — Creation timestamp (seconds). CLI '--json' renders this as an RFC3339 string in the process's local timezone (NOT UTC, and NOT the wire integer); an unset value renders as null.
- created_by (integer) (required) — Member ID that created the war room.
- incident_id (string) (required) — Associated incident ID (MongoDB ObjectID).
- integration_id (integer) (required) — IM integration ID.
+ - integration_unavailable (boolean) — True when the IM integration behind this war room is disabled or no longer exists.
- plugin_type (string) (required) — IM plugin type (e.g. 'feishu', 'dingtalk', 'wecom', 'slack').
- status (string) (required) — War room record status: 'enabled' active, 'deleted' disbanded. [enabled, deleted]
`,
diff --git a/internal/cli/zz_generated_manifest.go b/internal/cli/zz_generated_manifest.go
index a4d53e9..92784e8 100644
--- a/internal/cli/zz_generated_manifest.go
+++ b/internal/cli/zz_generated_manifest.go
@@ -199,14 +199,12 @@ var generatedOpIDs = []string{
"monit-rule-read-audits",
"monit-rule-read-counter-channel",
"monit-rule-read-counter-total",
- "monit-rule-read-export",
"monit-rule-read-info-v2",
"monit-rule-read-list",
"monit-rule-write-create-v2",
"monit-rule-write-delete",
"monit-rule-write-delete-batch",
"monit-rule-write-fields-update",
- "monit-rule-write-import",
"monit-rule-write-move",
"monit-rule-write-update-v2",
"oncall-license-read-license-list",
diff --git a/internal/cli/zz_generated_members.go b/internal/cli/zz_generated_members.go
index a601e1d..3dc3185 100644
--- a/internal/cli/zz_generated_members.go
+++ b/internal/cli/zz_generated_members.go
@@ -376,7 +376,6 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[];
func genMembersMemberNotifyCmd() *cobra.Command {
var dataJSON string
- var fDryRun bool
var fHTML string
var fPersonIDs []int
var fSubject string
@@ -385,19 +384,18 @@ func genMembersMemberNotifyCmd() *cobra.Command {
Short: "Notify members",
Long: `Notify members.
-Send an email to account members on behalf of the caller, with content the caller supplies. Only callable with a credential minted for an AI SRE session; any other credential is rejected with 'AccessDenied'. Delivery is asynchronous — 'accepted' means the email was queued, not that it was delivered. Call it with 'dry_run' set to 'true' before sending: 'html' in the response is the email exactly as recipients will get it, so you can confirm the sanitizer kept everything the message depends on.
+Send an email to account members on behalf of the caller, with content the caller supplies. Only callable with a credential minted for an AI SRE session; any other credential is rejected with 'AccessDenied'. Delivery is asynchronous — 'accepted' means the email was queued, not that it was delivered.
API: POST /member/notify (memberNotify)
Request fields:
- --dry-run bool — Check without sending. When 'true', every check runs and the response returns the exact email in 'html', but nothing is queued and neither the hourly limit nor the per-turn duplicate check is consumed. Defaults to 'false'.
- --html string (required) — Email body as an HTML fragment (no ''/''/'' wrapper needed); recipients receive it as the whole email body. Required, up to 102,400 bytes of raw UTF-8 input (larger messages are clipped by common email clients), and must be non-empty after sanitization. Sanitized server-side: '