@@ -28,20 +28,18 @@ func newIncidentCmd() *cobra.Command {
2828 cmd .AddCommand (newIncidentGetCmd ())
2929 cmd .AddCommand (newIncidentCreateCmd ())
3030 cmd .AddCommand (newIncidentUpdateCmd ())
31- cmd .AddCommand (newIncidentAckCmd ())
32- cmd .AddCommand (newIncidentUnackCmd ())
31+ // ack, unack, wake, reopen, and disable-merge are registered via the
32+ // generated layer (positional ids fold to incident_ids; flags are a superset
33+ // of the dropped curated shadows).
3334 cmd .AddCommand (newIncidentCloseCmd ())
34- cmd .AddCommand (newIncidentWakeCmd ())
3535 cmd .AddCommand (newIncidentTimelineCmd ())
3636 cmd .AddCommand (newIncidentAlertsCmd ())
3737 cmd .AddCommand (newIncidentSimilarCmd ())
3838 cmd .AddCommand (newIncidentMergeCmd ())
3939 cmd .AddCommand (newIncidentSnoozeCmd ())
40- cmd .AddCommand (newIncidentReopenCmd ())
4140 cmd .AddCommand (newIncidentReassignCmd ())
4241 cmd .AddCommand (newIncidentAddResponderCmd ())
4342 cmd .AddCommand (newIncidentCommentCmd ())
44- cmd .AddCommand (newIncidentDisableMergeCmd ())
4543 cmd .AddCommand (newIncidentRemoveCmd ())
4644 cmd .AddCommand (newIncidentWarRoomCmd ())
4745 cmd .AddCommand (newIncidentFeedCmd ())
@@ -441,53 +439,6 @@ func newIncidentUpdateCmd() *cobra.Command {
441439 return cmd
442440}
443441
444- func newIncidentAckCmd () * cobra.Command {
445- return & cobra.Command {
446- Use : "ack <id> [<id2> ...]" ,
447- Short : "Acknowledge incidents" ,
448- Args : requireArgs ("incident_id" ),
449- RunE : func (cmd * cobra.Command , args []string ) error {
450- return runCommand (cmd , args , func (ctx * RunContext ) error {
451- if _ , err := ctx .Client .Incidents .Ack (cmdContext (ctx .Cmd ), & flashduty.AckIncidentRequest {
452- IncidentIDs : ctx .Args ,
453- }); err != nil {
454- return err
455- }
456- ctx .WriteResult (fmt .Sprintf ("Acknowledged %d incident(s)." , len (ctx .Args )))
457- return nil
458- })
459- },
460- }
461- }
462-
463- func newIncidentUnackCmd () * cobra.Command {
464- return & cobra.Command {
465- Use : "unack <id> [<id2> ...]" ,
466- Short : "Cancel incident acknowledgement" ,
467- Long : `Cancel acknowledgement for one or more incidents.
468-
469- Use this when an incident was acknowledged by mistake and should return to the
470- unacknowledged state. The command accepts up to 100 incident IDs.` ,
471- Example : ` flashduty incident unack inc_123
472- flashduty incident unack inc_123 inc_456` ,
473- Args : requireArgs ("incident_id" ),
474- RunE : func (cmd * cobra.Command , args []string ) error {
475- if err := validateIncidentIDBatch (args ); err != nil {
476- return err
477- }
478- return runCommand (cmd , args , func (ctx * RunContext ) error {
479- if _ , err := ctx .Client .Incidents .Unack (cmdContext (ctx .Cmd ), & flashduty.UnackIncidentRequest {
480- IncidentIDs : ctx .Args ,
481- }); err != nil {
482- return err
483- }
484- ctx .WriteResult (fmt .Sprintf ("Unacknowledged %d incident(s)." , len (ctx .Args )))
485- return nil
486- })
487- },
488- }
489- }
490-
491442func newIncidentCloseCmd () * cobra.Command {
492443 return & cobra.Command {
493444 Use : "close <id> [<id2> ...]" ,
@@ -507,34 +458,6 @@ func newIncidentCloseCmd() *cobra.Command {
507458 }
508459}
509460
510- func newIncidentWakeCmd () * cobra.Command {
511- return & cobra.Command {
512- Use : "wake <id> [<id2> ...]" ,
513- Short : "Restore notifications for snoozed incidents" ,
514- Long : `Wake one or more snoozed incidents.
515-
516- This cancels snooze and restores normal incident notifications. The command
517- accepts up to 100 incident IDs.` ,
518- Example : ` flashduty incident wake inc_123
519- flashduty incident wake inc_123 inc_456` ,
520- Args : requireArgs ("incident_id" ),
521- RunE : func (cmd * cobra.Command , args []string ) error {
522- if err := validateIncidentIDBatch (args ); err != nil {
523- return err
524- }
525- return runCommand (cmd , args , func (ctx * RunContext ) error {
526- if _ , err := ctx .Client .Incidents .Wake (cmdContext (ctx .Cmd ), & flashduty.WakeIncidentRequest {
527- IncidentIDs : ctx .Args ,
528- }); err != nil {
529- return err
530- }
531- ctx .WriteResult (fmt .Sprintf ("Restored notifications for %d incident(s)." , len (ctx .Args )))
532- return nil
533- })
534- },
535- }
536- }
537-
538461func newIncidentTimelineCmd () * cobra.Command {
539462 return & cobra.Command {
540463 Use : "timeline <id>" ,
@@ -784,25 +707,6 @@ func newIncidentSnoozeCmd() *cobra.Command {
784707 return cmd
785708}
786709
787- func newIncidentReopenCmd () * cobra.Command {
788- return & cobra.Command {
789- Use : "reopen <id> [<id2> ...]" ,
790- Short : "Reopen closed incidents" ,
791- Args : requireArgs ("incident_id" ),
792- RunE : func (cmd * cobra.Command , args []string ) error {
793- return runCommand (cmd , args , func (ctx * RunContext ) error {
794- if _ , err := ctx .Client .Incidents .Reopen (cmdContext (ctx .Cmd ), & flashduty.ReopenIncidentRequest {
795- IncidentIDs : ctx .Args ,
796- }); err != nil {
797- return err
798- }
799- ctx .WriteResult (fmt .Sprintf ("Reopened %d incident(s)." , len (ctx .Args )))
800- return nil
801- })
802- },
803- }
804- }
805-
806710func newIncidentReassignCmd () * cobra.Command {
807711 var person string
808712
@@ -952,31 +856,6 @@ webhook reply behavior.`,
952856 return cmd
953857}
954858
955- func newIncidentDisableMergeCmd () * cobra.Command {
956- return & cobra.Command {
957- Use : "disable-merge <id> [<id2> ...]" ,
958- Short : "Disable automatic merging for incidents" ,
959- Long : `Disable automatic alert merging for one or more incidents.
960-
961- Use this when an incident should stay isolated and must not absorb additional
962- matching alerts automatically. The command accepts up to 100 incident IDs.` ,
963- Example : ` flashduty incident disable-merge inc_123
964- flashduty incident disable-merge inc_123 inc_456` ,
965- Args : requireArgs ("incident_id" ),
966- RunE : func (cmd * cobra.Command , args []string ) error {
967- return runCommand (cmd , args , func (ctx * RunContext ) error {
968- if _ , err := ctx .Client .Incidents .DisableMerge (cmdContext (ctx .Cmd ), & flashduty.DisableIncidentMergeRequest {
969- IncidentIDs : ctx .Args ,
970- }); err != nil {
971- return err
972- }
973- ctx .WriteResult (fmt .Sprintf ("Disabled auto-merge for %d incident(s)." , len (ctx .Args )))
974- return nil
975- })
976- },
977- }
978- }
979-
980859func newIncidentRemoveCmd () * cobra.Command {
981860 var force bool
982861
0 commit comments