Skip to content

Commit a0fe1e9

Browse files
authored
(DOCSP-37380) Updates all remaining config file pages to template (#358)
* (DOCSP-37380) Updates all remaining config file pages to template * Adds second action template * Tests replacements on cluster page * Updates clusters page * Changes OA, alert pages * Fixes error * Fix template issue
1 parent 88fe158 commit a0fe1e9

9 files changed

+220
-546
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Follow these steps to |action 2| with a configuration file:
2+
3+
.. procedure::
4+
:style: normal
5+
6+
.. step:: Copy the sample request for |openapi-link 2|.
7+
8+
a. Navigate to the |openapi-link 2|
9+
section of the |service| Admin API specification.
10+
b. Under :guilabel:`Request samples` on the right side, click
11+
:guilabel:`Expand all`.
12+
c. Click :guilabel:`Copy` to copy the sample request.
13+
14+
.. step:: Create the configuration file.
15+
16+
a. Paste the sample request into a text editor and change
17+
the values to reflect your desired configuration.
18+
b. Save the file with a ``.json`` extension.
19+
20+
.. step:: Run the |atlas-cli command 2| command with
21+
the ``--file`` option.
22+
23+
Specify the path to the file you saved with the ``--file`` flag.
24+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Follow these steps to |action 3| with a configuration file:
2+
3+
.. procedure::
4+
:style: normal
5+
6+
.. step:: Copy the sample request for |openapi-link 3|.
7+
8+
a. Navigate to the |openapi-link 3|
9+
section of the |service| Admin API specification.
10+
b. Under :guilabel:`Request samples` on the right side, click
11+
:guilabel:`Expand all`.
12+
c. Click :guilabel:`Copy` to copy the sample request.
13+
14+
.. step:: Create the configuration file.
15+
16+
a. Paste the sample request into a text editor and change
17+
the values to reflect your desired configuration.
18+
b. Save the file with a ``.json`` extension.
19+
20+
.. step:: Run the |atlas-cli command 3| command with
21+
the ``--file`` option.
22+
23+
Specify the path to the file you saved with the ``--file`` flag.
24+

source/reference/json/alert-config-file.txt

Lines changed: 27 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -10,104 +10,49 @@ Alert Configuration File
1010
:depth: 1
1111
:class: singlecol
1212

13-
You can use a configuration file to specify the
14-
settings for :ref:`creating <atlas-alerts-settings-create>`
15-
or :ref:`updating <atlas-alerts-settings-update>` an alert
16-
configuration through the {+atlas-cli+}. The {+atlas-cli+}
17-
accepts ``.json`` configuration files.
1813

19-
.. _alert-config-settings:
20-
21-
Alert Configuration Settings
22-
----------------------------
23-
24-
Depending on the type of alert configuration, you can specify the
25-
following settings to create or update an alert configuration
26-
in a configuration file:
27-
28-
.. list-table::
29-
:widths: 20 10 70
30-
:header-rows: 1
14+
.. This page differs from the main template because it documents
15+
.. multiple commands For a one-command
16+
.. template, use the template on cloud-backup-schedule-config-file.txt
3117

32-
* - Field
33-
- Type
34-
- Description
18+
.. |atlas-cli command| replace:: :ref:`atlas-alerts-settings-create`
19+
.. |configuration-file-name| replace:: alert configuration
20+
.. |openapi-link| replace:: :oas-atlas-op:`Create One Alert Configuration in One Project </Alert-Configurations/operation/createAlertConfiguration>`
21+
.. |action| replace:: create an alert configuration
3522

36-
* - ``enabled``
37-
- boolean
38-
- Flag that indicates whether someone enabled this
39-
alert configuration for the specified project.
23+
.. |atlas-cli command 2| replace:: :ref:`atlas-alerts-settings-update`
24+
.. |openapi-link 2| replace:: :oas-atlas-tag:`Update One Alert Configuration for One Project </Alert-Configurations/operation/updateAlertConfiguration>`
25+
.. |action 2| replace:: update an alert configuration
4026

41-
* - ``eventTypeName``
42-
- string
43-
- Required. Event type that triggers an alert.
27+
You can use a |configuration-file-name| file to specify the
28+
settings required when you |action| or |action 2|
29+
using the {+atlas-cli+}. The {+atlas-cli+} accepts ``.json``
30+
|configuration-file-name| files.
4431

45-
* - ``matchers``
46-
- array of objects
47-
- Rules to apply when matching an object against this alert
48-
configuration. You can use this field only if the ``eventTypeName``
49-
specifies an event for a host, replica set, or sharded cluster.
50-
51-
* - ``metricThreshold``
52-
- object
53-
- Threshold for the metric that, when exceeded, triggers an alert.
54-
You can use this field only if the ``eventTypeName`` reflects
55-
a change in measurement or metric.
56-
57-
* - ``notifications``
58-
- array of objects
59-
- List that contains the targets that |service| sends notifications.
32+
.. _alert-config-settings:
6033

61-
* - ``threshold``
62-
- object
63-
- A limit that triggers an alert when exceeded.
34+
Available Settings
35+
------------------
6436

65-
For detailed descriptions and a full list of available settings,
66-
see the request body schema in the API specification:
37+
When you |action| using a configuration file, you
38+
can specify any settings that are listed in
39+
|openapi-link| under :guilabel:`Request Body Schema`.
6740

68-
- :oas-atlas-op:`Create One Alert Configuration in One Project </createAlertConfiguration>`
69-
- :oas-atlas-op:`Update One Alert Configuration for One Project </updateAlertConfiguration>`
41+
When you |action 2| using a configuration file, you
42+
can specify any settings that are listed in
43+
|openapi-link 2| under :guilabel:`Request Body Schema`.
7044

7145
.. _example-alert-config-file:
7246

73-
Example Alert Configuration File
74-
--------------------------------
75-
76-
To create or update an alert configuration, specify the
77-
fields that you want to include in the configuration file.
78-
For example, the following sample file enables an alert
79-
configuration that notifies you when a replica set called
80-
``event-replica-set`` loses its primary node:
81-
82-
.. literalinclude:: /includes/alert-configuration-config-file.json
83-
84-
Example Alert Configuration Commands
85-
------------------------------------
86-
87-
After you create the file, run the {+atlas-cli+}
88-
command to create or update the alert configuration.
47+
Create a Configuration File
48+
---------------------------
8949

9050
Create an Alert Configuration
9151
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9252

93-
To create an alert configuration, specify the ``--flag`` option
94-
and the path to the file. The following example creates an
95-
alert configuration by using a configuration file named
96-
``alert-config.json``:
97-
98-
.. code-block::
99-
100-
atlas alerts settings create --file /alert-config.json
53+
.. include:: /includes/steps-config-file-template.rst
10154

10255
Update an Alert Configuration
10356
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10457

105-
To update an alert configuration, specify the ID of the
106-
alert configuration that you want to update, the ``--flag``
107-
option, and the path to the file. The following example updates
108-
an existing alert configuration by using a configuration file
109-
named ``alert-config.json``:
110-
111-
.. code-block::
112-
113-
atlas alerts settings update <alertConfigId> --file /alert-config.json
58+
.. include:: /includes/steps-config-file-template-action-2.rst

0 commit comments

Comments
 (0)