Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion internal/monitors/monitor_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ func GetMonitorsApplyCmd() *cli.Command {
Name: "apply",
Usage: "Create or update monitors",
Description: `Creates or updates monitors according to the OpenStatus configuration file.
Compares your openstatus.yaml with the current state and applies changes.`,
Compares your openstatus.yaml with the current state and applies changes.

DEPRECATED: this command is deprecated. Prefer managing your monitors with Terraform via 'openstatus terraform generate'.`,
UsageText: `openstatus monitors apply
openstatus monitors apply --config custom.yaml -y
openstatus monitors apply --dry-run`,
Expand Down Expand Up @@ -143,6 +145,7 @@ Compares your openstatus.yaml with the current state and applies changes.`,
if err != nil {
return cli.Exit(err.Error(), 1)
}
fmt.Fprintln(os.Stderr, "Warning: this command is deprecated. Prefer managing your monitors with Terraform via 'openstatus terraform generate'.")

path := cmd.String("config")

Expand Down
3 changes: 2 additions & 1 deletion internal/monitors/monitor_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,13 @@ func GetMonitorImportCmd() *cli.Command {
Usage: "Import all your monitors",
UsageText: `openstatus monitors import
openstatus monitors import --output monitors.yaml`,
Description: "Import all your monitors from your workspace to a YAML file; it will also create a lock file to manage your monitors with 'apply'.",
Description: "Import all your monitors from your workspace to a YAML file; it will also create a lock file to manage your monitors with 'apply'.\n\nDEPRECATED: the monitors.yaml config file is deprecated for import. Prefer managing monitors declaratively with 'openstatus monitors apply'.",
Action: func(ctx context.Context, cmd *cli.Command) error {
apiKey, err := auth.ResolveAccessToken(cmd)
if err != nil {
return cli.Exit(err.Error(), 1)
}
fmt.Fprintln(os.Stderr, "Warning: the monitors.yaml config file is deprecated for import. Prefer managing monitors declaratively with 'openstatus monitors apply'.")
s := output.StartSpinner("Importing monitors...")
client := NewMonitorClient(apiKey)
err = ExportMonitor(ctx, client, cmd.String("output"))
Expand Down
Loading