Skip to content

Commit b014c68

Browse files
authored
Merge pull request #4 from sarahsimpers/DOCSP-21488
Makes approved changes from cloud-docs PR and resolves errors
2 parents 48eb33a + 5fad2fd commit b014c68

14 files changed

+458
-52
lines changed

snooty.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ data-lake = "Atlas Data Lake"
2525
data-lake-short = "Data Lake"
2626
data-lake-stores = "data stores"
2727
data-lake-store = "data store"
28+
database-deployment = "database deployment"
29+
database-deployments = "database deployments"
2830
default-profile = ":ref:`default profile <mcli-profiles>`"
2931
mcli = "MongoDB CLI"
3032
mcli-long = "MongoDB Command Line Interface (``mongocli``)"

source/atlas-cli-env-variables.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Precedence
1919

2020
- When you run any command, each setting that you specify with an
2121
environment variable takes precedence over the :ref:`profile stored in the
22-
configuration file <atlas-cli-save-connection-settings>`.
22+
configuration file <atlas-cli-profiles>`.
2323

2424
- When you run a command using the ``--projectId`` option, the command
2525
line option takes precedence over both the environment variable and

source/atlas-cli-profiles.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

source/atlas-cli-quickstart.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Prerequisites
2828

2929
Before you begin, complete the following tasks:
3030

31-
- Create an :doc:`Atlas organization </organizations-projects/>`
31+
- Create an :atlas:`Atlas organization </organizations-projects/>`
3232
- :ref:`install-atlas-cli`
3333
- :ref:`connect-atlas-cli`
3434

source/atlas-cli-save-connection-settings.txt

Lines changed: 204 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _atlas-cli-save-connection-settings:
1+
.. _atlas-cli-profiles:
22

33
========================
44
Save Connection Settings
@@ -12,8 +12,209 @@ Save Connection Settings
1212
:depth: 1
1313
:class: singlecol
1414

15-
Content Placeholder
15+
You can save your frequently-used connection settings as profiles.
16+
Profiles store the project IDs, organization
17+
IDs, and, optionally, |api| keys to use in future {+atlas-cli+}
18+
sessions. To save time, you can specify a profile instead of using the
19+
``--projectId`` and ``--orgId`` flags with each command. The {+atlas-cli+}
20+
stores your profiles in a :ref:`configuration file <config-toml-location>`
21+
called ``config.toml``.
22+
23+
.. note::
24+
25+
Any settings stored in :ref:`environment variables <atlas-cli-env-vars>`
26+
take precedence over settings stored in profiles. Any project or organization
27+
specified with the ``--projectId`` and ``--orgId`` flags take precedence over
28+
both the profile and the environment variables.
1629

1730
.. _config-toml-location:
1831

19-
Content on where to find the config file
32+
Locate the Configuration File
33+
-----------------------------
34+
35+
The {+atlas-cli+} saves the configuration file to the following
36+
location depending on your operating system:
37+
38+
.. tabs-platforms::
39+
40+
.. tab::
41+
:tabid: macos
42+
43+
.. code-block::
44+
45+
/Users/{username}/Library/Application Support/atlascli
46+
47+
.. tab::
48+
:tabid: windows
49+
50+
.. code-block::
51+
52+
%AppData/atlascli
53+
54+
.. tab::
55+
:tabid: linux
56+
57+
.. code-block::
58+
59+
$XDG_CONFIG_HOME/atlascli
60+
61+
If ``$XDG_CONFIG_HOME`` is not set, the {+atlas-cli+} uses:
62+
63+
.. code-block::
64+
65+
$HOME/.config/atlascli
66+
67+
The
68+
{+atlas-cli+} grants the user who ran the command read and write access to
69+
the file.
70+
71+
.. _atlas-cli-set-profile:
72+
73+
Create a Profile
74+
----------------
75+
76+
The first time you run the
77+
``atlas auth login`` or ``atlas config init`` command, the
78+
{+atlas-cli+} automatically creates the ``config.toml`` file and a default
79+
profile. If you run a command without specifying a profile, environment
80+
variables, or ``--projectId`` and ``--orgId`` flags, the {+atlas-cli+} uses the
81+
default profile for the command.
82+
83+
Select Your Use Case
84+
~~~~~~~~~~~~~~~~~~~~
85+
86+
Select a connection method based on your use case:
87+
88+
.. include:: /includes/list-table-atlas-cli-auth.rst
89+
90+
To learn more, see :ref:`Select a Connection Method <connect-atlas-cli>`.
91+
92+
Complete the Prerequisites
93+
~~~~~~~~~~~~~~~~~~~~~~~~~~
94+
95+
- :ref:`Install the {+atlas-cli+} <install-atlas-cli>`.
96+
- Add your host's IP address to the :ref:`IP access list <access-list>`.
97+
- If you select ``atlas config init`` as your connection method, you must
98+
:ref:`Configure API keys <atlas-admin-api-access>`.
99+
100+
Follow These Steps
101+
~~~~~~~~~~~~~~~~~~
102+
103+
Select a use case and follow the procedure to create a profile.
104+
105+
.. tabs::
106+
107+
.. tab:: Non-programmatic Use
108+
:tabid: atlas-auth-login
109+
110+
.. include:: /includes/fact-default-vs-named-profile.rst
111+
112+
.. tabs::
113+
114+
.. tab:: Default Profile
115+
:tabid: Default
116+
117+
Follow these steps to create the default profile. If the default profile already
118+
exists, these commands update the default profile's values.
119+
120+
.. procedure::
121+
122+
.. include:: /includes/steps-atlas-cli-auth-nonprog-default.rst
123+
124+
.. include:: /includes/steps-atlas-cli-add-profile-nonprogrammatic.rst
125+
126+
.. tab:: Named Profile
127+
:tabid: Named
128+
129+
Follow these steps to create a profile with a custom name.
130+
131+
.. procedure::
132+
133+
.. step:: Run the authentication command.
134+
135+
Run the ``atlas auth login`` command in your terminal with the
136+
``profile <profileName>`` flag. ``<profileName>`` should be
137+
the desired name for your new profile.
138+
139+
.. code-block:: sh
140+
141+
atlas auth login --profile myProfile
142+
143+
The command opens a browser window and returns a one-time
144+
activation code. This code expires after 10 minutes.
145+
146+
.. include:: /includes/steps-atlas-cli-add-profile-nonprogrammatic.rst
147+
148+
.. tab:: Programmatic Use
149+
:tabid: atlas-config-init
150+
151+
.. include:: /includes/fact-default-vs-named-profile.rst
152+
153+
.. tabs::
154+
155+
.. tab:: Default Profile
156+
:tabid: Default
157+
158+
Follow these steps to create the default profile. If the default profile already
159+
exists, these commands update the default profile's values.
160+
161+
.. procedure::
162+
163+
.. include:: /includes/steps-atlas-cli-auth-prog-default.rst
164+
165+
.. include:: /includes/steps-atlas-cli-add-profile-programmatic.rst
166+
167+
.. tab:: Named Profile
168+
:tabid: Named
169+
170+
Follow these steps to create a profile with a custom name.
171+
172+
.. procedure::
173+
174+
.. step:: Run the authentication command.
175+
176+
Run the ``atlas config init`` command in your terminal with the
177+
``profile <profileName>`` flag. ``<profileName>`` should be
178+
the desired name for your new profile.
179+
180+
.. code-block:: sh
181+
182+
atlas config init --profile myProfile
183+
184+
.. include:: /includes/steps-atlas-cli-add-profile-nonprogrammatic.rst
185+
186+
187+
.. _atlas-cli-profile-update:
188+
189+
Update a Profile
190+
----------------
191+
192+
You can update the
193+
settings stored in your configuration file in the following ways:
194+
195+
- Edit the ``config.toml`` file with a text editor.
196+
- Run the ``atlas config set`` command for a setting. This edits an individual
197+
value in the ``config.toml`` file.
198+
199+
Run a Command with a Profile
200+
----------------------------
201+
202+
To run an {+atlas-cli+} command using a profile:
203+
204+
- :ref:`<atlas-cli-set-profile>`.
205+
- Append the ``--profile <profileName>`` flag to a command or omit the
206+
``--profile <profileName>`` flag to use the default profile.
207+
208+
.. example::
209+
210+
This command uses a profile named ``myProfile``:
211+
212+
.. code-block::
213+
214+
atlas <command> --profile myProfile
215+
216+
This command uses the default profile:
217+
218+
.. code-block::
219+
220+
atlas <command>

source/connect-atlas-cli.txt

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,7 @@ Select a Connection Method
1616
When you connect to |service| from the {+atlas-cli+}, you can authenticate with
1717
one of the following commands:
1818

19-
.. list-table::
20-
:header-rows: 1
21-
:widths: 20 40 20
22-
23-
* - Command
24-
- Authentication Method
25-
- Use Case
26-
27-
* - ``atlas auth login``
28-
- |service| login credentials and an authentication token
29-
- Best for non-programmatic use
30-
31-
* - ``atlas config init``
32-
- |api| keys
33-
- Best for programmatic use
19+
.. include:: /includes/list-table-atlas-cli-auth.rst
3420

3521
.. important::
3622

@@ -127,16 +113,7 @@ from the {+atlas-cli+}.
127113

128114
.. procedure::
129115

130-
.. step:: Run the authentication command.
131-
132-
Run the ``atlas auth login`` command in your terminal.
133-
134-
.. code-block:: sh
135-
136-
atlas auth login
137-
138-
The command opens a browser window and returns a one-time
139-
activation code. This code expires after 10 minutes.
116+
.. include:: /includes/steps-atlas-cli-auth-nonprog-default.rst
140117

141118
.. step:: Sign into |service|.
142119

@@ -200,13 +177,7 @@ from the {+atlas-cli+}.
200177

201178
.. procedure::
202179

203-
.. step:: Run the authentication command.
204-
205-
Run the ``atlas config init`` command in your terminal.
206-
207-
.. code-block:: sh
208-
209-
atlas config init
180+
.. include:: /includes/steps-atlas-cli-auth-prog-default.rst
210181

211182
.. step:: Enter your |api| keys.
212183

@@ -248,7 +219,7 @@ different profile, see :ref:`<atlas-cli-profiles>`.
248219

249220
.. toctree::
250221

251-
/atlas-cli-profiles
222+
/atlas-cli-save-connection-settings
252223
/migrate-to-atlas-cli
253224

254225

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Select the default profile or a named profile.
2+
3+
Create a default profile to:
4+
5+
- Run a command without specifying a profile, environment
6+
variables, or ``--projectId`` and ``--orgId`` flags.
7+
- Use the ``--profile default`` flag.
8+
9+
Create a named profile to use the ``--profile <profileName>`` flag.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.. note::
2+
3+
To use the command line interface for |mms|, `install the {+mcli+} <https://www.mongodb.com/docs/mongocli/stable/install/>`__.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. list-table::
2+
:header-rows: 1
3+
:widths: 20 40 20
4+
5+
* - Command
6+
- Authentication Method
7+
- Use Case
8+
9+
* - ``atlas auth login``
10+
- |service| login credentials and an authentication token
11+
- Best for non-programmatic use
12+
13+
* - ``atlas config init``
14+
- |api| keys
15+
- Best for programmatic use

0 commit comments

Comments
 (0)