Skip to content

Commit

Permalink
Release App Services CLI (mongodb#607)
Browse files Browse the repository at this point in the history
* App Services CLI (mongodb#594)

* New Configuration File Version (mongodb#598)
  • Loading branch information
nlarew authored and MongoCaleb committed Jun 3, 2024
1 parent cdb8963 commit b655297
Show file tree
Hide file tree
Showing 197 changed files with 6,664 additions and 833 deletions.
41 changes: 39 additions & 2 deletions config/redirects
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,44 @@ raw: docs/atlas/app-servicesAtlas%20App%20Services -> ${base}/
raw: ${prefix}/manage-apps/secure -> ${base}/security/

## (DOCSP-30776): Make "Tiered Device Sync" page public and change its name
raw: ${prefix}/sync/app-builder/tiered-device-sync/index -> ${base}/edge-server/

## (DOCSP-32967): Make "Edge Server" page a section
raw: ${prefix}/sync/app-builder/tiered-device-sync/index -> ${base}/edge-server/
raw: ${prefix}/sync/app-builder/edge-server/ -> ${base}/edge-server/

# realm-cli -> appservices-cli
raw: ${prefix}/cli/realm-cli-accessList-create -> ${base}/realm-cli/realm-cli-accessList-create/
raw: ${prefix}/cli/realm-cli-accessList-delete -> ${base}/realm-cli/realm-cli-accessList-delete/
raw: ${prefix}/cli/realm-cli-accessList-list -> ${base}/realm-cli/realm-cli-accessList-list/
raw: ${prefix}/cli/realm-cli-accessList-update -> ${base}/realm-cli/realm-cli-accessList-update/
raw: ${prefix}/cli/realm-cli-accessList -> ${base}/realm-cli/realm-cli-accessList/
raw: ${prefix}/cli/realm-cli-apps-create -> ${base}/realm-cli/realm-cli-apps-create/
raw: ${prefix}/cli/realm-cli-apps-delete -> ${base}/realm-cli/realm-cli-apps-delete/
raw: ${prefix}/cli/realm-cli-apps-describe -> ${base}/realm-cli/realm-cli-apps-describe/
raw: ${prefix}/cli/realm-cli-apps-diff -> ${base}/realm-cli/realm-cli-apps-diff/
raw: ${prefix}/cli/realm-cli-apps-init -> ${base}/realm-cli/realm-cli-apps-init/
raw: ${prefix}/cli/realm-cli-apps-list -> ${base}/realm-cli/realm-cli-apps-list/
raw: ${prefix}/cli/realm-cli-apps -> ${base}/realm-cli/realm-cli-apps/
raw: ${prefix}/cli/realm-cli-function-run -> ${base}/realm-cli/realm-cli-function-run/
raw: ${prefix}/cli/realm-cli-function -> ${base}/realm-cli/realm-cli-function/
raw: ${prefix}/cli/realm-cli-login -> ${base}/realm-cli/realm-cli-login/
raw: ${prefix}/cli/realm-cli-logout -> ${base}/realm-cli/realm-cli-logout/
raw: ${prefix}/cli/realm-cli-logs-list -> ${base}/realm-cli/realm-cli-logs-list/
raw: ${prefix}/cli/realm-cli-logs -> ${base}/realm-cli/realm-cli-logs/
raw: ${prefix}/cli/realm-cli-pull -> ${base}/realm-cli/realm-cli-pull/
raw: ${prefix}/cli/realm-cli-push -> ${base}/realm-cli/realm-cli-push/
raw: ${prefix}/cli/realm-cli-reference-v1 -> ${base}/realm-cli/realm-cli-reference-v1/
raw: ${prefix}/cli/realm-cli-schema-datamodels -> ${base}/realm-cli/realm-cli-schema-datamodels/
raw: ${prefix}/cli/realm-cli-schema -> ${base}/realm-cli/realm-cli-schema/
raw: ${prefix}/cli/realm-cli-secrets-create -> ${base}/realm-cli/realm-cli-secrets-create/
raw: ${prefix}/cli/realm-cli-secrets-delete -> ${base}/realm-cli/realm-cli-secrets-delete/
raw: ${prefix}/cli/realm-cli-secrets-list -> ${base}/realm-cli/realm-cli-secrets-list/
raw: ${prefix}/cli/realm-cli-secrets-update -> ${base}/realm-cli/realm-cli-secrets-update/
raw: ${prefix}/cli/realm-cli-secrets -> ${base}/realm-cli/realm-cli-secrets/
raw: ${prefix}/cli/realm-cli-users-create -> ${base}/realm-cli/realm-cli-users-create/
raw: ${prefix}/cli/realm-cli-users-delete -> ${base}/realm-cli/realm-cli-users-delete/
raw: ${prefix}/cli/realm-cli-users-disable -> ${base}/realm-cli/realm-cli-users-disable/
raw: ${prefix}/cli/realm-cli-users-enable -> ${base}/realm-cli/realm-cli-users-enable/
raw: ${prefix}/cli/realm-cli-users-list -> ${base}/realm-cli/realm-cli-users-list/
raw: ${prefix}/cli/realm-cli-users-revoke -> ${base}/realm-cli/realm-cli-users-revoke/
raw: ${prefix}/cli/realm-cli-users -> ${base}/realm-cli/realm-cli-users/
raw: ${prefix}/cli/realm-cli-whoami -> ${base}/realm-cli/realm-cli-whoami/
31 changes: 21 additions & 10 deletions snooty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,25 @@ toc_landing_pages = [
"/schemas",
"/data-api",
"/tutorials",
# CLI
# App Services CLI
"/cli",
"/cli/realm-cli-accessList",
"/cli/realm-cli-apps",
"/cli/realm-cli-function",
"/cli/realm-cli-logs",
"/cli/realm-cli-schema",
"/cli/realm-cli-secrets",
"/cli/realm-cli-users",
"/cli/appservices-accessList",
"/cli/appservices-apps",
"/cli/appservices-function",
"/cli/appservices-logs",
"/cli/appservices-schema",
"/cli/appservices-secrets",
"/cli/appservices-users",
# [Deprecated] Realm CLI
"/realm-cli",
"/realm-cli/v2",
"/realm-cli/v2/realm-cli-accessList",
"/realm-cli/v2/realm-cli-apps",
"/realm-cli/v2/realm-cli-function",
"/realm-cli/v2/realm-cli-logs",
"/realm-cli/v2/realm-cli-schema",
"/realm-cli/v2/realm-cli-secrets",
"/realm-cli/v2/realm-cli-users",
# Reference
"/reference/config",
# Other
Expand All @@ -58,8 +68,9 @@ adf = "Atlas Data Federation"
adf-datasource = "Federated data source"
adf-instance = "Federated database instance"
base-url = "https://www.mongodb.com/docs/atlas/app-services"
cli = "Realm CLI"
cli-bin = ":binary:`realm-cli`" # binary -- DO NOT USE IN LINKS! Will break them.
cli = "App Services CLI"
cli-bin = "appservices"
cli-ref = ":ref:`App Services CLI <appservices-cli>`"
deployment-history-size = "25"
log-retention-time = "10 days"
max-concurrent-requests = "10,000"
Expand Down
2 changes: 1 addition & 1 deletion source/activity/forward-logs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ log forwarder by name.

.. code-block:: sh

realm-cli push
{+cli-bin+} push

Restart a Suspended Log Forwarder
---------------------------------
Expand Down
12 changes: 6 additions & 6 deletions source/activity/view-logs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ with the App Services CLI.
View Recent Logs
~~~~~~~~~~~~~~~~

To return the 100 most recent log entries for your application, run ``realm-cli
To return the 100 most recent log entries for your application, run ``{+cli-bin+}
logs list``.

.. code-block:: shell

realm-cli logs list
{+cli-bin+} logs list

Tail Logs in Real Time
~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -73,7 +73,7 @@ as they come in.

.. code-block:: shell

realm-cli logs list --tail
{+cli-bin+} logs list --tail

View Error Logs
~~~~~~~~~~~~~~~
Expand All @@ -83,7 +83,7 @@ the flag, the command returns both error logs and regular logs.

.. code-block:: shell

realm-cli logs list --errors
{+cli-bin+} logs list --errors

Filter Logs by Type
~~~~~~~~~~~~~~~~~~~
Expand All @@ -104,7 +104,7 @@ The following types are valid:

.. code-block:: shell

realm-cli logs list --type=function --type=trigger
{+cli-bin+} logs list --type=function --type=trigger

.. _cli-view-logs-for-date-range:

Expand All @@ -117,7 +117,7 @@ together.

.. code-block:: shell

realm-cli logs list --start="2021-01-01T00:00:00.000+0000" --end="2021-02-01T00:00:00.000+0000"
{+cli-bin+} logs list --start="2021-01-01T00:00:00.000+0000" --end="2021-02-01T00:00:00.000+0000"

App Services API
----------------
Expand Down
22 changes: 10 additions & 12 deletions source/apps/cicd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,13 @@ the Development stage or use your production App ID in the Production stage.
<sdlc-create-app>`.

Set Up {+cli+}
~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~

:ref:`{+cli+} <realm-cli>` is the easiest way to programmatically create,
configure, and manage App Services Apps. You should :ref:`install <install-realm-cli>`
and use the latest version in your deployment scripts.
The {+cli+} is the easiest way to programmatically
create, configure, and manage Atlas Apps. You should install and
use the latest version in your deployment scripts.

.. code-block:: bash

npm install -g mongodb-realm-cli
.. include:: /includes/install-appservices-cli.rst

You'll also need a MongoDB Atlas public/private API key pair to authenticate and
use the CLI. For more information and a walkthrough of how to get an API key,
Expand All @@ -157,7 +155,7 @@ To log in, save your API keys in a new named profile configuration and then log
in with that profile:

.. code-block:: yaml
:caption: ~/.config/realm-cli/<Profile Name>.yaml
:caption: ~/.config/{+cli-bin+}/<Profile Name>.yaml

<Profile Name>:
public_api_key: "<MongoDB Atlas Public API Key>"
Expand All @@ -168,7 +166,7 @@ in with that profile:

.. code-block:: bash

realm-cli login --profile="<Profile Name>"
{+cli-bin+} login --profile="<Profile Name>"

.. tip::

Expand All @@ -194,7 +192,7 @@ To use a new app for your development or staging branch:
.. code-block:: bash

cd path/to/realmApp
realm-cli push -y --project="<MongoDB Atlas Project ID>" # e.g. --project="609ea544934fe445460219a2"
{+cli-bin+} push -y --project="<MongoDB Atlas Project ID>" # e.g. --project="609ea544934fe445460219a2"

2. **Save the App ID**

Expand All @@ -205,7 +203,7 @@ To use a new app for your development or staging branch:
.. code-block:: bash

# Save to an environment variable
output=$(realm-cli app describe)
output=$({+cli-bin+} app describe)
app_id=$(echo $output | sed 's/^.*client_app_id": "\([^"]*\).*/\1/')
export REALM_APP_ID=app_id
# Save to a file
Expand All @@ -224,7 +222,7 @@ To update an existing app, specify its App ID in the ``--remote`` flag:

.. code-block:: bash

realm-cli push --remote=$REALM_APP_ID -y
{+cli-bin+} push --remote=$REALM_APP_ID -y

Run Tests Against the App
~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
10 changes: 5 additions & 5 deletions source/apps/copy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Before You Begin

- .. include:: /includes/prereqs/atlas-admin-api-key.rst

- .. include:: /includes/prereqs/app-services-cli.rst
- .. include:: /includes/prereqs/appservices-cli.rst

.. tab::
:tabid: github
Expand Down Expand Up @@ -80,7 +80,7 @@ Procedure
.. code-block:: bash

# Create the new App
realm-cli app create \
{+cli-bin+} app create \
--name "myapp-copy" \
--deployment-model "LOCAL" \
--location "US-OR"
Expand All @@ -100,7 +100,7 @@ Procedure
.. code-block:: bash

# Pull the config files for an existing App
realm-cli pull --remote="myapp-abcde"
{+cli-bin+} pull --remote="myapp-abcde"

.. include:: /apps/copy-app-copy-config-files.rst

Expand All @@ -117,7 +117,7 @@ Procedure
# Navigate back to the new App
cd myapp-copy
# Push the copied configuration files to App Services
realm-cli push
{+cli-bin+} push

.. tab::
:tabid: github
Expand Down Expand Up @@ -157,7 +157,7 @@ Procedure
cd myapp-copy
# Create the new App. The create command saves the new
# App's configiration file directory in the current directory
realm-cli app create \
{+cli-bin+} app create \
--name "myapp-copy" \
--deployment-model "LOCAL" \
--location "US-OR"
Expand Down
6 changes: 3 additions & 3 deletions source/apps/create.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Before You Begin

- .. include:: /includes/prereqs/atlas-admin-api-key.rst

- .. include:: /includes/prereqs/app-services-cli.rst
- .. include:: /includes/prereqs/appservices-cli.rst

.. tab::
:tabid: api
Expand Down Expand Up @@ -145,7 +145,7 @@ Procedure

.. code-block:: shell

realm-cli apps create
{+cli-bin+} apps create

The command also supports additional flags that you can optionally include
to customize your app. The following table lists common flags you might use:
Expand Down Expand Up @@ -183,7 +183,7 @@ Procedure
.. seealso::

For more details and additional flags, see the
:ref:`CLI documentation for the create command <realm-cli-apps-create>`.
:ref:`CLI documentation for the create command <appservices-apps-create>`.

.. tab::
:tabid: api
Expand Down
8 changes: 4 additions & 4 deletions source/apps/delete.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Before You Begin

- .. include:: /includes/prereqs/atlas-admin-api-key.rst

- .. include:: /includes/prereqs/app-services-cli.rst
- .. include:: /includes/prereqs/appservices-cli.rst

- .. include:: /includes/prereqs/app-id.rst

Expand Down Expand Up @@ -94,7 +94,7 @@ Procedure

.. code-block:: shell

realm-cli apps delete
{+cli-bin+} apps delete

If you have more than one App, you will be prompted to select one or
more apps that you would like to delete from a list of all your Apps.
Expand All @@ -104,12 +104,12 @@ Procedure

.. code-block:: shell

realm-cli apps delete --app <App ID | App Name>
{+cli-bin+} apps delete --app <App ID | App Name>

.. seealso::

For more details and additional flags, see the
CLI documentation for the :ref:`app delete <realm-cli-apps-delete>` command.
CLI documentation for the :ref:`app delete <appservices-apps-delete>` command.

.. tab::
:tabid: api
Expand Down
4 changes: 2 additions & 2 deletions source/apps/environment.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Before You Begin

- .. include:: /includes/prereqs/atlas-admin-api-key.rst

- .. include:: /includes/prereqs/app-services-cli.rst
- .. include:: /includes/prereqs/appservices-cli.rst

- .. include:: /includes/prereqs/app-id.rst

Expand Down Expand Up @@ -233,7 +233,7 @@ Procedure

.. code-block:: bash

realm-cli push --remote="<Your App ID>"
{+cli-bin+} push --remote="<Your App ID>"

.. tab::
:tabid: api
Expand Down
8 changes: 4 additions & 4 deletions source/apps/export.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Before You Begin

- .. include:: /includes/prereqs/atlas-admin-api-key.rst

- .. include:: /includes/prereqs/app-services-cli.rst
- .. include:: /includes/prereqs/appservices-cli.rst

- .. include:: /includes/prereqs/app-id.rst

Expand Down Expand Up @@ -113,7 +113,7 @@ Procedure

.. code-block:: shell

realm-cli pull --remote=<Client App ID>
{+cli-bin+} pull --remote=<Client App ID>

By default the command pulls files into the current working
directory. You can configure the command to create a new
Expand All @@ -122,7 +122,7 @@ Procedure

.. code-block:: shell

realm-cli pull --remote=<App ID> --local=<Output Directory Path>
{+cli-bin+} pull --remote=<App ID> --local=<Output Directory Path>

.. tip::

Expand All @@ -131,7 +131,7 @@ Procedure
pull the configuration files.

The command also supports :ref:`additional flags
<realm-cli-pull>` that you can optionally include to
<appservices-pull>` that you can optionally include to
customize your app. The following table lists common flags
you might use:

Expand Down
6 changes: 3 additions & 3 deletions source/apps/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ or App Services CLI to find it programmatically.
.. .. tab::
:tabid: cli

.. To find an App ID, run :ref:`realm-cli apps list
<realm-cli-apps-list>` and find the App you're interested in the
.. To find an App ID, run :ref:`{+cli-bin+} apps list
<appservices-apps-list>` and find the App you're interested in the
list returned by the command.

.. Each entry in the list contains two App ID values you may want:
Expand All @@ -127,7 +127,7 @@ or App Services CLI to find it programmatically.
.. .. input::
:language: bash

.. realm-cli apps list
.. {+cli-bin+} apps list

.. .. output::
:language: text
Expand Down
Loading

0 comments on commit b655297

Please sign in to comment.