Summary:
Edit customer default alert and smtp settings:
```
yba alert control -h
Manage default alert controls
Usage:
yba alert control [flags]
Aliases:
control, health
Flags:
--callhome-level string [Optional] Manage callhome level. Allowed values: none, low, medium, high.
--health-check-interval int [Optional] Health check intervals in minutes. Value below 5 minutes is not allowed. (default 5)
--active-alert-notification-interval int [Optional] Period which is used to send active alert notifications in minutes.
--email-alerts string [Optional] Manage email notifications. Allowed values: enable, disable.
--default-recipients stringArray [Optional] Edit default recipients for email notifications. Can be provided as separate flags or as comma-separated values. Required when email-alerts is enabled.
--send-emails-to-yb-team [Optional] Send emails to YugabyteDB team. (default false)
--email-from string [Optional] Email address to send alerts from. Required when email-alerts is enabled
--smtp-server string [Optional] SMTP server address. Required when email-alerts is enabled
--smtp-port int [Optional] SMTP server port. Required when email-alerts is enabled (default -1)
--smtp-username string [Optional] SMTP server username.
--smtp-password string [Optional] SMTP server password.
--use-ssl [Optional] Use SSL for SMTP connection. (default false)
--use-tls [Optional] Use TLS for SMTP connection. (default false)
--health-check-email-interval int [Optional] Period between health check email notifications in minutes.
--include-only-errors-in-email [Optional] Include only errors in email notifications. (default false)
-h, --help help for control
```
Maintenance window commands:
```
yba alert maintenance-window
Manage YugabyteDB Anywhere maintenance window
Usage:
yba alert maintenance-window [flags]
yba alert maintenance-window [command]
Aliases:
maintenance-window, maintenancewindow
Available Commands:
create Create a maintenance window to suppress alerts
delete Delete a YugabyteDB Anywhere maintenance window
describe Describe a YugabyteDB Anywhere maintenance window
list List YugabyteDB Anywhere maintenance windows
```
List:
```
yba alert maintenance-window list -h
List YugabyteDB Anywhere maintenance windows
Usage:
yba alert maintenance-window list [flags]
Aliases:
list, ls
Examples:
yba alert maintenance-window list
Flags:
-n, --name string [Optional] Name of the maintenance window.
--states string [Optional] Comma separaed list of state of the maintenance window. Allowed values: active, pending, finished.
--uuids string [Optional] Comma separated list of UUIDs of the maintenance window.
-h, --help help for list
```
Describe:
```
yba alert maintenance-window describe -h
Describe a YugabyteDB Anywhere maintenance window
Usage:
yba alert maintenance-window describe [flags]
Aliases:
describe, get
Examples:
yba alert maintenance-window describe --uuid <maintenance-window-uuid>
Flags:
-u, --uuid string [Required] UUID of the maintenance window.
-h, --help help for describe
```
Delete:
```
yba alert maintenance-window delete -h
Delete a YugabyteDB Anywhere maintenance window
Usage:
yba alert maintenance-window delete [flags]
Aliases:
delete, remove, rm
Examples:
yba alert maintenance-window delete --uuid <maintenance-window-uuid>
Flags:
-u, --uuid string [Required] UUID of the maintenance window.
-f, --force [Optional] Bypass the prompt for non-interactive usage.
-h, --help help for delete
Global Flags:
-a, --apiToken string YugabyteDB Anywhere api token.
--config string Config file, defaults to $HOME/.yba-cli.yaml
--debug Use debug mode, same as --logLevel debug.
--disable-color Disable colors in output. (default false)
-H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000")
-l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
-o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table")
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s)
--wait Wait until the task is completed, otherwise it will exit immediately. (default true)
```
Create:
```
yba alert maintenance-window create -h
Create a maintenance window to suppress alerts
Usage:
yba alert maintenance-window create [flags]
Aliases:
create, add
Flags:
-n, --name string [Required] Name of the maintenance window.
--description string [Required] Description of the maintenance window.
--start-time string [Required] ISO 8601 (YYYY-MM-DDTHH:MM:SSZ) format for start time of the maintenance window.
--end-time string [Required] ISO 8601 (YYYY-MM-DDTHH:MM:SSZ) format for end time of the maintenance window.
--alert-target-uuids string [Optional] Comma separated list of universe UUIDs to suppress alerts. If left empty, suppress alerts on all the universes (including future universes).
--health-check-universe-uuids string [Optional] Comma separated list of universe UUIDs to suppress health checks. If left empty, suppress health check notifications on all the universes (including future universes).
-h, --help help for create
Global Flags:
-a, --apiToken string YugabyteDB Anywhere api token.
--config string Config file, defaults to $HOME/.yba-cli.yaml
--debug Use debug mode, same as --logLevel debug.
--disable-color Disable colors in output. (default false)
-H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000")
-l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
-o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table")
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s)
--wait Wait until the task is completed, otherwise it will exit immediately. (default true)
```
Update:
```
yba alert maintenance-window update -h
Update a maintenance window to suppress alerts
Usage:
yba alert maintenance-window update [flags]
Aliases:
update, edit
Flags:
-u, --uuid string [Required] UUID of the maintenance window.
--name string [Optional] Update name of the maintenance window.
--description string [Optional] Update description of the maintenance window.
--start-time string [Optional] Update ISO 8601 (YYYY-MM-DDTHH:MM:SSZ) format for start time of the maintenance window.
--end-time string [Optional] UpdateISO 8601 (YYYY-MM-DDTHH:MM:SSZ) format for end time of the maintenance window.
--alert-target-uuids string [Optional] Update comma separated list of universe UUIDs to suppress alerts. If left empty, suppress alerts on all the universes (including future universes).
--health-check-universe-uuids string [Optional] Update comma separated list of universe UUIDs to suppress health checks. If left empty, suppress health check notifications on all the universes (including future universes).
--mark-as-complete [Optional] Mark the maintenance window as complete.
-h, --help help for update
Global Flags:
-a, --apiToken string YugabyteDB Anywhere api token.
--config string Config file, defaults to $HOME/.yba-cli.yaml
--debug Use debug mode, same as --logLevel debug.
--disable-color Disable colors in output. (default false)
-H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000")
-l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
-o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table")
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s)
--wait Wait until the task is completed, otherwise it will exit immediately. (default true)
```
Test Plan:
List:
```
yba alert maintenance-window ls
Name UUID Start Time End Time State
dkumar-ui e5a7fc41-75d1-40b8-b4a9-db526ae28035 Thu, 20 Mar 2025 16:08:19 +0000 Thu, 20 Mar 2025 16:08:28 +0000 FINISHED
dkumar-cli d7d97084-fc00-4619-8829-f169254719bc Thu, 20 Mar 2025 11:09:42 +0000 Thu, 20 Mar 2025 11:14:42 +0000 FINISHED
My Maintenance Window 9dd8e1dc-a9ad-466c-a8c2-4d777d7b8848 Sun, 06 Nov 2022 06:55:00 +0000 Sun, 06 Nov 2022 07:30:00 +0000 FINISHED
Maintenance packs d0734d3f-fdeb-415f-b52c-c66f97714617 Thu, 03 Nov 2022 01:59:00 +0000 Thu, 03 Nov 2022 02:05:43 +0000 FINISHED
test 92d5d3ad-c06a-49dd-9004-d6918d00e9e1 Mon, 08 Aug 2022 19:38:41 +0000 Mon, 08 Aug 2022 22:09:51 +0000 FINISHED
test 83a45ae6-e4c2-42c2-b320-ae1fc6d21fcd Mon, 21 Mar 2022 17:55:54 +0000 Tue, 22 Mar 2022 03:55:36 +0000 FINISHED
Test dcb0ba8a-479d-4457-b304-3d21317a4486 Thu, 10 Mar 2022 11:03:56 +0000 Fri, 11 Mar 2022 11:34:56 +0000 FINISHED
Maintenance 19069663-333d-4d75-a71e-36fad2bc708c Tue, 22 Feb 2022 23:29:56 +0000 Tue, 22 Feb 2022 23:50:59 +0000 FINISHED
Maintenance Window Test 856d389d-585b-4643-bf7b-0a7f8a5c8af2 Fri, 18 Feb 2022 21:27:10 +0000 Sun, 20 Feb 2022 21:40:00 +0000 FINISHED
Demo AMW ef3116ff-a76c-440d-9270-e3b69da75c3e Wed, 02 Feb 2022 12:30:10 +0000 Mon, 21 Mar 2022 17:55:40 +0000 FINISHED
Test Window a50cde82-baf1-4dae-9a7e-e515a87c7965 Mon, 24 Jan 2022 06:56:47 +0000 Mon, 24 Jan 2022 07:07:55 +0000 FINISHED
Maintenance window Test 08fa2030-a095-4f25-940e-0cf44f8da685 Wed, 19 Jan 2022 15:01:00 +0000 Thu, 20 Jan 2022 15:01:00 +0000 FINISHED
```
Describe:
```
yba alert maintenance-window get --uuid d7d97084-fc00-4619-8829-f169254719bc
General
Name UUID Start Time End Time State
dkumar-cli d7d97084-fc00-4619-8829-f169254719bc Thu, 20 Mar 2025 11:09:42 +0000 Thu, 20 Mar 2025 11:14:42 +0000 FINISHED
Create Time Description
Thu, 20 Mar 2025 12:00:11 +0000 testing cli
Suppress Alerts For Universes
Suppressed for All Universes
Suppress Health Check For Universes
Suppressed for All Universes
```
Delete:
```
yba alert maintenance-window rm --uuid 54222e51-ce1f-4e72-b9ef-a0dfbf8446ce
```
Reviewers: amalyshev
Reviewed By: amalyshev
Differential Revision: https://phorge.dev.yugabyte.com/D42621