diff --git a/go.mod b/go.mod index 4ddd2db..7f139fd 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.8.0 + github.com/flashcatcloud/go-flashduty v0.10.0 github.com/mattn/go-runewidth v0.0.27 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 diff --git a/go.sum b/go.sum index 0337244..8df64ee 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.8.0 h1:ozNY6fTRbaxdEjMDpfoeiEJZpUpKgefGoypbeViJ49c= -github.com/flashcatcloud/go-flashduty v0.8.0/go.mod h1:aA0RtZEs0AYOwwdNKdtVeD8YMOdnmVY1zAlVD+9Ovx8= +github.com/flashcatcloud/go-flashduty v0.10.0 h1:7dEcF2+f2rFcXWWyCzV7WPdtBnOPrHT6cTNL4ITwrvM= +github.com/flashcatcloud/go-flashduty v0.10.0/go.mod h1:aA0RtZEs0AYOwwdNKdtVeD8YMOdnmVY1zAlVD+9Ovx8= 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.27 h1:Feg/Oou5zI/wnpgDF6omIU0OokC9GxLC/WRknhVlIR0= diff --git a/internal/cli/zz_generated_alert_rules.go b/internal/cli/zz_generated_alert_rules.go index 7e5d5c1..927389b 100644 --- a/internal/cli/zz_generated_alert_rules.go +++ b/internal/cli/zz_generated_alert_rules.go @@ -373,6 +373,7 @@ Response fields ('data' is a TOP-LEVEL array of these row objects — pipe 'jq ' - args (object) - 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 { @@ -425,7 +426,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - created_at (integer) (required) - creator_id (integer) (required) - creator_name (string) (required) - - cron_pattern (string) (required) — 5-field cron schedule. + - cron_pattern (string) (required) — 5-field cron schedule. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead. - debug_log_enabled (boolean) (required) - delay_seconds (integer) (required) - description (string) @@ -483,6 +484,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - args (object) - expr (string) — Query expression. - name (string) — Relate-query identifier. + - timezone (string) — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty. - updated_at (integer) (required) - updater_id (integer) (required) - updater_name (string) (required) @@ -536,7 +538,7 @@ Response fields ('data' is a TOP-LEVEL array of these row objects — pipe 'jq ' - created_at (integer) (required) - creator_id (integer) (required) - creator_name (string) (required) - - cron_pattern (string) (required) — 5-field cron schedule, e.g. '* * * * *'. + - cron_pattern (string) (required) — 5-field cron schedule, e.g. '* * * * *'. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead. - debug_log_enabled (boolean) (required) — Whether debug logging is enabled. - delay_seconds (integer) (required) — Evaluation delay in seconds. - ds_type (string) (required) — Data source type, e.g. 'prometheus'. @@ -545,6 +547,7 @@ Response fields ('data' is a TOP-LEVEL array of these row objects — pipe 'jq ' - id (integer) (required) — Unique rule ID. - labels (object) — Custom labels. - name (string) (required) — Rule name. + - timezone (string) — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty. - triggered (boolean) (required) — True if the rule currently has active alerts. - updated_at (integer) (required) - updater_id (integer) (required) @@ -600,6 +603,7 @@ func genAlertRulesWriteCreateCmd() *cobra.Command { var fName string var fRepeatInterval int64 var fRepeatTotal int64 + var fTimezone string var fUpdatedAt int64 var fUpdaterID int64 var fUpdaterName string @@ -618,7 +622,7 @@ Request fields: --created-at int --creator-id int --creator-name string - --cron-pattern string — 5-field cron schedule. + --cron-pattern string — 5-field cron schedule. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead. --debug-log-enabled bool --delay-seconds int --description string @@ -632,6 +636,7 @@ Request fields: --name string — Rule name. --repeat-interval int — Notification repeat interval in seconds. --repeat-total int — Max number of repeat notifications. + --timezone string — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty. --updated-at int --updater-id int --updater-name string @@ -688,7 +693,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - created_at (integer) - creator_id (integer) - creator_name (string) - - cron_pattern (string) — 5-field cron schedule. + - cron_pattern (string) — 5-field cron schedule. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead. - debug_log_enabled (boolean) - delay_seconds (integer) - description (string) @@ -746,6 +751,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - args (object) - expr (string) — Query expression. - name (string) — Relate-query identifier. + - timezone (string) — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty. - updated_at (integer) - updater_id (integer) - updater_name (string) @@ -811,6 +817,9 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le if cmd.Flags().Changed("repeat-total") { body["repeat_total"] = fRepeatTotal } + if cmd.Flags().Changed("timezone") { + body["timezone"] = fTimezone + } if cmd.Flags().Changed("updated-at") { body["updated_at"] = fUpdatedAt } @@ -842,7 +851,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le cmd.Flags().Int64Var(&fCreatedAt, "created-at", 0, "Request field created_at") cmd.Flags().Int64Var(&fCreatorID, "creator-id", 0, "Request field creator_id") cmd.Flags().StringVar(&fCreatorName, "creator-name", "", "Request field creator_name") - cmd.Flags().StringVar(&fCronPattern, "cron-pattern", "", "5-field cron schedule.") + cmd.Flags().StringVar(&fCronPattern, "cron-pattern", "", "5-field cron schedule. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead.") cmd.Flags().BoolVar(&fDebugLogEnabled, "debug-log-enabled", false, "Request field debug_log_enabled") cmd.Flags().Int64Var(&fDelaySeconds, "delay-seconds", 0, "Request field delay_seconds") cmd.Flags().StringVar(&fDescription, "description", "", "Request field description") @@ -856,6 +865,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le cmd.Flags().StringVar(&fName, "name", "", "Rule name.") cmd.Flags().Int64Var(&fRepeatInterval, "repeat-interval", 0, "Notification repeat interval in seconds.") cmd.Flags().Int64Var(&fRepeatTotal, "repeat-total", 0, "Max number of repeat notifications.") + cmd.Flags().StringVar(&fTimezone, "timezone", "", "Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty.") cmd.Flags().Int64Var(&fUpdatedAt, "updated-at", 0, "Request field updated_at") cmd.Flags().Int64Var(&fUpdaterID, "updater-id", 0, "Request field updater_id") cmd.Flags().StringVar(&fUpdaterName, "updater-name", "", "Request field updater_name") @@ -974,6 +984,7 @@ func genAlertRulesWriteFieldsUpdateCmd() *cobra.Command { var fIDs []int var fRepeatInterval int64 var fRepeatTotal int64 + var fTimezone string cmd := &cobra.Command{ Use: "rule-update-fields", Short: "Batch update rule fields", @@ -997,6 +1008,7 @@ Request fields: --ids []int (required) — Rule IDs to update. --repeat-interval int --repeat-total int + --timezone string — Timezone in which the rule executes. IANA timezone name; defaults to 'Asia/Shanghai'. annotations (object, via --data) enabled_times (array, via --data) - days (array) — Days of week, 0 = Sunday. @@ -1051,6 +1063,9 @@ Response fields ('data' is a TOP-LEVEL array of these row objects — pipe 'jq ' if cmd.Flags().Changed("repeat-total") { body["repeat_total"] = fRepeatTotal } + if cmd.Flags().Changed("timezone") { + body["timezone"] = fTimezone + } return nil }) if err != nil { @@ -1081,6 +1096,7 @@ Response fields ('data' is a TOP-LEVEL array of these row objects — pipe 'jq ' cmd.Flags().IntSliceVar(&fIDs, "ids", nil, "Rule IDs to update. (required)") cmd.Flags().Int64Var(&fRepeatInterval, "repeat-interval", 0, "Request field repeat_interval") cmd.Flags().Int64Var(&fRepeatTotal, "repeat-total", 0, "Request field repeat_total") + cmd.Flags().StringVar(&fTimezone, "timezone", "", "Timezone in which the rule executes. IANA timezone name; defaults to 'Asia/Shanghai'.") 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 } @@ -1250,6 +1266,7 @@ func genAlertRulesWriteUpdateCmd() *cobra.Command { var fName string var fRepeatInterval int64 var fRepeatTotal int64 + var fTimezone string var fUpdatedAt int64 var fUpdaterID int64 var fUpdaterName string @@ -1268,7 +1285,7 @@ Request fields: --created-at int --creator-id int --creator-name string - --cron-pattern string — 5-field cron schedule. + --cron-pattern string — 5-field cron schedule. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead. --debug-log-enabled bool --delay-seconds int --description string @@ -1282,6 +1299,7 @@ Request fields: --name string — Rule name. --repeat-interval int — Notification repeat interval in seconds. --repeat-total int — Max number of repeat notifications. + --timezone string — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty. --updated-at int --updater-id int --updater-name string @@ -1338,7 +1356,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - created_at (integer) - creator_id (integer) - creator_name (string) - - cron_pattern (string) — 5-field cron schedule. + - cron_pattern (string) — 5-field cron schedule. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead. - debug_log_enabled (boolean) - delay_seconds (integer) - description (string) @@ -1396,6 +1414,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - args (object) - expr (string) — Query expression. - name (string) — Relate-query identifier. + - timezone (string) — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty. - updated_at (integer) - updater_id (integer) - updater_name (string) @@ -1461,6 +1480,9 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le if cmd.Flags().Changed("repeat-total") { body["repeat_total"] = fRepeatTotal } + if cmd.Flags().Changed("timezone") { + body["timezone"] = fTimezone + } if cmd.Flags().Changed("updated-at") { body["updated_at"] = fUpdatedAt } @@ -1492,7 +1514,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le cmd.Flags().Int64Var(&fCreatedAt, "created-at", 0, "Request field created_at") cmd.Flags().Int64Var(&fCreatorID, "creator-id", 0, "Request field creator_id") cmd.Flags().StringVar(&fCreatorName, "creator-name", "", "Request field creator_name") - cmd.Flags().StringVar(&fCronPattern, "cron-pattern", "", "5-field cron schedule.") + cmd.Flags().StringVar(&fCronPattern, "cron-pattern", "", "5-field cron schedule. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead.") cmd.Flags().BoolVar(&fDebugLogEnabled, "debug-log-enabled", false, "Request field debug_log_enabled") cmd.Flags().Int64Var(&fDelaySeconds, "delay-seconds", 0, "Request field delay_seconds") cmd.Flags().StringVar(&fDescription, "description", "", "Request field description") @@ -1506,6 +1528,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le cmd.Flags().StringVar(&fName, "name", "", "Rule name.") cmd.Flags().Int64Var(&fRepeatInterval, "repeat-interval", 0, "Notification repeat interval in seconds.") cmd.Flags().Int64Var(&fRepeatTotal, "repeat-total", 0, "Max number of repeat notifications.") + cmd.Flags().StringVar(&fTimezone, "timezone", "", "Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty.") cmd.Flags().Int64Var(&fUpdatedAt, "updated-at", 0, "Request field updated_at") cmd.Flags().Int64Var(&fUpdaterID, "updater-id", 0, "Request field updater_id") cmd.Flags().StringVar(&fUpdaterName, "updater-name", "", "Request field updater_name") diff --git a/internal/cli/zz_generated_applications.go b/internal/cli/zz_generated_applications.go index 55aaf7f..0acd8bc 100644 --- a/internal/cli/zz_generated_applications.go +++ b/internal/cli/zz_generated_applications.go @@ -32,7 +32,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - application_id (string) — Unique application ID. - application_name (string) — Application display name. - client_token (string) — Token used to initialize the RUM SDK. - - created_at (integer) — Creation timestamp, Unix epoch seconds. + - created_at (integer) — Creation timestamp, Unix epoch milliseconds. - created_by (integer) — Creator member ID. - is_private (boolean) — If 'true', the application is only accessible to team members. - links (object) — External link integration settings for the application. @@ -47,7 +47,7 @@ Response fields ('data' envelope is unwrapped — these fields are at the top le - endpoint (string) — Trace endpoint URL (http or https). - open_type (string) — How to open the trace link. [popup, tab] - type (string) — Application type. [browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity] - - updated_at (integer) — Last update timestamp, Unix epoch seconds. + - updated_at (integer) — Last update timestamp, Unix epoch milliseconds. - updated_by (integer) — Last updater member ID. `, Args: requireBodyFieldOrExactArg("application_id", "application-id"), @@ -108,7 +108,7 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[]; - application_id (string) — Unique application ID. - application_name (string) — Application display name. - client_token (string) — Token used to initialize the RUM SDK. - - created_at (integer) — Creation timestamp, Unix epoch seconds. + - created_at (integer) — Creation timestamp, Unix epoch milliseconds. - created_by (integer) — Creator member ID. - is_private (boolean) — If 'true', the application is only accessible to team members. - links (object) — External link integration settings for the application. @@ -123,7 +123,7 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[]; - endpoint (string) — Trace endpoint URL (http or https). - open_type (string) — How to open the trace link. [popup, tab] - type (string) — Application type. [browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity] - - updated_at (integer) — Last update timestamp, Unix epoch seconds. + - updated_at (integer) — Last update timestamp, Unix epoch milliseconds. - updated_by (integer) — Last updater member ID. `, Args: requireBodyFieldOrArgs("application_ids", "application-ids"), @@ -199,7 +199,7 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[]; - application_id (string) — Unique application ID. - application_name (string) — Application display name. - client_token (string) — Token used to initialize the RUM SDK. - - created_at (integer) — Creation timestamp, Unix epoch seconds. + - created_at (integer) — Creation timestamp, Unix epoch milliseconds. - created_by (integer) — Creator member ID. - is_private (boolean) — If 'true', the application is only accessible to team members. - links (object) — External link integration settings for the application. @@ -214,7 +214,7 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[]; - endpoint (string) — Trace endpoint URL (http or https). - open_type (string) — How to open the trace link. [popup, tab] - type (string) — Application type. [browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity] - - updated_at (integer) — Last update timestamp, Unix epoch seconds. + - updated_at (integer) — Last update timestamp, Unix epoch milliseconds. - updated_by (integer) — Last updater member ID. - total (integer) `, diff --git a/internal/cli/zz_generated_error_ingestion_rules.go b/internal/cli/zz_generated_error_ingestion_rules.go new file mode 100644 index 0000000..84accaa --- /dev/null +++ b/internal/cli/zz_generated_error_ingestion_rules.go @@ -0,0 +1,532 @@ +// Code generated by internal/cmd/cligen; DO NOT EDIT. + +package cli + +import ( + "github.com/spf13/cobra" + + flashduty "github.com/flashcatcloud/go-flashduty" +) + +func genErrorIngestionRulesCreateCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fDescription string + var fRuleName string + cmd := &cobra.Command{ + Use: "error-ingestion-rules-create ", + Short: "Create an error ingestion rule", + Long: `Create an error ingestion rule. + +Create a new error ingestion rule that filters which errors are stored. + +API: POST /rum/error-ingestion/rules/create (rum-error-ingestion-rules-create) + +Request fields: + --application-id string (required) — RUM application ID. + --description string — Rule description, up to 512 characters. (≤512 chars) + --rule-name string (required) — Rule name, 1-128 characters. (1-128 chars) + filters (array, via --data) (required) — Filter conditions the rule matches errors against. + +Response fields ('data' envelope is unwrapped — these fields are at the top level): + - rule_id (string) (required) — ID assigned to the new rule. + - rule_name (string) (required) — Echo of the created rule's name. +`, + Args: requireBodyFieldOrExactArg("application_id", "application-id"), + Example: ` flashduty rum error-ingestion-rules-create --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","description":"Only ingest TypeError/ReferenceError from production, excluding Safari.","filters":[[{"key":"error.env","oper":"IN","vals":["production"]},{"key":"error.error_type","oper":"IN","vals":["TypeError","ReferenceError"]}],[{"key":"error.browser_name","oper":"NOTIN","vals":["Safari"]}]],"rule_name":"Production console errors"}'`, + 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 err := genFoldPositional(args, body, "application_id", "string"); err != nil { + return err + } + if cmd.Flags().Changed("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("description") { + body["description"] = fDescription + } + if cmd.Flags().Changed("rule-name") { + body["rule_name"] = fRuleName + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMErrorIngestionCreateRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.ErrorIngestionRules.Create(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fDescription, "description", "", "Rule description, up to 512 characters. (≤512 chars)") + cmd.Flags().StringVar(&fRuleName, "rule-name", "", "Rule name, 1-128 characters. (required) (1-128 chars)") + 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 genErrorIngestionRulesDeleteCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fRuleID string + cmd := &cobra.Command{ + Use: "error-ingestion-rules-delete", + Short: "Delete an error ingestion rule", + Long: `Delete an error ingestion rule. + +Delete an error ingestion rule from a RUM application. + +API: POST /rum/error-ingestion/rules/delete (rum-error-ingestion-rules-delete) + +Request fields: + --application-id string (required) — RUM application ID. + --rule-id string (required) — Rule ID. +`, + Example: ` flashduty rum error-ingestion-rules-delete --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","rule_id":"9spXEVoMeZWujjz25yrgTe"}'`, + 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("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("rule-id") { + body["rule_id"] = fRuleID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMErrorIngestionRuleIDRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.ErrorIngestionRules.Delete(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/error-ingestion/rules/delete") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fRuleID, "rule-id", "", "Rule ID. (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 genErrorIngestionRulesDisableCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fRuleID string + cmd := &cobra.Command{ + Use: "error-ingestion-rules-disable", + Short: "Disable an error ingestion rule", + Long: `Disable an error ingestion rule. + +Disable an error ingestion rule without deleting it. + +API: POST /rum/error-ingestion/rules/disable (rum-error-ingestion-rules-disable) + +Request fields: + --application-id string (required) — RUM application ID. + --rule-id string (required) — Rule ID. +`, + Example: ` flashduty rum error-ingestion-rules-disable --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","rule_id":"9spXEVoMeZWujjz25yrgTe"}'`, + 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("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("rule-id") { + body["rule_id"] = fRuleID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMErrorIngestionRuleIDRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.ErrorIngestionRules.Disable(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/error-ingestion/rules/disable") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fRuleID, "rule-id", "", "Rule ID. (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 genErrorIngestionRulesEnableCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fRuleID string + cmd := &cobra.Command{ + Use: "error-ingestion-rules-enable", + Short: "Enable an error ingestion rule", + Long: `Enable an error ingestion rule. + +Re-enable a previously disabled error ingestion rule. + +API: POST /rum/error-ingestion/rules/enable (rum-error-ingestion-rules-enable) + +Request fields: + --application-id string (required) — RUM application ID. + --rule-id string (required) — Rule ID. +`, + Example: ` flashduty rum error-ingestion-rules-enable --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","rule_id":"9spXEVoMeZWujjz25yrgTe"}'`, + 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("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("rule-id") { + body["rule_id"] = fRuleID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMErrorIngestionRuleIDRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.ErrorIngestionRules.Enable(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/error-ingestion/rules/enable") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fRuleID, "rule-id", "", "Rule ID. (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 genErrorIngestionRulesHistoryListCmd() *cobra.Command { + var dataJSON string + var fP int64 + var fLimit int64 + var fSearchAfterCtx string + var fApplicationID string + var fAsc bool + var fOrderby string + cmd := &cobra.Command{ + Use: "error-ingestion-rules-history-list ", + Short: "List error ingestion rule history", + Long: `List error ingestion rule history. + +Return paginated snapshots of an application's error ingestion rule history. + +API: POST /rum/error-ingestion/rules/history/list (rum-error-ingestion-rules-history-list) + +Request fields: + --page int — Zero-based page number. Default 0. (min 0) + --limit int — Page size. Default 20, capped at 100; values ≤ 0 fall back to the default. (max 100) + --search-after-ctx string + --application-id string (required) — RUM application ID. + --asc bool — Sort ascending instead of the default descending order. + --orderby string — Sort column: 'updated_at' or 'version'. Unrecognized values fall back to 'updated_at'. + +Response fields ('data' envelope is unwrapped — rows are nested under items[]; pipe 'jq '.items[]'', NOT '.data.items[]'): + - has_next_page (boolean) (required) — Whether another page of history exists after this one. + - items (array) (required) — History snapshots, ordered by 'orderby'/'asc'. + - rules (array) (required) — The application's complete rule list as of this version. + - account_id (integer) (required) — Account ID. + - application_id (string) (required) — RUM application ID the rule belongs to. + - created_at (integer) (required) — Unix timestamp in milliseconds when the row was created. + - created_by (integer) (required) — Member ID who created the rule. + - deleted_at (integer) (required) — Unix timestamp in milliseconds when the row was soft-deleted; '0' when not deleted. + - description (string) (required) — Rule description. + - filters (array) (required) — The rule's filter conditions as of this snapshot version. + - id (integer) (required) — Internal row ID. + - rule_id (string) (required) — Rule ID. + - rule_name (string) (required) — Rule name. + - status (string) (required) — The rule's status as of this snapshot version. [enabled, disabled] + - updated_at (integer) (required) — Unix timestamp in milliseconds when the row was last updated. + - updated_by (integer) (required) — Member ID who last updated the rule. + - updated_at (integer) (required) — Unix timestamp in milliseconds when this snapshot was recorded. + - updated_by (integer) (required) — Member ID whose action triggered this snapshot. + - updated_by_name (string) (required) — Display name of the member whose action triggered this snapshot. + - version (integer) (required) — History version number, incrementing from 1. + - total (integer) (required) — Total number of history versions for the application. +`, + Args: requireBodyFieldOrExactArg("application_id", "application-id"), + Example: ` flashduty rum error-ingestion-rules-history-list --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","asc":false,"limit":20,"orderby":"updated_at","p":0}'`, + 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 err := genFoldPositional(args, body, "application_id", "string"); err != nil { + return err + } + if cmd.Flags().Changed("page") { + body["p"] = fP + } + if cmd.Flags().Changed("limit") { + body["limit"] = fLimit + } + if cmd.Flags().Changed("search-after-ctx") { + body["search_after_ctx"] = fSearchAfterCtx + } + if cmd.Flags().Changed("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("asc") { + body["asc"] = fAsc + } + if cmd.Flags().Changed("orderby") { + body["orderby"] = fOrderby + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMErrorIngestionHistoryListRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.ErrorIngestionRules.HistoryList(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().Int64Var(&fP, "page", 0, "Zero-based page number. Default 0. (min 0)") + cmd.Flags().Int64Var(&fLimit, "limit", 0, "Page size. Default 20, capped at 100; values ≤ 0 fall back to the default. (max 100)") + cmd.Flags().StringVar(&fSearchAfterCtx, "search-after-ctx", "", "Request field ") + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().BoolVar(&fAsc, "asc", false, "Sort ascending instead of the default descending order.") + cmd.Flags().StringVar(&fOrderby, "orderby", "", "Sort column: 'updated_at' or 'version'. Unrecognized values fall back to 'updated_at'.") + 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 genErrorIngestionRulesHistoryRevertCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fVersion int64 + cmd := &cobra.Command{ + Use: "error-ingestion-rules-history-revert ", + Short: "Revert error ingestion rules to a history version", + Long: `Revert error ingestion rules to a history version. + +Restore an application's entire rule set to a prior history version. + +API: POST /rum/error-ingestion/rules/history/revert (rum-error-ingestion-rules-history-revert) + +Request fields: + --application-id string (required) — RUM application ID. + --version int (required) — History version number to revert to. (min 1) +`, + Args: requireBodyFieldOrExactArg("application_id", "application-id"), + Example: ` flashduty rum error-ingestion-rules-history-revert --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","version":2}'`, + 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 err := genFoldPositional(args, body, "application_id", "string"); err != nil { + return err + } + if cmd.Flags().Changed("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("version") { + body["version"] = fVersion + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMErrorIngestionRevertRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.ErrorIngestionRules.HistoryRevert(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/error-ingestion/rules/history/revert") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().Int64Var(&fVersion, "version", 0, "History version number to revert to. (required) (min 1)") + 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 genErrorIngestionRulesListCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + cmd := &cobra.Command{ + Use: "error-ingestion-rules-list ", + Short: "List error ingestion rules", + Long: `List error ingestion rules. + +Return every error ingestion rule configured for a RUM application. + +API: POST /rum/error-ingestion/rules/list (rum-error-ingestion-rules-list) + +Request fields: + --application-id string (required) — RUM application ID. + +Response fields ('data' envelope is unwrapped — rows are nested under items[]; pipe 'jq '.items[]'', NOT '.data.items[]'): + - items (array) (required) — Rules, newest-created first. + - created_at (integer) (required) — Unix timestamp in milliseconds when the rule was created. + - description (string) (required) — Rule description, up to 512 characters. + - filters (array) (required) — The rule's filter conditions. + - rule_id (string) (required) — Rule ID. + - rule_name (string) (required) — Rule name, 1-128 characters. Not required to be unique within the application. + - status (string) (required) — Current status of the rule. [enabled, disabled] + - updated_at (integer) (required) — Unix timestamp in milliseconds when the rule was last updated. +`, + Args: requireBodyFieldOrExactArg("application_id", "application-id"), + Example: ` flashduty rum error-ingestion-rules-list --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o"}'`, + 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 err := genFoldPositional(args, body, "application_id", "string"); err != nil { + return err + } + if cmd.Flags().Changed("application-id") { + body["application_id"] = fApplicationID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMErrorIngestionListRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.ErrorIngestionRules.List(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (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 genErrorIngestionRulesUpdateCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fDescription string + var fRuleID string + var fRuleName string + cmd := &cobra.Command{ + Use: "error-ingestion-rules-update", + Short: "Update an error ingestion rule", + Long: `Update an error ingestion rule. + +Update the name, description, or filters of an error ingestion rule. + +API: POST /rum/error-ingestion/rules/update (rum-error-ingestion-rules-update) + +Request fields: + --application-id string (required) — RUM application ID. + --description string — New rule description, up to 512 characters. Omit to leave unchanged. (≤512 chars) + --rule-id string (required) — Rule ID to update. + --rule-name string — New rule name, 1-128 characters. Omit to leave unchanged. (1-128 chars) + filters (array, via --data) — New filter conditions. Omit to leave unchanged. +`, + Example: ` flashduty rum error-ingestion-rules-update --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","description":"Now also excludes staging traffic.","rule_id":"9spXEVoMeZWujjz25yrgTe"}'`, + 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("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("description") { + body["description"] = fDescription + } + if cmd.Flags().Changed("rule-id") { + body["rule_id"] = fRuleID + } + if cmd.Flags().Changed("rule-name") { + body["rule_name"] = fRuleName + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMErrorIngestionUpdateRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.ErrorIngestionRules.Update(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/error-ingestion/rules/update") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fDescription, "description", "", "New rule description, up to 512 characters. Omit to leave unchanged. (≤512 chars)") + cmd.Flags().StringVar(&fRuleID, "rule-id", "", "Rule ID to update. (required)") + cmd.Flags().StringVar(&fRuleName, "rule-name", "", "New rule name, 1-128 characters. Omit to leave unchanged. (1-128 chars)") + 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 registerGeneratedErrorIngestionRules(root *cobra.Command) { + gRUM := genGroup(root, "rum", "RUM API") + genAddLeaf(gRUM, genErrorIngestionRulesCreateCmd()) + genAddLeaf(gRUM, genErrorIngestionRulesDeleteCmd()) + genAddLeaf(gRUM, genErrorIngestionRulesDisableCmd()) + genAddLeaf(gRUM, genErrorIngestionRulesEnableCmd()) + genAddLeaf(gRUM, genErrorIngestionRulesHistoryListCmd()) + genAddLeaf(gRUM, genErrorIngestionRulesHistoryRevertCmd()) + genAddLeaf(gRUM, genErrorIngestionRulesListCmd()) + genAddLeaf(gRUM, genErrorIngestionRulesUpdateCmd()) +} diff --git a/internal/cli/zz_generated_facets.go b/internal/cli/zz_generated_facets.go index 13c42d8..21d333a 100644 --- a/internal/cli/zz_generated_facets.go +++ b/internal/cli/zz_generated_facets.go @@ -94,74 +94,6 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[]; return cmd } -func genFacetsFacetListCmd() *cobra.Command { - var dataJSON string - var fIsFacet bool - var fScopes []string - cmd := &cobra.Command{ - Use: "facet-list", - Short: "List RUM facet fields", - Long: `List RUM facet fields. - -Return all available RUM field definitions, optionally filtered by scope and facet status. - -API: POST /rum/facet/list (rum-read-facet-list) - -Request fields: - --is-facet bool — When true, return only facet-enabled fields. When false or omitted, return all fields. - --scopes []string — Filter by RUM data scopes. Valid values: 'session', 'view', 'action', 'error', 'resource', 'long_task', 'vital', 'issue', 'sourcemap'. - -Response fields ('data' envelope is unwrapped — rows are nested under items[]; pipe 'jq '.items[]'', NOT '.data.items[]'): - - items (array) (required) - - account_id (integer) (required) — Account ID. 0 for built-in fields. - - description (string) (required) — Description of what this field captures. - - edit_able (boolean) (required) — True if this is a custom field that can be edited by the user. - - enum_values (array) (required) — Predefined enumerable values for this field. Element type matches the field's 'value_type': string for 'string', number for 'number', boolean for 'boolean'. Empty when the field has no fixed set of values. - - field_key (string) (required) — Unique field key, e.g. 'error.type'. - - field_name (string) (required) — Human-readable field name. - - group (string) (required) — Display group for this field. - - is_facet (boolean) (required) — True if value distribution counting is supported for this field. - - queryable (boolean) (required) — True if this field can be used in DQL/SQL queries. - - scopes (array) (required) — RUM scopes this field appears in. - - show_type (string) (required) — Display type in the analytics UI. [list, range] - - status (string) (required) — Field status, e.g. 'active'. - - unit_family (string) (required) — Measurement unit family, e.g. 'time', 'bytes'. Empty for dimensionless fields. - - unit_name (string) (required) — Specific measurement unit, e.g. 'millisecond', 'byte'. - - value_type (string) (required) — Data type of the field value. [string, number, boolean, array, array, array] -`, - Example: ` flashduty rum facet-list --data '{"is_facet":true,"scopes":["error"]}'`, - 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("is-facet") { - body["is_facet"] = fIsFacet - } - if cmd.Flags().Changed("scopes") { - body["scopes"] = fScopes - } - return nil - }) - if err != nil { - return err - } - req := new(flashduty.RUMFacetListRequest) - if err := genBindBody(body, req); err != nil { - return err - } - out, _, err := ctx.Client.Facets.FacetList(cmdContext(ctx.Cmd), req) - if err != nil { - return err - } - return printGenericResult(ctx, out) - }) - }, - } - cmd.Flags().BoolVar(&fIsFacet, "is-facet", false, "When true, return only facet-enabled fields. When false or omitted, return all fields.") - cmd.Flags().StringSliceVar(&fScopes, "scopes", nil, "Filter by RUM data scopes. Valid values: 'session', 'view', 'action', 'error', 'resource', 'long_task', 'vital', 'issue', 'sourcemap'.") - 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 genFacetsFieldListCmd() *cobra.Command { var dataJSON string var fIsFacet bool @@ -233,6 +165,5 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[]; func registerGeneratedFacets(root *cobra.Command) { gRUM := genGroup(root, "rum", "RUM API") genAddLeaf(gRUM, genFacetsFacetCountCmd()) - genAddLeaf(gRUM, genFacetsFacetListCmd()) genAddLeaf(gRUM, genFacetsFieldListCmd()) } diff --git a/internal/cli/zz_generated_issue_preset_severity_rules.go b/internal/cli/zz_generated_issue_preset_severity_rules.go new file mode 100644 index 0000000..6b226bb --- /dev/null +++ b/internal/cli/zz_generated_issue_preset_severity_rules.go @@ -0,0 +1,610 @@ +// Code generated by internal/cmd/cligen; DO NOT EDIT. + +package cli + +import ( + "github.com/spf13/cobra" + + flashduty "github.com/flashcatcloud/go-flashduty" +) + +func genIssuePresetSeverityRulesCreateCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fDescription string + var fRuleName string + var fSeverity string + cmd := &cobra.Command{ + Use: "issue-preset-severity-rules-create ", + Short: "Create preset severity rule", + Long: `Create preset severity rule. + +Create a new preset severity rule for a RUM application. + +API: POST /rum/issue/preset-severity/rules/create (rum-issue-preset-severity-rules-create) + +Request fields: + --application-id string (required) — RUM application ID. + --description string — Optional description, up to 512 characters. (≤512 chars) + --rule-name string (required) — Rule display name, 1-128 characters. (1-128 chars) + --severity string (required) — Severity to assign to errors matching this rule. [Critical, Warning, Info] + filters (array, via --data) (required) — OR-of-ANDs filter structure: the outer array is OR'd, each inner array is AND'd. A rule matches an error when at least one inner AND-group fully matches. + +Response fields ('data' envelope is unwrapped — these fields are at the top level): + - priority (integer) (required) — Evaluation order assigned to the new rule (always the current lowest precedence, i.e. current max + 1). + - rule_id (string) (required) — ID of the newly created rule. + - rule_name (string) (required) — Echo of the rule's display name. +`, + Args: requireBodyFieldOrExactArg("application_id", "application-id"), + Example: ` flashduty rum issue-preset-severity-rules-create --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","description":"Escalate production crashes to Critical severity","filters":[[{"key":"error.env","oper":"IN","vals":["production"]},{"key":"error.is_crash","oper":"IN","vals":["true"]}]],"rule_name":"Critical crash spikes","severity":"Critical"}'`, + 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 err := genFoldPositional(args, body, "application_id", "string"); err != nil { + return err + } + if cmd.Flags().Changed("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("description") { + body["description"] = fDescription + } + if cmd.Flags().Changed("rule-name") { + body["rule_name"] = fRuleName + } + if cmd.Flags().Changed("severity") { + body["severity"] = fSeverity + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMPresetSeverityRuleCreateRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.IssuePresetSeverityRules.Create(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fDescription, "description", "", "Optional description, up to 512 characters. (≤512 chars)") + cmd.Flags().StringVar(&fRuleName, "rule-name", "", "Rule display name, 1-128 characters. (required) (1-128 chars)") + cmd.Flags().StringVar(&fSeverity, "severity", "", "Severity to assign to errors matching this rule. (required) [Critical, Warning, Info]") + 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 genIssuePresetSeverityRulesDeleteCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fRuleID string + cmd := &cobra.Command{ + Use: "issue-preset-severity-rules-delete", + Short: "Delete preset severity rule", + Long: `Delete preset severity rule. + +Delete a preset severity rule. + +API: POST /rum/issue/preset-severity/rules/delete (rum-issue-preset-severity-rules-delete) + +Request fields: + --application-id string (required) — RUM application ID. + --rule-id string (required) — Rule ID. +`, + Example: ` flashduty rum issue-preset-severity-rules-delete --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","rule_id":"n8mZQ2VbXk4wPRs6DfC9Ay"}'`, + 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("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("rule-id") { + body["rule_id"] = fRuleID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMPresetSeverityRuleIDRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.IssuePresetSeverityRules.Delete(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/issue/preset-severity/rules/delete") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fRuleID, "rule-id", "", "Rule ID. (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 genIssuePresetSeverityRulesDisableCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fRuleID string + cmd := &cobra.Command{ + Use: "issue-preset-severity-rules-disable", + Short: "Disable preset severity rule", + Long: `Disable preset severity rule. + +Disable a preset severity rule. + +API: POST /rum/issue/preset-severity/rules/disable (rum-issue-preset-severity-rules-disable) + +Request fields: + --application-id string (required) — RUM application ID. + --rule-id string (required) — Rule ID. +`, + Example: ` flashduty rum issue-preset-severity-rules-disable --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","rule_id":"TAHUYnQmXKzgMS4TFVUKvz"}'`, + 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("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("rule-id") { + body["rule_id"] = fRuleID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMPresetSeverityRuleIDRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.IssuePresetSeverityRules.Disable(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/issue/preset-severity/rules/disable") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fRuleID, "rule-id", "", "Rule ID. (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 genIssuePresetSeverityRulesEnableCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fRuleID string + cmd := &cobra.Command{ + Use: "issue-preset-severity-rules-enable", + Short: "Enable preset severity rule", + Long: `Enable preset severity rule. + +Enable a preset severity rule. + +API: POST /rum/issue/preset-severity/rules/enable (rum-issue-preset-severity-rules-enable) + +Request fields: + --application-id string (required) — RUM application ID. + --rule-id string (required) — Rule ID. +`, + Example: ` flashduty rum issue-preset-severity-rules-enable --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","rule_id":"TAHUYnQmXKzgMS4TFVUKvz"}'`, + 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("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("rule-id") { + body["rule_id"] = fRuleID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMPresetSeverityRuleIDRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.IssuePresetSeverityRules.Enable(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/issue/preset-severity/rules/enable") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fRuleID, "rule-id", "", "Rule ID. (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 genIssuePresetSeverityRulesHistoryListCmd() *cobra.Command { + var dataJSON string + var fP int64 + var fLimit int64 + var fSearchAfterCtx string + var fApplicationID string + var fAsc bool + var fOrderby string + cmd := &cobra.Command{ + Use: "issue-preset-severity-rules-history-list ", + Short: "List preset severity rule history", + Long: `List preset severity rule history. + +Return the change history of preset severity rules for a RUM application. + +API: POST /rum/issue/preset-severity/rules/history/list (rum-issue-preset-severity-rules-history-list) + +Request fields: + --page int — Zero-based page number. (min 0) + --limit int — Page size. Values <= 0 default to 20; values above 100 are capped at 100. (max 100) + --search-after-ctx string + --application-id string (required) — RUM application ID. + --asc bool — Sort ascending when true; results are descending by default. + --orderby string — Sort column. Any other value (including omitted) falls back to 'updated_at'. [updated_at, version] + +Response fields ('data' envelope is unwrapped — rows are nested under items[]; pipe 'jq '.items[]'', NOT '.data.items[]'): + - has_next_page (boolean) (required) — Whether another page is available after this one. + - items (array) (required) + - rules (array) (required) — Full rule set captured immediately before the mutation that produced this snapshot. Empty for the very first snapshot. + - account_id (integer) (required) — Account ID the rule belongs to. + - application_id (string) (required) — RUM application ID the rule belongs to. + - created_at (integer) (required) — Unix timestamp in milliseconds when the rule was created. + - created_by (integer) (required) — Member ID who originally created the rule. + - deleted_at (integer) (required) — Unix timestamp in milliseconds the rule was soft-deleted; '0' means not deleted. Always '0' in practice, since deleted rules are excluded before a snapshot is taken. + - description (string) (required) — Rule description. May be empty. + - filters (array) (required) — OR-of-ANDs filter structure: the outer array is OR'd, each inner array is AND'd. A rule matches an error when at least one inner AND-group fully matches. + - id (integer) (required) — Internal auto-increment row ID. Not stable across a history revert — reverting reinserts rows with new IDs. + - priority (integer) (required) — Evaluation order at snapshot time; '1' is highest precedence. + - rule_id (string) (required) — Unique rule ID. + - rule_name (string) (required) — Rule display name. + - severity (string) (required) — Severity assigned to errors matching this rule. [Critical, Warning, Info] + - status (string) (required) — Rule status at snapshot time. [enabled, disabled] + - updated_at (integer) (required) — Unix timestamp in milliseconds when the rule was last updated. + - updated_by (integer) (required) — Member ID who last updated the rule as of snapshot time. + - updated_at (integer) (required) — Unix timestamp in milliseconds when the snapshot was written. + - updated_by (integer) (required) — Member ID who triggered the mutation this snapshot precedes. + - updated_by_name (string) (required) — Display name of 'updated_by' at the time of the change. + - version (integer) (required) — Monotonically increasing snapshot version number, starting at 1. + - total (integer) (required) — Total number of history snapshots for the application. +`, + Args: requireBodyFieldOrExactArg("application_id", "application-id"), + Example: ` flashduty rum issue-preset-severity-rules-history-list --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","limit":20,"p":0}'`, + 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 err := genFoldPositional(args, body, "application_id", "string"); err != nil { + return err + } + if cmd.Flags().Changed("page") { + body["p"] = fP + } + if cmd.Flags().Changed("limit") { + body["limit"] = fLimit + } + if cmd.Flags().Changed("search-after-ctx") { + body["search_after_ctx"] = fSearchAfterCtx + } + if cmd.Flags().Changed("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("asc") { + body["asc"] = fAsc + } + if cmd.Flags().Changed("orderby") { + body["orderby"] = fOrderby + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMPresetSeverityRuleHistoryListRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.IssuePresetSeverityRules.HistoryList(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().Int64Var(&fP, "page", 0, "Zero-based page number. (min 0)") + cmd.Flags().Int64Var(&fLimit, "limit", 0, "Page size. Values <= 0 default to 20; values above 100 are capped at 100. (max 100)") + cmd.Flags().StringVar(&fSearchAfterCtx, "search-after-ctx", "", "Request field ") + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().BoolVar(&fAsc, "asc", false, "Sort ascending when true; results are descending by default.") + cmd.Flags().StringVar(&fOrderby, "orderby", "", "Sort column. Any other value (including omitted) falls back to 'updated_at'. [updated_at, version]") + 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 genIssuePresetSeverityRulesHistoryRevertCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fVersion int64 + cmd := &cobra.Command{ + Use: "issue-preset-severity-rules-history-revert ", + Short: "Revert preset severity rules to a history snapshot", + Long: `Revert preset severity rules to a history snapshot. + +Roll back preset severity rules to the state captured in a specific history snapshot. + +API: POST /rum/issue/preset-severity/rules/history/revert (rum-issue-preset-severity-rules-history-revert) + +Request fields: + --application-id string (required) — RUM application ID. + --version int (required) — Version number of the snapshot to revert to. (min 1) +`, + Args: requireBodyFieldOrExactArg("application_id", "application-id"), + Example: ` flashduty rum issue-preset-severity-rules-history-revert --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","version":2}'`, + 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 err := genFoldPositional(args, body, "application_id", "string"); err != nil { + return err + } + if cmd.Flags().Changed("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("version") { + body["version"] = fVersion + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMPresetSeverityRuleHistoryRevertRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.IssuePresetSeverityRules.HistoryRevert(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/issue/preset-severity/rules/history/revert") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().Int64Var(&fVersion, "version", 0, "Version number of the snapshot to revert to. (required) (min 1)") + 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 genIssuePresetSeverityRulesListCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + cmd := &cobra.Command{ + Use: "issue-preset-severity-rules-list ", + Short: "List preset severity rules", + Long: `List preset severity rules. + +Return all preset severity rules configured for a RUM application. + +API: POST /rum/issue/preset-severity/rules/list (rum-issue-preset-severity-rules-list) + +Request fields: + --application-id string (required) — RUM application ID. + +Response fields ('data' envelope is unwrapped — rows are nested under items[]; pipe 'jq '.items[]'', NOT '.data.items[]'): + - items (array) (required) — Rules ordered by evaluation order ('priority' ascending, then 'created_at' ascending). + - created_at (integer) (required) — Unix timestamp in milliseconds when the rule was created. + - description (string) (required) — Rule description. May be empty. + - filters (array) (required) — OR-of-ANDs filter structure: the outer array is OR'd, each inner array is AND'd. A rule matches an error when at least one inner AND-group fully matches. + - priority (integer) (required) — Evaluation order among the application's rules. '1' is evaluated first (highest precedence); the first enabled rule whose filters match wins. + - rule_id (string) (required) — Unique rule ID. + - rule_name (string) (required) — Rule display name. + - severity (string) (required) — Severity assigned to errors matching this rule. [Critical, Warning, Info] + - status (string) (required) — Only enabled rules are evaluated against incoming errors. [enabled, disabled] + - updated_at (integer) (required) — Unix timestamp in milliseconds when the rule was last updated. +`, + Args: requireBodyFieldOrExactArg("application_id", "application-id"), + Example: ` flashduty rum issue-preset-severity-rules-list --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o"}'`, + 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 err := genFoldPositional(args, body, "application_id", "string"); err != nil { + return err + } + if cmd.Flags().Changed("application-id") { + body["application_id"] = fApplicationID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMPresetSeverityRuleListRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.IssuePresetSeverityRules.List(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (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 genIssuePresetSeverityRulesReorderCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fDragRuleID string + var fTargetRuleID string + cmd := &cobra.Command{ + Use: "issue-preset-severity-rules-reorder", + Short: "Reorder preset severity rule", + Long: `Reorder preset severity rule. + +Move one preset severity rule to another rule's position in evaluation order. + +API: POST /rum/issue/preset-severity/rules/reorder (rum-issue-preset-severity-rules-reorder) + +Request fields: + --application-id string (required) — RUM application ID. + --drag-rule-id string (required) — ID of the rule being moved. + --target-rule-id string (required) — ID of the rule whose evaluation position 'drag_rule_id' moves to. +`, + Example: ` flashduty rum issue-preset-severity-rules-reorder --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","drag_rule_id":"n8mZQ2VbXk4wPRs6DfC9Ay","target_rule_id":"TAHUYnQmXKzgMS4TFVUKvz"}'`, + 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("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("drag-rule-id") { + body["drag_rule_id"] = fDragRuleID + } + if cmd.Flags().Changed("target-rule-id") { + body["target_rule_id"] = fTargetRuleID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMPresetSeverityRuleReorderRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.IssuePresetSeverityRules.Reorder(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/issue/preset-severity/rules/reorder") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fDragRuleID, "drag-rule-id", "", "ID of the rule being moved. (required)") + cmd.Flags().StringVar(&fTargetRuleID, "target-rule-id", "", "ID of the rule whose evaluation position 'drag_rule_id' moves to. (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 genIssuePresetSeverityRulesUpdateCmd() *cobra.Command { + var dataJSON string + var fApplicationID string + var fDescription string + var fRuleID string + var fRuleName string + var fSeverity string + cmd := &cobra.Command{ + Use: "issue-preset-severity-rules-update", + Short: "Update preset severity rule", + Long: `Update preset severity rule. + +Update the name, description, filters, or severity of a preset severity rule. + +API: POST /rum/issue/preset-severity/rules/update (rum-issue-preset-severity-rules-update) + +Request fields: + --application-id string (required) — RUM application ID. + --description string — New description, up to 512 characters. Omit to leave unchanged. (≤512 chars) + --rule-id string (required) — Rule ID to update. + --rule-name string — New display name, 1-128 characters. Omit to leave unchanged. (1-128 chars) + --severity string — New severity. Omit to leave unchanged. [Critical, Warning, Info] + filters (array, via --data) — OR-of-ANDs filter structure: the outer array is OR'd, each inner array is AND'd. A rule matches an error when at least one inner AND-group fully matches. +`, + Example: ` flashduty rum issue-preset-severity-rules-update --data '{"application_id":"WoyQQ3BohkdtPivubEvE8o","rule_id":"TAHUYnQmXKzgMS4TFVUKvz","rule_name":"Critical crash spikes (updated)","severity":"Critical"}'`, + 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("application-id") { + body["application_id"] = fApplicationID + } + if cmd.Flags().Changed("description") { + body["description"] = fDescription + } + if cmd.Flags().Changed("rule-id") { + body["rule_id"] = fRuleID + } + if cmd.Flags().Changed("rule-name") { + body["rule_name"] = fRuleName + } + if cmd.Flags().Changed("severity") { + body["severity"] = fSeverity + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMPresetSeverityRuleUpdateRequest) + if err := genBindBody(body, req); err != nil { + return err + } + resp, err := ctx.Client.IssuePresetSeverityRules.Update(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + if resp != nil && len(resp.Raw) > 0 { + return ctx.WriteRaw(resp.Raw) + } + ctx.WriteResult("OK: POST /rum/issue/preset-severity/rules/update") + return nil + }) + }, + } + cmd.Flags().StringVar(&fApplicationID, "application-id", "", "RUM application ID. (required)") + cmd.Flags().StringVar(&fDescription, "description", "", "New description, up to 512 characters. Omit to leave unchanged. (≤512 chars)") + cmd.Flags().StringVar(&fRuleID, "rule-id", "", "Rule ID to update. (required)") + cmd.Flags().StringVar(&fRuleName, "rule-name", "", "New display name, 1-128 characters. Omit to leave unchanged. (1-128 chars)") + cmd.Flags().StringVar(&fSeverity, "severity", "", "New severity. Omit to leave unchanged. [Critical, Warning, Info]") + 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 registerGeneratedIssuePresetSeverityRules(root *cobra.Command) { + gRUM := genGroup(root, "rum", "RUM API") + genAddLeaf(gRUM, genIssuePresetSeverityRulesCreateCmd()) + genAddLeaf(gRUM, genIssuePresetSeverityRulesDeleteCmd()) + genAddLeaf(gRUM, genIssuePresetSeverityRulesDisableCmd()) + genAddLeaf(gRUM, genIssuePresetSeverityRulesEnableCmd()) + genAddLeaf(gRUM, genIssuePresetSeverityRulesHistoryListCmd()) + genAddLeaf(gRUM, genIssuePresetSeverityRulesHistoryRevertCmd()) + genAddLeaf(gRUM, genIssuePresetSeverityRulesListCmd()) + genAddLeaf(gRUM, genIssuePresetSeverityRulesReorderCmd()) + genAddLeaf(gRUM, genIssuePresetSeverityRulesUpdateCmd()) +} diff --git a/internal/cli/zz_generated_manifest.go b/internal/cli/zz_generated_manifest.go index dbf06a1..96ef7cb 100644 --- a/internal/cli/zz_generated_manifest.go +++ b/internal/cli/zz_generated_manifest.go @@ -196,6 +196,11 @@ var generatedOpIDs = []string{ "monit-rule-write-move", "monit-rule-write-status", "monit-rule-write-update", + "monit-servicemap-read-fleet", + "monit-servicemap-read-fleet-summary", + "monit-servicemap-read-status", + "monit-servicemap-read-summary", + "monit-servicemap-read-topology", "monit-store-ruleset-create", "monit-store-ruleset-delete", "monit-store-ruleset-info", @@ -239,13 +244,30 @@ var generatedOpIDs = []string{ "rum-application-write-create", "rum-application-write-delete", "rum-application-write-update", + "rum-error-ingestion-rules-create", + "rum-error-ingestion-rules-delete", + "rum-error-ingestion-rules-disable", + "rum-error-ingestion-rules-enable", + "rum-error-ingestion-rules-history-list", + "rum-error-ingestion-rules-history-revert", + "rum-error-ingestion-rules-list", + "rum-error-ingestion-rules-update", + "rum-issue-preset-severity-rules-create", + "rum-issue-preset-severity-rules-delete", + "rum-issue-preset-severity-rules-disable", + "rum-issue-preset-severity-rules-enable", + "rum-issue-preset-severity-rules-history-list", + "rum-issue-preset-severity-rules-history-revert", + "rum-issue-preset-severity-rules-list", + "rum-issue-preset-severity-rules-reorder", + "rum-issue-preset-severity-rules-update", "rum-issue-read-info", "rum-issue-read-list", "rum-issue-write-update", "rum-read-data-query", "rum-read-facet-count", - "rum-read-facet-list", "rum-read-field-list", + "rum-resource-read-info", "rum-session-replay-read-metadata", "rum-session-replay-read-segments", "scheduleCreate", diff --git a/internal/cli/zz_generated_members.go b/internal/cli/zz_generated_members.go index ba456c9..6ebbfe5 100644 --- a/internal/cli/zz_generated_members.go +++ b/internal/cli/zz_generated_members.go @@ -368,52 +368,53 @@ Response fields ('data' envelope is unwrapped — rows are nested under items[]; func genMembersMemberResetInfoCmd() *cobra.Command { var dataJSON string - var fAvatar string var fCountryCode string var fEmail string - var fLocale string + var fFrom string var fMemberID int64 var fMemberName string var fPhone string - var fTimeZone string + var fRefID string cmd := &cobra.Command{ - Use: "info-reset ", + Use: "info-reset", Short: "Reset member info", Long: `Reset member info. -Batch-update multiple profile fields of the current member. +Identify a member and reset the specified profile fields. API: POST /member/info/reset (memberResetInfo) Request fields: - --avatar string — Avatar URL - --country-code string — Country code - --email string — Email address - --locale string — Locale [zh-CN, en-US] - --member-id int (required) — Member ID of the member to update - --member-name string — Display name (2-39 chars) - --phone string — Phone number - --time-zone string — Time zone + --country-code string — Country or region code used to parse phone. + --email string — Email address used to identify the member. + --from string — Set to 'api' to mark an updated phone or email as verified. Only takes effect when the account has member invites disabled; any other value is ignored. + --member-id int — Member ID used to identify the member. + --member-name string — Member name used to identify the member. + --phone string — Phone number used to identify the member. Include country_code when the number is not in E.164 format. + --ref-id string — External reference ID used to identify the member. + updates (object, via --data) (required) — Member profile fields to write. Omitted fields remain unchanged. + - avatar (string) — New avatar URL. (≤499 chars) + - country_code (string) — Country or region code for the new phone number. + - email (string) — New email address. + - locale (string) — New locale preference. [zh-CN, en-US] + - member_name (string) — New display name. (2-39 chars) + - password (string) — New login password in the encrypted format accepted by the backend. + - phone (string) — New phone number. Include country_code when the number is not in E.164 format. + - ref_id (string) — New external reference ID. + - time_zone (string) — New IANA time zone name, such as Asia/Shanghai. `, - Args: requireBodyFieldOrExactArg("member_id", "member-id"), - Example: ` flashduty member info-reset --data '{"locale":"zh-CN","member_id":2476444212131,"member_name":"Alice","time_zone":"Asia/Shanghai"}'`, + Example: ` flashduty member info-reset --data '{"member_id":2476444212131,"updates":{"locale":"zh-CN","member_name":"Alice Chen","time_zone":"Asia/Shanghai"}}'`, 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 err := genFoldPositional(args, body, "member_id", "int"); err != nil { - return err - } - if cmd.Flags().Changed("avatar") { - body["avatar"] = fAvatar - } if cmd.Flags().Changed("country-code") { body["country_code"] = fCountryCode } if cmd.Flags().Changed("email") { body["email"] = fEmail } - if cmd.Flags().Changed("locale") { - body["locale"] = fLocale + if cmd.Flags().Changed("from") { + body["from"] = fFrom } if cmd.Flags().Changed("member-id") { body["member_id"] = fMemberID @@ -424,8 +425,8 @@ Request fields: if cmd.Flags().Changed("phone") { body["phone"] = fPhone } - if cmd.Flags().Changed("time-zone") { - body["time_zone"] = fTimeZone + if cmd.Flags().Changed("ref-id") { + body["ref_id"] = fRefID } return nil }) @@ -448,14 +449,13 @@ Request fields: }) }, } - cmd.Flags().StringVar(&fAvatar, "avatar", "", "Avatar URL") - cmd.Flags().StringVar(&fCountryCode, "country-code", "", "Country code") - cmd.Flags().StringVar(&fEmail, "email", "", "Email address") - cmd.Flags().StringVar(&fLocale, "locale", "", "Locale [zh-CN, en-US]") - cmd.Flags().Int64Var(&fMemberID, "member-id", 0, "Member ID of the member to update (required)") - cmd.Flags().StringVar(&fMemberName, "member-name", "", "Display name (2-39 chars)") - cmd.Flags().StringVar(&fPhone, "phone", "", "Phone number") - cmd.Flags().StringVar(&fTimeZone, "time-zone", "", "Time zone") + cmd.Flags().StringVar(&fCountryCode, "country-code", "", "Country or region code used to parse phone.") + cmd.Flags().StringVar(&fEmail, "email", "", "Email address used to identify the member.") + cmd.Flags().StringVar(&fFrom, "from", "", "Set to 'api' to mark an updated phone or email as verified. Only takes effect when the account has member invites disabled; any other value is ignored.") + cmd.Flags().Int64Var(&fMemberID, "member-id", 0, "Member ID used to identify the member.") + cmd.Flags().StringVar(&fMemberName, "member-name", "", "Member name used to identify the member.") + cmd.Flags().StringVar(&fPhone, "phone", "", "Phone number used to identify the member. Include country_code when the number is not in E.164 format.") + cmd.Flags().StringVar(&fRefID, "ref-id", "", "External reference ID used to identify the member.") 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 } diff --git a/internal/cli/zz_generated_register.go b/internal/cli/zz_generated_register.go index 778a687..bd9ce7c 100644 --- a/internal/cli/zz_generated_register.go +++ b/internal/cli/zz_generated_register.go @@ -17,6 +17,7 @@ func registerGenerated(root *cobra.Command) { registerGeneratedDiagnostics(root) registerGeneratedMonitorUtilities(root) registerGeneratedRuleSets(root) + registerGeneratedServiceMap(root) registerGeneratedAlertEnrichment(root) registerGeneratedAlerts(root) registerGeneratedAnalytics(root) @@ -37,8 +38,11 @@ func registerGenerated(root *cobra.Command) { registerGeneratedTeams(root) registerGeneratedApplications(root) registerGeneratedDataQuery(root) + registerGeneratedErrorIngestionRules(root) registerGeneratedFacets(root) + registerGeneratedIssuePresetSeverityRules(root) registerGeneratedIssues(root) + registerGeneratedResources(root) registerGeneratedSessionReplay(root) registerGeneratedSourcemaps(root) } diff --git a/internal/cli/zz_generated_resources.go b/internal/cli/zz_generated_resources.go new file mode 100644 index 0000000..5117899 --- /dev/null +++ b/internal/cli/zz_generated_resources.go @@ -0,0 +1,86 @@ +// Code generated by internal/cmd/cligen; DO NOT EDIT. + +package cli + +import ( + "github.com/spf13/cobra" + + flashduty "github.com/flashcatcloud/go-flashduty" +) + +func genResourcesInfoCmd() *cobra.Command { + var dataJSON string + var fNoCache bool + cmd := &cobra.Command{ + Use: "resource-info", + Short: "Get RUM resource info", + Long: `Get RUM resource info. + +Return the account's RUM resource record and its current session usage. + +API: POST /rum/resource/info (rum-resource-read-info) + +Request fields: + --no-cache bool — Bypass the short-lived cache of the resource record (plan version, quotas, status) and read it from source. Does not refresh the usage counts. Default 'false'. + +Response fields ('data' envelope is unwrapped — these fields are at the top level): + - account_id (integer) (required) — Account ID that owns this resource. + - action.days (integer) (required) — Retention period in days for action (user interaction) data. + - created_at (integer) (required) — Unix timestamp in seconds when the resource was created. Also anchors the start of the first billing window. + - error.days (integer) (required) — Retention period in days for error data. + - expired_at (integer) — Unix timestamp in seconds when the on-premises license expires. Only present on on-premises deployments; omitted entirely for SaaS accounts. + - long_task.days (integer) (required) — Retention period in days for long-task data. + - offering_id (integer) (required) — ID of the offering (SKU) this resource was provisioned from. + - order_id (string) (required) — ID of the order that provisioned this resource. Empty for resources provisioned outside the order flow (e.g. on-premises). + - product (string) (required) — Product code for this resource. Always 'rum' for this endpoint. [rum] + - resource.days (integer) (required) — Retention period in days for resource (network request) data. + - resource_id (string) (required) — Unique resource identifier for the account's RUM resource. + - resource_name (string) (required) — Display name of the resource. + - session.days (integer) (required) — Retention period in days for session data. + - session_investigate.free_cnt (integer) (required) — Free quota for investigate sessions per application, per billing window. + - session_investigate.used_cnt (integer) (required) — Number of investigate (error tracking) sessions used in the current billing window. + - session_limit_reached (boolean) (required) — 'true' when a 'version=free' account has exceeded its combined free session quota across all applications. Always 'false' for non-free plans. + - session_measure.free_cnt (integer) (required) — Free quota for measure sessions per application, per billing window. + - session_measure.used_cnt (integer) (required) — Number of measure (performance) sessions used in the current billing window. + - session_replay.free_cnt (integer) (required) — Free quota for session-replay sessions per application, per billing window. + - session_replay.used_cnt (integer) (required) — Number of session-replay sessions used in the current billing window. + - status (string) (required) — Status of the resource. A resource with status 'deleted' or 'destroyed' never reaches this field — the operation returns 'ResourceNotFound' for those instead. [enabled, disabled] + - updated_at (integer) (required) — Unix timestamp in seconds when the resource was last updated. + - version (string) (required) — Plan version of this resource. [free, professional] + - view.days (integer) (required) — Retention period in days for view (page/screen) data. + - window_end_time (integer) (required) — Unix timestamp in seconds for the end of the current 30-day billing window. + - window_start_time (integer) (required) — Unix timestamp in seconds for the start of the current 30-day billing window. +`, + Example: ` flashduty rum resource-info --data '{"no_cache":false}'`, + 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("no-cache") { + body["no_cache"] = fNoCache + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.RUMResourceInfoRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.Resources.Info(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().BoolVar(&fNoCache, "no-cache", false, "Bypass the short-lived cache of the resource record (plan version, quotas, status) and read it from source. Does not refresh the usage counts. Default 'false'.") + 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 registerGeneratedResources(root *cobra.Command) { + gRUM := genGroup(root, "rum", "RUM API") + genAddLeaf(gRUM, genResourcesInfoCmd()) +} diff --git a/internal/cli/zz_generated_response_help.go b/internal/cli/zz_generated_response_help.go index f091003..0c59024 100644 --- a/internal/cli/zz_generated_response_help.go +++ b/internal/cli/zz_generated_response_help.go @@ -28,15 +28,15 @@ var responseHelpBySDKMethod = map[string]string{ "AlertRules.ReadCounterStatus": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - folder_id (integer) (required)\n - folder_name (string)\n - rule_total (integer) (required) — Total rules in the folder family.\n - triggered_rule_count (integer) (required) — Rules with active alerts.\n", "AlertRules.ReadCounterTotal": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required)\n - clock (integer) (required) — Sample timestamp, Unix epoch seconds.\n - id (integer) (required)\n - num (integer) (required) — Rule count at the sample time.\n", "AlertRules.ReadDstypes": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Owning account ID. `0` for global types.\n - id (integer) (required)\n - ident (string) (required) — Identifier used as the `ds_type` of rules, e.g. `prometheus`.\n - name (string) (required) — Display name, e.g. `Prometheus`.\n - weight (integer) (required) — Display order weight; higher appears first.\n", - "AlertRules.ReadExport": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - annotations (object)\n - cron_pattern (string) (required)\n - debug_log_enabled (boolean) (required)\n - delay_seconds (integer)\n - description (string)\n - description_type (string) [text, markdown]\n - ds_ids (array)\n - ds_list (array)\n - ds_type (string) (required)\n - enabled (boolean) (required)\n - enabled_times (array)\n - days (array) — Days of week, 0 = Sunday.\n - etime (string) — End time, e.g. `18:00`.\n - stime (string) — Start time, e.g. `09:00`.\n - labels (object)\n - name (string) (required)\n - repeat_interval (integer)\n - repeat_total (integer)\n - rule_configs (object) — Rule evaluation configuration.\n - check_anydata (object) — Any-data check configuration. Fires when the query returns any data rows.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery (object) — Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.\n - args (object)\n - condition (string) — Recovery expression. Required when `mode` is `ql`.\n - 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]\n - recovery_check_times (integer)\n - severity (string) [Critical, Warning, Info]\n - check_nodata (object) — No-data check configuration.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery_check_times (integer)\n - resolve_timeout (integer) — Auto-resolve after N seconds.\n - severity (string) [Critical, Warning, Info]\n - check_threshold (object) — Threshold check configuration.\n - alerting_check_times (integer)\n - critical (string)\n - enabled (boolean)\n - info (string)\n - push_recovery_event (boolean)\n - recovery (object)\n - condition (string)\n - mode (string) [invert, threshold, ql]\n - recovery_check_times (integer)\n - warning (string)\n - queries (array)\n - args (object)\n - expr (string) — Query expression.\n - label_fields (array)\n - name (string) — Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.\n - value_fields (array)\n - 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`.\n - args (object)\n - expr (string) — Query expression.\n - name (string) — Relate-query identifier.\n", - "AlertRules.ReadInfo": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required)\n - annotations (object)\n - channel_ids (array) — Channel IDs to send alerts to.\n - created_at (integer) (required)\n - creator_id (integer) (required)\n - creator_name (string) (required)\n - cron_pattern (string) (required) — 5-field cron schedule.\n - debug_log_enabled (boolean) (required)\n - delay_seconds (integer) (required)\n - description (string)\n - description_type (string) — Format for the description. Defaults to `text` when omitted or empty. [text, markdown]\n - ds_ids (array) — Specific data source IDs.\n - ds_list (array) — Data source name patterns (supports wildcards).\n - ds_type (string) (required) — Data source type.\n - enabled (boolean) (required)\n - enabled_times (array) — Time windows when the rule is active. Defaults to all days from 00:00 to 23:59 when omitted or empty.\n - days (array) — Days of week (0=Sunday).\n - etime (string) — End time, e.g. `18:00`.\n - stime (string) — Start time, e.g. `09:00`.\n - folder_id (integer) (required) — Folder the rule belongs to.\n - id (integer) (required)\n - labels (object) — Custom labels.\n - name (string) (required) — Rule name.\n - repeat_interval (integer) — Notification repeat interval in seconds.\n - repeat_total (integer) — Max number of repeat notifications.\n - rule_configs (object) — Rule evaluation configuration.\n - check_anydata (object) — Any-data check configuration. Fires when the query returns any data rows.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery (object) — Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.\n - args (object)\n - condition (string) — Recovery expression. Required when `mode` is `ql`.\n - 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]\n - recovery_check_times (integer)\n - severity (string) [Critical, Warning, Info]\n - check_nodata (object) — No-data check configuration.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery_check_times (integer)\n - resolve_timeout (integer) — Auto-resolve after N seconds.\n - severity (string) [Critical, Warning, Info]\n - check_threshold (object) — Threshold check configuration.\n - alerting_check_times (integer)\n - critical (string)\n - enabled (boolean)\n - info (string)\n - push_recovery_event (boolean)\n - recovery (object)\n - condition (string)\n - mode (string) [invert, threshold, ql]\n - recovery_check_times (integer)\n - warning (string)\n - queries (array)\n - args (object)\n - expr (string) — Query expression.\n - label_fields (array)\n - name (string) — Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.\n - value_fields (array)\n - 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`.\n - args (object)\n - expr (string) — Query expression.\n - name (string) — Relate-query identifier.\n - updated_at (integer) (required)\n - updater_id (integer) (required)\n - updater_name (string) (required)\n", - "AlertRules.ReadList": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID.\n - created_at (integer) (required)\n - creator_id (integer) (required)\n - creator_name (string) (required)\n - cron_pattern (string) (required) — 5-field cron schedule, e.g. `* * * * *`.\n - debug_log_enabled (boolean) (required) — Whether debug logging is enabled.\n - delay_seconds (integer) (required) — Evaluation delay in seconds.\n - ds_type (string) (required) — Data source type, e.g. `prometheus`.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - folder_id (integer) (required) — Folder ID.\n - id (integer) (required) — Unique rule ID.\n - labels (object) — Custom labels.\n - name (string) (required) — Rule name.\n - triggered (boolean) (required) — True if the rule currently has active alerts.\n - updated_at (integer) (required)\n - updater_id (integer) (required)\n - updater_name (string) (required)\n", - "AlertRules.WriteCreate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer)\n - annotations (object)\n - channel_ids (array) — Channel IDs to send alerts to.\n - created_at (integer)\n - creator_id (integer)\n - creator_name (string)\n - cron_pattern (string) — 5-field cron schedule.\n - debug_log_enabled (boolean)\n - delay_seconds (integer)\n - description (string)\n - description_type (string) — Format for the description. Defaults to `text` when omitted or empty. [text, markdown]\n - ds_ids (array) — Specific data source IDs.\n - ds_list (array) — Data source name patterns (supports wildcards).\n - ds_type (string) — Data source type.\n - enabled (boolean)\n - enabled_times (array) — Time windows when the rule is active. Defaults to all days from 00:00 to 23:59 when omitted or empty.\n - days (array) — Days of week (0=Sunday).\n - etime (string) — End time, e.g. `18:00`.\n - stime (string) — Start time, e.g. `09:00`.\n - folder_id (integer) — Folder the rule belongs to.\n - id (integer)\n - labels (object) — Custom labels.\n - name (string) — Rule name.\n - repeat_interval (integer) — Notification repeat interval in seconds.\n - repeat_total (integer) — Max number of repeat notifications.\n - rule_configs (object) — Rule evaluation configuration.\n - check_anydata (object) — Any-data check configuration. Fires when the query returns any data rows.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery (object) — Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.\n - args (object)\n - condition (string) — Recovery expression. Required when `mode` is `ql`.\n - 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]\n - recovery_check_times (integer)\n - severity (string) [Critical, Warning, Info]\n - check_nodata (object) — No-data check configuration.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery_check_times (integer)\n - resolve_timeout (integer) — Auto-resolve after N seconds.\n - severity (string) [Critical, Warning, Info]\n - check_threshold (object) — Threshold check configuration.\n - alerting_check_times (integer)\n - critical (string)\n - enabled (boolean)\n - info (string)\n - push_recovery_event (boolean)\n - recovery (object)\n - condition (string)\n - mode (string) [invert, threshold, ql]\n - recovery_check_times (integer)\n - warning (string)\n - queries (array)\n - args (object)\n - expr (string) — Query expression.\n - label_fields (array)\n - name (string) — Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.\n - value_fields (array)\n - 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`.\n - args (object)\n - expr (string) — Query expression.\n - name (string) — Relate-query identifier.\n - updated_at (integer)\n - updater_id (integer)\n - updater_name (string)\n", + "AlertRules.ReadExport": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - annotations (object)\n - cron_pattern (string) (required)\n - debug_log_enabled (boolean) (required)\n - delay_seconds (integer)\n - description (string)\n - description_type (string) [text, markdown]\n - ds_ids (array)\n - ds_list (array)\n - ds_type (string) (required)\n - enabled (boolean) (required)\n - enabled_times (array)\n - days (array) — Days of week, 0 = Sunday.\n - etime (string) — End time, e.g. `18:00`.\n - stime (string) — Start time, e.g. `09:00`.\n - labels (object)\n - name (string) (required)\n - repeat_interval (integer)\n - repeat_total (integer)\n - rule_configs (object) — Rule evaluation configuration.\n - check_anydata (object) — Any-data check configuration. Fires when the query returns any data rows.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery (object) — Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.\n - args (object)\n - condition (string) — Recovery expression. Required when `mode` is `ql`.\n - 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]\n - recovery_check_times (integer)\n - severity (string) [Critical, Warning, Info]\n - check_nodata (object) — No-data check configuration.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery_check_times (integer)\n - resolve_timeout (integer) — Auto-resolve after N seconds.\n - severity (string) [Critical, Warning, Info]\n - check_threshold (object) — Threshold check configuration.\n - alerting_check_times (integer)\n - critical (string)\n - enabled (boolean)\n - info (string)\n - push_recovery_event (boolean)\n - recovery (object)\n - condition (string)\n - mode (string) [invert, threshold, ql]\n - recovery_check_times (integer)\n - warning (string)\n - queries (array)\n - args (object)\n - expr (string) — Query expression.\n - label_fields (array)\n - name (string) — Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.\n - value_fields (array)\n - 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`.\n - args (object)\n - expr (string) — Query expression.\n - name (string) — Relate-query identifier.\n - timezone (string) — Timezone in which the rule executes. IANA timezone name; defaults to `Asia/Shanghai`.\n", + "AlertRules.ReadInfo": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required)\n - annotations (object)\n - channel_ids (array) — Channel IDs to send alerts to.\n - created_at (integer) (required)\n - creator_id (integer) (required)\n - creator_name (string) (required)\n - cron_pattern (string) (required) — 5-field cron schedule. Must not start with `CRON_TZ=` or `TZ=`; use the `timezone` field instead.\n - debug_log_enabled (boolean) (required)\n - delay_seconds (integer) (required)\n - description (string)\n - description_type (string) — Format for the description. Defaults to `text` when omitted or empty. [text, markdown]\n - ds_ids (array) — Specific data source IDs.\n - ds_list (array) — Data source name patterns (supports wildcards).\n - ds_type (string) (required) — Data source type.\n - enabled (boolean) (required)\n - enabled_times (array) — Time windows when the rule is active. Defaults to all days from 00:00 to 23:59 when omitted or empty.\n - days (array) — Days of week (0=Sunday).\n - etime (string) — End time, e.g. `18:00`.\n - stime (string) — Start time, e.g. `09:00`.\n - folder_id (integer) (required) — Folder the rule belongs to.\n - id (integer) (required)\n - labels (object) — Custom labels.\n - name (string) (required) — Rule name.\n - repeat_interval (integer) — Notification repeat interval in seconds.\n - repeat_total (integer) — Max number of repeat notifications.\n - rule_configs (object) — Rule evaluation configuration.\n - check_anydata (object) — Any-data check configuration. Fires when the query returns any data rows.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery (object) — Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.\n - args (object)\n - condition (string) — Recovery expression. Required when `mode` is `ql`.\n - 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]\n - recovery_check_times (integer)\n - severity (string) [Critical, Warning, Info]\n - check_nodata (object) — No-data check configuration.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery_check_times (integer)\n - resolve_timeout (integer) — Auto-resolve after N seconds.\n - severity (string) [Critical, Warning, Info]\n - check_threshold (object) — Threshold check configuration.\n - alerting_check_times (integer)\n - critical (string)\n - enabled (boolean)\n - info (string)\n - push_recovery_event (boolean)\n - recovery (object)\n - condition (string)\n - mode (string) [invert, threshold, ql]\n - recovery_check_times (integer)\n - warning (string)\n - queries (array)\n - args (object)\n - expr (string) — Query expression.\n - label_fields (array)\n - name (string) — Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.\n - value_fields (array)\n - 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`.\n - args (object)\n - expr (string) — Query expression.\n - name (string) — Relate-query identifier.\n - timezone (string) — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. `Asia/Shanghai`, `UTC`, `Europe/London`); shortcuts and offsets such as `Local`, `UTC+8`, or `CST` are rejected. Treated as `Asia/Shanghai` if empty.\n - updated_at (integer) (required)\n - updater_id (integer) (required)\n - updater_name (string) (required)\n", + "AlertRules.ReadList": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID.\n - created_at (integer) (required)\n - creator_id (integer) (required)\n - creator_name (string) (required)\n - cron_pattern (string) (required) — 5-field cron schedule, e.g. `* * * * *`. Must not start with `CRON_TZ=` or `TZ=`; use the `timezone` field instead.\n - debug_log_enabled (boolean) (required) — Whether debug logging is enabled.\n - delay_seconds (integer) (required) — Evaluation delay in seconds.\n - ds_type (string) (required) — Data source type, e.g. `prometheus`.\n - enabled (boolean) (required) — Whether the rule is enabled.\n - folder_id (integer) (required) — Folder ID.\n - id (integer) (required) — Unique rule ID.\n - labels (object) — Custom labels.\n - name (string) (required) — Rule name.\n - timezone (string) — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. `Asia/Shanghai`, `UTC`, `Europe/London`); shortcuts and offsets such as `Local`, `UTC+8`, or `CST` are rejected. Treated as `Asia/Shanghai` if empty.\n - triggered (boolean) (required) — True if the rule currently has active alerts.\n - updated_at (integer) (required)\n - updater_id (integer) (required)\n - updater_name (string) (required)\n", + "AlertRules.WriteCreate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer)\n - annotations (object)\n - channel_ids (array) — Channel IDs to send alerts to.\n - created_at (integer)\n - creator_id (integer)\n - creator_name (string)\n - cron_pattern (string) — 5-field cron schedule. Must not start with `CRON_TZ=` or `TZ=`; use the `timezone` field instead.\n - debug_log_enabled (boolean)\n - delay_seconds (integer)\n - description (string)\n - description_type (string) — Format for the description. Defaults to `text` when omitted or empty. [text, markdown]\n - ds_ids (array) — Specific data source IDs.\n - ds_list (array) — Data source name patterns (supports wildcards).\n - ds_type (string) — Data source type.\n - enabled (boolean)\n - enabled_times (array) — Time windows when the rule is active. Defaults to all days from 00:00 to 23:59 when omitted or empty.\n - days (array) — Days of week (0=Sunday).\n - etime (string) — End time, e.g. `18:00`.\n - stime (string) — Start time, e.g. `09:00`.\n - folder_id (integer) — Folder the rule belongs to.\n - id (integer)\n - labels (object) — Custom labels.\n - name (string) — Rule name.\n - repeat_interval (integer) — Notification repeat interval in seconds.\n - repeat_total (integer) — Max number of repeat notifications.\n - rule_configs (object) — Rule evaluation configuration.\n - check_anydata (object) — Any-data check configuration. Fires when the query returns any data rows.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery (object) — Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.\n - args (object)\n - condition (string) — Recovery expression. Required when `mode` is `ql`.\n - 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]\n - recovery_check_times (integer)\n - severity (string) [Critical, Warning, Info]\n - check_nodata (object) — No-data check configuration.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery_check_times (integer)\n - resolve_timeout (integer) — Auto-resolve after N seconds.\n - severity (string) [Critical, Warning, Info]\n - check_threshold (object) — Threshold check configuration.\n - alerting_check_times (integer)\n - critical (string)\n - enabled (boolean)\n - info (string)\n - push_recovery_event (boolean)\n - recovery (object)\n - condition (string)\n - mode (string) [invert, threshold, ql]\n - recovery_check_times (integer)\n - warning (string)\n - queries (array)\n - args (object)\n - expr (string) — Query expression.\n - label_fields (array)\n - name (string) — Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.\n - value_fields (array)\n - 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`.\n - args (object)\n - expr (string) — Query expression.\n - name (string) — Relate-query identifier.\n - timezone (string) — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. `Asia/Shanghai`, `UTC`, `Europe/London`); shortcuts and offsets such as `Local`, `UTC+8`, or `CST` are rejected. Treated as `Asia/Shanghai` if empty.\n - updated_at (integer)\n - updater_id (integer)\n - updater_name (string)\n", "AlertRules.WriteFieldsUpdate": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - message (string) (required) — Empty on success, error message on failure.\n - name (string) (required) — Rule name.\n", "AlertRules.WriteImport": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - message (string) (required) — Empty on success, error message on failure.\n - name (string) (required) — Rule name.\n", "AlertRules.WriteMove": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - message (string) (required) — Empty on success, error message on failure.\n - name (string) (required) — Rule name.\n", "AlertRules.WriteStatus": "Response fields (`data` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - folder_id (integer) (required)\n - folder_name (string)\n - rule_total (integer) (required) — Total rules in the folder family.\n - triggered_rule_count (integer) (required) — Rules with active alerts.\n", - "AlertRules.WriteUpdate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer)\n - annotations (object)\n - channel_ids (array) — Channel IDs to send alerts to.\n - created_at (integer)\n - creator_id (integer)\n - creator_name (string)\n - cron_pattern (string) — 5-field cron schedule.\n - debug_log_enabled (boolean)\n - delay_seconds (integer)\n - description (string)\n - description_type (string) — Format for the description. Defaults to `text` when omitted or empty. [text, markdown]\n - ds_ids (array) — Specific data source IDs.\n - ds_list (array) — Data source name patterns (supports wildcards).\n - ds_type (string) — Data source type.\n - enabled (boolean)\n - enabled_times (array) — Time windows when the rule is active. Defaults to all days from 00:00 to 23:59 when omitted or empty.\n - days (array) — Days of week (0=Sunday).\n - etime (string) — End time, e.g. `18:00`.\n - stime (string) — Start time, e.g. `09:00`.\n - folder_id (integer) — Folder the rule belongs to.\n - id (integer)\n - labels (object) — Custom labels.\n - name (string) — Rule name.\n - repeat_interval (integer) — Notification repeat interval in seconds.\n - repeat_total (integer) — Max number of repeat notifications.\n - rule_configs (object) — Rule evaluation configuration.\n - check_anydata (object) — Any-data check configuration. Fires when the query returns any data rows.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery (object) — Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.\n - args (object)\n - condition (string) — Recovery expression. Required when `mode` is `ql`.\n - 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]\n - recovery_check_times (integer)\n - severity (string) [Critical, Warning, Info]\n - check_nodata (object) — No-data check configuration.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery_check_times (integer)\n - resolve_timeout (integer) — Auto-resolve after N seconds.\n - severity (string) [Critical, Warning, Info]\n - check_threshold (object) — Threshold check configuration.\n - alerting_check_times (integer)\n - critical (string)\n - enabled (boolean)\n - info (string)\n - push_recovery_event (boolean)\n - recovery (object)\n - condition (string)\n - mode (string) [invert, threshold, ql]\n - recovery_check_times (integer)\n - warning (string)\n - queries (array)\n - args (object)\n - expr (string) — Query expression.\n - label_fields (array)\n - name (string) — Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.\n - value_fields (array)\n - 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`.\n - args (object)\n - expr (string) — Query expression.\n - name (string) — Relate-query identifier.\n - updated_at (integer)\n - updater_id (integer)\n - updater_name (string)\n", + "AlertRules.WriteUpdate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer)\n - annotations (object)\n - channel_ids (array) — Channel IDs to send alerts to.\n - created_at (integer)\n - creator_id (integer)\n - creator_name (string)\n - cron_pattern (string) — 5-field cron schedule. Must not start with `CRON_TZ=` or `TZ=`; use the `timezone` field instead.\n - debug_log_enabled (boolean)\n - delay_seconds (integer)\n - description (string)\n - description_type (string) — Format for the description. Defaults to `text` when omitted or empty. [text, markdown]\n - ds_ids (array) — Specific data source IDs.\n - ds_list (array) — Data source name patterns (supports wildcards).\n - ds_type (string) — Data source type.\n - enabled (boolean)\n - enabled_times (array) — Time windows when the rule is active. Defaults to all days from 00:00 to 23:59 when omitted or empty.\n - days (array) — Days of week (0=Sunday).\n - etime (string) — End time, e.g. `18:00`.\n - stime (string) — Start time, e.g. `09:00`.\n - folder_id (integer) — Folder the rule belongs to.\n - id (integer)\n - labels (object) — Custom labels.\n - name (string) — Rule name.\n - repeat_interval (integer) — Notification repeat interval in seconds.\n - repeat_total (integer) — Max number of repeat notifications.\n - rule_configs (object) — Rule evaluation configuration.\n - check_anydata (object) — Any-data check configuration. Fires when the query returns any data rows.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery (object) — Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.\n - args (object)\n - condition (string) — Recovery expression. Required when `mode` is `ql`.\n - 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]\n - recovery_check_times (integer)\n - severity (string) [Critical, Warning, Info]\n - check_nodata (object) — No-data check configuration.\n - alerting_check_times (integer)\n - enabled (boolean)\n - push_recovery_event (boolean)\n - recovery_check_times (integer)\n - resolve_timeout (integer) — Auto-resolve after N seconds.\n - severity (string) [Critical, Warning, Info]\n - check_threshold (object) — Threshold check configuration.\n - alerting_check_times (integer)\n - critical (string)\n - enabled (boolean)\n - info (string)\n - push_recovery_event (boolean)\n - recovery (object)\n - condition (string)\n - mode (string) [invert, threshold, ql]\n - recovery_check_times (integer)\n - warning (string)\n - queries (array)\n - args (object)\n - expr (string) — Query expression.\n - label_fields (array)\n - name (string) — Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.\n - value_fields (array)\n - 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`.\n - args (object)\n - expr (string) — Query expression.\n - name (string) — Relate-query identifier.\n - timezone (string) — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. `Asia/Shanghai`, `UTC`, `Europe/London`); shortcuts and offsets such as `Local`, `UTC+8`, or `CST` are rejected. Treated as `Asia/Shanghai` if empty.\n - updated_at (integer)\n - updater_id (integer)\n - updater_name (string)\n", "Alerts.EventReadList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) — Account ID.\n - alert_id (string) — Parent alert ID (MongoDB ObjectID).\n - alert_key (string) — Deduplication key used to merge events into an alert.\n - channel_id (integer) — Channel ID the event is routed to.\n - created_at (integer) — Record creation time, Unix epoch seconds.\n - data_source_id (integer) — Deprecated. Use `integration_id` instead.\n - deleted_at (integer) — Soft-delete timestamp (seconds). Zero if not deleted.\n - description (string) — Event description.\n - event_id (string) — Event ID (MongoDB ObjectID).\n - event_severity (string) — Severity of this event. [Critical, Warning, Info, Ok]\n - event_status (string) — Status of this event. [Critical, Warning, Info, Ok]\n - event_time (integer) — Event timestamp, Unix epoch seconds.\n - images (array) — Images attached to the event.\n - alt (string) — Alt text.\n - href (string) — Optional link URL when the image is clicked.\n - src (string) (required) — Image source URL or internal image reference (starts with `img_` or `http`).\n - integration_id (integer) — Integration that produced this event.\n - integration_type (string) — Type/plugin key of the integration that produced this event.\n - labels (object) — Label key-value pairs.\n - title (string) — Event title.\n - title_rule (string) — Title template used to derive `title` from labels.\n - updated_at (integer) — Record update time, Unix epoch seconds.\n", "Alerts.ReadEventList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) — Account ID.\n - alert_id (string) — Parent alert ID (MongoDB ObjectID).\n - alert_key (string) — Deduplication key used to merge events into an alert.\n - channel_id (integer) — Channel ID the event is routed to.\n - created_at (integer) — Record creation time, Unix epoch seconds.\n - data_source_id (integer) — Deprecated. Use `integration_id` instead.\n - deleted_at (integer) — Soft-delete timestamp (seconds). Zero if not deleted.\n - description (string) — Event description.\n - event_id (string) — Event ID (MongoDB ObjectID).\n - event_severity (string) — Severity of this event. [Critical, Warning, Info, Ok]\n - event_status (string) — Status of this event. [Critical, Warning, Info, Ok]\n - event_time (integer) — Event timestamp, Unix epoch seconds.\n - images (array) — Images attached to the event.\n - alt (string) — Alt text.\n - href (string) — Optional link URL when the image is clicked.\n - src (string) (required) — Image source URL or internal image reference (starts with `img_` or `http`).\n - integration_id (integer) — Integration that produced this event.\n - integration_type (string) — Type/plugin key of the integration that produced this event.\n - labels (object) — Label key-value pairs.\n - title (string) — Event title.\n - title_rule (string) — Title template used to derive `title` from labels.\n - updated_at (integer) — Record update time, Unix epoch seconds.\n", "Alerts.ReadFeed": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID.\n - created_at (integer) (required) — Creation timestamp in Unix epoch milliseconds.\n - creator_id (integer) (required) — Member ID of the creator. 0 for system-generated entries.\n - detail (object) (required) — Type-specific payload. The concrete shape is determined by `type`.\n - comment (string) — Comment body.\n - severity (string) — Severity level. [Ok, Critical, Warning, Info]\n - status (string) — Severity level. [Ok, Critical, Warning, Info]\n - ref_id (string) (required) — ObjectID of the alert this entry references.\n - 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. | | `a_comm` | Comment added on the alert. | | `a_close` | Alert closed. | [a_new, a_comm, a_close]\n - updated_at (integer) (required) — Last update timestamp in Unix epoch milliseconds.\n", @@ -51,9 +51,9 @@ var responseHelpBySDKMethod = map[string]string{ "Analytics.ByTeam": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer)\n - acknowledgement_pct (number)\n - channel_id (integer)\n - channel_name (string)\n - hours (string) — Hour bucket when `split_hours` is enabled. [work, sleep, off]\n - mean_seconds_to_ack (number)\n - mean_seconds_to_close (number)\n - noise_reduction_pct (number)\n - responder_id (integer)\n - responder_name (string)\n - team_id (integer)\n - team_name (string)\n - total_alert_cnt (integer)\n - total_alert_event_cnt (integer)\n - total_engaged_seconds (integer)\n - total_incident_cnt (integer)\n - total_incidents_acknowledged (integer)\n - total_incidents_auto_closed (integer)\n - total_incidents_closed (integer)\n - total_incidents_escalated (integer)\n - total_incidents_manually_closed (integer)\n - total_incidents_manually_escalated (integer)\n - total_incidents_reassigned (integer)\n - total_incidents_timeout_closed (integer)\n - total_incidents_timeout_escalated (integer)\n - total_interruptions (integer)\n - total_notifications (integer)\n - total_seconds_to_ack (integer)\n - total_seconds_to_close (integer)\n - ts (integer) — Aggregation bucket start time, Unix seconds. Present when `aggregate_unit` is used.\n", "Analytics.IncidentList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - acknowledgements (integer)\n - assigned_to (object) — Current assignment target for the incident.\n - assigned_at (integer) — Unix timestamp (seconds) when this assignment was made.\n - escalate_rule_id (string) — Escalation rule ID (MongoDB ObjectID) driving the assignment.\n - escalate_rule_name (string) — Display name of the escalation rule.\n - id (string) — Internal assignment record ID.\n - layer_idx (integer) — Current level index within the escalation rule.\n - person_ids (array) — Member IDs assigned directly to this incident.\n - type (string) — Assignment type. [assign, reassign, escalate, reopen]\n - assignments (integer)\n - channel_id (integer)\n - channel_name (string)\n - closed_by (string) [auto, timeout, manually]\n - closer_id (integer) — Member ID of the person who closed the incident.\n - closer_name (string) — Display name of the person who closed the incident.\n - created_at (integer)\n - creator_id (integer)\n - creator_name (string)\n - description (string)\n - engaged_seconds (integer)\n - escalations (integer)\n - ever_muted (boolean) — Whether the incident has ever been muted.\n - fields (object)\n - frequency (string) — Incident frequency classification. [frequent, rare]\n - hours (string)\n - incident_id (string)\n - interruptions (integer)\n - labels (object)\n - manual_escalations (integer)\n - notifications (integer)\n - owner_id (integer) — Member ID of the incident owner.\n - owner_name (string) — Display name of the incident owner.\n - progress (string) — Incident progress state — one of `Triggered`, `Processing`, `Closed`.\n - reassignments (integer)\n - responders (array)\n - seconds_to_ack (integer)\n - seconds_to_close (integer)\n - severity (string) [Critical, Warning, Info, Ok]\n - snoozed_before (integer) — Unix timestamp in seconds until which the incident is snoozed.\n - team_id (integer)\n - team_name (string)\n - timeout_escalations (integer)\n - title (string)\n", "Analytics.TopkAlertsByLabel": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - hours (string) — Hour bucket when `split_hours` is enabled.\n - label (string) — Aggregation key value (check name or resource identifier).\n - total_alert_cnt (integer)\n - total_alert_event_cnt (integer)\n", - "Applications.ReadInfo": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) — Account ID.\n - alerting (object) — Alert settings for the application.\n - channel_ids (array) — Channel IDs to send alerts to.\n - enabled (boolean) — Whether alerting is enabled.\n - integration_id (integer) — Associated on-call integration ID (read-only, auto-assigned).\n - application_id (string) — Unique application ID.\n - application_name (string) — Application display name.\n - client_token (string) — Token used to initialize the RUM SDK.\n - created_at (integer) — Creation timestamp, Unix epoch seconds.\n - created_by (integer) — Creator member ID.\n - is_private (boolean) — If `true`, the application is only accessible to team members.\n - links (object) — External link integration settings for the application.\n - enabled (boolean) — Whether external link integration is enabled.\n - systems (any) — External systems whose URL templates can be opened from matching RUM events.\n - no_geo (boolean) — If `true`, geographic location is not inferred from IP.\n - no_ip (boolean) — If `true`, IP addresses are not collected.\n - status (string) — Application status. [enabled, disabled, deleted]\n - team_id (integer) — Owning team ID.\n - tracing (object) — APM tracing integration settings.\n - enabled (boolean) — Whether tracing integration is enabled.\n - endpoint (string) — Trace endpoint URL (http or https).\n - open_type (string) — How to open the trace link. [popup, tab]\n - type (string) — Application type. [browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity]\n - updated_at (integer) — Last update timestamp, Unix epoch seconds.\n - updated_by (integer) — Last updater member ID.\n", - "Applications.ReadInfos": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) — Account ID.\n - alerting (object) — Alert settings for the application.\n - channel_ids (array) — Channel IDs to send alerts to.\n - enabled (boolean) — Whether alerting is enabled.\n - integration_id (integer) — Associated on-call integration ID (read-only, auto-assigned).\n - application_id (string) — Unique application ID.\n - application_name (string) — Application display name.\n - client_token (string) — Token used to initialize the RUM SDK.\n - created_at (integer) — Creation timestamp, Unix epoch seconds.\n - created_by (integer) — Creator member ID.\n - is_private (boolean) — If `true`, the application is only accessible to team members.\n - links (object) — External link integration settings for the application.\n - enabled (boolean) — Whether external link integration is enabled.\n - systems (any) — External systems whose URL templates can be opened from matching RUM events.\n - no_geo (boolean) — If `true`, geographic location is not inferred from IP.\n - no_ip (boolean) — If `true`, IP addresses are not collected.\n - status (string) — Application status. [enabled, disabled, deleted]\n - team_id (integer) — Owning team ID.\n - tracing (object) — APM tracing integration settings.\n - enabled (boolean) — Whether tracing integration is enabled.\n - endpoint (string) — Trace endpoint URL (http or https).\n - open_type (string) — How to open the trace link. [popup, tab]\n - type (string) — Application type. [browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity]\n - updated_at (integer) — Last update timestamp, Unix epoch seconds.\n - updated_by (integer) — Last updater member ID.\n", - "Applications.ReadList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) — Account ID.\n - alerting (object) — Alert settings for the application.\n - channel_ids (array) — Channel IDs to send alerts to.\n - enabled (boolean) — Whether alerting is enabled.\n - integration_id (integer) — Associated on-call integration ID (read-only, auto-assigned).\n - application_id (string) — Unique application ID.\n - application_name (string) — Application display name.\n - client_token (string) — Token used to initialize the RUM SDK.\n - created_at (integer) — Creation timestamp, Unix epoch seconds.\n - created_by (integer) — Creator member ID.\n - is_private (boolean) — If `true`, the application is only accessible to team members.\n - links (object) — External link integration settings for the application.\n - enabled (boolean) — Whether external link integration is enabled.\n - systems (any) — External systems whose URL templates can be opened from matching RUM events.\n - no_geo (boolean) — If `true`, geographic location is not inferred from IP.\n - no_ip (boolean) — If `true`, IP addresses are not collected.\n - status (string) — Application status. [enabled, disabled, deleted]\n - team_id (integer) — Owning team ID.\n - tracing (object) — APM tracing integration settings.\n - enabled (boolean) — Whether tracing integration is enabled.\n - endpoint (string) — Trace endpoint URL (http or https).\n - open_type (string) — How to open the trace link. [popup, tab]\n - type (string) — Application type. [browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity]\n - updated_at (integer) — Last update timestamp, Unix epoch seconds.\n - updated_by (integer) — Last updater member ID.\n", + "Applications.ReadInfo": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) — Account ID.\n - alerting (object) — Alert settings for the application.\n - channel_ids (array) — Channel IDs to send alerts to.\n - enabled (boolean) — Whether alerting is enabled.\n - integration_id (integer) — Associated on-call integration ID (read-only, auto-assigned).\n - application_id (string) — Unique application ID.\n - application_name (string) — Application display name.\n - client_token (string) — Token used to initialize the RUM SDK.\n - created_at (integer) — Creation timestamp, Unix epoch milliseconds.\n - created_by (integer) — Creator member ID.\n - is_private (boolean) — If `true`, the application is only accessible to team members.\n - links (object) — External link integration settings for the application.\n - enabled (boolean) — Whether external link integration is enabled.\n - systems (any) — External systems whose URL templates can be opened from matching RUM events.\n - no_geo (boolean) — If `true`, geographic location is not inferred from IP.\n - no_ip (boolean) — If `true`, IP addresses are not collected.\n - status (string) — Application status. [enabled, disabled, deleted]\n - team_id (integer) — Owning team ID.\n - tracing (object) — APM tracing integration settings.\n - enabled (boolean) — Whether tracing integration is enabled.\n - endpoint (string) — Trace endpoint URL (http or https).\n - open_type (string) — How to open the trace link. [popup, tab]\n - type (string) — Application type. [browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity]\n - updated_at (integer) — Last update timestamp, Unix epoch milliseconds.\n - updated_by (integer) — Last updater member ID.\n", + "Applications.ReadInfos": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) — Account ID.\n - alerting (object) — Alert settings for the application.\n - channel_ids (array) — Channel IDs to send alerts to.\n - enabled (boolean) — Whether alerting is enabled.\n - integration_id (integer) — Associated on-call integration ID (read-only, auto-assigned).\n - application_id (string) — Unique application ID.\n - application_name (string) — Application display name.\n - client_token (string) — Token used to initialize the RUM SDK.\n - created_at (integer) — Creation timestamp, Unix epoch milliseconds.\n - created_by (integer) — Creator member ID.\n - is_private (boolean) — If `true`, the application is only accessible to team members.\n - links (object) — External link integration settings for the application.\n - enabled (boolean) — Whether external link integration is enabled.\n - systems (any) — External systems whose URL templates can be opened from matching RUM events.\n - no_geo (boolean) — If `true`, geographic location is not inferred from IP.\n - no_ip (boolean) — If `true`, IP addresses are not collected.\n - status (string) — Application status. [enabled, disabled, deleted]\n - team_id (integer) — Owning team ID.\n - tracing (object) — APM tracing integration settings.\n - enabled (boolean) — Whether tracing integration is enabled.\n - endpoint (string) — Trace endpoint URL (http or https).\n - open_type (string) — How to open the trace link. [popup, tab]\n - type (string) — Application type. [browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity]\n - updated_at (integer) — Last update timestamp, Unix epoch milliseconds.\n - updated_by (integer) — Last updater member ID.\n", + "Applications.ReadList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) — Account ID.\n - alerting (object) — Alert settings for the application.\n - channel_ids (array) — Channel IDs to send alerts to.\n - enabled (boolean) — Whether alerting is enabled.\n - integration_id (integer) — Associated on-call integration ID (read-only, auto-assigned).\n - application_id (string) — Unique application ID.\n - application_name (string) — Application display name.\n - client_token (string) — Token used to initialize the RUM SDK.\n - created_at (integer) — Creation timestamp, Unix epoch milliseconds.\n - created_by (integer) — Creator member ID.\n - is_private (boolean) — If `true`, the application is only accessible to team members.\n - links (object) — External link integration settings for the application.\n - enabled (boolean) — Whether external link integration is enabled.\n - systems (any) — External systems whose URL templates can be opened from matching RUM events.\n - no_geo (boolean) — If `true`, geographic location is not inferred from IP.\n - no_ip (boolean) — If `true`, IP addresses are not collected.\n - status (string) — Application status. [enabled, disabled, deleted]\n - team_id (integer) — Owning team ID.\n - tracing (object) — APM tracing integration settings.\n - enabled (boolean) — Whether tracing integration is enabled.\n - endpoint (string) — Trace endpoint URL (http or https).\n - open_type (string) — How to open the trace link. [popup, tab]\n - type (string) — Application type. [browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity]\n - updated_at (integer) — Last update timestamp, Unix epoch milliseconds.\n - updated_by (integer) — Last updater member ID.\n", "Applications.WebhookTest": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - message (string) (required) — `ok` on success, otherwise the delivery error message.\n - ok (boolean) (required) — Whether the webhook endpoint accepted the sample event.\n - status_code (integer) (required) — HTTP status code returned by the webhook endpoint. 0 when the request did not receive a response.\n", "Applications.WriteCreate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - application_id (string) — Auto-generated unique application ID.\n - application_name (string) — Application display name.\n - client_token (string) — Token for RUM SDK initialization.\n", "AuditLogs.OperationList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - name (string) (required) — Stable machine-readable operation name for use as a filter.\n - name_cn (string) (required) — Human-readable Chinese label shown in the console.\n", @@ -96,8 +96,10 @@ var responseHelpBySDKMethod = map[string]string{ "Diagnostics.TargetsList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - agent_version (string) — Most recently observed Agent version.\n - cluster_name (string) — Edge cluster name.\n - edge_ipport (string) — Edge instance address (`ip:port`), surfaced for diagnostics.\n - target_kind (string) — Target kind, e.g. `host`, `mysql`. Filtering by kind is not supported in v1.\n - target_locator (string) — Target identifier; the list is sorted by this field ascending.\n - updated_at (integer) — Last route-projection upsert time, Unix seconds. Treat as 'most recently observed', not a live-online indicator.\n", "Diagnostics.ToolsCatalog": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - error (object) — Request-level business error. Omitted on success. Returned with HTTP 200 — do not rely on the status code alone.\n - code (string) [target_unavailable, timeout, forward_failed, invalid_tool_result, ambiguous_target_kind]\n - message (string)\n - target_kinds (array) — Returned for `ambiguous_target_kind`; lists the candidate kinds.\n - target (object) — Resolved target. Omitted when `target_kind` was not supplied and the locator could not be uniquely inferred.\n - kind (string)\n - locator (string)\n - tools (array) — Tool metadata advertised by the target's agent. Always present; an empty array when `error` is set.\n - description (string) — Tool capability description for UI / AI-SRE consumption.\n - input_schema (object) — JSON Schema for `tools[].params`.\n - name (string) — Tool name; pass into `/monit/tools/invoke` as `tools[].tool`.\n - target_kind (string) — Target kind this tool applies to.\n", "Diagnostics.ToolsInvoke": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - error (object) — Request-level business error. Omitted on success. Returned with HTTP 200 — do not rely on the status code alone.\n - code (string) [target_unavailable, forward_failed, ambiguous_target_kind]\n - message (string)\n - target_kinds (array)\n - results (array) — Per-tool results, aligned with the request `tools[]` order. Empty when a request-level `error` is present.\n - data (object) — Tool business payload. Present only on success. Webapi already unwraps the monit-agent result envelope, so there is no nested `data.data`.\n - error (object) — Per-tool failure. Present only on failure, and mutually exclusive with `data` / `summary` / `truncated`.\n - code (string) — Common WebAPI codes: `timeout`, `target_unavailable`, `invalid_tool_result`, `internal`, `invalid_args`, `unsupported_syntax`, `path_not_found`, and `catalog_changed`. Agent-specific tool errors may also be returned unchanged.\n - message (string)\n - params (object) — Request params echoed back by webapi. Normalized to `{}` when the request omitted them or sent null.\n - summary (string) — Human/LLM-readable one-line distillation of the result. Present only when non-empty.\n - tool (string) — Tool name, aligned one-to-one with the request `tools[]` order.\n - tool_version (string) — Agent-executed tool version. Omitted when the failure occurred before the agent picked a version.\n - truncated (object) — Present only when the result was actually truncated — the field's presence is the signal, so there is no redundant `truncated: true`.\n - reason (string) — Why the result was truncated.\n - target (object) — Resolved target. Omitted when `target_kind` was not supplied and the locator could not be uniquely inferred.\n - kind (string)\n - locator (string)\n", + "ErrorIngestionRules.Create": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - rule_id (string) (required) — ID assigned to the new rule.\n - rule_name (string) (required) — Echo of the created rule's name.\n", + "ErrorIngestionRules.HistoryList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - rules (array) (required) — The application's complete rule list as of this version.\n - account_id (integer) (required) — Account ID.\n - application_id (string) (required) — RUM application ID the rule belongs to.\n - created_at (integer) (required) — Unix timestamp in milliseconds when the row was created.\n - created_by (integer) (required) — Member ID who created the rule.\n - deleted_at (integer) (required) — Unix timestamp in milliseconds when the row was soft-deleted; `0` when not deleted.\n - description (string) (required) — Rule description.\n - filters (array) (required) — The rule's filter conditions as of this snapshot version.\n - id (integer) (required) — Internal row ID.\n - rule_id (string) (required) — Rule ID.\n - rule_name (string) (required) — Rule name.\n - status (string) (required) — The rule's status as of this snapshot version. [enabled, disabled]\n - updated_at (integer) (required) — Unix timestamp in milliseconds when the row was last updated.\n - updated_by (integer) (required) — Member ID who last updated the rule.\n - updated_at (integer) (required) — Unix timestamp in milliseconds when this snapshot was recorded.\n - updated_by (integer) (required) — Member ID whose action triggered this snapshot.\n - updated_by_name (string) (required) — Display name of the member whose action triggered this snapshot.\n - version (integer) (required) — History version number, incrementing from 1.\n", + "ErrorIngestionRules.List": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - created_at (integer) (required) — Unix timestamp in milliseconds when the rule was created.\n - description (string) (required) — Rule description, up to 512 characters.\n - filters (array) (required) — The rule's filter conditions.\n - rule_id (string) (required) — Rule ID.\n - rule_name (string) (required) — Rule name, 1-128 characters. Not required to be unique within the application.\n - status (string) (required) — Current status of the rule. [enabled, disabled]\n - updated_at (integer) (required) — Unix timestamp in milliseconds when the rule was last updated.\n", "Facets.FacetCount": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - count (integer) (required) — Number of events with this facet value in the time range.\n - facet_value (any) (required) — The facet value. Type matches the field's `value_type`.\n", - "Facets.FacetList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID. 0 for built-in fields.\n - description (string) (required) — Description of what this field captures.\n - edit_able (boolean) (required) — True if this is a custom field that can be edited by the user.\n - enum_values (array) (required) — Predefined enumerable values for this field. Element type matches the field's `value_type`: string for `string`, number for `number`, boolean for `boolean`. Empty when the field has no fixed set of values.\n - field_key (string) (required) — Unique field key, e.g. `error.type`.\n - field_name (string) (required) — Human-readable field name.\n - group (string) (required) — Display group for this field.\n - is_facet (boolean) (required) — True if value distribution counting is supported for this field.\n - queryable (boolean) (required) — True if this field can be used in DQL/SQL queries.\n - scopes (array) (required) — RUM scopes this field appears in.\n - show_type (string) (required) — Display type in the analytics UI. [list, range]\n - status (string) (required) — Field status, e.g. `active`.\n - unit_family (string) (required) — Measurement unit family, e.g. `time`, `bytes`. Empty for dimensionless fields.\n - unit_name (string) (required) — Specific measurement unit, e.g. `millisecond`, `byte`.\n - value_type (string) (required) — Data type of the field value. [string, number, boolean, array, array, array]\n", "Facets.FieldList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID. 0 for built-in fields.\n - description (string) (required) — Description of what this field captures.\n - edit_able (boolean) (required) — True if this is a custom field that can be edited by the user.\n - enum_values (array) (required) — Predefined enumerable values for this field. Element type matches the field's `value_type`: string for `string`, number for `number`, boolean for `boolean`. Empty when the field has no fixed set of values.\n - field_key (string) (required) — Unique field key, e.g. `error.type`.\n - field_name (string) (required) — Human-readable field name.\n - group (string) (required) — Display group for this field.\n - is_facet (boolean) (required) — True if value distribution counting is supported for this field.\n - queryable (boolean) (required) — True if this field can be used in DQL/SQL queries.\n - scopes (array) (required) — RUM scopes this field appears in.\n - show_type (string) (required) — Display type in the analytics UI. [list, range]\n - status (string) (required) — Field status, e.g. `active`.\n - unit_family (string) (required) — Measurement unit family, e.g. `time`, `bytes`. Empty for dimensionless fields.\n - unit_name (string) (required) — Specific measurement unit, e.g. `millisecond`, `byte`.\n - value_type (string) (required) — Data type of the field value. [string, number, boolean, array, array, array]\n", "ImIntegrations.List": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) — Account this integration belongs to.\n - category (string) — Category of the integration plugin.\n - created_at (integer) — Unix timestamp in seconds when the integration was created.\n - creator_id (integer) — Person who created the integration.\n - data_source_id (integer) — Integration ID.\n - description (string) — Integration description.\n - exclusive_data_source_id (integer) — Exclusive integration ID associated with this integration.\n - integration_id (integer) — Integration ID, alias of data_source_id.\n - integration_key (string) — Push key used by alert sources to send to this integration.\n - last_time (integer) — Unix timestamp in seconds of the most recent activity on the integration.\n - name (string) — Integration name.\n - no_editable (boolean) — Whether the integration is read-only.\n - plugin_id (integer) — Plugin ID backing this integration.\n - plugin_type (string) — Type identifier of the integration plugin.\n - plugin_type_name (string) — Localized display name of the integration plugin type.\n - ref_id (string) — External reference ID of the integration.\n - settings (object) — Plugin-specific configuration of the integration.\n - status (string) — Current status of the integration.\n - team_id (integer) — Team that owns this integration.\n - updated_at (integer) — Unix timestamp in seconds when the integration was last updated.\n - updated_by (integer) — Person who last updated the integration.\n", "Incidents.AlertList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID.\n - alert_id (string) (required) — Alert ID (MongoDB ObjectID).\n - alert_key (string) (required) — Deduplication key used to merge events into the alert.\n - alert_severity (string) (required) — Current severity. [Critical, Warning, Info, Ok]\n - alert_status (string) (required) — Current status. [Critical, Warning, Info, Ok]\n - channel_id (integer) (required) — Channel ID.\n - channel_name (string) (required) — Channel display name.\n - channel_status (string) (required) — Channel status.\n - created_at (integer) (required) — Creation timestamp (seconds).\n - data_source_id (integer) (required) — Deprecated. Use `integration_id` instead.\n - data_source_name (string) (required) — Deprecated. Use `integration_name`.\n - data_source_ref_id (string) (required) — Deprecated. Use `integration_ref_id`.\n - data_source_type (string) — Deprecated. Use `integration_type`.\n - deleted_at (integer) — Soft-delete timestamp (seconds). Zero if not deleted.\n - description (string) (required) — Alert description.\n - end_time (integer) (required) — Unix timestamp (seconds) when the alert recovered. 0 if still active.\n - event_cnt (integer) (required) — Total number of raw events merged into this alert.\n - events (array) — Raw alert event preview, populated only when requested. Capped at the 20 newest events per alert.\n - account_id (integer) — Account ID.\n - alert_id (string) — Parent alert ID (MongoDB ObjectID).\n - alert_key (string) — Deduplication key used to merge events into an alert.\n - channel_id (integer) — Channel ID the event is routed to.\n - created_at (integer) — Record creation time, Unix epoch seconds.\n - data_source_id (integer) — Deprecated. Use `integration_id` instead.\n - deleted_at (integer) — Soft-delete timestamp (seconds). Zero if not deleted.\n - description (string) — Event description.\n - event_id (string) — Event ID (MongoDB ObjectID).\n - event_severity (string) — Severity of this event. [Critical, Warning, Info, Ok]\n - event_status (string) — Status of this event. [Critical, Warning, Info, Ok]\n - event_time (integer) — Event timestamp, Unix epoch seconds.\n - images (array) — Images attached to the event.\n - alt (string) — Alt text.\n - href (string) — Optional link URL when the image is clicked.\n - src (string) (required) — Image source URL or internal image reference (starts with `img_` or `http`).\n - integration_id (integer) — Integration that produced this event.\n - integration_type (string) — Type/plugin key of the integration that produced this event.\n - labels (object) — Label key-value pairs.\n - title (string) — Event title.\n - title_rule (string) — Title template used to derive `title` from labels.\n - updated_at (integer) — Record update time, Unix epoch seconds.\n - ever_muted (boolean) (required) — Whether this alert has ever been silenced.\n - images (array) (required) — Attached images.\n - alt (string) — Alt text.\n - href (string) — Optional link the image points to.\n - src (string) (required) — Image source. Either an `img_` upload token or an `http(s)` URL.\n - incident (object) — Parent incident reference, if the alert has been merged into one.\n - incident_id (string) — Incident ID (ObjectID hex string).\n - progress (string) — Incident progress — one of `Triggered`, `Processing`, `Closed`.\n - title (string) — Incident title.\n - integration_id (integer) (required) — Integration ID that produced the alert.\n - integration_name (string) (required) — Integration display name.\n - integration_ref_id (string) (required) — Integration reference ID.\n - integration_type (string) (required) — Integration type string.\n - labels (object) (required) — Alert labels.\n - last_time (integer) (required) — Unix timestamp (seconds) of the most recent event.\n - responder_email (string) (required) — Primary responder email, if any.\n - responder_name (string) (required) — Primary responder name, if any.\n - start_time (integer) (required) — Unix timestamp (seconds) when the alert first fired.\n - title (string) (required) — Alert title.\n - title_rule (string) (required) — Title rendering rule.\n - updated_at (integer) (required) — Last update timestamp (seconds).\n", @@ -132,6 +134,9 @@ var responseHelpBySDKMethod = map[string]string{ "Integrations.DatasourceImPersonTryLink": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - new_linked_person_ids (array) (required) — Person IDs newly linked during this call.\n", "Integrations.Detail": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - attempt (integer) (required) — Attempt sequence number.\n - channel_id (integer) — Channel ID when applicable.\n - channel_name (string) — Name of the associated channel, resolved at query time.\n - duration (integer) (required) — Total elapsed time of the attempt in milliseconds.\n - endpoint (string) (required) — Destination URL.\n - error_message (string) — Error message when delivery failed.\n - event_id (string) (required) — Event ID.\n - event_time (string) (required) — Event time as a formatted timestamp string.\n - event_type (string) (required) — Event type.\n - integration_id (integer) (required) — Integration ID.\n - ref_id (string) — Source object ID.\n - ref_title (string) — Title of the source incident or alert, resolved at query time.\n - request_body (string) — Outbound request body payload.\n - request_headers (string) — Serialized outbound request headers.\n - response_body (string) — Response body.\n - response_headers (string) — Serialized response headers.\n - status (string) (required) — Delivery outcome. [success, failed]\n - status_code (integer) (required) — HTTP status code.\n - webhook_type (string) (required) — Source object kind. `incident` or `alert`.\n", "Integrations.List": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - attempt (integer) (required) — Attempt sequence number.\n - channel_id (integer) — Channel ID associated with the event, when applicable.\n - duration (integer) (required) — Total elapsed time of the attempt in milliseconds.\n - endpoint (string) (required) — Destination URL.\n - error_message (string) — Error message when delivery failed.\n - event_id (string) (required) — Unique event identifier for the delivery attempt.\n - event_time (string) (required) — Event time as a formatted timestamp string.\n - event_type (string) (required) — Event type (e.g. `created`, `acknowledged`, `closed`).\n - integration_id (integer) (required) — Integration ID that triggered the webhook.\n - ref_id (string) — Source object ID (incident ID or alert ID).\n - request_body (string) — Outbound request body payload.\n - request_headers (string) — Serialized outbound request headers.\n - response_body (string) — Response body returned by the destination.\n - response_headers (string) — Serialized response headers from the destination.\n - status (string) (required) — Delivery outcome. [success, failed]\n - status_code (integer) (required) — HTTP status code returned by the destination.\n - webhook_type (string) (required) — Source object kind. `incident` or `alert`.\n", + "IssuePresetSeverityRules.Create": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - priority (integer) (required) — Evaluation order assigned to the new rule (always the current lowest precedence, i.e. current max + 1).\n - rule_id (string) (required) — ID of the newly created rule.\n - rule_name (string) (required) — Echo of the rule's display name.\n", + "IssuePresetSeverityRules.HistoryList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - rules (array) (required) — Full rule set captured immediately before the mutation that produced this snapshot. Empty for the very first snapshot.\n - account_id (integer) (required) — Account ID the rule belongs to.\n - application_id (string) (required) — RUM application ID the rule belongs to.\n - created_at (integer) (required) — Unix timestamp in milliseconds when the rule was created.\n - created_by (integer) (required) — Member ID who originally created the rule.\n - deleted_at (integer) (required) — Unix timestamp in milliseconds the rule was soft-deleted; `0` means not deleted. Always `0` in practice, since deleted rules are excluded before a snapshot is taken.\n - description (string) (required) — Rule description. May be empty.\n - filters (array) (required) — OR-of-ANDs filter structure: the outer array is OR'd, each inner array is AND'd. A rule matches an error when at least one inner AND-group fully matches.\n - id (integer) (required) — Internal auto-increment row ID. Not stable across a history revert — reverting reinserts rows with new IDs.\n - priority (integer) (required) — Evaluation order at snapshot time; `1` is highest precedence.\n - rule_id (string) (required) — Unique rule ID.\n - rule_name (string) (required) — Rule display name.\n - severity (string) (required) — Severity assigned to errors matching this rule. [Critical, Warning, Info]\n - status (string) (required) — Rule status at snapshot time. [enabled, disabled]\n - updated_at (integer) (required) — Unix timestamp in milliseconds when the rule was last updated.\n - updated_by (integer) (required) — Member ID who last updated the rule as of snapshot time.\n - updated_at (integer) (required) — Unix timestamp in milliseconds when the snapshot was written.\n - updated_by (integer) (required) — Member ID who triggered the mutation this snapshot precedes.\n - updated_by_name (string) (required) — Display name of `updated_by` at the time of the change.\n - version (integer) (required) — Monotonically increasing snapshot version number, starting at 1.\n", + "IssuePresetSeverityRules.List": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - created_at (integer) (required) — Unix timestamp in milliseconds when the rule was created.\n - description (string) (required) — Rule description. May be empty.\n - filters (array) (required) — OR-of-ANDs filter structure: the outer array is OR'd, each inner array is AND'd. A rule matches an error when at least one inner AND-group fully matches.\n - priority (integer) (required) — Evaluation order among the application's rules. `1` is evaluated first (highest precedence); the first enabled rule whose filters match wins.\n - rule_id (string) (required) — Unique rule ID.\n - rule_name (string) (required) — Rule display name.\n - severity (string) (required) — Severity assigned to errors matching this rule. [Critical, Warning, Info]\n - status (string) (required) — Only enabled rules are evaluated against incoming errors. [enabled, disabled]\n - updated_at (integer) (required) — Unix timestamp in milliseconds when the rule was last updated.\n", "Issues.ReadInfo": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - age (integer)\n - application_id (string)\n - application_name (string)\n - created_at (integer)\n - error (object)\n - message (string)\n - type (string)\n - error_count (integer) — Total error occurrences.\n - first_seen (object)\n - timestamp (integer)\n - version (string)\n - is_crash (boolean) — Whether the error caused an app crash.\n - issue_id (string) — Unique issue ID.\n - last_seen (object)\n - timestamp (integer)\n - version (string)\n - regression (object) — Regression metadata. Present only when a previously resolved issue re-occurred.\n - regressed_at (integer) — Timestamp when the regression was detected.\n - regressed_at_version (string) — Application version in which the regression was observed.\n - resolved_at (integer) — Timestamp of the previous resolution before the regression.\n - resolved_at (integer)\n - resolved_by (integer)\n - service (string)\n - session_count (integer) — Affected user sessions.\n - severity (string) — Issue severity level.\n - status (string) [for_review, reviewed, ignored, resolved]\n - suspected_cause (object)\n - person_id (integer)\n - reason (string)\n - source (string) [auto, user]\n - value (string) [api.failed_request, network.error, code.exception, code.invalid_object_access, code.invalid_argument, unknown]\n - team_id (integer)\n - updated_at (integer)\n - versions (array)\n", "Issues.ReadList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - age (integer)\n - application_id (string)\n - application_name (string)\n - created_at (integer)\n - error (object)\n - message (string)\n - type (string)\n - error_count (integer) — Total error occurrences.\n - first_seen (object)\n - timestamp (integer)\n - version (string)\n - is_crash (boolean) — Whether the error caused an app crash.\n - issue_id (string) — Unique issue ID.\n - last_seen (object)\n - timestamp (integer)\n - version (string)\n - regression (object) — Regression metadata. Present only when a previously resolved issue re-occurred.\n - regressed_at (integer) — Timestamp when the regression was detected.\n - regressed_at_version (string) — Application version in which the regression was observed.\n - resolved_at (integer) — Timestamp of the previous resolution before the regression.\n - resolved_at (integer)\n - resolved_by (integer)\n - service (string)\n - session_count (integer) — Affected user sessions.\n - severity (string) — Issue severity level.\n - status (string) [for_review, reviewed, ignored, resolved]\n - suspected_cause (object)\n - person_id (integer)\n - reason (string)\n - source (string) [auto, user]\n - value (string) [api.failed_request, network.error, code.exception, code.invalid_object_access, code.invalid_argument, unknown]\n - team_id (integer)\n - updated_at (integer)\n - versions (array)\n", "Licenses.List": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - created_at (integer) (required) — Unix timestamp when a fixed license was assigned. `0` for temporary licenses.\n - person_id (integer) (required) — ID of the licensed person.\n - person_name (string) (required) — Display name of the licensed person.\n - type (string) (required) — License assignment type. `fixed` is explicitly assigned; `temporary` is held from the active license window. [fixed, temporary]\n - updated_at (integer) (required) — Unix timestamp when a fixed license was last changed. `0` for temporary licenses.\n - updated_by (integer) (required) — Person ID that last changed a fixed license. `0` for temporary licenses.\n", @@ -147,6 +152,7 @@ var responseHelpBySDKMethod = map[string]string{ "NotificationTemplates.ReadList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — ID of the owning account.\n - created_at (integer) (required) — Unix epoch seconds the template was created.\n - creator_id (integer) (required) — Member ID of the creator.\n - deleted_at (integer) — Unix epoch seconds the template was soft-deleted. Absent (omitempty) when the template is live.\n - description (string) (required) — Free-form description.\n - dingtalk (string) (required) — DingTalk robot message template source.\n - dingtalk_app (string) (required) — DingTalk app message template source.\n - email (string) (required) — Email body template source (Go `html/template` syntax).\n - feishu (string) (required) — Feishu robot message template source.\n - feishu_app (string) (required) — Feishu app message template source.\n - feishu_app_card_table_enabled (boolean) (required) — Whether alert labels use table rendering in Feishu app cards.\n - incident_card_hidden_fields (object) — Incident-card fields to hide, keyed by IM app type. Only supported IM app types and field names are accepted.\n - slack (string) (required) — Slack robot message template source.\n - slack_app (string) (required) — Slack app message template source.\n - sms (string) (required) — SMS template source (Go `text/template` syntax).\n - status (string) (required) — Template lifecycle status. [enabled, disabled, deleted]\n - team_id (integer) (required) — ID of the team this template is scoped to, or 0 for account-wide.\n - teams_app (string) (required) — Microsoft Teams app message template source.\n - telegram (string) (required) — Telegram bot message template source.\n - template_id (string) (required) — Template ID.\n - template_name (string) (required) — Unique template name within the account.\n - updated_at (integer) (required) — Unix epoch seconds the template was last updated.\n - updated_by (integer) (required) — Member ID of the last editor.\n - voice (string) (required) — Voice call script template source.\n - wecom (string) (required) — WeCom robot message template source.\n - wecom_app (string) (required) — WeCom app message template source.\n - zoom (string) (required) — Zoom bot message template source.\n", "NotificationTemplates.ReadPreview": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - content (string) — Rendered template output, present when success is true.\n - fixed_fields (array) — Fixed incident-card fields returned for supported IM previews after the requested hiding rules are applied.\n - field (string) (required) — Incident-card field name. [channel, snoozed_before, severity, responders, aggregate_alert_count]\n - value (string) (required) — Rendered display value for the fixed field.\n - message (string) — Error message describing why rendering failed, present when success is false.\n - success (boolean) — Whether the template rendered without errors.\n", "NotificationTemplates.WriteCreate": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - template_id (string) (required) — Newly created template ID.\n - template_name (string) (required) — Template name echoed from the request.\n", + "Resources.Info": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required) — Account ID that owns this resource.\n - action.days (integer) (required) — Retention period in days for action (user interaction) data.\n - created_at (integer) (required) — Unix timestamp in seconds when the resource was created. Also anchors the start of the first billing window.\n - error.days (integer) (required) — Retention period in days for error data.\n - expired_at (integer) — Unix timestamp in seconds when the on-premises license expires. Only present on on-premises deployments; omitted entirely for SaaS accounts.\n - long_task.days (integer) (required) — Retention period in days for long-task data.\n - offering_id (integer) (required) — ID of the offering (SKU) this resource was provisioned from.\n - order_id (string) (required) — ID of the order that provisioned this resource. Empty for resources provisioned outside the order flow (e.g. on-premises).\n - product (string) (required) — Product code for this resource. Always `rum` for this endpoint. [rum]\n - resource.days (integer) (required) — Retention period in days for resource (network request) data.\n - resource_id (string) (required) — Unique resource identifier for the account's RUM resource.\n - resource_name (string) (required) — Display name of the resource.\n - session.days (integer) (required) — Retention period in days for session data.\n - session_investigate.free_cnt (integer) (required) — Free quota for investigate sessions per application, per billing window.\n - session_investigate.used_cnt (integer) (required) — Number of investigate (error tracking) sessions used in the current billing window.\n - session_limit_reached (boolean) (required) — `true` when a `version=free` account has exceeded its combined free session quota across all applications. Always `false` for non-free plans.\n - session_measure.free_cnt (integer) (required) — Free quota for measure sessions per application, per billing window.\n - session_measure.used_cnt (integer) (required) — Number of measure (performance) sessions used in the current billing window.\n - session_replay.free_cnt (integer) (required) — Free quota for session-replay sessions per application, per billing window.\n - session_replay.used_cnt (integer) (required) — Number of session-replay sessions used in the current billing window.\n - status (string) (required) — Status of the resource. A resource with status `deleted` or `destroyed` never reaches this field — the operation returns `ResourceNotFound` for those instead. [enabled, disabled]\n - updated_at (integer) (required) — Unix timestamp in seconds when the resource was last updated.\n - version (string) (required) — Plan version of this resource. [free, professional]\n - view.days (integer) (required) — Retention period in days for view (page/screen) data.\n - window_end_time (integer) (required) — Unix timestamp in seconds for the end of the current 30-day billing window.\n - window_start_time (integer) (required) — Unix timestamp in seconds for the start of the current 30-day billing window.\n", "RolesPermissions.ReadInfo": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - created_at (integer) (required) — Unix epoch seconds the role was created.\n - description (string) (required) — Role description.\n - editable (boolean) (required) — False for built-in roles which cannot be modified.\n - permission_ids (array) (required) — IDs of permissions granted by this role.\n - role_id (integer) (required) — Unique role ID.\n - role_name (string) (required) — Role display name.\n - status (string) (required) — Role status. [enabled, disabled]\n - updated_at (integer) (required) — Unix epoch seconds the role was last updated.\n", "RolesPermissions.ReadList": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - created_at (integer) (required) — Unix epoch seconds the role was created.\n - description (string) (required) — Role description.\n - editable (boolean) (required) — False for built-in roles which cannot be modified.\n - permission_ids (array) (required) — IDs of permissions granted by this role.\n - role_id (integer) (required) — Unique role ID.\n - role_name (string) (required) — Role display name.\n - status (string) (required) — Role status. [enabled, disabled]\n - updated_at (integer) (required) — Unix epoch seconds the role was last updated.\n", "RolesPermissions.ReadListPermission": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - class (string) (required) — Permission class (e.g., 'On-call', 'Organization').\n - description (string) (required) — Human-readable permission description.\n - id (integer) (required) — Unique permission ID.\n - is_granted (boolean) — Present when with_all is true. Indicates whether this permission is granted to the requested roles.\n - permission_name (string) (required) — Permission display name.\n - permission_type (string) (required) — Whether this is a read or manage permission. [read, manage]\n - scope (string) (required) — Permission scope (e.g., 'on-call', 'organization').\n - status (string) (required) — Permission status. [enabled, disabled]\n", @@ -162,6 +168,11 @@ var responseHelpBySDKMethod = map[string]string{ "Schedules.List": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID.\n - create_at (integer) (required) — Creation timestamp (Unix seconds).\n - create_by (integer) (required) — Creator person ID.\n - cur_oncall (object) (required) — Current on-call group, or null when nobody is on-call.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - update_at (integer) (required) — Update timestamp (Unix seconds).\n - weight (integer) (required) — Layer weight the shift comes from.\n - description (any) (required) — Schedule description. null when returned from /schedule/preview.\n - disabled (any) (required) — Disabled flag (0 = enabled, 1 = disabled). Deprecated. null when returned from /schedule/preview.\n - end (integer) — Window end (Unix seconds).\n - field (string) — Field name used by the legacy update-field endpoint.\n - final_schedule (object) (required) — Collapsed final schedule across all layers.\n - layer_name (string) (required) — Layer display name.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - schedules (array) (required) — Computed shifts.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - group_id (any) (required) — Legacy team/group ID. null when returned from /schedule/preview.\n - id (any) (required) — Schedule ID. null when returned from /schedule/preview.\n - layer_schedules (array) (required) — Alias of schedule_layers returned for compatibility.\n - layer_name (string) (required) — Layer display name.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - schedules (array) (required) — Computed shifts.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - layers (array) (required) — Rotation layers defined on the schedule.\n - account_id (integer) (required) — Account ID.\n - create_at (integer) (required) — Creation timestamp (Unix seconds).\n - create_by (integer) (required) — Creator person ID.\n - day_mask (object) (required) — Day-of-week mask.\n - repeat (array) — Weekday numbers (0 = Sunday) included in the rotation.\n - enable_time (integer) (required) — When the layer becomes effective (Unix seconds).\n - expire_time (integer) (required) — When the layer expires (Unix seconds, 0 means never).\n - fair_rotation (boolean) (required) — Whether fair rotation is enabled.\n - groups (array) (required) — Oncall groups participating in the rotation.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - handoff_time (integer) (required) — Handoff time inside the rotation cycle (seconds).\n - hidden (integer) (required) — Whether the layer is hidden in the UI (0 = no, 1 = yes).\n - layer_end (any) — Layer end timestamp (Unix seconds). null means open-ended.\n - layer_name (string) — User-facing layer name.\n - layer_start (integer) — Layer start timestamp (Unix seconds).\n - mask_continuous_enabled (boolean) (required) — Whether continuous masking is enabled.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - restrict_end (integer) (required) — Legacy end offset inside the restriction window (seconds).\n - restrict_mode (integer) (required) — Restriction mode: 0 = none, 1 = day, 2 = week.\n - restrict_periods (array) (required) — Restriction windows inside each rotation cycle.\n - restrict_end (integer) (required) — End offset inside the rotation cycle.\n - restrict_start (integer) (required) — Start offset inside the rotation cycle.\n - restrict_start (integer) (required) — Legacy start offset inside the restriction window (seconds).\n - rotation_duration (integer) (required) — Rotation duration in seconds.\n - rotation_unit (string) (required) — Rotation unit. [hour, day, week, month]\n - rotation_value (integer) (required) — Rotation quantity (number of rotation_unit per cycle).\n - schedule_id (integer) (required) — Parent schedule ID.\n - update_at (integer) (required) — Last update timestamp (Unix seconds).\n - update_by (integer) (required) — Last updater person ID.\n - weight (integer) (required) — Layer weight for ordering.\n - name (any) (required) — Schedule name (legacy field; mirrors schedule_name). null when returned from /schedule/preview.\n - next_oncall (object) (required) — Next on-call group, or null when unknown.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - update_at (integer) (required) — Update timestamp (Unix seconds).\n - weight (integer) (required) — Layer weight the shift comes from.\n - notify (object) (required) — Notification configuration attached to a schedule.\n - advance_in_time (integer) — Advance notification lead time (seconds).\n - by (object) (required) — Per-recipient notification preference.\n - follow_preference (boolean) (required) — Whether to follow each responder's personal notification preference.\n - personal_channels (array) (required) — Personal notification channel keys.\n - fixed_time (object) (required) — Fixed-time notification config.\n - cycle (string) (required) — Notification cycle.\n - start (string) (required) — Notification start time within the cycle.\n - im (object) — Legacy IM-type to token map.\n - webhooks (array) (required) — IM webhook notification channels.\n - settings (object) (required) — Settings for an IM webhook notification channel.\n - type (string) (required) — IM provider type (for example feishu_app, dingtalk_app, wecom_app, teams_app, slack_app).\n - schedule_id (integer) (required) — Schedule ID.\n - schedule_layers (array) (required) — Computed layers for the requested window.\n - layer_name (string) (required) — Layer display name.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - schedules (array) (required) — Computed shifts.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - schedule_name (any) (required) — Schedule display name. null when returned from /schedule/preview.\n - start (integer) — Window start (Unix seconds).\n - status (any) (required) — Legacy status flag. Deprecated. null when returned from /schedule/preview.\n - team_id (any) (required) — Owning team ID. null when returned from /schedule/preview.\n - update_at (integer) (required) — Last update timestamp (Unix seconds).\n - update_by (integer) (required) — Last updater person ID.\n", "Schedules.Preview": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - account_id (integer) (required) — Account ID.\n - create_at (integer) (required) — Creation timestamp (Unix seconds).\n - create_by (integer) (required) — Creator person ID.\n - cur_oncall (object) (required) — Current on-call group, or null when nobody is on-call.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - person_ids (array) (required) — Person IDs in this slot.\n - role_id (integer) (required) — Oncall role ID.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - update_at (integer) (required) — Update timestamp (Unix seconds).\n - weight (integer) (required) — Layer weight the shift comes from.\n - description (any) (required) — Schedule description. null when returned from /schedule/preview.\n - disabled (any) (required) — Disabled flag (0 = enabled, 1 = disabled). Deprecated. null when returned from /schedule/preview.\n - end (integer) — Window end (Unix seconds).\n - field (string) — Field name used by the legacy update-field endpoint.\n - final_schedule (object) (required) — Collapsed final schedule across all layers.\n - layer_name (string) (required) — Layer display name.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - schedules (array) (required) — Computed shifts.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - group_id (any) (required) — Legacy team/group ID. null when returned from /schedule/preview.\n - id (any) (required) — Schedule ID. null when returned from /schedule/preview.\n - layer_schedules (array) (required) — Alias of schedule_layers returned for compatibility.\n - layer_name (string) (required) — Layer display name.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - schedules (array) (required) — Computed shifts.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - layers (array) (required) — Rotation layers defined on the schedule.\n - account_id (integer) (required) — Account ID.\n - create_at (integer) (required) — Creation timestamp (Unix seconds).\n - create_by (integer) (required) — Creator person ID.\n - day_mask (object) (required) — Day-of-week mask.\n - repeat (array) — Weekday numbers (0 = Sunday) included in the rotation.\n - enable_time (integer) (required) — When the layer becomes effective (Unix seconds).\n - expire_time (integer) (required) — When the layer expires (Unix seconds, 0 means never).\n - fair_rotation (boolean) (required) — Whether fair rotation is enabled.\n - groups (array) (required) — Oncall groups participating in the rotation.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - person_ids (array) (required) — Person IDs in this slot.\n - role_id (integer) (required) — Oncall role ID.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - handoff_time (integer) (required) — Handoff time inside the rotation cycle (seconds).\n - hidden (integer) (required) — Whether the layer is hidden in the UI (0 = no, 1 = yes).\n - layer_end (any) — Layer end timestamp (Unix seconds). null means open-ended.\n - layer_name (string) — User-facing layer name.\n - layer_start (integer) — Layer start timestamp (Unix seconds).\n - mask_continuous_enabled (boolean) (required) — Whether continuous masking is enabled.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - restrict_end (integer) (required) — Legacy end offset inside the restriction window (seconds).\n - restrict_mode (integer) (required) — Restriction mode: 0 = none, 1 = day, 2 = week.\n - restrict_periods (array) (required) — Restriction windows inside each rotation cycle.\n - restrict_end (integer) (required) — End offset inside the rotation cycle.\n - restrict_start (integer) (required) — Start offset inside the rotation cycle.\n - restrict_start (integer) (required) — Legacy start offset inside the restriction window (seconds).\n - rotation_duration (integer) (required) — Rotation duration in seconds.\n - rotation_unit (string) (required) — Rotation unit. [hour, day, week, month]\n - rotation_value (integer) (required) — Rotation quantity (number of rotation_unit per cycle).\n - schedule_id (integer) (required) — Parent schedule ID.\n - update_at (integer) (required) — Last update timestamp (Unix seconds).\n - update_by (integer) (required) — Last updater person ID.\n - weight (integer) (required) — Layer weight for ordering.\n - name (any) (required) — Schedule name (legacy field; mirrors schedule_name). null when returned from /schedule/preview.\n - next_oncall (object) (required) — Next on-call group, or null when unknown.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - person_ids (array) (required) — Person IDs in this slot.\n - role_id (integer) (required) — Oncall role ID.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - update_at (integer) (required) — Update timestamp (Unix seconds).\n - weight (integer) (required) — Layer weight the shift comes from.\n - notify (object) (required) — Notification configuration attached to a schedule.\n - advance_in_time (integer) — Advance notification lead time (seconds).\n - by (object) (required) — Per-recipient notification preference.\n - follow_preference (boolean) (required) — Whether to follow each responder's personal notification preference.\n - personal_channels (array) (required) — Personal notification channel keys.\n - fixed_time (object) (required) — Fixed-time notification config.\n - cycle (string) (required) — Notification cycle.\n - start (string) (required) — Notification start time within the cycle.\n - im (object) — Legacy IM-type to token map.\n - webhooks (array) (required) — IM webhook notification channels.\n - settings (object) (required) — Settings for an IM webhook notification channel.\n - alias (string) (required) — Channel alias.\n - chat_ids (array) (required) — Chat IDs.\n - data_source_id (integer) (required) — Data source ID.\n - sign_secret (string) (required) — Signature secret.\n - token (string) (required) — Webhook token.\n - verify_token (string) (required) — Verification token.\n - type (string) (required) — IM provider type (for example feishu_app, dingtalk_app, wecom_app, teams_app, slack_app).\n - schedule_id (integer) (required) — Schedule ID.\n - schedule_layers (array) (required) — Computed layers for the requested window.\n - layer_name (string) (required) — Layer display name.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - schedules (array) (required) — Computed shifts.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - schedule_name (any) (required) — Schedule display name. null when returned from /schedule/preview.\n - start (integer) — Window start (Unix seconds).\n - status (any) (required) — Legacy status flag. Deprecated. null when returned from /schedule/preview.\n - team_id (any) (required) — Owning team ID. null when returned from /schedule/preview.\n - update_at (integer) (required) — Last update timestamp (Unix seconds).\n - update_by (integer) (required) — Last updater person ID.\n", "Schedules.Self": "Response fields (this command's `--json` is a TOP-LEVEL array of these row objects — pipe `jq '.[]'`, NOT `.items[]`):\n - account_id (integer) (required) — Account ID.\n - create_at (integer) (required) — Creation timestamp (Unix seconds).\n - create_by (integer) (required) — Creator person ID.\n - cur_oncall (object) (required) — Current on-call group, or null when nobody is on-call.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - update_at (integer) (required) — Update timestamp (Unix seconds).\n - weight (integer) (required) — Layer weight the shift comes from.\n - description (any) (required) — Schedule description. null when returned from /schedule/preview.\n - disabled (any) (required) — Disabled flag (0 = enabled, 1 = disabled). Deprecated. null when returned from /schedule/preview.\n - end (integer) — Window end (Unix seconds).\n - field (string) — Field name used by the legacy update-field endpoint.\n - final_schedule (object) (required) — Collapsed final schedule across all layers.\n - layer_name (string) (required) — Layer display name.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - schedules (array) (required) — Computed shifts.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - group_id (any) (required) — Legacy team/group ID. null when returned from /schedule/preview.\n - id (any) (required) — Schedule ID. null when returned from /schedule/preview.\n - layer_schedules (array) (required) — Alias of schedule_layers returned for compatibility.\n - layer_name (string) (required) — Layer display name.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - schedules (array) (required) — Computed shifts.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - layers (array) (required) — Rotation layers defined on the schedule.\n - account_id (integer) (required) — Account ID.\n - create_at (integer) (required) — Creation timestamp (Unix seconds).\n - create_by (integer) (required) — Creator person ID.\n - day_mask (object) (required) — Day-of-week mask.\n - repeat (array) — Weekday numbers (0 = Sunday) included in the rotation.\n - enable_time (integer) (required) — When the layer becomes effective (Unix seconds).\n - expire_time (integer) (required) — When the layer expires (Unix seconds, 0 means never).\n - fair_rotation (boolean) (required) — Whether fair rotation is enabled.\n - groups (array) (required) — Oncall groups participating in the rotation.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - handoff_time (integer) (required) — Handoff time inside the rotation cycle (seconds).\n - hidden (integer) (required) — Whether the layer is hidden in the UI (0 = no, 1 = yes).\n - layer_end (any) — Layer end timestamp (Unix seconds). null means open-ended.\n - layer_name (string) — User-facing layer name.\n - layer_start (integer) — Layer start timestamp (Unix seconds).\n - mask_continuous_enabled (boolean) (required) — Whether continuous masking is enabled.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - restrict_end (integer) (required) — Legacy end offset inside the restriction window (seconds).\n - restrict_mode (integer) (required) — Restriction mode: 0 = none, 1 = day, 2 = week.\n - restrict_periods (array) (required) — Restriction windows inside each rotation cycle.\n - restrict_end (integer) (required) — End offset inside the rotation cycle.\n - restrict_start (integer) (required) — Start offset inside the rotation cycle.\n - restrict_start (integer) (required) — Legacy start offset inside the restriction window (seconds).\n - rotation_duration (integer) (required) — Rotation duration in seconds.\n - rotation_unit (string) (required) — Rotation unit. [hour, day, week, month]\n - rotation_value (integer) (required) — Rotation quantity (number of rotation_unit per cycle).\n - schedule_id (integer) (required) — Parent schedule ID.\n - update_at (integer) (required) — Last update timestamp (Unix seconds).\n - update_by (integer) (required) — Last updater person ID.\n - weight (integer) (required) — Layer weight for ordering.\n - name (any) (required) — Schedule name (legacy field; mirrors schedule_name). null when returned from /schedule/preview.\n - next_oncall (object) (required) — Next on-call group, or null when unknown.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - end (integer) (required) — Group end timestamp (Unix seconds).\n - group_name (string) (required) — Group display name.\n - members (array) (required) — Members of this group.\n - name (string) (required) — Legacy group name.\n - start (integer) (required) — Group start timestamp (Unix seconds).\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - update_at (integer) (required) — Update timestamp (Unix seconds).\n - weight (integer) (required) — Layer weight the shift comes from.\n - notify (object) (required) — Notification configuration attached to a schedule.\n - advance_in_time (integer) — Advance notification lead time (seconds).\n - by (object) (required) — Per-recipient notification preference.\n - follow_preference (boolean) (required) — Whether to follow each responder's personal notification preference.\n - personal_channels (array) (required) — Personal notification channel keys.\n - fixed_time (object) (required) — Fixed-time notification config.\n - cycle (string) (required) — Notification cycle.\n - start (string) (required) — Notification start time within the cycle.\n - im (object) — Legacy IM-type to token map.\n - webhooks (array) (required) — IM webhook notification channels.\n - settings (object) (required) — Settings for an IM webhook notification channel.\n - type (string) (required) — IM provider type (for example feishu_app, dingtalk_app, wecom_app, teams_app, slack_app).\n - schedule_id (integer) (required) — Schedule ID.\n - schedule_layers (array) (required) — Computed layers for the requested window.\n - layer_name (string) (required) — Layer display name.\n - mode (integer) (required) — Layer mode: 0 = common rotation, 1 = override.\n - name (string) (required) — Layer internal name.\n - schedules (array) (required) — Computed shifts.\n - end (integer) (required) — Shift end timestamp (Unix seconds).\n - group (object) (required) — Oncall group definition within a rotation layer.\n - index (integer) (required) — Index inside the rotation.\n - start (integer) (required) — Shift start timestamp (Unix seconds).\n - schedule_name (any) (required) — Schedule display name. null when returned from /schedule/preview.\n - start (integer) — Window start (Unix seconds).\n - status (any) (required) — Legacy status flag. Deprecated. null when returned from /schedule/preview.\n - team_id (any) (required) — Owning team ID. null when returned from /schedule/preview.\n - update_at (integer) (required) — Last update timestamp (Unix seconds).\n - update_by (integer) (required) — Last updater person ID.\n", + "ServiceMap.Fleet": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - coverage (object) (required) — Coverage of the candidate scan that produced this page.\n - failed (integer) (required) — Number of candidate hosts whose status could not be read.\n - matched (integer) (required) — Number of scanned hosts that passed all filters.\n - returned (integer) (required) — Number of matched hosts included in this page (`<= limit`).\n - scanned (integer) (required) — Number of distinct candidate hosts actually examined in this request.\n - states (object) (required) — Count of returned items per status value; always includes all seven status keys, zero-filled. Reflects only this page, not the account's full population.\n - generated_at_ms (integer) (required) — Unix timestamp in milliseconds this response was generated.\n - items (array) (required) — Matching hosts for this page.\n - agent_version (string) (required) — Agent version reported by this host.\n - edge_cluster (string) (required) — Edge cluster name this host belongs to.\n - host_id (string) (required) — Stable ServiceMap host identifier.\n - servicemap (object) (required) — ServiceMap capability and current collection status for this host.\n - authoritative (boolean) (required) — True if the host has an authoritative current graph.\n - capability_status (string) — Agent-reported capability status, e.g. `running`, `disabled`, `starting`, `failed`, `unsupported`.\n - capture_mode (string) — Capture mode, e.g. `ebpf` or `polling`.\n - edge_count (integer) (required) — Number of edges in the host's current graph.\n - enabled (boolean) (required) — True if ServiceMap collection is enabled on this host.\n - error_code (string) — Set to `status_unavailable` when this host's live status could not be read; other fields fall back to inventory-derived defaults in that case.\n - freshness_status (string) — Freshness classification of the host's graph. [fresh, stale, unknown]\n - graph_available (boolean) (required) — True if a current graph can be fetched for this host right now.\n - max_age_ms (integer) — Age in milliseconds of the host's graph data, relative to when this response was generated.\n - node_count (integer) (required) — Number of nodes in the host's current graph.\n - observed_at_ms (integer) — Unix timestamp in milliseconds the host's graph was observed by the agent.\n - reason_codes (array) — Machine-readable codes explaining the current status.\n - received_at_ms (integer) — Unix timestamp in milliseconds the host's current graph generation was received by the server.\n - report_interval_ms (integer) — Configured reporting interval in milliseconds.\n - snapshot_ready (boolean) (required) — True if the agent has produced at least one full snapshot.\n - status (string) (required) — Overall ServiceMap collection status. [active, degraded, stale, initializing, disabled, unsupported, no_data]\n - next_cursor (string) — Opaque cursor to fetch the next page. Absent when there are no more candidates to scan.\n - partial (boolean) (required) — True if any host in this page failed to read status, or the scan was truncated.\n - truncated (boolean) (required) — True if `scan_limit` was reached before finding `limit` matches; `next_cursor` may still find more.\n - truncation_reasons (array) — Machine-readable reasons the scan was truncated, when `truncated=true`.\n", + "ServiceMap.FleetSummary": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - coverage (object) (required) — Aggregate status distribution across the scanned candidate hosts.\n - classified (integer) (required) — Number of matched hosts successfully classified into one of the seven statuses; equals the sum of `states`.\n - failed (integer) (required) — Number of hosts whose candidate/detail read raced or whose live status could not be read.\n - matched (integer) (required) — Number of scanned hosts that passed the agent version / edge cluster / capture mode filters and still have a current inventory row.\n - scanned (integer) (required) — Number of distinct candidate hosts actually examined.\n - states (object) (required) — Count of hosts per status value; always includes all seven keys, zero-filled.\n - generated_at_ms (integer) (required) — Unix timestamp in milliseconds this response was generated.\n - partial (boolean) (required) — True if the scan was truncated or any host failed to classify.\n - scan_limit (integer) (required) — The normalized scan budget actually applied, echoing the default when the request omitted it.\n - truncated (boolean) (required) — True if `scan_limit` was reached before scanning every candidate host in the account.\n - truncation_reasons (array) — Machine-readable reasons the scan was truncated, when `truncated=true`.\n", + "ServiceMap.Status": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - coverage (object) (required) — Summary of how many hosts were successfully covered.\n - failed (integer) (required) — Number of hosts whose status could not be read.\n - requested (integer) (required) — Number of hosts requested (explicit `host_id`/`host_ids`, or the fleet sample size actually scanned).\n - states (object) (required) — Count of items per status value; always includes all seven keys (`active`, `degraded`, `stale`, `initializing`, `disabled`, `unsupported`, `no_data`), zero-filled.\n - succeeded (integer) (required) — Number of hosts whose status was read successfully.\n - truncated (boolean) (required) — True if `fleet` mode found more candidates than `limit` allowed to return.\n - fleet (boolean) (required) — Echoes whether this response was produced from a fleet sample rather than explicit host IDs.\n - generated_at_ms (integer) (required) — Unix timestamp in milliseconds this response was generated.\n - items (array) (required) — Per-host status, in the same order the hosts were resolved.\n - authoritative (boolean) (required) — True if the host has an authoritative current graph.\n - capability (object) (required) — The host's self-reported ServiceMap capability.\n - capture_mode (string) — Capture mode, e.g. `ebpf` or `polling`.\n - enabled (boolean) (required) — True if ServiceMap collection is enabled on this host.\n - host_id (string) — Host ID this capability describes.\n - present (boolean) (required) — True if the host has an inventory row with ServiceMap capability metadata at all.\n - reason_codes (array) — Machine-readable codes explaining the current capability status.\n - report_interval_ms (integer) — Configured reporting interval in milliseconds.\n - snapshot_ready (boolean) (required) — True if the agent has produced at least one full snapshot.\n - status (string) — Agent-reported capability status, e.g. `running`, `disabled`, `starting`, `failed`, `unsupported`.\n - coverage (object) (required) — Coverage and enrichment status for this host's graph.\n - degraded (boolean) (required) — True if the host's graph was degraded at collection time.\n - kubernetes_enrichment_status (string) — Kubernetes enrichment status for this host, as self-reported by the agent.\n - network_inventory_status (string) — Network-inventory enrichment status for this host, e.g. `complete`, `partial`, `unavailable`, as self-reported by the agent.\n - reason_codes (array) — Machine-readable codes explaining the current coverage status.\n - truncated (boolean) (required) — True if the host's graph was truncated at collection time.\n - edge_count (integer) (required) — Number of edges in the host's current graph.\n - error_code (string) — Set to `status_unavailable` when this host's status could not be read; other fields fall back to inventory-derived defaults in that case.\n - freshness (object) (required) — How recent the host's graph data is.\n - max_age_ms (integer) (required) — Age in milliseconds of the staleest graph covered, relative to now.\n - newest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the most recently received graph among the hosts covered.\n - oldest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the least recently received graph among the hosts covered.\n - status (string) (required) — Freshness classification. [fresh, stale, unknown]\n - graph_available (boolean) (required) — True if a current graph can be fetched for this host right now.\n - host_id (string) (required) — Host ID this status describes.\n - latest_health_at_ms (integer) — Unix timestamp in milliseconds of the most recent non-authoritative health signal, when more recent than the current graph.\n - network_scope_id (string) — Network scope resolved for this host, when known.\n - node_count (integer) (required) — Number of nodes in the host's current graph.\n - observed_at_ms (integer) — Unix timestamp in milliseconds the host's graph was observed by the agent.\n - reason_codes (array) — Machine-readable codes explaining the current status.\n - received_at_ms (integer) — Unix timestamp in milliseconds the host's current graph generation was received by the server.\n - report_interval_ms (integer) — Configured reporting interval in milliseconds.\n - status (string) (required) — Overall ServiceMap collection status. [active, degraded, stale, initializing, disabled, unsupported, no_data]\n - partial (boolean) (required) — True if any host failed or the fleet sample was truncated.\n", + "ServiceMap.Summary": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - anchor_entity_id (string) — Echo of the requested anchor entity ID, when one was given.\n - anchor_host_id (string) (required) — Echo of the requested anchor host ID.\n - authoritative (boolean) (required) — Always `true`; the summary is only ever built from an authoritative graph.\n - context_ref_detail (string) (required) — Pre-rendered natural-language evidence string summarizing this response, designed for LLM prompts. The structured fields above are the source of truth; this is a convenience rendering of them.\n - coverage (object) (required) — Aggregate coverage and enrichment status for the anchor host's graph.\n - capture_modes (array) — Distinct capture modes (e.g. `ebpf`) seen across loaded hosts.\n - degraded_hosts (integer) (required) — Number of loaded host graphs that were degraded at collection time.\n - direction (string) (required) — Always `outbound`; ServiceMap currently only models outbound relations. [outbound]\n - hosts_loaded (integer) (required) — Number of distinct host graphs loaded to answer the query.\n - ipv6_only_known_listener_count (integer) — Number of IPv6 wildcard listeners with a known IPV6_V6ONLY setting.\n - ipv6_only_unknown_listener_count (integer) — Number of IPv6 wildcard listeners whose IPV6_V6ONLY setting could not be determined.\n - ipv6_wildcard_listener_count (integer) — Number of IPv6 wildcard (unspecified-address) listeners observed.\n - kubernetes_enrichment_status (string) (required) — Aggregate Kubernetes enrichment coverage across loaded hosts. [unknown, complete, partial, unavailable]\n - listener_address_family_status (string) (required) — Aggregate coverage of IPv4/IPv6 listener address-family resolution across loaded hosts. [unknown, complete, partial, unavailable]\n - network_inventory_status (string) (required) — Aggregate network-inventory enrichment coverage across loaded hosts. [unknown, complete, partial, unavailable]\n - reasons (array) — Machine-readable reason codes explaining any degraded or truncated state among loaded hosts.\n - truncated_hosts (integer) (required) — Number of loaded host graphs that were truncated at collection time.\n - freshness (object) (required) — How recent the graph data is.\n - max_age_ms (integer) (required) — Age in milliseconds of the staleest graph covered, relative to now.\n - newest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the most recently received graph among the hosts covered.\n - oldest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the least recently received graph among the hosts covered.\n - status (string) (required) — Freshness classification. [fresh, stale, unknown]\n - graph_role (string) (required) — `current` if the summary reflects the live graph; `last_known_good` if the latest ingestion is unhealthy and this reflects the last authoritative graph instead. [current, last_known_good]\n - latest_collection_authoritative (boolean) (required) — False when `graph_role=last_known_good`, i.e. the most recent collection attempt was not authoritative.\n - latest_health_at_ms (integer) — Unix timestamp in milliseconds of the most recent non-authoritative health signal, when more recent than the current graph.\n - neighbors (array) (required) — Up to 12 outbound relations, most informative first.\n - active_connections (any) — Active connection count for this relation, when the underlying agent reports it.\n - destination_ip (string) — Destination IP address.\n - destination_port (integer) — Destination port.\n - destination_protocol (string) — Transport protocol of the destination. [tcp, udp]\n - edge_id (string) (required) — Edge ID.\n - last_seen (string) — Timestamp this relation was last observed.\n - resolution_status (string) (required) — Resolution outcome for this relation's destination. [resolved, ambiguous, unresolved]\n - source_display_name (string) — Display name of the source node, when known.\n - source_entity_id (string) (required) — Entity ID of the source node.\n - target_display_name (string) — Display name of the resolved target, when known.\n - target_entity_id (string) — Entity ID of the resolved target, when `resolution_status=resolved` and unambiguous.\n - target_host_id (string) — Host ID of the resolved target, when `resolution_status=resolved` and unambiguous.\n - network_scope_id (string) (required) — Network scope the summary was resolved within.\n - observed_at_ms (integer) (required) — Unix timestamp in milliseconds the underlying data was observed by the agent.\n - received_at_ms (integer) (required) — Unix timestamp in milliseconds the current graph generation was received by the server.\n - resolution_counts (object) (required) — Counts of the anchor host's outbound relations by resolution outcome.\n - ambiguous (integer) (required) — Number of edges resolved to multiple or low-confidence candidates.\n - resolved (integer) (required) — Number of edges resolved to exactly one confident candidate.\n - unresolved (integer) (required) — Number of edges with no resolvable candidate.\n - status (string) (required) — ServiceMap collection status of the anchor host. [active, degraded, stale, initializing, disabled, unsupported, no_data]\n - truncated (boolean) (required) — True if the fixed-size summary omitted any neighbor or coverage detail to stay within its bounds.\n - truncation_reasons (array) — Machine-readable reasons the summary was truncated, when `truncated=true`.\n", + "ServiceMap.Topology": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - anchor_entity_id (string) — Echo of the requested anchor entity ID, when one was given.\n - anchor_host_id (string) (required) — Echo of the requested anchor host ID.\n - coverage (object) (required) — Aggregate coverage and enrichment status across loaded hosts.\n - capture_modes (array) — Distinct capture modes (e.g. `ebpf`) seen across loaded hosts.\n - degraded_hosts (integer) (required) — Number of loaded host graphs that were degraded at collection time.\n - direction (string) (required) — Always `outbound`; ServiceMap currently only models outbound relations. [outbound]\n - hosts_loaded (integer) (required) — Number of distinct host graphs loaded to answer the query.\n - ipv6_only_known_listener_count (integer) — Number of IPv6 wildcard listeners with a known IPV6_V6ONLY setting.\n - ipv6_only_unknown_listener_count (integer) — Number of IPv6 wildcard listeners whose IPV6_V6ONLY setting could not be determined.\n - ipv6_wildcard_listener_count (integer) — Number of IPv6 wildcard (unspecified-address) listeners observed.\n - kubernetes_enrichment_status (string) (required) — Aggregate Kubernetes enrichment coverage across loaded hosts. [unknown, complete, partial, unavailable]\n - listener_address_family_status (string) (required) — Aggregate coverage of IPv4/IPv6 listener address-family resolution across loaded hosts. [unknown, complete, partial, unavailable]\n - network_inventory_status (string) (required) — Aggregate network-inventory enrichment coverage across loaded hosts. [unknown, complete, partial, unavailable]\n - reasons (array) — Machine-readable reason codes explaining any degraded or truncated state among loaded hosts.\n - truncated_hosts (integer) (required) — Number of loaded host graphs that were truncated at collection time.\n - edges (array) (required) — Edges discovered during the traversal. Excludes unresolved edges when `unresolved_mode=summary`.\n - depth (integer) (required) — Traversal depth this edge was discovered at, relative to the anchor.\n - destination (object) (required) — Destination endpoint of the connection.\n - ip (string) (required) — Destination IP address.\n - port (integer) (required) — Destination port.\n - protocol (string) (required) — Transport protocol, `tcp` or `udp`. [tcp, udp]\n - endpoint_resolution (object) (required) — Resolution of the destination endpoint to candidate target nodes.\n - candidates (array) (required) — Candidate nodes found for this endpoint, ranked by confidence.\n - confidence (number) (required) — Match confidence in `[0, 1]`; capped at 0.6 whenever more than one candidate is returned.\n - effective_ip (string) (required) — Destination IP actually being resolved against this candidate.\n - entity_id (string) (required) — Entity/process ID of the candidate listener.\n - graph_sequence (integer) (required) — Sequence number of the graph generation this candidate was observed in.\n - host_id (string) (required) — Host ID of the candidate listener.\n - listener_id (string) (required) — Identifier of the matched listener.\n - listener_ip (string) (required) — IP address the listener is bound to (may be a wildcard address).\n - match_kind (string) (required) — How the listener matched the destination, e.g. `exact`, `wildcard`, `wildcard_dual_stack`, `wildcard_address_family_unknown`.\n - netns_id (string) (required) — Network namespace ID the candidate listener is in.\n - node_display_name (string) — Display name of the candidate's owning node, when known.\n - node_kind (string) — Kind of the candidate's owning node, when known.\n - observed_at_ms (integer) (required) — Unix timestamp in milliseconds when the candidate's graph generation was observed by the agent.\n - port (integer) (required) — Destination port.\n - protocol (string) (required) — Transport protocol, `tcp` or `udp`. [tcp, udp]\n - candidates_truncated (boolean) — True if the candidate list was cut short by an internal query budget.\n - endpoint (object) (required) — The destination endpoint being resolved.\n - ip (string) (required) — Destination IP address.\n - port (integer) (required) — Destination port.\n - protocol (string) (required) — Transport protocol, `tcp` or `udp`. [tcp, udp]\n - reason (string) — Machine-readable reason code when `status` is not `resolved`, e.g. `no_current_listener`, `multiple_current_listeners`, `query_budget_exceeded`.\n - status (string) (required) — Resolution outcome. `resolved` = exactly one confident candidate; `ambiguous` = multiple or low-confidence candidates; `unresolved` = no candidate found. [resolved, ambiguous, unresolved]\n - evidence (string) (required) — How the edge was observed, e.g. `connect`.\n - first_seen (string) — Timestamp the edge was first observed.\n - host_id (string) (required) — Host the edge's source node lives on.\n - id (string) (required) — Edge ID, unique within its host.\n - last_seen (string) — Timestamp the edge was last observed.\n - metrics (any) — Opaque per-edge metrics payload, only present when `include_metrics=true` was requested.\n - source_entity_id (string) (required) — Entity ID of the source node.\n - source_netns_id (string) (required) — Network namespace ID the connection originated from.\n - freshness (object) (required) — How recent the graph data is.\n - max_age_ms (integer) (required) — Age in milliseconds of the staleest graph covered, relative to now.\n - newest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the most recently received graph among the hosts covered.\n - oldest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the least recently received graph among the hosts covered.\n - status (string) (required) — Freshness classification. [fresh, stale, unknown]\n - network_scope_id (string) (required) — Network scope the graph was resolved within.\n - nodes (array) (required) — Nodes discovered during the traversal.\n - container_name (string) — Container name, when the node runs in a container.\n - display_name (string) (required) — Human-readable display name.\n - executable_name (string) — Executable file name.\n - first_seen (string) — Timestamp the node was first observed.\n - host_id (string) (required) — Host the node was observed on.\n - id (string) (required) — Entity ID of the node, unique within its host.\n - identity (any) — Opaque, kind-specific identity payload. Shape depends on `kind`.\n - image_repository (string) — Container image repository.\n - image_version (string) — Container image tag/version.\n - instance_count (integer) — Number of instances folded into this node, when the node represents a workload replica set.\n - kind (string) (required) — Node kind, e.g. `process`, `container`.\n - last_seen (string) — Timestamp the node was last observed.\n - namespace (string) — Kubernetes namespace, when known.\n - sample_instances (any) — Opaque sample of underlying instances folded into this node, when applicable.\n - systemd_unit (string) — systemd unit name, when the node is a systemd-managed process.\n - workload_name (string) — Kubernetes workload name, when known.\n - observed_at_ms (integer) (required) — Unix timestamp in milliseconds the underlying data was observed by the agent (the most recent among loaded hosts).\n - resolution_counts (object) (required) — Counts of edges by resolution outcome.\n - ambiguous (integer) (required) — Number of edges resolved to multiple or low-confidence candidates.\n - resolved (integer) (required) — Number of edges resolved to exactly one confident candidate.\n - unresolved (integer) (required) — Number of edges with no resolvable candidate.\n - truncated (boolean) (required) — True if any bound (`max_nodes`, `max_edges`, or an internal query budget) cut the traversal short.\n - truncation_reasons (array) — Machine-readable reasons the traversal was truncated, when `truncated=true`.\n - unresolved_endpoints (array) (required) — Sample or full set of edges whose destination could not be resolved, per `unresolved_projection`.\n - destination (object) (required) — Destination endpoint of the connection.\n - ip (string) (required) — Destination IP address.\n - port (integer) (required) — Destination port.\n - protocol (string) (required) — Transport protocol, `tcp` or `udp`. [tcp, udp]\n - edge_id (string) (required) — Edge ID, unique within its host.\n - host_id (string) (required) — Host the edge's source node lives on.\n - reason (string) (required) — Machine-readable reason the endpoint could not be resolved.\n - source_entity_id (string) (required) — Entity ID of the source node.\n - source_netns_id (string) (required) — Network namespace ID the connection originated from.\n - unresolved_projection (object) (required) — How unresolved edges were projected into this response.\n - by_reason (array) (required) — Breakdown of `total` unresolved edges by reason code.\n - count (integer) (required) — Number of unresolved edges with this reason.\n - reason (string) (required) — Machine-readable unresolved reason code.\n - mode (string) (required) — The `unresolved_mode` that was applied. [summary, full]\n - omitted (integer) (required) — Number of unresolved edges found but not returned (`total - returned`).\n - returned (integer) (required) — Number of unresolved edges included in `unresolved_endpoints`.\n - total (integer) (required) — Total number of unresolved edges found, regardless of how many were returned.\n", "SessionReplay.Metadata": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - application (object)\n - id (string) — RUM application ID the session belongs to.\n - device (object)\n - type (string) — Device type recorded for the session, e.g. `desktop`, `mobile`, `tablet`.\n - foreground_periods (array) — Foreground periods across the session (mobile sessions only; empty for web).\n - end (integer) — Unix timestamp in milliseconds when the foreground period ended.\n - start (integer) — Unix timestamp in milliseconds when the foreground period started.\n - view_id (string) — View ID active during this foreground period.\n - session (object)\n - end (integer) — Unix timestamp in milliseconds when the session ended (or was last updated, if still active).\n - is_active (boolean) — Whether the session was still active as of the last recorded event.\n - server_time_delta (integer) — Clock skew in milliseconds between the client and Flashduty's servers, added to client timestamps for correction.\n - source (string) — SDK platform that recorded the session. [browser, android, ios, miniprogram, react-native, flutter, kotlin-multiplatform, roku, unity]\n - start (integer) — Unix timestamp in milliseconds when the session started.\n - views (array) — Every view recorded during the session, in chronological order.\n - container_source (string) — SDK platform of the container app, when this view is embedded (e.g. a WebView inside a native app).\n - container_view_id (string) — View ID of the containing view, when this view is embedded.\n - end (integer) — Unix timestamp in milliseconds when the view ended.\n - is_active (boolean) — Whether the view was still active as of the last recorded event.\n - loading_type (string) — How the view was entered, e.g. `initial_load`, `route_change`.\n - name (string) — View name, typically the route or screen name.\n - server_time_delta (integer) — Clock skew in milliseconds between the client and Flashduty's servers, added to client timestamps for correction.\n - source (string) — SDK platform that recorded the view. [browser, android, ios, miniprogram, react-native, flutter, kotlin-multiplatform, roku, unity]\n - start (integer) — Unix timestamp in milliseconds when the view started.\n - url (string) — URL (web) or screen identifier (mobile) associated with the view.\n - view_id (string) — Unique ID of the view within the session.\n", "SessionReplay.Segments": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - items (array) — Presigned, time-limited URLs (valid 1 hour) for downloading each segment's raw compressed bytes.\n - search_after_ctx (string) — Pagination cursor to pass as `search_after_ctx` on the next call. Empty when this page was the last one.\n", "Sessions.ReadInfo": "Response fields (`data` envelope is unwrapped — these fields are at the top level):\n - events (array) (required) — Recent events, ascending by (created_at, event_id).\n - actions (object) — ADK actions envelope (state deltas, transfers, escalation).\n - author (string) — Event author (e.g. user, the agent name).\n - branch (string) — ADK branch path for nested agents.\n - content (object) — ADK content envelope {role, parts:[...]}.\n - created_at (integer) (required) — Unix timestamp in milliseconds when the event was written.\n - error_code (string) — Error code when the event represents a failure.\n - error_message (string) — Human-readable error message, when present.\n - event_id (string) (required) — Event identifier.\n - invocation_id (string) — ADK invocation id grouping a turn.\n - partial (boolean) (required) — True for a streaming partial chunk.\n - session_id (string) (required) — Owning session id.\n - status (string) — Event status. [normal, compressed]\n - turn_complete (boolean) (required) — True on the terminal event of a turn.\n - usage_metadata (object) — Per-turn token usage metadata.\n - has_more_older (boolean) (required) — True when older events remain beyond this page.\n - search_after_ctx (string) — Opaque keyset cursor; pass back as search_after_ctx to fetch the next older page. Omitted when has_more_older is false.\n - session (object) (required) — One agent session row.\n - access_source (string) — How the caller received access to this session. Omitted when no access source is resolved. [owner, team_member, manager, share_link]\n - app_name (string) (required) — Agent app that owns the session.\n - archived_at (integer) (required) — Unix timestamp in milliseconds when archived; 0 means not archived.\n - bound_environment (object) — The runner or cloud sandbox the session is bound to. Null until the first message.\n - id (string) (required) — Environment identifier: a cloud sandbox ID for `cloud` bindings, a runner/environment ID for `byoc` bindings.\n - kind (string) (required) — Environment kind bound to the session: `cloud` (managed sandbox) or `byoc` (self-hosted runner). [cloud, byoc]\n - name (string) — Human-readable environment name; empty for cloud bindings using the default allowlist.\n - status (string) — Live binding health, namespaced by kind: BYOC uses online/pending/offline/deleted; cloud uses available/rebuilding/expired. [online, pending, offline, deleted, available, rebuilding, expired]\n - can_continue (boolean) (required) — True when the caller can add a new turn to this session.\n - can_fork (boolean) (required) — True when the caller can fork this session.\n - can_manage (boolean) (required) — True when the caller may rename/archive/delete the session; personal sessions are creator-only, team sessions allow the creator, account admin, or team member.\n - can_view (boolean) (required) — True when the caller can view this session.\n - context_resolved (object) — Snapshot of the three-tier knowledge-pack resolution for this session.\n - account_pack_id (string) — Resolved account-scoped pack id.\n - incident_id (string) — Bound incident id, when war-room originated.\n - resolved_at_ms (integer) (required) — Unix timestamp in milliseconds when the packs were resolved.\n - team_pack_id (string) — Resolved team-scoped pack id.\n - versions (object) — Per-pack resolved version map.\n - context_window (integer) (required) — The bound model's max context size in tokens. 0 means unknown.\n - created_at (integer) (required) — Unix timestamp in milliseconds when the session was created.\n - current_context_tokens (integer) (required) — Size in tokens of the LLM context window as of the most recent turn. 0 means no turn has completed.\n - current_turn_active_ms (integer) (required) — Active working duration in milliseconds for the current or most recent round, excluding time spent waiting on ask_user; resets to 0 at the start of each new round.\n - current_turn_started_at (integer) (required) — Unix timestamp in milliseconds when the current or most recent round started; 0 if no round has started yet.\n - current_turn_tokens (integer) (required) — Total tokens (input+output+reasoning) for the in-flight round across the parent and its subagents; only computed by session/get while the session is running, always 0 in session/list responses and when idle.\n - current_turn_wait_ms (integer) (required) — Accumulated ask_user human-wait duration in milliseconds for the current round; resets to 0 at the start of each new round.\n - entry_kind (string) — Surface that created the session. [web, im, api, automation, subagent]\n - has_unread (boolean) (required) — True when there is assistant output the caller has not yet viewed.\n - incognito (boolean) (required) — True for incognito (non-persisted-memory) sessions.\n - is_mine (boolean) (required) — True when the caller created this session.\n - is_running (boolean) (required) — True when an agent turn is currently in flight for this session.\n - last_event_at (integer) — Unix timestamp in milliseconds of the most recent assistant-side event.\n - parent_session_id (string) — Parent session id for subagent (child) sessions; empty otherwise.\n - person_id (string) (required) — Creator person id.\n - pinned_at (integer) (required) — Caller's per-user pin timestamp in milliseconds; 0 means not pinned.\n - session_id (string) (required) — Session identifier.\n - session_name (string) (required) — Session title; may be empty for untitled sessions.\n - share_enabled (boolean) (required) — True when the session's share link is active.\n - share_version (integer) (required) — Revision of the share link; it increases when sharing is revoked.\n - shared_at (integer) (required) — Unix timestamp in milliseconds when sharing was last enabled; 0 if never shared.\n - shared_by (integer) (required) — Person ID that most recently enabled sharing; 0 if never shared.\n - state (object) — Raw session-state bag (session-scoped keys). Omitted when empty.\n - status (string) (required) — Lifecycle status. [enabled, deleted]\n - team_id (integer) (required) — Owning team id; 0 means no team is bound. Immutable after create.\n - team_name (string) — Resolved team name; empty for unbound rows or deleted teams.\n - template_staging_round_id (string) — Current save→validate round id (template-assistant only); empty otherwise.\n - token_usage (object) — Cumulative session-level token rollup across all turns. The account-billing source of truth.\n - cached_tokens (integer) (required) — Portion of input_tokens served from the prompt cache.\n - input_tokens (integer) (required) — Total prompt (input) tokens, including the cached portion.\n - output_tokens (integer) (required) — Total generated (output) tokens.\n - reasoning_tokens (integer) (required) — Total reasoning/thinking tokens.\n - updated_at (integer) (required) — Unix timestamp in milliseconds of the last session update.\n - suggest_init (boolean) (required) — Account-wide onboarding flag: true when the account has zero knowledge packs in any scope; not specific to this session.\n", diff --git a/internal/cli/zz_generated_service_map.go b/internal/cli/zz_generated_service_map.go new file mode 100644 index 0000000..bd73050 --- /dev/null +++ b/internal/cli/zz_generated_service_map.go @@ -0,0 +1,602 @@ +// Code generated by internal/cmd/cligen; DO NOT EDIT. + +package cli + +import ( + "github.com/spf13/cobra" + + flashduty "github.com/flashcatcloud/go-flashduty" +) + +func genServiceMapFleetCmd() *cobra.Command { + var dataJSON string + var fAgentVersions []string + var fCaptureModes []string + var fCursor string + var fEdgeClusters []string + var fLimit int64 + var fScanLimit int64 + var fStatuses []string + cmd := &cobra.Command{ + Use: "servicemap-fleet", + Short: "Browse service map fleet hosts", + Long: `Browse service map fleet hosts. + +Browse the account's hosts with ServiceMap capability and current collection status. + +API: POST /monit/servicemap/fleet (monit-servicemap-read-fleet) + +Request fields: + --agent-versions []string — Filter to hosts on any of these exact agent versions. Up to 20 values. + --capture-modes []string — Filter to hosts using any of these capture modes. 'unknown' matches hosts that have not reported a capture mode yet. [ebpf, polling, unknown] + --cursor string — Opaque pagination cursor. Pass back the exact value from a previous response's 'next_cursor'; omit for the first page. + --edge-clusters []string — Filter to hosts in any of these exact edge cluster names. Up to 20 values. + --limit int — Maximum number of matching hosts to return in this page. Default 50, range 1-100. (1-100) + --scan-limit int — Maximum number of candidate hosts to examine while filling this page. Default 1000, range 'limit'-2000. (max 2000) + --statuses []string — Filter to hosts currently in any of these statuses. Up to 20 values. [active, degraded, stale, initializing, disabled, unsupported, no_data] + +Response fields ('data' envelope is unwrapped — these fields are at the top level): + - coverage (object) (required) — Coverage of the candidate scan that produced this page. + - failed (integer) (required) — Number of candidate hosts whose status could not be read. + - matched (integer) (required) — Number of scanned hosts that passed all filters. + - returned (integer) (required) — Number of matched hosts included in this page ('<= limit'). + - scanned (integer) (required) — Number of distinct candidate hosts actually examined in this request. + - states (object) (required) — Count of returned items per status value; always includes all seven status keys, zero-filled. Reflects only this page, not the account's full population. + - generated_at_ms (integer) (required) — Unix timestamp in milliseconds this response was generated. + - items (array) (required) — Matching hosts for this page. + - agent_version (string) (required) — Agent version reported by this host. + - edge_cluster (string) (required) — Edge cluster name this host belongs to. + - host_id (string) (required) — Stable ServiceMap host identifier. + - servicemap (object) (required) — ServiceMap capability and current collection status for this host. + - authoritative (boolean) (required) — True if the host has an authoritative current graph. + - capability_status (string) — Agent-reported capability status, e.g. 'running', 'disabled', 'starting', 'failed', 'unsupported'. + - capture_mode (string) — Capture mode, e.g. 'ebpf' or 'polling'. + - edge_count (integer) (required) — Number of edges in the host's current graph. + - enabled (boolean) (required) — True if ServiceMap collection is enabled on this host. + - error_code (string) — Set to 'status_unavailable' when this host's live status could not be read; other fields fall back to inventory-derived defaults in that case. + - freshness_status (string) — Freshness classification of the host's graph. [fresh, stale, unknown] + - graph_available (boolean) (required) — True if a current graph can be fetched for this host right now. + - max_age_ms (integer) — Age in milliseconds of the host's graph data, relative to when this response was generated. + - node_count (integer) (required) — Number of nodes in the host's current graph. + - observed_at_ms (integer) — Unix timestamp in milliseconds the host's graph was observed by the agent. + - reason_codes (array) — Machine-readable codes explaining the current status. + - received_at_ms (integer) — Unix timestamp in milliseconds the host's current graph generation was received by the server. + - report_interval_ms (integer) — Configured reporting interval in milliseconds. + - snapshot_ready (boolean) (required) — True if the agent has produced at least one full snapshot. + - status (string) (required) — Overall ServiceMap collection status. [active, degraded, stale, initializing, disabled, unsupported, no_data] + - next_cursor (string) — Opaque cursor to fetch the next page. Absent when there are no more candidates to scan. + - partial (boolean) (required) — True if any host in this page failed to read status, or the scan was truncated. + - truncated (boolean) (required) — True if 'scan_limit' was reached before finding 'limit' matches; 'next_cursor' may still find more. + - truncation_reasons (array) — Machine-readable reasons the scan was truncated, when 'truncated=true'. +`, + Example: ` flashduty monit servicemap-fleet --data '{"agent_versions":["v1.2.3"],"capture_modes":["ebpf"],"edge_clusters":["edge-a"],"limit":50,"scan_limit":1000,"statuses":["degraded","stale"]}'`, + 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("agent-versions") { + body["agent_versions"] = fAgentVersions + } + if cmd.Flags().Changed("capture-modes") { + body["capture_modes"] = fCaptureModes + } + if cmd.Flags().Changed("cursor") { + body["cursor"] = fCursor + } + if cmd.Flags().Changed("edge-clusters") { + body["edge_clusters"] = fEdgeClusters + } + if cmd.Flags().Changed("limit") { + body["limit"] = fLimit + } + if cmd.Flags().Changed("scan-limit") { + body["scan_limit"] = fScanLimit + } + if cmd.Flags().Changed("statuses") { + body["statuses"] = fStatuses + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.ServiceMapFleetBrowseRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.ServiceMap.Fleet(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().StringSliceVar(&fAgentVersions, "agent-versions", nil, "Filter to hosts on any of these exact agent versions. Up to 20 values.") + cmd.Flags().StringSliceVar(&fCaptureModes, "capture-modes", nil, "Filter to hosts using any of these capture modes. 'unknown' matches hosts that have not reported a capture mode yet. [ebpf, polling, unknown]") + cmd.Flags().StringVar(&fCursor, "cursor", "", "Opaque pagination cursor. Pass back the exact value from a previous response's 'next_cursor'; omit for the first page.") + cmd.Flags().StringSliceVar(&fEdgeClusters, "edge-clusters", nil, "Filter to hosts in any of these exact edge cluster names. Up to 20 values.") + cmd.Flags().Int64Var(&fLimit, "limit", 0, "Maximum number of matching hosts to return in this page. Default 50, range 1-100. (1-100)") + cmd.Flags().Int64Var(&fScanLimit, "scan-limit", 0, "Maximum number of candidate hosts to examine while filling this page. Default 1000, range 'limit'-2000. (max 2000)") + cmd.Flags().StringSliceVar(&fStatuses, "statuses", nil, "Filter to hosts currently in any of these statuses. Up to 20 values. [active, degraded, stale, initializing, disabled, unsupported, no_data]") + 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 genServiceMapFleetSummaryCmd() *cobra.Command { + var dataJSON string + var fAgentVersions []string + var fCaptureModes []string + var fEdgeClusters []string + var fScanLimit int64 + cmd := &cobra.Command{ + Use: "servicemap-fleet-summary", + Short: "Get service map fleet summary", + Long: `Get service map fleet summary. + +Return an aggregate status distribution across the account's ServiceMap-capable hosts. + +API: POST /monit/servicemap/fleet/summary (monit-servicemap-read-fleet-summary) + +Request fields: + --agent-versions []string — Filter to hosts on any of these exact agent versions. Up to 20 values. + --capture-modes []string — Filter to hosts using any of these capture modes. 'unknown' matches hosts that have not reported a capture mode yet. [ebpf, polling, unknown] + --edge-clusters []string — Filter to hosts in any of these exact edge cluster names. Up to 20 values. + --scan-limit int — Maximum number of candidate hosts to scan. Default 2000, range 1-5000. (1-5000) + +Response fields ('data' envelope is unwrapped — these fields are at the top level): + - coverage (object) (required) — Aggregate status distribution across the scanned candidate hosts. + - classified (integer) (required) — Number of matched hosts successfully classified into one of the seven statuses; equals the sum of 'states'. + - failed (integer) (required) — Number of hosts whose candidate/detail read raced or whose live status could not be read. + - matched (integer) (required) — Number of scanned hosts that passed the agent version / edge cluster / capture mode filters and still have a current inventory row. + - scanned (integer) (required) — Number of distinct candidate hosts actually examined. + - states (object) (required) — Count of hosts per status value; always includes all seven keys, zero-filled. + - generated_at_ms (integer) (required) — Unix timestamp in milliseconds this response was generated. + - partial (boolean) (required) — True if the scan was truncated or any host failed to classify. + - scan_limit (integer) (required) — The normalized scan budget actually applied, echoing the default when the request omitted it. + - truncated (boolean) (required) — True if 'scan_limit' was reached before scanning every candidate host in the account. + - truncation_reasons (array) — Machine-readable reasons the scan was truncated, when 'truncated=true'. +`, + Example: ` flashduty monit servicemap-fleet-summary --data '{"agent_versions":["v1.2.3"],"capture_modes":["ebpf"],"edge_clusters":["edge-a"],"scan_limit":2000}'`, + 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("agent-versions") { + body["agent_versions"] = fAgentVersions + } + if cmd.Flags().Changed("capture-modes") { + body["capture_modes"] = fCaptureModes + } + if cmd.Flags().Changed("edge-clusters") { + body["edge_clusters"] = fEdgeClusters + } + if cmd.Flags().Changed("scan-limit") { + body["scan_limit"] = fScanLimit + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.ServiceMapFleetSummaryRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.ServiceMap.FleetSummary(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().StringSliceVar(&fAgentVersions, "agent-versions", nil, "Filter to hosts on any of these exact agent versions. Up to 20 values.") + cmd.Flags().StringSliceVar(&fCaptureModes, "capture-modes", nil, "Filter to hosts using any of these capture modes. 'unknown' matches hosts that have not reported a capture mode yet. [ebpf, polling, unknown]") + cmd.Flags().StringSliceVar(&fEdgeClusters, "edge-clusters", nil, "Filter to hosts in any of these exact edge cluster names. Up to 20 values.") + cmd.Flags().Int64Var(&fScanLimit, "scan-limit", 0, "Maximum number of candidate hosts to scan. Default 2000, range 1-5000. (1-5000)") + 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 genServiceMapStatusCmd() *cobra.Command { + var dataJSON string + var fFleet bool + var fHostID string + var fHostIDs []string + var fLimit int64 + cmd := &cobra.Command{ + Use: "servicemap-status", + Short: "Get service map status", + Long: `Get service map status. + +Return ServiceMap collection status for one or more hosts, or a bounded fleet sample. + +API: POST /monit/servicemap/status (monit-servicemap-read-status) + +Request fields: + --fleet bool — When 'true', ignore 'host_id'/'host_ids' and instead sample up to 'limit' fleet candidate hosts for the account. Default 'false'. + --host-id string — A single host ID to check. Combine with 'host_ids' to check several; mutually exclusive with 'fleet=true'. (≤128 chars) + --host-ids []string — Multiple host IDs to check in one call, up to 200 combined with 'host_id'. Mutually exclusive with 'fleet=true'. + --limit int — In 'fleet' mode, the number of candidate hosts to sample. Ignored otherwise. Default 100, range 1-200. (1-200) + +Response fields ('data' envelope is unwrapped — these fields are at the top level): + - coverage (object) (required) — Summary of how many hosts were successfully covered. + - failed (integer) (required) — Number of hosts whose status could not be read. + - requested (integer) (required) — Number of hosts requested (explicit 'host_id'/'host_ids', or the fleet sample size actually scanned). + - states (object) (required) — Count of items per status value; always includes all seven keys ('active', 'degraded', 'stale', 'initializing', 'disabled', 'unsupported', 'no_data'), zero-filled. + - succeeded (integer) (required) — Number of hosts whose status was read successfully. + - truncated (boolean) (required) — True if 'fleet' mode found more candidates than 'limit' allowed to return. + - fleet (boolean) (required) — Echoes whether this response was produced from a fleet sample rather than explicit host IDs. + - generated_at_ms (integer) (required) — Unix timestamp in milliseconds this response was generated. + - items (array) (required) — Per-host status, in the same order the hosts were resolved. + - authoritative (boolean) (required) — True if the host has an authoritative current graph. + - capability (object) (required) — The host's self-reported ServiceMap capability. + - capture_mode (string) — Capture mode, e.g. 'ebpf' or 'polling'. + - enabled (boolean) (required) — True if ServiceMap collection is enabled on this host. + - host_id (string) — Host ID this capability describes. + - present (boolean) (required) — True if the host has an inventory row with ServiceMap capability metadata at all. + - reason_codes (array) — Machine-readable codes explaining the current capability status. + - report_interval_ms (integer) — Configured reporting interval in milliseconds. + - snapshot_ready (boolean) (required) — True if the agent has produced at least one full snapshot. + - status (string) — Agent-reported capability status, e.g. 'running', 'disabled', 'starting', 'failed', 'unsupported'. + - coverage (object) (required) — Coverage and enrichment status for this host's graph. + - degraded (boolean) (required) — True if the host's graph was degraded at collection time. + - kubernetes_enrichment_status (string) — Kubernetes enrichment status for this host, as self-reported by the agent. + - network_inventory_status (string) — Network-inventory enrichment status for this host, e.g. 'complete', 'partial', 'unavailable', as self-reported by the agent. + - reason_codes (array) — Machine-readable codes explaining the current coverage status. + - truncated (boolean) (required) — True if the host's graph was truncated at collection time. + - edge_count (integer) (required) — Number of edges in the host's current graph. + - error_code (string) — Set to 'status_unavailable' when this host's status could not be read; other fields fall back to inventory-derived defaults in that case. + - freshness (object) (required) — How recent the host's graph data is. + - max_age_ms (integer) (required) — Age in milliseconds of the staleest graph covered, relative to now. + - newest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the most recently received graph among the hosts covered. + - oldest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the least recently received graph among the hosts covered. + - status (string) (required) — Freshness classification. [fresh, stale, unknown] + - graph_available (boolean) (required) — True if a current graph can be fetched for this host right now. + - host_id (string) (required) — Host ID this status describes. + - latest_health_at_ms (integer) — Unix timestamp in milliseconds of the most recent non-authoritative health signal, when more recent than the current graph. + - network_scope_id (string) — Network scope resolved for this host, when known. + - node_count (integer) (required) — Number of nodes in the host's current graph. + - observed_at_ms (integer) — Unix timestamp in milliseconds the host's graph was observed by the agent. + - reason_codes (array) — Machine-readable codes explaining the current status. + - received_at_ms (integer) — Unix timestamp in milliseconds the host's current graph generation was received by the server. + - report_interval_ms (integer) — Configured reporting interval in milliseconds. + - status (string) (required) — Overall ServiceMap collection status. [active, degraded, stale, initializing, disabled, unsupported, no_data] + - partial (boolean) (required) — True if any host failed or the fleet sample was truncated. +`, + Example: ` flashduty monit servicemap-status --data '{"host_id":"host_0123456789abcdef0123456789abcdef"}'`, + 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("fleet") { + body["fleet"] = fFleet + } + if cmd.Flags().Changed("host-id") { + body["host_id"] = fHostID + } + if cmd.Flags().Changed("host-ids") { + body["host_ids"] = fHostIDs + } + if cmd.Flags().Changed("limit") { + body["limit"] = fLimit + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.ServiceMapStatusRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.ServiceMap.Status(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().BoolVar(&fFleet, "fleet", false, "When 'true', ignore 'host_id'/'host_ids' and instead sample up to 'limit' fleet candidate hosts for the account. Default 'false'.") + cmd.Flags().StringVar(&fHostID, "host-id", "", "A single host ID to check. Combine with 'host_ids' to check several; mutually exclusive with 'fleet=true'. (≤128 chars)") + cmd.Flags().StringSliceVar(&fHostIDs, "host-ids", nil, "Multiple host IDs to check in one call, up to 200 combined with 'host_id'. Mutually exclusive with 'fleet=true'.") + cmd.Flags().Int64Var(&fLimit, "limit", 0, "In 'fleet' mode, the number of candidate hosts to sample. Ignored otherwise. Default 100, range 1-200. (1-200)") + 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 genServiceMapSummaryCmd() *cobra.Command { + var dataJSON string + var fNetworkScopeID string + cmd := &cobra.Command{ + Use: "servicemap-summary", + Short: "Get service map summary", + Long: `Get service map summary. + +Return a bounded, AI-ready summary of a host's outbound service dependencies. + +API: POST /monit/servicemap/summary (monit-servicemap-read-summary) + +Request fields: + --network-scope-id string — Optional integrity check: if set, must match the network scope already associated with 'anchor.host_id', or the request is rejected with 'InvalidParameter'. + anchor (object, via --data) (required) — Host (and optional entity) to summarize. + - entity_id (string) — Optional process/entity ID within the host to anchor on. Omit to anchor on the whole host. + - host_id (string) (required) — Stable ServiceMap host identifier, e.g. 'host_0123...'. Must already be known to ServiceMap. (≤128 chars) + +Response fields ('data' envelope is unwrapped — these fields are at the top level): + - anchor_entity_id (string) — Echo of the requested anchor entity ID, when one was given. + - anchor_host_id (string) (required) — Echo of the requested anchor host ID. + - authoritative (boolean) (required) — Always 'true'; the summary is only ever built from an authoritative graph. + - context_ref_detail (string) (required) — Pre-rendered natural-language evidence string summarizing this response, designed for LLM prompts. The structured fields above are the source of truth; this is a convenience rendering of them. + - coverage (object) (required) — Aggregate coverage and enrichment status for the anchor host's graph. + - capture_modes (array) — Distinct capture modes (e.g. 'ebpf') seen across loaded hosts. + - degraded_hosts (integer) (required) — Number of loaded host graphs that were degraded at collection time. + - direction (string) (required) — Always 'outbound'; ServiceMap currently only models outbound relations. [outbound] + - hosts_loaded (integer) (required) — Number of distinct host graphs loaded to answer the query. + - ipv6_only_known_listener_count (integer) — Number of IPv6 wildcard listeners with a known IPV6_V6ONLY setting. + - ipv6_only_unknown_listener_count (integer) — Number of IPv6 wildcard listeners whose IPV6_V6ONLY setting could not be determined. + - ipv6_wildcard_listener_count (integer) — Number of IPv6 wildcard (unspecified-address) listeners observed. + - kubernetes_enrichment_status (string) (required) — Aggregate Kubernetes enrichment coverage across loaded hosts. [unknown, complete, partial, unavailable] + - listener_address_family_status (string) (required) — Aggregate coverage of IPv4/IPv6 listener address-family resolution across loaded hosts. [unknown, complete, partial, unavailable] + - network_inventory_status (string) (required) — Aggregate network-inventory enrichment coverage across loaded hosts. [unknown, complete, partial, unavailable] + - reasons (array) — Machine-readable reason codes explaining any degraded or truncated state among loaded hosts. + - truncated_hosts (integer) (required) — Number of loaded host graphs that were truncated at collection time. + - freshness (object) (required) — How recent the graph data is. + - max_age_ms (integer) (required) — Age in milliseconds of the staleest graph covered, relative to now. + - newest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the most recently received graph among the hosts covered. + - oldest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the least recently received graph among the hosts covered. + - status (string) (required) — Freshness classification. [fresh, stale, unknown] + - graph_role (string) (required) — 'current' if the summary reflects the live graph; 'last_known_good' if the latest ingestion is unhealthy and this reflects the last authoritative graph instead. [current, last_known_good] + - latest_collection_authoritative (boolean) (required) — False when 'graph_role=last_known_good', i.e. the most recent collection attempt was not authoritative. + - latest_health_at_ms (integer) — Unix timestamp in milliseconds of the most recent non-authoritative health signal, when more recent than the current graph. + - neighbors (array) (required) — Up to 12 outbound relations, most informative first. + - active_connections (any) — Active connection count for this relation, when the underlying agent reports it. + - destination_ip (string) — Destination IP address. + - destination_port (integer) — Destination port. + - destination_protocol (string) — Transport protocol of the destination. [tcp, udp] + - edge_id (string) (required) — Edge ID. + - last_seen (string) — Timestamp this relation was last observed. + - resolution_status (string) (required) — Resolution outcome for this relation's destination. [resolved, ambiguous, unresolved] + - source_display_name (string) — Display name of the source node, when known. + - source_entity_id (string) (required) — Entity ID of the source node. + - target_display_name (string) — Display name of the resolved target, when known. + - target_entity_id (string) — Entity ID of the resolved target, when 'resolution_status=resolved' and unambiguous. + - target_host_id (string) — Host ID of the resolved target, when 'resolution_status=resolved' and unambiguous. + - network_scope_id (string) (required) — Network scope the summary was resolved within. + - observed_at_ms (integer) (required) — Unix timestamp in milliseconds the underlying data was observed by the agent. + - received_at_ms (integer) (required) — Unix timestamp in milliseconds the current graph generation was received by the server. + - resolution_counts (object) (required) — Counts of the anchor host's outbound relations by resolution outcome. + - ambiguous (integer) (required) — Number of edges resolved to multiple or low-confidence candidates. + - resolved (integer) (required) — Number of edges resolved to exactly one confident candidate. + - unresolved (integer) (required) — Number of edges with no resolvable candidate. + - status (string) (required) — ServiceMap collection status of the anchor host. [active, degraded, stale, initializing, disabled, unsupported, no_data] + - truncated (boolean) (required) — True if the fixed-size summary omitted any neighbor or coverage detail to stay within its bounds. + - truncation_reasons (array) — Machine-readable reasons the summary was truncated, when 'truncated=true'. +`, + Example: ` flashduty monit servicemap-summary --data '{"anchor":{"host_id":"host_0123456789abcdef0123456789abcdef"}}'`, + 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("network-scope-id") { + body["network_scope_id"] = fNetworkScopeID + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.ServiceMapSummaryRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.ServiceMap.Summary(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().StringVar(&fNetworkScopeID, "network-scope-id", "", "Optional integrity check: if set, must match the network scope already associated with 'anchor.host_id', or the request is rejected with 'InvalidParameter'.") + 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 genServiceMapTopologyCmd() *cobra.Command { + var dataJSON string + var fAt string + var fDepth int64 + var fDirection string + var fIncludeMetrics bool + var fMaxEdges int64 + var fMaxNodes int64 + var fNetworkScopeID string + var fUnresolvedMode string + cmd := &cobra.Command{ + Use: "servicemap-topology", + Short: "Get service map topology", + Long: `Get service map topology. + +Return the outbound dependency graph around a host, discovered by live network observation. + +API: POST /monit/servicemap/topology (monit-servicemap-read-topology) + +Request fields: + --at string — Time selector for the query. Only 'now' is currently supported; omitting the field behaves the same. [now] + --depth int — Maximum traversal depth from the anchor. Default 1, maximum 3. (max 3) + --direction string — Traversal direction. Only 'outbound' is currently supported; omitting the field behaves the same. [outbound] + --include-metrics bool — Whether to include the raw per-edge 'metrics' payload in the response. Default 'false'. + --max-edges int — Maximum number of edges to examine before truncating. Default 200, maximum 1000. (max 1000) + --max-nodes int — Maximum number of nodes to return before truncating. Default 100, maximum 500. (max 500) + --network-scope-id string — Optional integrity check: if set, must match the network scope already associated with 'anchor.host_id', or the request is rejected with 'InvalidParameter'. + --unresolved-mode string — How unresolved edges are projected. 'full' (default) includes them in 'edges' and 'unresolved_endpoints'; 'summary' omits them from 'edges' and returns only a bounded sample in 'unresolved_endpoints'. [summary, full] + anchor (object, via --data) (required) — Host (and optional entity) to start the traversal from. + - entity_id (string) — Optional process/entity ID within the host to anchor on. Omit to anchor on the whole host. + - host_id (string) (required) — Stable ServiceMap host identifier, e.g. 'host_0123...'. Must already be known to ServiceMap. (≤128 chars) + +Response fields ('data' envelope is unwrapped — these fields are at the top level): + - anchor_entity_id (string) — Echo of the requested anchor entity ID, when one was given. + - anchor_host_id (string) (required) — Echo of the requested anchor host ID. + - coverage (object) (required) — Aggregate coverage and enrichment status across loaded hosts. + - capture_modes (array) — Distinct capture modes (e.g. 'ebpf') seen across loaded hosts. + - degraded_hosts (integer) (required) — Number of loaded host graphs that were degraded at collection time. + - direction (string) (required) — Always 'outbound'; ServiceMap currently only models outbound relations. [outbound] + - hosts_loaded (integer) (required) — Number of distinct host graphs loaded to answer the query. + - ipv6_only_known_listener_count (integer) — Number of IPv6 wildcard listeners with a known IPV6_V6ONLY setting. + - ipv6_only_unknown_listener_count (integer) — Number of IPv6 wildcard listeners whose IPV6_V6ONLY setting could not be determined. + - ipv6_wildcard_listener_count (integer) — Number of IPv6 wildcard (unspecified-address) listeners observed. + - kubernetes_enrichment_status (string) (required) — Aggregate Kubernetes enrichment coverage across loaded hosts. [unknown, complete, partial, unavailable] + - listener_address_family_status (string) (required) — Aggregate coverage of IPv4/IPv6 listener address-family resolution across loaded hosts. [unknown, complete, partial, unavailable] + - network_inventory_status (string) (required) — Aggregate network-inventory enrichment coverage across loaded hosts. [unknown, complete, partial, unavailable] + - reasons (array) — Machine-readable reason codes explaining any degraded or truncated state among loaded hosts. + - truncated_hosts (integer) (required) — Number of loaded host graphs that were truncated at collection time. + - edges (array) (required) — Edges discovered during the traversal. Excludes unresolved edges when 'unresolved_mode=summary'. + - depth (integer) (required) — Traversal depth this edge was discovered at, relative to the anchor. + - destination (object) (required) — Destination endpoint of the connection. + - ip (string) (required) — Destination IP address. + - port (integer) (required) — Destination port. + - protocol (string) (required) — Transport protocol, 'tcp' or 'udp'. [tcp, udp] + - endpoint_resolution (object) (required) — Resolution of the destination endpoint to candidate target nodes. + - candidates (array) (required) — Candidate nodes found for this endpoint, ranked by confidence. + - confidence (number) (required) — Match confidence in '[0, 1]'; capped at 0.6 whenever more than one candidate is returned. + - effective_ip (string) (required) — Destination IP actually being resolved against this candidate. + - entity_id (string) (required) — Entity/process ID of the candidate listener. + - graph_sequence (integer) (required) — Sequence number of the graph generation this candidate was observed in. + - host_id (string) (required) — Host ID of the candidate listener. + - listener_id (string) (required) — Identifier of the matched listener. + - listener_ip (string) (required) — IP address the listener is bound to (may be a wildcard address). + - match_kind (string) (required) — How the listener matched the destination, e.g. 'exact', 'wildcard', 'wildcard_dual_stack', 'wildcard_address_family_unknown'. + - netns_id (string) (required) — Network namespace ID the candidate listener is in. + - node_display_name (string) — Display name of the candidate's owning node, when known. + - node_kind (string) — Kind of the candidate's owning node, when known. + - observed_at_ms (integer) (required) — Unix timestamp in milliseconds when the candidate's graph generation was observed by the agent. + - port (integer) (required) — Destination port. + - protocol (string) (required) — Transport protocol, 'tcp' or 'udp'. [tcp, udp] + - candidates_truncated (boolean) — True if the candidate list was cut short by an internal query budget. + - endpoint (object) (required) — The destination endpoint being resolved. + - ip (string) (required) — Destination IP address. + - port (integer) (required) — Destination port. + - protocol (string) (required) — Transport protocol, 'tcp' or 'udp'. [tcp, udp] + - reason (string) — Machine-readable reason code when 'status' is not 'resolved', e.g. 'no_current_listener', 'multiple_current_listeners', 'query_budget_exceeded'. + - status (string) (required) — Resolution outcome. 'resolved' = exactly one confident candidate; 'ambiguous' = multiple or low-confidence candidates; 'unresolved' = no candidate found. [resolved, ambiguous, unresolved] + - evidence (string) (required) — How the edge was observed, e.g. 'connect'. + - first_seen (string) — Timestamp the edge was first observed. + - host_id (string) (required) — Host the edge's source node lives on. + - id (string) (required) — Edge ID, unique within its host. + - last_seen (string) — Timestamp the edge was last observed. + - metrics (any) — Opaque per-edge metrics payload, only present when 'include_metrics=true' was requested. + - source_entity_id (string) (required) — Entity ID of the source node. + - source_netns_id (string) (required) — Network namespace ID the connection originated from. + - freshness (object) (required) — How recent the graph data is. + - max_age_ms (integer) (required) — Age in milliseconds of the staleest graph covered, relative to now. + - newest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the most recently received graph among the hosts covered. + - oldest_received_at_ms (integer) (required) — Unix timestamp in milliseconds of the least recently received graph among the hosts covered. + - status (string) (required) — Freshness classification. [fresh, stale, unknown] + - network_scope_id (string) (required) — Network scope the graph was resolved within. + - nodes (array) (required) — Nodes discovered during the traversal. + - container_name (string) — Container name, when the node runs in a container. + - display_name (string) (required) — Human-readable display name. + - executable_name (string) — Executable file name. + - first_seen (string) — Timestamp the node was first observed. + - host_id (string) (required) — Host the node was observed on. + - id (string) (required) — Entity ID of the node, unique within its host. + - identity (any) — Opaque, kind-specific identity payload. Shape depends on 'kind'. + - image_repository (string) — Container image repository. + - image_version (string) — Container image tag/version. + - instance_count (integer) — Number of instances folded into this node, when the node represents a workload replica set. + - kind (string) (required) — Node kind, e.g. 'process', 'container'. + - last_seen (string) — Timestamp the node was last observed. + - namespace (string) — Kubernetes namespace, when known. + - sample_instances (any) — Opaque sample of underlying instances folded into this node, when applicable. + - systemd_unit (string) — systemd unit name, when the node is a systemd-managed process. + - workload_name (string) — Kubernetes workload name, when known. + - observed_at_ms (integer) (required) — Unix timestamp in milliseconds the underlying data was observed by the agent (the most recent among loaded hosts). + - resolution_counts (object) (required) — Counts of edges by resolution outcome. + - ambiguous (integer) (required) — Number of edges resolved to multiple or low-confidence candidates. + - resolved (integer) (required) — Number of edges resolved to exactly one confident candidate. + - unresolved (integer) (required) — Number of edges with no resolvable candidate. + - truncated (boolean) (required) — True if any bound ('max_nodes', 'max_edges', or an internal query budget) cut the traversal short. + - truncation_reasons (array) — Machine-readable reasons the traversal was truncated, when 'truncated=true'. + - unresolved_endpoints (array) (required) — Sample or full set of edges whose destination could not be resolved, per 'unresolved_projection'. + - destination (object) (required) — Destination endpoint of the connection. + - ip (string) (required) — Destination IP address. + - port (integer) (required) — Destination port. + - protocol (string) (required) — Transport protocol, 'tcp' or 'udp'. [tcp, udp] + - edge_id (string) (required) — Edge ID, unique within its host. + - host_id (string) (required) — Host the edge's source node lives on. + - reason (string) (required) — Machine-readable reason the endpoint could not be resolved. + - source_entity_id (string) (required) — Entity ID of the source node. + - source_netns_id (string) (required) — Network namespace ID the connection originated from. + - unresolved_projection (object) (required) — How unresolved edges were projected into this response. + - by_reason (array) (required) — Breakdown of 'total' unresolved edges by reason code. + - count (integer) (required) — Number of unresolved edges with this reason. + - reason (string) (required) — Machine-readable unresolved reason code. + - mode (string) (required) — The 'unresolved_mode' that was applied. [summary, full] + - omitted (integer) (required) — Number of unresolved edges found but not returned ('total - returned'). + - returned (integer) (required) — Number of unresolved edges included in 'unresolved_endpoints'. + - total (integer) (required) — Total number of unresolved edges found, regardless of how many were returned. +`, + Example: ` flashduty monit servicemap-topology --data '{"anchor":{"host_id":"host_0123456789abcdef0123456789abcdef"},"depth":2,"include_metrics":true,"max_edges":200,"max_nodes":100,"unresolved_mode":"full"}'`, + 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("at") { + body["at"] = fAt + } + if cmd.Flags().Changed("depth") { + body["depth"] = fDepth + } + if cmd.Flags().Changed("direction") { + body["direction"] = fDirection + } + if cmd.Flags().Changed("include-metrics") { + body["include_metrics"] = fIncludeMetrics + } + if cmd.Flags().Changed("max-edges") { + body["max_edges"] = fMaxEdges + } + if cmd.Flags().Changed("max-nodes") { + body["max_nodes"] = fMaxNodes + } + if cmd.Flags().Changed("network-scope-id") { + body["network_scope_id"] = fNetworkScopeID + } + if cmd.Flags().Changed("unresolved-mode") { + body["unresolved_mode"] = fUnresolvedMode + } + return nil + }) + if err != nil { + return err + } + req := new(flashduty.ServiceMapTopologyRequest) + if err := genBindBody(body, req); err != nil { + return err + } + out, _, err := ctx.Client.ServiceMap.Topology(cmdContext(ctx.Cmd), req) + if err != nil { + return err + } + return printGenericResult(ctx, out) + }) + }, + } + cmd.Flags().StringVar(&fAt, "at", "", "Time selector for the query. Only 'now' is currently supported; omitting the field behaves the same. [now]") + cmd.Flags().Int64Var(&fDepth, "depth", 0, "Maximum traversal depth from the anchor. Default 1, maximum 3. (max 3)") + cmd.Flags().StringVar(&fDirection, "direction", "", "Traversal direction. Only 'outbound' is currently supported; omitting the field behaves the same. [outbound]") + cmd.Flags().BoolVar(&fIncludeMetrics, "include-metrics", false, "Whether to include the raw per-edge 'metrics' payload in the response. Default 'false'.") + cmd.Flags().Int64Var(&fMaxEdges, "max-edges", 0, "Maximum number of edges to examine before truncating. Default 200, maximum 1000. (max 1000)") + cmd.Flags().Int64Var(&fMaxNodes, "max-nodes", 0, "Maximum number of nodes to return before truncating. Default 100, maximum 500. (max 500)") + cmd.Flags().StringVar(&fNetworkScopeID, "network-scope-id", "", "Optional integrity check: if set, must match the network scope already associated with 'anchor.host_id', or the request is rejected with 'InvalidParameter'.") + cmd.Flags().StringVar(&fUnresolvedMode, "unresolved-mode", "", "How unresolved edges are projected. 'full' (default) includes them in 'edges' and 'unresolved_endpoints'; 'summary' omits them from 'edges' and returns only a bounded sample in 'unresolved_endpoints'. [summary, full]") + 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 registerGeneratedServiceMap(root *cobra.Command) { + gMonit := genGroup(root, "monit", "Monitors API") + genAddLeaf(gMonit, genServiceMapFleetCmd()) + genAddLeaf(gMonit, genServiceMapFleetSummaryCmd()) + genAddLeaf(gMonit, genServiceMapStatusCmd()) + genAddLeaf(gMonit, genServiceMapSummaryCmd()) + genAddLeaf(gMonit, genServiceMapTopologyCmd()) +} diff --git a/internal/skilldoc/generate.go b/internal/skilldoc/generate.go index 1431f90..3303736 100644 --- a/internal/skilldoc/generate.go +++ b/internal/skilldoc/generate.go @@ -391,7 +391,11 @@ var responseHeaderRe = regexp.MustCompile(`^Response fields \((.*)\):$`) // responseFieldRe matches one Response-fields bullet row at any indent depth, // e.g. " - account_id (integer) (required) — ..." or, one level deeper, // " - person_ids (array) ...". Capture groups: indent, name, type. -var responseFieldRe = regexp.MustCompile(`^( *)- ([a-zA-Z0-9_]+) \(([^)]*)\)`) +// +// A dot is part of the name, not a nesting separator: some responses carry +// flat wire names that contain one (e.g. session_measure.used_cnt, view.days). +// Excluding it silently dropped every such field from the rendered line. +var responseFieldRe = regexp.MustCompile(`^( *)- ([a-zA-Z0-9_.]+) \(([^)]*)\)`) // wrapperWireNames are the exact wire names cligen's own listEnvelope // (internal/cmd/cligen/main.go) treats as a paginated-list envelope field: diff --git a/internal/skilldoc/response_shape_test.go b/internal/skilldoc/response_shape_test.go index 1dc7ab6..56d2aec 100644 --- a/internal/skilldoc/response_shape_test.go +++ b/internal/skilldoc/response_shape_test.go @@ -340,3 +340,23 @@ func TestGenerateFence_ResponseShapeDedupIsPerGroupNotGlobal(t *testing.T) { t.Errorf("gadget's create must render its own full field list, not reference widget's card:\n%s", gadgetSec) } } + +// dottedWireNameLong mirrors a response whose wire names contain a dot — the +// RUM resource record reports usage as session_measure.used_cnt rather than a +// nested object. The dot is part of the key, not an indent level. +const dottedWireNameLong = `Read the account's RUM resource record. + +Response fields ('data' envelope is unwrapped — these fields are at the top level): + - account_id (integer) (required) — Account ID. + - session_measure.used_cnt (integer) (required) — Measure sessions used. + - view.days (integer) (required) — View retention in days. +` + +func TestResponseShapeLine_KeepsDottedWireNames(t *testing.T) { + got := responseShapeLine(dottedWireNameLong) + for _, want := range []string{"account_id (integer)", "session_measure.used_cnt (integer)", "view.days (integer)"} { + if !strings.Contains(got, want) { + t.Errorf("missing field %q:\n%s", want, got) + } + } +} diff --git a/skills/flashduty/reference/member.md b/skills/flashduty/reference/member.md index 5812945..29ace88 100644 --- a/skills/flashduty/reference/member.md +++ b/skills/flashduty/reference/member.md @@ -67,16 +67,16 @@ Delete member Get current member info - response: single object (`data` unwrapped to the top level) — fields: account_avatar (string); account_email (string); account_id (integer); account_locale (string); account_name (string); account_role_ids (array); account_time_zone (string); avatar (string); country_code (string); domain (string); email (string); email_verified (boolean); is_external (boolean); locale (string); member_id (integer); member_name (string); phone (string); phone_verified (boolean); status (string); time_zone (string) -### info-reset +### info-reset Reset member info -- `--avatar` string — Avatar URL -- `--country-code` string — Country code -- `--email` string — Email address -- `--locale` string — Locale · enum: zh-CN | en-US -- `` (positional, required) int64 — Member ID of the member to update -- `--member-name` string — Display name (2-39 chars) -- `--phone` string — Phone number -- `--time-zone` string — Time zone +- `--country-code` string — Country or region code used to parse phone. +- `--email` string — Email address used to identify the member. +- `--from` string — Set to 'api' to mark an updated phone or email as verified. Only takes effect when the account has member invites disabled; any other value is ignored. +- `--member-id` int64 — Member ID used to identify the member. +- `--member-name` string — Member name used to identify the member. +- `--phone` string — Phone number used to identify the member. Include country_code when the number is not in E.164 format. +- `--ref-id` string — External reference ID used to identify the member. +- body-only (`--data`): updates (object) (required) ### invite Invite members diff --git a/skills/flashduty/reference/monit.md b/skills/flashduty/reference/monit.md index 3bb5cfd..78a4fae 100644 --- a/skills/flashduty/reference/monit.md +++ b/skills/flashduty/reference/monit.md @@ -197,7 +197,7 @@ Create alert rule - `--created-at` int64 - `--creator-id` int64 - `--creator-name` string -- `--cron-pattern` string — 5-field cron schedule. +- `--cron-pattern` string — 5-field cron schedule. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead. - `--debug-log-enabled` bool - `--delay-seconds` int64 - `--description` string @@ -211,11 +211,12 @@ Create alert rule - `--name` string — Rule name. - `--repeat-interval` int64 — Notification repeat interval in seconds. - `--repeat-total` int64 — Max number of repeat notifications. +- `--timezone` string — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty. - `--updated-at` int64 - `--updater-id` int64 - `--updater-name` string - body-only (`--data`): annotations (object); enabled_times (array); labels (object); rule_configs (object) -- response: single object (`data` unwrapped to the top level) — fields: account_id (integer); annotations (object); channel_ids (array); created_at (integer); creator_id (integer); creator_name (string); cron_pattern (string); debug_log_enabled (boolean); delay_seconds (integer); description (string); description_type (string); ds_ids (array); ds_list (array); ds_type (string); enabled (boolean); enabled_times (array); folder_id (integer); id (integer); labels (object); name (string); repeat_interval (integer); repeat_total (integer); rule_configs (object); updated_at (integer); updater_id (integer); updater_name (string) +- response: single object (`data` unwrapped to the top level) — fields: account_id (integer); annotations (object); channel_ids (array); created_at (integer); creator_id (integer); creator_name (string); cron_pattern (string); debug_log_enabled (boolean); delay_seconds (integer); description (string); description_type (string); ds_ids (array); ds_list (array); ds_type (string); enabled (boolean); enabled_times (array); folder_id (integer); id (integer); labels (object); name (string); repeat_interval (integer); repeat_total (integer); rule_configs (object); timezone (string); updated_at (integer); updater_id (integer); updater_name (string) ### rule-delete Delete alert rule @@ -232,7 +233,7 @@ List available datasource types ### rule-export Export alert rules - `--ids` intSlice (required) — Rule IDs. -- response: TOP-LEVEL array — pipe `--json | jq '.[]'` (NOT `.items[]`) — fields: annotations (object); cron_pattern (string); debug_log_enabled (boolean); delay_seconds (integer); description (string); description_type (string); ds_ids (array); ds_list (array); ds_type (string); enabled (boolean); enabled_times (array); labels (object); name (string); repeat_interval (integer); repeat_total (integer); rule_configs (object) +- response: TOP-LEVEL array — pipe `--json | jq '.[]'` (NOT `.items[]`) — fields: annotations (object); cron_pattern (string); debug_log_enabled (boolean); delay_seconds (integer); description (string); description_type (string); ds_ids (array); ds_list (array); ds_type (string); enabled (boolean); enabled_times (array); labels (object); name (string); repeat_interval (integer); repeat_total (integer); rule_configs (object); timezone (string) ### rule-import Import alert rules @@ -246,7 +247,7 @@ Get alert rule detail ### rule-list-basic List alert rules - `--folder-id` int64 — Folder ID. 0 to list all accessible rules. -- response: TOP-LEVEL array — pipe `--json | jq '.[]'` (NOT `.items[]`) — fields: account_id (integer); created_at (integer); creator_id (integer); creator_name (string); cron_pattern (string); debug_log_enabled (boolean); delay_seconds (integer); ds_type (string); enabled (boolean); folder_id (integer); id (integer); labels (object); name (string); triggered (boolean); updated_at (integer); updater_id (integer); updater_name (string) +- response: TOP-LEVEL array — pipe `--json | jq '.[]'` (NOT `.items[]`) — fields: account_id (integer); created_at (integer); creator_id (integer); creator_name (string); cron_pattern (string); debug_log_enabled (boolean); delay_seconds (integer); ds_type (string); enabled (boolean); folder_id (integer); id (integer); labels (object); name (string); timezone (string); triggered (boolean); updated_at (integer); updater_id (integer); updater_name (string) ### rule-move Move alert rules to folder @@ -266,7 +267,7 @@ Update alert rule - `--created-at` int64 - `--creator-id` int64 - `--creator-name` string -- `--cron-pattern` string — 5-field cron schedule. +- `--cron-pattern` string — 5-field cron schedule. Must not start with 'CRON_TZ=' or 'TZ='; use the 'timezone' field instead. - `--debug-log-enabled` bool - `--delay-seconds` int64 - `--description` string @@ -280,6 +281,7 @@ Update alert rule - `--name` string — Rule name. - `--repeat-interval` int64 — Notification repeat interval in seconds. - `--repeat-total` int64 — Max number of repeat notifications. +- `--timezone` string — Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. 'Asia/Shanghai', 'UTC', 'Europe/London'); shortcuts and offsets such as 'Local', 'UTC+8', or 'CST' are rejected. Treated as 'Asia/Shanghai' if empty. - `--updated-at` int64 - `--updater-id` int64 - `--updater-name` string @@ -301,9 +303,56 @@ Batch update rule fields - `--ids` intSlice (required) — Rule IDs to update. - `--repeat-interval` int64 - `--repeat-total` int64 +- `--timezone` string — Timezone in which the rule executes. IANA timezone name; defaults to 'Asia/Shanghai'. - body-only (`--data`): annotations (object); enabled_times (array); labels (object) - response: same shape as `rule-import` above +### servicemap-fleet +Browse service map fleet hosts +- `--agent-versions` stringSlice — Filter to hosts on any of these exact agent versions. Up to 20 values. +- `--capture-modes` stringSlice — Filter to hosts using any of these capture modes. 'unknown' matches hosts that have not reported a capture mode yet. · enum: ebpf | polling | unknown +- `--cursor` string — Opaque pagination cursor. Pass back the exact value from a previous response's 'next_cursor'; omit for the first page. +- `--edge-clusters` stringSlice — Filter to hosts in any of these exact edge cluster names. Up to 20 values. +- `--limit` int64 — Maximum number of matching hosts to return in this page. Default 50, range 1-100. (1-100) +- `--scan-limit` int64 — Maximum number of candidate hosts to examine while filling this page. Default 1000, range 'limit'-2000. (max 2000) +- `--statuses` stringSlice — Filter to hosts currently in any of these statuses. Up to 20 values. · enum: active | degraded | stale | initializing | disabled | unsupported | no_data +- response: single object (`data` unwrapped to the top level) — fields: coverage (object); generated_at_ms (integer); items (array); next_cursor (string); partial (boolean); truncated (boolean); truncation_reasons (array) + +### servicemap-fleet-summary +Get service map fleet summary +- `--agent-versions` stringSlice — Filter to hosts on any of these exact agent versions. Up to 20 values. +- `--capture-modes` stringSlice — Filter to hosts using any of these capture modes. 'unknown' matches hosts that have not reported a capture mode yet. · enum: ebpf | polling | unknown +- `--edge-clusters` stringSlice — Filter to hosts in any of these exact edge cluster names. Up to 20 values. +- `--scan-limit` int64 — Maximum number of candidate hosts to scan. Default 2000, range 1-5000. (1-5000) +- response: single object (`data` unwrapped to the top level) — fields: coverage (object); generated_at_ms (integer); partial (boolean); scan_limit (integer); truncated (boolean); truncation_reasons (array) + +### servicemap-status +Get service map status +- `--fleet` bool — When 'true', ignore 'host_id'/'host_ids' and instead sample up to 'limit' fleet candidate hosts for the account. Default 'false'. +- `--host-id` string — A single host ID to check. Combine with 'host_ids' to check several; mutually exclusive with 'fleet=true'. (≤128 chars) +- `--host-ids` stringSlice — Multiple host IDs to check in one call, up to 200 combined with 'host_id'. Mutually exclusive with 'fleet=true'. +- `--limit` int64 — In 'fleet' mode, the number of candidate hosts to sample. Ignored otherwise. Default 100, range 1-200. (1-200) +- response: single object (`data` unwrapped to the top level) — fields: coverage (object); fleet (boolean); generated_at_ms (integer); items (array); partial (boolean) + +### servicemap-summary +Get service map summary +- `--network-scope-id` string — Optional integrity check: if set, must match the network scope already associated with 'anchor.host_id', or the request is rejected with 'InvalidParameter'. +- body-only (`--data`): anchor (object) (required) +- response: single object (`data` unwrapped to the top level) — fields: anchor_entity_id (string); anchor_host_id (string); authoritative (boolean); context_ref_detail (string); coverage (object); freshness (object); graph_role (string); latest_collection_authoritative (boolean); latest_health_at_ms (integer); neighbors (array); network_scope_id (string); observed_at_ms (integer); received_at_ms (integer); resolution_counts (object); status (string); truncated (boolean); truncation_reasons (array) + +### servicemap-topology +Get service map topology +- `--at` string — Time selector for the query. Only 'now' is currently supported; omitting the field behaves the same. · enum: now +- `--depth` int64 — Maximum traversal depth from the anchor. Default 1, maximum 3. (max 3) +- `--direction` string — Traversal direction. Only 'outbound' is currently supported; omitting the field behaves the same. · enum: outbound +- `--include-metrics` bool — Whether to include the raw per-edge 'metrics' payload in the response. Default 'false'. +- `--max-edges` int64 — Maximum number of edges to examine before truncating. Default 200, maximum 1000. (max 1000) +- `--max-nodes` int64 — Maximum number of nodes to return before truncating. Default 100, maximum 500. (max 500) +- `--network-scope-id` string — Optional integrity check: if set, must match the network scope already associated with 'anchor.host_id', or the request is rejected with 'InvalidParameter'. +- `--unresolved-mode` string — How unresolved edges are projected. 'full' (default) includes them in 'edges' and 'unresolved_endpoints'; 'summary' omits them from 'edges' and returns only a bounded sample in 'unresolved_endpoints'. · enum: summary | full +- body-only (`--data`): anchor (object) (required) +- response: single object (`data` unwrapped to the top level) — fields: anchor_entity_id (string); anchor_host_id (string); coverage (object); edges (array); freshness (object); network_scope_id (string); nodes (array); observed_at_ms (integer); resolution_counts (object); truncated (boolean); truncation_reasons (array); unresolved_endpoints (array); unresolved_projection (object) + ### store-ruleset-create Create ruleset - `--note` string (required) — Description or title of the ruleset. diff --git a/skills/flashduty/reference/rum.md b/skills/flashduty/reference/rum.md index eb514c3..73cc112 100644 --- a/skills/flashduty/reference/rum.md +++ b/skills/flashduty/reference/rum.md @@ -121,6 +121,57 @@ Query RUM data - `--start-time` int64 (required) — Start of the query window, Unix epoch milliseconds. - body-only (`--data`): queries (array) (required) +### error-ingestion-rules-create +Create an error ingestion rule +- `` (positional, required) string — RUM application ID. +- `--description` string — Rule description, up to 512 characters. (≤512 chars) +- `--rule-name` string (required) — Rule name, 1-128 characters. (1-128 chars) +- body-only (`--data`): filters (array) (required) +- response: single object (`data` unwrapped to the top level) — fields: rule_id (string); rule_name (string) + +### error-ingestion-rules-delete +Delete an error ingestion rule +- `--application-id` string (required) — RUM application ID. +- `--rule-id` string (required) — Rule ID. + +### error-ingestion-rules-disable +Disable an error ingestion rule +- `--application-id` string (required) — RUM application ID. +- `--rule-id` string (required) — Rule ID. + +### error-ingestion-rules-enable +Enable an error ingestion rule +- `--application-id` string (required) — RUM application ID. +- `--rule-id` string (required) — Rule ID. + +### error-ingestion-rules-history-list +List error ingestion rule history +- `` (positional, required) string — RUM application ID. +- `--asc` bool — Sort ascending instead of the default descending order. +- `--limit` int64 — Page size. Default 20, capped at 100; values ≤ 0 fall back to the default. (max 100) +- `--orderby` string — Sort column: 'updated_at' or 'version'. Unrecognized values fall back to 'updated_at'. +- `--page` int64 — Zero-based page number. Default 0. (min 0) +- `--search-after-ctx` string +- response: `{items: [...], has_next_page, total}` page wrapper — pipe `--json | jq '.items[]'` (NOT top-level `.[]`) — items fields: rules (array); updated_at (integer); updated_by (integer); updated_by_name (string); version (integer) + +### error-ingestion-rules-history-revert +Revert error ingestion rules to a history version +- `` (positional, required) string — RUM application ID. +- `--version` int64 (required) — History version number to revert to. (min 1) + +### error-ingestion-rules-list +List error ingestion rules +- `` (positional, required) string — RUM application ID. +- response: `{items: [...]}` page wrapper — pipe `--json | jq '.items[]'` (NOT top-level `.[]`) — items fields: created_at (integer); description (string); filters (array); rule_id (string); rule_name (string); status (string); updated_at (integer) + +### error-ingestion-rules-update +Update an error ingestion rule +- `--application-id` string (required) — RUM application ID. +- `--description` string — New rule description, up to 512 characters. Omit to leave unchanged. (≤512 chars) +- `--rule-id` string (required) — Rule ID to update. +- `--rule-name` string — New rule name, 1-128 characters. Omit to leave unchanged. (1-128 chars) +- body-only (`--data`): filters (array) + ### facet-count Count facet value distribution - `--dql` string — RUM DQL filter expression applied before counting. @@ -133,17 +184,11 @@ Count facet value distribution - body-only (`--data`): facet_value (any) - response: `{items: [...]}` page wrapper — pipe `--json | jq '.items[]'` (NOT top-level `.[]`) — items fields: count (integer); facet_value (any) -### facet-list -List RUM facet fields -- `--is-facet` bool — When true, return only facet-enabled fields. When false or omitted, return all fields. -- `--scopes` stringSlice — Filter by RUM data scopes. Valid values: 'session', 'view', 'action', 'error', 'resource', 'long_task', 'vital', 'issue', 'sourcemap'. -- response: `{items: [...]}` page wrapper — pipe `--json | jq '.items[]'` (NOT top-level `.[]`) — items fields: account_id (integer); description (string); edit_able (boolean); enum_values (array); field_key (string); field_name (string); group (string); is_facet (boolean); queryable (boolean); scopes (array); show_type (string); status (string); unit_family (string); unit_name (string); value_type (string) - ### field-list List RUM fields - `--is-facet` bool — When true, return only facet-enabled fields. When false or omitted, return all fields. - `--scopes` stringSlice — Filter by RUM data scopes. Valid values: 'session', 'view', 'action', 'error', 'resource', 'long_task', 'vital', 'issue', 'sourcemap'. -- response: same shape as `facet-list` above +- response: `{items: [...]}` page wrapper — pipe `--json | jq '.items[]'` (NOT top-level `.[]`) — items fields: account_id (integer); description (string); edit_able (boolean); enum_values (array); field_key (string); field_name (string); group (string); is_facet (boolean); queryable (boolean); scopes (array); show_type (string); status (string); unit_family (string); unit_name (string); value_type (string) ### issue-info Get issue detail @@ -169,12 +214,76 @@ List issues - `--team-ids` intSlice — Filter by team IDs. - response: `{items: [...], has_next_page, total}` page wrapper — pipe `--json | jq '.items[]'` (NOT top-level `.[]`) — items fields: age (integer); application_id (string); application_name (string); created_at (integer); error (object); error_count (integer); first_seen (object); is_crash (boolean); issue_id (string); last_seen (object); regression (object); resolved_at (integer); resolved_by (integer); service (string); session_count (integer); severity (string); status (string); suspected_cause (object); team_id (integer); updated_at (integer); versions (array) +### issue-preset-severity-rules-create +Create preset severity rule +- `` (positional, required) string — RUM application ID. +- `--description` string — Optional description, up to 512 characters. (≤512 chars) +- `--rule-name` string (required) — Rule display name, 1-128 characters. (1-128 chars) +- `--severity` string (required) — Severity to assign to errors matching this rule. · enum: Critical | Warning | Info +- body-only (`--data`): filters (array) (required) +- response: single object (`data` unwrapped to the top level) — fields: priority (integer); rule_id (string); rule_name (string) + +### issue-preset-severity-rules-delete +Delete preset severity rule +- `--application-id` string (required) — RUM application ID. +- `--rule-id` string (required) — Rule ID. + +### issue-preset-severity-rules-disable +Disable preset severity rule +- `--application-id` string (required) — RUM application ID. +- `--rule-id` string (required) — Rule ID. + +### issue-preset-severity-rules-enable +Enable preset severity rule +- `--application-id` string (required) — RUM application ID. +- `--rule-id` string (required) — Rule ID. + +### issue-preset-severity-rules-history-list +List preset severity rule history +- `` (positional, required) string — RUM application ID. +- `--asc` bool — Sort ascending when true; results are descending by default. +- `--limit` int64 — Page size. Values <= 0 default to 20; values above 100 are capped at 100. (max 100) +- `--orderby` string — Sort column. Any other value (including omitted) falls back to 'updated_at'. · enum: updated_at | version +- `--page` int64 — Zero-based page number. (min 0) +- `--search-after-ctx` string +- response: same shape as `error-ingestion-rules-history-list ` above + +### issue-preset-severity-rules-history-revert +Revert preset severity rules to a history snapshot +- `` (positional, required) string — RUM application ID. +- `--version` int64 (required) — Version number of the snapshot to revert to. (min 1) + +### issue-preset-severity-rules-list +List preset severity rules +- `` (positional, required) string — RUM application ID. +- response: `{items: [...]}` page wrapper — pipe `--json | jq '.items[]'` (NOT top-level `.[]`) — items fields: created_at (integer); description (string); filters (array); priority (integer); rule_id (string); rule_name (string); severity (string); status (string); updated_at (integer) + +### issue-preset-severity-rules-reorder +Reorder preset severity rule +- `--application-id` string (required) — RUM application ID. +- `--drag-rule-id` string (required) — ID of the rule being moved. +- `--target-rule-id` string (required) — ID of the rule whose evaluation position 'drag_rule_id' moves to. + +### issue-preset-severity-rules-update +Update preset severity rule +- `--application-id` string (required) — RUM application ID. +- `--description` string — New description, up to 512 characters. Omit to leave unchanged. (≤512 chars) +- `--rule-id` string (required) — Rule ID to update. +- `--rule-name` string — New display name, 1-128 characters. Omit to leave unchanged. (1-128 chars) +- `--severity` string — New severity. Omit to leave unchanged. · enum: Critical | Warning | Info +- body-only (`--data`): filters (array) + ### issue-update Update issue - `` (positional, required) string — Issue ID to update. - `--status` string — New status. · enum: for_review | reviewed | ignored | resolved - `--suspected-cause` string — Suspected cause. · enum: api.failed_request | network.error | code.exception | code.invalid_object_access | code.invalid_argument | unknown +### resource-info +Get RUM resource info +- `--no-cache` bool — Bypass the short-lived cache of the resource record (plan version, quotas, status) and read it from source. Does not refresh the usage counts. Default 'false'. +- response: single object (`data` unwrapped to the top level) — fields: account_id (integer); action.days (integer); created_at (integer); error.days (integer); expired_at (integer); long_task.days (integer); offering_id (integer); order_id (string); product (string); resource.days (integer); resource_id (string); resource_name (string); session.days (integer); session_investigate.free_cnt (integer); session_investigate.used_cnt (integer); session_limit_reached (boolean); session_measure.free_cnt (integer); session_measure.used_cnt (integer); session_replay.free_cnt (integer); session_replay.used_cnt (integer); status (string); updated_at (integer); version (string); view.days (integer); window_end_time (integer); window_start_time (integer) + ### session-replay-metadata Get session replay metadata - `` (positional, required) string — RUM session ID.