Skip to content

Commit fd6089b

Browse files
authored
(DOCSP-10374) mongocli iam organization create (#111)
* (DOCSP-10374) mongocli iam organization create
1 parent f905674 commit fd6089b

File tree

3 files changed

+161
-4
lines changed

3 files changed

+161
-4
lines changed

source/includes/atlas-snapshots-list-output-fields.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,4 @@
142142
- The type of server that the part represents:
143143

144144
- ``REPLICA_SET``
145-
- ``CONFIG_SERVER_REPLICA_SET``
145+
- ``CONFIG_SERVER_REPLICA_SET``

source/reference/access.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
:class: singlecol
1414

1515
``iam``
16-
----------
16+
-------
1717

18-
The mongocli ``iam`` command allows you to list, create, and delete projects
19-
in a specified organization.
18+
The mongocli ``iam`` command allows you to create organizations and
19+
list, create, and delete projects in a specified organization.
2020

21+
- :ref:`Create an organization <mcli-iam-organization-create>`
2122
- :ref:`List projects <mcli-iam-project-list>`
2223
- :ref:`Create a project <mcli-iam-project-create>`
2324
- :ref:`Delete a project <mcli-iam-project-delete>`
@@ -27,6 +28,7 @@ in a specified organization.
2728
.. toctree::
2829
:titlesonly:
2930

31+
Create an Organization </reference/iam-organization-create>
3032
List Projects </reference/iam-project-list>
3133
Create a Project </reference/iam-project-create>
3234
Delete a Project </reference/iam-project-delete>
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
.. _mcli-iam-organization-create:
2+
3+
================================
4+
mongocli iam organization 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 ``mongocli iam organization create`` command creates a new
16+
|cloud-short| or |onprem| organization.
17+
18+
You must have the ``Global Owner`` role to create an organization.
19+
20+
.. _mcli-iam-organization-create-syntax:
21+
22+
Syntax
23+
------
24+
25+
.. code-block:: text
26+
27+
mongocli iam organizations|organization create <organization-name>
28+
[ --profile|-P <profile-name> ]
29+
30+
.. important::
31+
32+
The service for which the organization is created is determined by
33+
your profile.
34+
35+
.. include:: /includes/fact-command-line-help.rst
36+
37+
.. _mcli-iam-organization-create-options:
38+
39+
Options
40+
-------
41+
42+
.. list-table::
43+
:header-rows: 1
44+
:widths: 20 10 60 10
45+
46+
* - Option
47+
- Type
48+
- Description
49+
- Required?
50+
51+
* - ``--profile``, ``-P``
52+
- string
53+
- Name of the profile where your credentials are saved.
54+
55+
You must have credentials with the ``Global Owner`` role to
56+
create an organization. You can use either a
57+
*Global API key pair* or a *Personal API key*:
58+
59+
.. list-table::
60+
:header-rows: 1
61+
:widths: 50 40 40
62+
63+
* - Credential Type
64+
- ``public_api_key`` Value
65+
- ``private_api_key`` Value
66+
67+
* - Global API Keys
68+
- Public Global API key
69+
- Private Global API key
70+
71+
* - Personal API Key
72+
- |cloud-short| or |onprem| username
73+
- Personal API key
74+
75+
The profile must include a ``service`` value of either:
76+
77+
- ``"ops-manager"`` for an |onprem| organization, or
78+
- ``"cloud-manager"`` for a |cloud-short| organization.
79+
80+
If omitted, uses the ``default`` profile. To learn more about
81+
creating a profile, see :ref:`mcli-configure`.
82+
83+
- no
84+
85+
.. _mcli-iam-organization-create-output:
86+
87+
Output
88+
------
89+
90+
The command prints following fields in |json| format to the
91+
terminal if the command succeeds. If the command returns errors,
92+
see :ref:`Troubleshooting <troubleshooting>` for recommended
93+
solutions.
94+
95+
.. list-table::
96+
:header-rows: 1
97+
:widths: 30 70
98+
99+
* - Field
100+
- Description
101+
102+
* - ``id``
103+
- Unique identifier of the organization.
104+
105+
* - ``links``
106+
- One or more links to sub-resources and/or related resources.
107+
The relations between URLs are explained in the `Web Linking
108+
Specification <http://tools.ietf.org/html/rfc5988>`_.
109+
110+
* - ``name``
111+
- Name of the organization.
112+
113+
.. _mcli-iam-organization-create-examples:
114+
115+
Examples
116+
--------
117+
118+
The following command creates an |onprem| organization called
119+
``myOrg`` using the default profile, which contains the
120+
``Global Owner`` credentials and specifies the |onprem| service:
121+
122+
.. code-block:: text
123+
124+
mongocli iam organization create myOrg
125+
126+
The previous command creates the |onprem| organization ``myOrg`` and
127+
prints the following in |json| format to the terminal. For more
128+
information on these fields, see
129+
:ref:`Output <mcli-iam-organization-create-output>`.
130+
131+
.. code-block:: json
132+
:copyable: false
133+
134+
{
135+
"id": "abcdefghi123456789",
136+
"links": [
137+
{
138+
"rel": "self",
139+
"href": "www.example.com:8080/api/public/v1.0/orgs/abcdefghi123456789"
140+
},
141+
{
142+
"rel": "http://mms.mongodb.com/groups",
143+
"href": "www.example.com:8080/api/public/v1.0/orgs/abcdefghi123456789/groups"
144+
},
145+
{
146+
"rel": "http://mms.mongodb.com/teams",
147+
"href": "www.example.com:8080/api/public/v1.0/orgs/abcdefghi123456789/teams"
148+
},
149+
{
150+
"rel": "http://mms.mongodb.com/users",
151+
"href": "www.example.com:8080/api/public/v1.0/orgs/abcdefghi123456789/users"
152+
}
153+
],
154+
"name": "myOrg"
155+
}

0 commit comments

Comments
 (0)