### Get Database Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-monitoringAndLogs-getDatabase.txt This example shows how to retrieve information about a specific database within a project. Ensure you have the necessary project ID and database name. ```shell atlas api monitoringAndLogs getDatabase --databaseName "myDatabase" --groupId "645074130000000000000000" --processId "myHost.example.com:27017" ``` -------------------------------- ### Start a Cluster with Project ID and JSON Output Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-clusters-start.txt Example of how to start a specific cluster by providing its name and the project ID. It also specifies JSON as the output format. ```bash # Start a cluster named myCluster for the project with ID 5e2211c17a3e5a48f5497de3: atlas clusters start myCluster --projectId 5e2211c17a3e5a48f5497de3 --output json ``` -------------------------------- ### Start a Stream Processor Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-streams-startStreamProcessor.txt This example demonstrates how to start a stream processor with the required parameters: processor name, tenant name, and group ID. Ensure you have the correct values for these parameters before execution. ```shell atlas api streams startStreamProcessor --processorName "myProcessor" --tenantName "myTenant" --groupId "641103200314320013123456" ``` -------------------------------- ### Example: Get Process Namespaces Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-collectionLevelMetrics-getProcessNamespaces.txt This example demonstrates how to retrieve namespace metrics for a specific process. Ensure you have the correct groupId and processId, and specify the desired time window using --start and --end or --period. ```shell atlas api collectionLevelMetrics getProcessNamespaces --groupId "6471216075831503111e1111" --processId "i-0123456789abcdef0:27017" --start "2023-11-15T00:00:00Z" --end "2023-11-15T23:59:59Z" ``` -------------------------------- ### Example: Get Cost Explorer Usage Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-invoices-getCostExplorerUsage.txt This example demonstrates how to retrieve usage details for a specific Cost Explorer query using the default API version. ```shell atlas api invoices getCostExplorerUsage --orgId "641100000000000000000000" --token "64110000000000000000000064110000000000006411000000000000" --output json ``` -------------------------------- ### Create a Download Restore Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-backups-restores-start.txt Example command to start a download restore job for a specified cluster. ```bash atlas backup restore start download \ --clusterName myDemo \ ``` -------------------------------- ### Get Group Process Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-monitoringAndLogs-getGroupProcess.txt This example shows how to retrieve processes for a specific project using the default API version. ```shell atlas api monitoringAndLogs getGroupProcess --groupId "64c7e5f0bd49110012b22222" ``` -------------------------------- ### Example: Get Default Integration Settings Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-thirdPartyIntegrations-getGroupIntegration.txt This example demonstrates how to retrieve the default integration settings for a specific integration type and project. Ensure you replace placeholder values with your actual project ID and desired integration type. ```shell atlas api thirdPartyIntegrations getGroupIntegration --integrationType "datadog" --groupId "641105163723750001000000" ``` -------------------------------- ### Get Export Bucket Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-cloudBackups-getExportBucket.txt This example shows how to retrieve an export bucket using the default API version. Ensure you have the correct export bucket ID and project ID. ```shell atlas api cloudBackups getExportBucket --exportBucketId 64d3a3e4f14370072c372020 --groupId 64d3a3e4f14370072c37201f ``` -------------------------------- ### Example: List Databases in JSON Format Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-metrics-databases-list.txt Use this command to get a JSON-formatted list of available databases for a specific host. Ensure you replace the placeholder hostname and port with your actual connection details. ```bash # Return a JSON-formatted list of available databases for the host atlas-lnmtkm-shard-00-00.ajlj3.mongodb.net:27017 atlas metrics databases list atlas-lnmtkm-shard-00-00.ajlj3.mongodb.net:27017 --output json ``` -------------------------------- ### Example: Get Group Live Migration (Default API Version) Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-cloudMigrationService-getGroupLiveMigration.txt This example demonstrates how to retrieve live migration job details using the default API version. Replace placeholder values with your actual project ID and live migration ID. ```shell atlas api cloudMigrationService getGroupLiveMigration --groupId "641103110320010030000000" --liveMigrationId "641103110320010030000000" ``` -------------------------------- ### Example: Get Invoice Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-invoices-getInvoice.txt This example demonstrates how to retrieve a specific invoice using its ID and the organization ID. The output format is the default JSON. ```shell atlas api invoices getInvoice --invoiceId 645f1234567890abcdef123456 --orgId 645f1234567890abcdef123456 ``` -------------------------------- ### Example: Create a Team with Users and Organization ID Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-teams-create.txt This example demonstrates how to create a team named 'myTeam', assign users 'user1@example.com' and 'user2@example.com' to it, specify the organization ID, and request JSON output. ```bash atlas teams create myTeam --username user1@example.com,user2@example.com --orgId 5e1234c17a3e5a48f5497de3 --output json ``` -------------------------------- ### Get Network Peering Container Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-networkPeering-getGroupContainer.txt This example demonstrates how to retrieve details for a specific network peering container using its ID and the project ID. ```shell # Example using default API version atlas api networkPeering getGroupContainer --containerId "648072023211210012345678" --groupId "648072023211210012345678" --pretty ``` -------------------------------- ### Describe Project Settings with Profile and Project ID Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-projects-settings-describe.txt This example demonstrates how to describe project settings using a specific profile and project ID. The `-P` option specifies the profile, and `--projectId` specifies the project. ```bash atlas projects settings describe -P myprofile --projectId 5e2211c17a3e5a48f5497de3 ``` -------------------------------- ### Example: List Stream Connections (Default) Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-streams-listStreamConnections.txt This example demonstrates how to list stream connections using the default API version. Ensure you have the necessary project roles to execute this command. ```shell atlas api streams listStreamConnections --groupId "640061023729847037298470" --tenantName "myTenant" ``` -------------------------------- ### Example: Get AWS Account Details Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-streams-getAccountDetails.txt This example demonstrates how to retrieve account details for an AWS provider. It specifies the cloud provider, group ID, and region name. ```shell atlas api streams getAccountDetails --cloudProvider aws --groupId 64d0f2120000000000000000 --regionName US_EAST_1 ``` -------------------------------- ### Enable Alert Configuration Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-alerts-settings-enable.txt This example shows how to enable a specific alert configuration using its ID and specifying the project ID. Replace the IDs with your actual configuration and project IDs. ```bash # Enable the alert configuration with the ID 5d1113b25a115342acc2d1aa in the project with the ID 5e2211c17a3e5a48f5497de3: atlas alerts settings enable 5d1113b25a115342acc2d1aa --projectId 5e2211c17a3e5a48f5497de3 ``` -------------------------------- ### Example: List Online Archives with Default Settings Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-onlineArchive-listOnlineArchives.txt This example demonstrates how to list all online archives for a given cluster and project using default API version and output format. It requires the `--clusterName` and `--groupId` options. ```shell atlas api onlineArchive listOnlineArchives --clusterName "" --groupId "" ``` -------------------------------- ### Example: Get Cluster Query Shape Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-queryShapeInsights-getClusterQueryShape.txt This example demonstrates how to retrieve the details of a rejected query shape for a specific cluster and project using the default API version. ```shell atlas api queryShapeInsights getClusterQueryShape --clusterName "myCluster" --groupId "641100000000000000000000" --queryShapeHash "a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890" ``` -------------------------------- ### Example: Get Outage Simulation Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-clusterOutageSimulation-getOutageSimulation.txt This example demonstrates how to retrieve an outage simulation for a specific cluster using the default API version. Replace `` and `` with your actual values. ```shell atlas api clusterOutageSimulation getOutageSimulation --clusterName MyCluster --groupId 628392303123456789abcdef --output json ``` -------------------------------- ### Create Project Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-projects-create.txt Example of creating a project named 'my-project' within an organization specified by '--orgId'. The '--output json' option is used to format the output as JSON. ```bash # Create a project in the organization with the ID 5e2211c17a3e5a48f5497de3 using default alert settings: atlas projects create my-project --orgId 5e2211c17a3e5a48f5497de3 --output json ``` -------------------------------- ### List Available Projects (Default) Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-cloudMigrationService-listAvailableProjects.txt This example demonstrates how to list all available projects for migration within an organization using the default API version. Ensure you have the necessary organization ID configured or provided. ```shell atlas api cloudMigrationService listAvailableProjects --orgId YOUR_ORG_ID ``` -------------------------------- ### Get Group User Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-mongoDbCloudUsers-getGroupUser.txt This example demonstrates how to retrieve information for a specific user within a project using the Atlas CLI. Ensure you have the correct project ID and user ID. ```shell # atlas api mongoDbCloudUsers getGroupUser --groupId "6452032123456789abcdabcd" --userId "6452032123456789abcdabcd" --pretty ``` -------------------------------- ### Create Database User with Read/Write Access Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-dbusers-create.txt Example of creating a database user with read/write access to any database for a specific project. ```bash # Create a database user named myUser with read/write access to any database for the project with ID 5e2211c17a3e5a48f5497de3: ``` -------------------------------- ### List Clusters Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-clusters-listClusters.txt This example demonstrates how to list all clusters in a project using the default API version. ```shell atlas api clusters listClusters --groupId "641113131313131313131313" ``` -------------------------------- ### Unacknowledge Alert Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-alerts-unacknowledge.txt This example demonstrates how to unacknowledge a specific alert using its ID and the project ID. The `--output json` option is used to get the output in JSON format. ```bash # Unacknowledge the alert with the ID 5d1113b25a115342acc2d1aa in the project with the ID 5e2211c17a3e5a48f5497de3: atlas alerts unacknowledge 5d1113b25a115342acc2d1aa --projectId 5e2211c17a3e5a48f5497de3 --output json ``` -------------------------------- ### Sample Output Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-backups-exports-buckets-list.txt This is a sample of the output you can expect when the command succeeds. The values in brackets represent your specific configuration details. ```text ID BUCKET NAME CLOUD PROVIDER IAM ROLE ID ``` -------------------------------- ### Create Data Federation Database Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-dataFederation-create.txt Example of creating a data federation database with specified region, AWS role, and S3 bucket for validation. ```bash atlas dataFederation create DataFederation1 --region us_east_1 --awsRoleId role --awsTestS3Bucket bucket ``` -------------------------------- ### Update Search Index Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-clusters-search-indexes-update.txt This example demonstrates how to update a search index using its ID and the cluster name. The `--output json` flag is used to get the output in JSON format. ```bash atlas clusters search indexes update 5f2099cd683fc55fbb30bef6 --clusterName myCluster --output json ``` -------------------------------- ### Get Organization Event Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-events-getOrgEvent.txt This example demonstrates how to retrieve a specific event for an organization using the `atlas api events getOrgEvent` command. Ensure you have the correct event ID and organization ID. ```shell atlas api events getOrgEvent --eventId 64d071100000000000000000 --orgId 64cfffe00000000000000000 ``` -------------------------------- ### Describe Identity Provider Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-federatedAuthentication-federationSettings-identityProvider-describe.txt Use this example to describe an identity provider by its ID and the associated federation settings ID. Ensure you replace the placeholder IDs with your actual values. ```bash # Describe the identity provider with ID aa2223b25a115342acc1f108 with federationSettingsId 5d1113b25a115342acc2d1aa. atlas federatedAuthentication federationSettings identityProvider describe aa2223b25a115342acc1f108 --federationSettingsId 5d1113b25a115342acc2d1aa ``` -------------------------------- ### Get Identity Provider Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-federatedAuthentication-getIdentityProvider.txt This example demonstrates how to retrieve a specific identity provider using its federation settings ID and identity provider ID. Ensure you have the correct IDs for your Atlas environment. ```shell atlas api federatedAuthentication getIdentityProvider --federationSettingsId "64d332005720370402900000" --identityProviderId "64d332005720370402900001" ``` -------------------------------- ### List Process Disks (Default) Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-monitoringAndLogs-listProcessDisks.txt This example shows the default command syntax for listing process disks. Ensure you have the necessary project ID and process ID configured. ```shell atlas api monitoringAndLogs listProcessDisks --groupId "645023727583070000000000" --processId "mongodb.example.com:27017" ``` -------------------------------- ### Get Organization Groups Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-organizations-getOrgGroups.txt This example demonstrates how to retrieve all projects within a specific organization using the `atlas api organizations getOrgGroups` command. Ensure you have the correct organization ID configured or provided. ```shell atlas api organizations getOrgGroups --orgId 628354710000000000000000 ``` -------------------------------- ### Get a specific team Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-teams-getOrgTeam.txt This example shows how to retrieve a specific team using its ID and the organization ID. ```shell atlas api teams getOrgTeam --teamId=5f04201234567890abcdef --orgId=6004201234567890abcdef ``` -------------------------------- ### Example: Create Atlas Stream Processing Instance Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-streams-instances-create.txt This example demonstrates how to deploy an Atlas Stream Processing instance with a specific name, project ID, cloud provider, region, and tier. Ensure you have the necessary permissions to run this command. ```bash # Deploy an Atlas Stream Processing instance called myProcessor for the project with the ID 5e2211c17a3e5a48f5497de3: atlas streams instance create myProcessor --projectId 5e2211c17a3e5a48f5497de3 --provider AWS --region VIRGINIA_USA --tier SP30 ``` -------------------------------- ### Example: Get Global Cluster Writes Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-globalClusters-getClusterGlobalWrites.txt This example demonstrates how to use the `atlas api globalClusters getClusterGlobalWrites` command to retrieve global cluster writes. Ensure you have the necessary cluster name and group ID configured. ```shell atlas api globalClusters getClusterGlobalWrites --clusterName "myGlobalCluster" --groupId "627a96877b35910038422222" ``` -------------------------------- ### Get Backup Private Endpoint Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-cloudBackups-getBackupPrivateEndpoint.txt This example demonstrates how to retrieve a specific private endpoint for backup operations using the Atlas CLI. Ensure you have the correct cloud provider, endpoint ID, and project ID. ```shell atlas api cloudBackups getBackupPrivateEndpoint --cloudProvider AWS --endpointId 64d0224730315f0012714342 --groupId 64cff19030315f001271433a ``` -------------------------------- ### Sample Output Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-projects-settings-describe.txt This is a sample output format for the command, showing various project settings. The actual values will be specific to your project. ```text COLLECT DATABASE SPECIFICS STATISTICS ENABLED DATA EXPLORER ENABLED DATA EXPLORER GEN AI FEATURES ENABLED DATA EXPLORER GEN AI SAMPLE DOCUMENT PASSING ENABLED PERFORMANCE ADVISOR ENABLED REALTIME PERFORMANCE PANEL ENABLED SCHEMA ADVISOR ENABLED ``` -------------------------------- ### Download Query Logs Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-onlineArchive-downloadQueryLogs.txt This example demonstrates how to download query logs for an online archive using default settings. Ensure you have the necessary cluster name and group ID configured. ```shell #!/bin/bash atlas api onlineArchive downloadQueryLogs --clusterName "" --groupId "" --output "gzip" --outputFile "querylogs.gz" ``` -------------------------------- ### Example: Get Maintenance Window Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-maintenanceWindows-getMaintenanceWindow.txt This example demonstrates how to retrieve the maintenance window for a specific project ID using the default API version. Ensure you have authenticated with Atlas CLI and replaced '64d40123456789abcdef0123' with your actual project ID. ```shell atlas atlas api maintenanceWindows getMaintenanceWindow --groupId "64d40123456789abcdef0123" --pretty ``` -------------------------------- ### Get Service Account Groups Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-serviceAccounts-getServiceAccountGroups.txt This example demonstrates how to retrieve a list of projects for a specific service account using the `atlas api serviceAccounts getServiceAccountGroups` command. Ensure you have the necessary Client ID and Organization ID configured. ```shell atlas api serviceAccounts getServiceAccountGroups --clientId "" --orgId "" ``` -------------------------------- ### Create Snapshot Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-backups-snapshots-create.txt Example of creating a backup snapshot for a cluster named 'myDemo'. This snapshot will be retained for 30 days and has a description 'test'. ```bash atlas backups snapshots create myDemo --desc "test" --retention 30 ``` -------------------------------- ### Live Migration Output Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-liveMigrations-create.txt This is an example of the output returned when a live migration command succeeds. Values in brackets represent your specific configuration. ```bash ID LAGTIME READY FOR CUTOVER STATUS ``` -------------------------------- ### Get Rate Limit Endpoint Set Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-rateLimiting-getRateLimit.txt This example demonstrates how to retrieve a rate limit endpoint set using the `atlas api rateLimiting getRateLimit` command. Ensure you have the correct `--endpointSetId` for the desired rate limit set. ```shell atlas api rateLimiting getRateLimit --endpointSetId "645e1234567890abcdef123456" ``` -------------------------------- ### Get Private Endpoint Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-encryptionAtRestUsingCustomerKeyManagement-getRestPrivateEndpoint.txt This example demonstrates how to retrieve a private endpoint using the `getRestPrivateEndpoint` command with specific parameters for cloud provider, endpoint ID, and group ID. The API version is explicitly set to "2023-01-01". ```shell atlas api encryptionAtRestUsingCustomerKeyManagement getRestPrivateEndpoint --cloudProvider AWS --endpointId 64d300000000000000000000 --groupId 64c300000000000000000000 --api "2023-01-01" ``` -------------------------------- ### Download Operational Logs (Default) Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-streams-downloadOperationalLogs.txt This example demonstrates how to download operational logs using default settings. It specifies the tenant name and group ID, and the output will be in gzip format. ```shell atlas api streams downloadOperationalLogs --tenantName "" --groupId "" ``` -------------------------------- ### Create Data Federation Private Endpoint Example Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-dataFederation-privateEndpoints-create.txt Example of creating a data federation private endpoint with a comment. Ensure you have the necessary permissions. ```bash atlas dataFederation privateEndpoints create 507f1f77bcf86cd799439011 --comment "comment" ``` -------------------------------- ### Get Database User (Shell) Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-api-databaseUsers-getDatabaseUser.txt Retrieves a database user using the Atlas CLI. Ensure you have the Atlas CLI installed and configured. ```shell atlas atlas-api databaseUsers getDatabaseUser --username --instance --projectId ``` -------------------------------- ### Example Output Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-security-ldap-verify-status.txt This is a sample output when the command succeeds, showing the request ID, project ID, and status of the LDAP configuration verification. ```text REQUEST ID PROJECT ID STATUS ``` -------------------------------- ### Start Atlas CLI Authentication Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/guides/tutorials/authenticate_with_service_account.md Initiates the interactive authentication setup for a specified Atlas CLI profile. Use this command to begin the login process. ```bash atlas auth login --profile myProfile ``` -------------------------------- ### Create a Free Cluster with Tags Source: https://github.com/mongodb/mongodb-atlas-cli/blob/master/docs/command/atlas-clusters-create.txt Deploy a free cluster with a specified name, project ID, cloud provider, region, tier, and tags for environment. ```bash atlas cluster create myCluster --projectId 5e2211c17a3e5a48f5497de3 --provider AWS --region US_EAST_1 --tier M0 --tag env=dev ```