MCPcopy Create free account
hub / github.com/compozy/agh / runSupportBundleCommand

Function runSupportBundleCommand

internal/cli/support.go:80–112  ·  view source on GitHub ↗
(cmd *cobra.Command, deps commandDeps, opts supportBundleOptions)

Source from the content-addressed store, hash-verified

78}
79
80func runSupportBundleCommand(cmd *cobra.Command, deps commandDeps, opts supportBundleOptions) error {
81 confirmed, err := confirmSupportBundleCreation(cmd, opts.yes)
82 if err != nil {
83 return err
84 }
85 client, err := clientFromDeps(deps)
86 if err != nil {
87 return err
88 }
89 includeStatus := !opts.noStatus
90 created, err := client.CreateSupportBundle(cmd.Context(), CreateSupportBundleRequest{
91 Yes: confirmed,
92 IncludeStatus: &includeStatus,
93 })
94 if err != nil {
95 return err
96 }
97 operation, err := waitForSupportBundle(cmd.Context(), deps, client, created.OperationID)
98 if err != nil {
99 return err
100 }
101 path, err := resolveSupportBundleOutputPath(deps, opts.outputPath, operation)
102 if err != nil {
103 return err
104 }
105 if err := downloadSupportBundle(cmd.Context(), client, operation.OperationID, path); err != nil {
106 return err
107 }
108 return writeSupportBundleResult(cmd, supportBundleResult{
109 Operation: operation,
110 Path: path,
111 })
112}
113
114func confirmSupportBundleCreation(cmd *cobra.Command, yes bool) (bool, error) {
115 if yes {

Callers 1

newSupportBundleCommandFunction · 0.85

Calls 7

clientFromDepsFunction · 0.85
writeSupportBundleResultFunction · 0.85
waitForSupportBundleFunction · 0.70
downloadSupportBundleFunction · 0.70
CreateSupportBundleMethod · 0.65

Tested by

no test coverage detected