MCPcopy Create free account
hub / github.com/algolia/cli / printDryRunSummary

Function printDryRunSummary

pkg/cmd/application/create/create.go:145–174  ·  view source on GitHub ↗

printDryRunSummary prints what would be created without sending anything.

(opts *CreateOptions)

Source from the content-addressed store, hash-verified

143
144// printDryRunSummary prints what would be created without sending anything.
145func printDryRunSummary(opts *CreateOptions) error {
146 name, err := resolveName(opts)
147 if err != nil {
148 return err
149 }
150
151 planLabel := opts.Plan
152 if planLabel == "" {
153 planLabel = dashboard.PlanTypeFree
154 }
155 summary := map[string]any{
156 "action": "create_application",
157 "name": name,
158 "region": opts.Region,
159 "plan": planLabel,
160 "default": opts.Default,
161 "dryRun": true,
162 }
163 return cmdutil.PrintRunSummary(
164 opts.IO,
165 opts.PrintFlags,
166 summary,
167 fmt.Sprintf(
168 "Dry run: would create application %q in region %q on the %q plan",
169 name,
170 opts.Region,
171 planLabel,
172 ),
173 )
174}
175
176// createResult carries what the creation flow produced, for telemetry.
177type createResult struct {

Callers 1

runCreateCmdFunction · 0.85

Calls 2

PrintRunSummaryFunction · 0.92
resolveNameFunction · 0.85

Tested by

no test coverage detected