mongocli ops-manager maintenanceWindow update
The maintenanceWindow update
command updates the configuration of
one Ops Manager
maintenance window
for the specified project. You can also update the configuration of a
maintenance window through the API.
Syntax
mongocli ops-manager|om maintenanceWindow update <maintenance-window-id> --startDate <start-date> --endDate <end-date> --alertType <alert-type> [ --desc <description> ] [ --output|-o <output-format> ] [ --profile|-P <profile-name> ] [ --projectId <project-ID> ]
Arguments
Argument | Type | Description | Required? |
---|---|---|---|
<maintenance-window-id> | string | Unique identifier of the maintenance window that you
want to update. | yes |
Options
Option | Type | Description | Required? |
---|---|---|---|
--startDate | string | Timestamp in ISO 8601 date and time format in UTC when the
maintenance window starts. | yes |
--endDate | string | Timestamp in ISO 8601 date and time format in UTC when the
maintenance window ends. | yes |
--alertType | string | Comma-separated list of alert types to silence during maintenance
window. For example: HOST,REPLICA_SET,CLUSTER,AGENT,BACKUP | yes |
--desc | string | Description of the maintenance window. | no |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
--profile , -P | string | Name of the profile where the public and private
keys for the project are saved. If omitted, uses the
default profile. To learn more about creating a
profile, see Configure the MongoDB CLI. | no |
--projectId | string | Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable. | no |
Output
The command prints the following fields in the specified format to the terminal if the command succeeds. If the command prints an error, see Troubleshooting for recommended solutions.
Maintenance window <window-id> succesfully updated.
Name | Type | Description |
---|---|---|
id | string | Unique identifier of the maintenance window. |
groupId | string | Unique identifier of the project to which this maintenance window
applies. |
created | string | Timestamp in ISO 8601 date and time format in UTC when the maintenance window was created. |
updated | string | Timestamp in ISO 8601 date and time format in UTC when the maintenance window was last updated. |
startDate | string | Timestamp in ISO 8601 date and time format in UTC when the maintenance window starts. |
endDate | string | Timestamp in ISO 8601 date and time format in UTC when the maintenance window ends. |
alertTypeNames | array of strings | Alert types to silence during maintenance window. For example:
HOST , REPLICA_SET , CLUSTER , AGENT , BACKUP |
description | string | Description of the maintenance window. This field is returned
only if you provided a description of the maintenance window. |
Example
The following example uses the mongocli om maintenanceWindow
update
command to update the maintenance window with ID
5f7cb0eec902201990cb1506
. It uses a profile called myOm
and
specifies JSON output.
mongocli om maintenanceWindow update 5f7cb0eec902201990cb1506 \ --startDate 2020-10-23T22:00:00Z \ --endDate 2020-10-24T22:00:00Z \ --alertType HOST,BACKUP \ --desc "One-day maintenance window" \ -P myOm -o json
The above command produces the following output. For more information about these fields, see Output.
{ "id": "5f7cb0eec902201990cb1506", "groupId": "5f1f39ffc902201990f53873", "created": "2020-10-06T18:01:18Z", "startDate": "2020-10-23T22:00:00Z", "endDate": "2020-10-24T22:00:00Z", "updated": "2020-10-06T18:05:29Z", "alertTypeNames": [ "BACKUP", "HOST" ], "description": "One-day maintenance window" }