Skip to content

Commit f18611f

Browse files
authored
DOCSP-12182: [mongocli] OM maintenanceWindow commands (#264)
1 parent eeb16ad commit f18611f

8 files changed

+735
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.. list-table::
2+
:widths: 15 10 75
3+
:header-rows: 1
4+
:stub-columns: 1
5+
6+
* - Name
7+
- Type
8+
- Description
9+
10+
* - ``id``
11+
- string
12+
- Unique identifier of the maintenance window.
13+
14+
* - ``groupId``
15+
- string
16+
- Unique identifier of the project to which this maintenance window
17+
applies.
18+
19+
* - ``created``
20+
- string
21+
- |iso8601-time| when the maintenance window was created.
22+
23+
* - ``updated``
24+
- string
25+
- |iso8601-time| when the maintenance window was last updated.
26+
27+
* - ``startDate``
28+
- string
29+
- |iso8601-time| when the maintenance window starts.
30+
31+
* - ``endDate``
32+
- string
33+
- |iso8601-time| when the maintenance window ends.
34+
35+
* - ``alertTypeNames``
36+
- array of strings
37+
- Alert types to silence during maintenance window. For example:
38+
``HOST``, ``REPLICA_SET``, ``CLUSTER``, ``AGENT``, ``BACKUP``
39+
40+
* - ``description``
41+
- string
42+
- Description of the maintenance window. This field is returned
43+
only if you provided a description of the maintenance window.

source/reference/ops-manager.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Ops Manager ``mongocli`` Commands
3434
:ref:`log <mcli-reference-om-log>`
3535
Starts and retrieves log collection jobs for a project.
3636

37+
:ref:`maintenance window <mcli-reference-om-maintenanceWindow>`
38+
Manage your |mms| :opsmgr:`maintenance window
39+
</reference/api/maintenance-windows>`.
40+
3741
:ref:`metric <mcli-reference-om-metric>`
3842
Lists metrics for MongoDB processes on a specified host.
3943

@@ -65,6 +69,7 @@ Ops Manager ``mongocli`` Commands
6569
Diagnostic Archives </reference/ops-manager/diagnose-archive-commands>
6670
Events </reference/ops-manager/event-commands>
6771
Logs </reference/ops-manager/log-commands>
72+
Maintenance Window </reference/ops-manager/maintenanceWindow-commands>
6873
Metrics </reference/ops-manager/metric-commands>
6974
Owner </reference/ops-manager/owner-commands>
7075
Process </reference/ops-manager/process-commands>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. _mcli-reference-om-maintenanceWindow:
2+
3+
=======================================
4+
Ops Manager Maintenance Window Commands
5+
=======================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. toctree::
10+
:titlesonly:
11+
12+
Create a Maintenance Window </reference/ops-manager/maintenanceWindow-create>
13+
List Maintenance Windows </reference/ops-manager/maintenanceWindow-list>
14+
Describe a Maintenance Window </reference/ops-manager/maintenanceWindow-describe>
15+
Update a Maintenance Window </reference/ops-manager/maintenanceWindow-update>
16+
Delete a Maintenance Window </reference/ops-manager/maintenanceWindow-delete>
17+
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
.. _mcli-om-maintenanceWindow-create-command:
2+
3+
=============================================
4+
mongocli ops-manager maintenanceWindow create
5+
=============================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
The ``maintenanceWindow create`` command creates one |mms|
16+
:opsmgr:`maintenance window </reference/api/maintenance-windows>`
17+
for the specified project. You can also create a maintenance window
18+
through the :opsmgr:`API </reference/api/maintenance-windows-create-one/>`.
19+
20+
.. _mcli-om-maintenanceWindow-create-syntax:
21+
22+
Syntax
23+
------
24+
25+
.. code-block:: text
26+
27+
mongocli ops-manager|om maintenanceWindow create
28+
--startDate <start-date>
29+
--endDate <end-date>
30+
--alertType <alert-type>
31+
[ --desc <description> ]
32+
[ --output|-o <output-format> ]
33+
[ --profile|-P <profile-name> ]
34+
[ --projectId <project-ID> ]
35+
36+
.. _mcli-om-maintenanceWindow-create-options:
37+
38+
Options
39+
-------
40+
41+
.. list-table::
42+
:header-rows: 1
43+
:widths: 20 10 60 10
44+
45+
* - Option
46+
- Type
47+
- Description
48+
- Required?
49+
50+
* - ``--startDate``
51+
- string
52+
- Timestamp in ``ISO 8601`` date and time format in UTC when the
53+
maintenance window starts.
54+
- yes
55+
56+
* - ``--endDate``
57+
- string
58+
- Timestamp in ``ISO 8601`` date and time format in UTC when the
59+
maintenance window ends.
60+
- yes
61+
62+
* - ``--alertType``
63+
- string
64+
- Comma-separated list of alert types to silence during maintenance
65+
window. For example: ``HOST,REPLICA_SET,CLUSTER,AGENT,BACKUP``
66+
- yes
67+
68+
* - ``--desc``
69+
- string
70+
- Description of the maintenance window.
71+
- no
72+
73+
* - ``--output``, ``-o``
74+
- string
75+
- .. include:: /includes/extracts/fact-basic-options-output.rst
76+
- no
77+
78+
* - ``--profile``, ``-P``
79+
- string
80+
- Name of the profile where the public and private
81+
keys for the project are saved. If omitted, uses the
82+
{+default-profile+}. To learn more about creating a
83+
profile, see :ref:`mcli-configure`.
84+
- no
85+
86+
* - ``--projectId``
87+
- string
88+
- Unique identifier of the project that contains the
89+
cluster. If omitted, uses the project ID in the profile or
90+
:ref:`environment variable <mcli-env-var>`.
91+
- no
92+
93+
.. _mcli-om-maintenanceWindow-create-output:
94+
95+
Output
96+
------
97+
98+
.. include:: /includes/command-output-intro.rst
99+
100+
.. tabs::
101+
102+
.. tab:: Default
103+
:tabid: default
104+
105+
.. code-block:: none
106+
:copyable: false
107+
108+
Maintenance window <window-id> successfully created.
109+
110+
.. tab:: JSON
111+
:tabid: json
112+
113+
.. include:: /includes/maintenance-window-response.rst
114+
115+
Example
116+
-------
117+
118+
The following example uses the ``mongocli om maintenanceWindow
119+
create`` command to create a maintenance window. It uses a profile called
120+
``myOm`` and specifies JSON output.
121+
122+
.. code-block:: none
123+
124+
mongocli om maintenanceWindow create \
125+
--startDate 2020-10-23T22:00:00Z \
126+
--endDate 2020-10-24T22:00:00Z \
127+
--alertType HOST,BACKUP \
128+
--desc "One-day maintenance window" \
129+
-P myOm -o json
130+
131+
The above command produces the following output. For more information about
132+
these fields, see :ref:`Output <mcli-om-maintenanceWindow-create-output>`.
133+
134+
.. code-block:: json
135+
:copyable: false
136+
137+
{
138+
"id": "5f7cb0eec902201990cb1506",
139+
"groupId": "5f1f39ffc902201990f53873",
140+
"created": "2020-10-06T18:01:18Z",
141+
"startDate": "2020-10-23T22:00:00Z",
142+
"endDate": "2020-10-24T22:00:00Z",
143+
"updated": "2020-10-06T18:05:29Z",
144+
"alertTypeNames": [
145+
"BACKUP",
146+
"HOST"
147+
],
148+
"description": "One-day maintenance window"
149+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
.. _mcli-om-maintenanceWindow-delete-command:
2+
3+
=============================================
4+
mongocli ops-manager maintenanceWindow delete
5+
=============================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
The ``maintenanceWindow delete`` command deletes one |mms|
16+
:opsmgr:`maintenance window </reference/api/maintenance-windows>`
17+
specified by ID. You can also delete a maintenance window
18+
through the :opsmgr:`API </reference/api/maintenance-windows-delete-one/>`.
19+
20+
.. _mcli-om-maintenanceWindow-delete-syntax:
21+
22+
Syntax
23+
------
24+
25+
.. code-block:: text
26+
27+
mongocli ops-manager|om maintenanceWindow delete <window-id>
28+
[ --force ]
29+
[ --profile|-P <profile-name> ]
30+
[ --projectId <project-ID> ]
31+
32+
Arguments
33+
---------
34+
35+
.. list-table::
36+
:header-rows: 1
37+
:widths: 20 10 60 10
38+
39+
* - Argument
40+
- Type
41+
- Description
42+
- Required?
43+
44+
* - ``<maintenance-window-id>``
45+
- string
46+
- Unique identifier of the maintenance window that you
47+
want to delete.
48+
- yes
49+
50+
.. _mcli-om-maintenanceWindow-delete-options:
51+
52+
Options
53+
-------
54+
55+
.. list-table::
56+
:header-rows: 1
57+
:widths: 20 10 60 10
58+
59+
* - Option
60+
- Type
61+
- Description
62+
- Required?
63+
64+
* - ``--force``
65+
-
66+
- Flag that indicates that the maintenance window can
67+
be deleted without requiring confirmation.
68+
- no
69+
70+
* - ``--profile``, ``-P``
71+
- string
72+
- Name of the profile where the public and private
73+
keys for the project are saved. If omitted, uses the
74+
{+default-profile+}. To learn more about creating a
75+
profile, see :ref:`mcli-configure`.
76+
- no
77+
78+
* - ``--projectId``
79+
- string
80+
- Unique identifier of the project that contains the
81+
cluster. If omitted, uses the project ID in the profile or
82+
:ref:`environment variable <mcli-env-var>`.
83+
- no
84+
85+
.. _mcli-om-maintenanceWindow-delete-output:
86+
87+
Output
88+
------
89+
90+
.. code-block:: none
91+
:copyable: false
92+
93+
Maintenance window <window-id> successfully deleted.
94+
95+
Example
96+
-------
97+
98+
The following example uses the ``mongocli om maintenanceWindow
99+
delete`` command to delete a maintenance window with ID
100+
``5f7cb0eec902201990cb1506``. It uses a profile called ``myOm``.
101+
102+
.. code-block:: none
103+
104+
mongocli om maintenanceWindow delete 5f7cb0eec902201990cb1506 --force -P myOm

0 commit comments

Comments
 (0)