Skip to content

Commit d7b1131

Browse files
* (DOCSP-11565)(DOCSP-11622)(DOCSP-11624)(DOCSP-11625): om agents apikey list,create,delete and om agents list <type> * (DOCSP-11565)(DOCSP-11622)(DOCSP-11624)(DOCSP-11625): parallel structure agents commands page
1 parent 5ecc106 commit d7b1131

File tree

7 files changed

+630
-1
lines changed

7 files changed

+630
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. note::
2+
3+
After creating an agent API key, subsequent requests return only the
4+
last four characters of the key in clear text. The response
5+
replaces the key's other characters with asterisks.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. warning::
2+
3+
{+mcli+} returns the agent |api| key only once. After running this
4+
command, immediately copy, save, and secure the agent API key.

source/reference/ops-manager/agent-commands.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ Ops Manager ``agent`` commands
99
.. toctree::
1010
:titlesonly:
1111

12-
Upgrade agents to their latest version </reference/ops-manager/agents-upgrade>
12+
List Agents of a Specified Type </reference/ops-manager/agents-list>
13+
Upgrade Agents to Their Latest Version </reference/ops-manager/agents-upgrade>
14+
List Agent API Keys </reference/ops-manager/agents-apikey-list>
15+
Create One Agent API Key </reference/ops-manager/agents-apikey-create>
16+
Delete One Agent API Key </reference/ops-manager/agents-apikey-delete>
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
.. _mcli-om-agents-apikey-create-command:
2+
3+
=========================================
4+
mongocli ops-manager agents apikey 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 ``agents apikey create`` command creates one agent API key for
16+
the specified |onprem| project.
17+
18+
You must have ``GROUP_OWNER`` privileges for a project to create an
19+
agent |api| key for that project.
20+
21+
.. _om-agents-apikey-create-syntax:
22+
23+
Syntax
24+
------
25+
26+
.. code-block:: text
27+
28+
mongocli ops-manager|om agents apikey|apikeys create
29+
-- desc <description of the agent API key>
30+
[ --output|-o <output-format> ]
31+
[ --profile|-P <profile-name> ]
32+
[ --projectId <id-of-project> ]
33+
34+
.. _om-agents-apikey-create-options:
35+
36+
Options
37+
-------
38+
39+
.. list-table::
40+
:widths: 20 10 60 10
41+
42+
* - Option
43+
- Type
44+
- Description
45+
- Required?
46+
47+
* - ``--desc``
48+
- string
49+
- Description of the agent API key.
50+
- yes
51+
52+
* - ``--output``, ``-o``
53+
- string
54+
- .. include:: /includes/extracts/fact-basic-options-output.rst
55+
- no
56+
57+
* - ``--profile``, ``-P``
58+
- string
59+
- Name of the profile where the public and private
60+
keys for the project are saved. If omitted, uses the
61+
{+default-profile+}. To learn more about creating a
62+
profile, see :ref:`mcli-configure`.
63+
- no
64+
65+
* - ``--projectId``
66+
- string
67+
- Unique identifier of the project that for which you want to
68+
create an agent API key. If omitted, uses the
69+
project ID in the profile or :ref:`environment variable
70+
<mcli-env-var>`.
71+
- no
72+
73+
.. _om-agents-apikey-create-output:
74+
75+
Output
76+
------
77+
78+
If the command succeeds, it returns the following output in the default
79+
format. If the command returns errors, see
80+
:ref:`Troubleshooting <troubleshooting>` for recommended solutions.
81+
82+
.. include:: /includes/admonitions/only-shows-agent-api-key-once.rst
83+
84+
.. code-block:: sh
85+
:copyable: false
86+
87+
API Key '<agent-api-key>' created.
88+
89+
.. include:: /includes/fact-default-output.rst
90+
91+
- :opsmgr:`Ops Manager API </reference/api/agentapikeys/create-one-agent-api-key/#response>`
92+
93+
Example
94+
-------
95+
96+
.. tabs::
97+
98+
.. tab:: Default Output
99+
:tabid: default-output
100+
101+
The following command retrieves agent API keys for a project
102+
using the {+default-profile+}, which contains credentials and the
103+
project ID. The output is returned in the default format.
104+
105+
.. code-block:: sh
106+
107+
mongocli om agents apikey create --desc agentKey
108+
109+
The previous command prints the following to the terminal.
110+
111+
.. include:: /includes/admonitions/only-shows-agent-api-key-once.rst
112+
113+
.. code-block:: sh
114+
:copyable: false
115+
116+
API Key '5f4944e7c90220199059813f0cf83079032a0f7f9538a2f69562a93a' created.
117+
118+
.. tab:: JSON Output
119+
:tabid: json-output
120+
121+
The following command retrieves agent API keys for a project
122+
using the {+default-profile+}, which contains credentials and the
123+
project ID. The output is returned in |json| format.
124+
125+
.. code-block:: sh
126+
127+
mongocli om agents apikey create --desc agentKey --output json
128+
129+
The previous command prints the following to the terminal in
130+
|json| format.
131+
132+
.. include:: /includes/admonitions/only-shows-agent-api-key-once.rst
133+
134+
.. code-block:: json
135+
:copyable: false
136+
137+
{
138+
"_id": "5f49471dc90220199059861c",
139+
"key": "5f49471dc90220199059861cb3e32a61a5ceeb1f5d958d2be0954acc",
140+
"desc": "agentKey",
141+
"createdTime": 1598637853857,
142+
"createdUserId": "5f36b26fc902201990297b3b",
143+
"createdIpAddr": "127.0.0.1",
144+
"createdBy": "PUBLIC_API"
145+
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
.. _mcli-om-agents-apikey-delete-command:
2+
3+
=========================================
4+
mongocli ops-manager agents apikey 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 ``agents apikey delete`` command deletes one agent API key for
16+
the specified |onprem| project. You must confirm the operation when you
17+
run this command without the ``--force`` option.
18+
19+
You must have ``GROUP_OWNER`` privileges for a project to delete an
20+
agent |api| key from that project.
21+
22+
.. _om-agents-apikey-delete-syntax:
23+
24+
Syntax
25+
------
26+
27+
.. code-block:: text
28+
29+
mongocli ops-manager|om agents apikey|apikeys delete|rm <agent-api-key-id>
30+
[ --force ]
31+
[ --profile|-P <profile-name> ]
32+
[ --projectId <id-of-project> ]
33+
34+
.. _mcli-om-agents-apikey-delete-arguments:
35+
36+
Arguments
37+
---------
38+
39+
.. list-table::
40+
:header-rows: 1
41+
:widths: 20 10 60 10
42+
43+
* - Argument
44+
- Type
45+
- Description
46+
- Required?
47+
48+
* - ``<agent-api-key-id>``
49+
- string
50+
- Unique identifier for the agent API key you want to delete.
51+
- yes
52+
53+
.. _om-agents-apikey-delete-options:
54+
55+
Options
56+
-------
57+
58+
.. list-table::
59+
:widths: 20 10 60 10
60+
61+
* - Option
62+
- Type
63+
- Description
64+
- Required?
65+
66+
* - ``--force``
67+
-
68+
- Flag that indicates that the agent API key can
69+
be deleted without requiring confirmation.
70+
- no
71+
72+
* - ``--profile``, ``-P``
73+
- string
74+
- Name of the profile where the public and private
75+
keys for the project are saved. If omitted, uses the
76+
{+default-profile+}. To learn more about creating a
77+
profile, see :ref:`mcli-configure`.
78+
- no
79+
80+
* - ``--projectId``
81+
- string
82+
- Unique identifier of the project that for which you want to
83+
delete an agent API key. If omitted, uses the
84+
project ID in the profile or :ref:`environment variable
85+
<mcli-env-var>`.
86+
- no
87+
88+
.. _om-agents-apikey-delete-output:
89+
90+
Output
91+
------
92+
93+
If the command succeeds, it returns the following output in the default
94+
format. If the command returns errors, see
95+
:ref:`Troubleshooting <troubleshooting>` for recommended solutions.
96+
97+
.. code-block:: sh
98+
:copyable: false
99+
100+
? Are you sure you want to delete: <agent-api-key-id> Yes
101+
API Key '<agent-api-key-id>' deleted
102+
103+
Example
104+
-------
105+
106+
The following command deletes one agent API keys for a project
107+
using the {+default-profile+}, which contains credentials and the
108+
project ID. The output is returned in the default format.
109+
110+
.. code-block:: sh
111+
112+
mongocli om agents apikey delete 5f49471dc90220199059861c
113+
114+
The previous command prints the following to the terminal.
115+
116+
.. code-block:: sh
117+
:copyable: false
118+
119+
? Are you sure you want to delete: 5f49471dc90220199059861c Yes
120+
API Key '5f49471dc90220199059861c' deleted.

0 commit comments

Comments
 (0)