You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// --owner-id, --title, --data) mirrors the generated command byte-for-byte via
289
+
// the same genAssembleBody/genBindBody request-building helpers, so this is a
290
+
// pure flag-source swap, not a behavior change. Registering it here (curated
291
+
// commands are added before registerGenerated runs, see root.go) makes
292
+
// genAddLeaf skip attaching the generated "merge" leaf under this same name.
293
+
funcnewAlertMergeCmd() *cobra.Command {
294
+
vardataJSONstring
295
+
varfAlertIDs []string
296
+
varfCommentFilestring
297
+
varfIncidentIDstring
298
+
varfOwnerIDint64
299
+
varfTitlestring
300
+
301
+
cmd:=&cobra.Command{
302
+
Use: "merge <alert-id> [<id2>...]",
303
+
Short: "Merge alerts into an incident",
304
+
Long: `Merge alerts into an incident.
305
+
306
+
Associate one or more alerts with an existing incident. If a source alert previously belonged to a different incident and that incident becomes empty after the merge, it will be automatically closed.
307
+
308
+
An optional comment on the merge action is read verbatim from --comment-file
309
+
(or from stdin, when the value is "-"); it is never parsed by a shell, so
310
+
backticks, $(...), and quotes inside it reach the API exactly as written.
311
+
312
+
API: POST /alert/merge (alert-write-merge)
313
+
314
+
Request fields:
315
+
--alert-ids []string (required) — Alert IDs to merge.
316
+
--comment-file string — Path to a file containing an optional comment on the merge action (- reads stdin).
cmd.Flags().Int64Var(&fOwnerID, "owner-id", 0, "Optional new owner for the target incident.")
374
+
cmd.Flags().StringVar(&fTitle, "title", "", "Optional new title for the target incident.")
375
+
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.")
376
+
377
+
returncmd
378
+
}
379
+
283
380
// resolveAlertFeedOperators resolves the actor (creator) person IDs of
284
381
// alert-feed items to display names via /person/infos, replicating the
285
382
// operator-name enrichment the legacy SDK did server-side. Best-effort: a
0 commit comments