1. Registry
  2. Packages
  3. Mongodbatlas Provider
  4. API Docs
  5. getCloudBackupCollectionRestoreJobCollections
Viewing docs for MongoDB Atlas v4.15.0
published on Friday, Aug 28, 2026 by Pulumi
mongodbatlas logo mongodbatlas logo
Viewing docs for MongoDB Atlas v4.15.0
published on Friday, Aug 28, 2026 by Pulumi

    mongodbatlas.getCloudBackupCollectionRestoreJobCollections describes the restore state of each collection in a collection restore job.

    To use this data source, the requesting Service Account or API Key must have the Backup Manager or Project Owner role.

    Note: Results are empty while the job is INITIALIZING. Collection states exist after the job enters IN_PROGRESS.

    Example Usage

    The following example lists per-collection restore state for a job, then reads one collection by sourceNamespace. When sourceNamespace is omitted, the example defaults to the last namespace from the plural data source.

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    import * as std from "@pulumi/std";
    
    // Per-collection read-back for the resolved collection restore job.
    const _this = mongodbatlas.getCloudBackupCollectionRestoreJobCollections({
        projectId: projectId,
        clusterName: clusterName,
        jobId: jobId,
    });
    const collections = std.coalesce({
        input: [
            _this.then(_this => _this.results),
            [],
        ],
    }).result;
    const sourceNamespace = std.coalesce({
        input: [
            sourceNamespaceConfig,
            collections.length > 0 ? collections[collections.length - 1].sourceNamespace : null,
        ],
    }).result;
    export const collectionStates = .map(c => ({
        sourceNamespace: c.sourceNamespace,
        targetNamespace: c.targetNamespace,
        effectiveTargetNamespace: c.effectiveTargetNamespace,
        state: c.state,
        indexStatus: c.indexStatus,
        documents: `${c.restoredDocuments} / ${c.totalDocuments}`,
    }));
    const thisGetCloudBackupCollectionRestoreJobCollection = mongodbatlas.getCloudBackupCollectionRestoreJobCollection({
        projectId: projectId,
        clusterName: clusterName,
        jobId: jobId,
        sourceNamespace: sourceNamespace,
    });
    export const collectionState = thisGetCloudBackupCollectionRestoreJobCollection.then(thisGetCloudBackupCollectionRestoreJobCollection => thisGetCloudBackupCollectionRestoreJobCollection.state);
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    import pulumi_std as std
    
    # Per-collection read-back for the resolved collection restore job.
    this = mongodbatlas.get_cloud_backup_collection_restore_job_collections(project_id=project_id,
        cluster_name=cluster_name,
        job_id=job_id)
    collections = std.coalesce(input=[
        this.results,
        [],
    ])["result"]
    source_namespace = std.coalesce(input=[
        source_namespace_config,
        collections[len(collections) - 1]["sourceNamespace"] if len(collections) > 0 else None,
    ])["result"]
    pulumi.export("collectionStates", [{
        "sourceNamespace": c["sourceNamespace"],
        "targetNamespace": c["targetNamespace"],
        "effectiveTargetNamespace": c["effectiveTargetNamespace"],
        "state": c["state"],
        "indexStatus": c["indexStatus"],
        "documents": f"{c['restoredDocuments']} / {c['totalDocuments']}",
    } for c in collections])
    this_get_cloud_backup_collection_restore_job_collection = mongodbatlas.get_cloud_backup_collection_restore_job_collection(project_id=project_id,
        cluster_name=cluster_name,
        job_id=job_id,
        source_namespace=source_namespace)
    pulumi.export("collectionState", this_get_cloud_backup_collection_restore_job_collection.state)
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        // Per-collection read-back for the resolved collection restore job.
        var @this = Mongodbatlas.GetCloudBackupCollectionRestoreJobCollections.Invoke(new()
        {
            ProjectId = projectId,
            ClusterName = clusterName,
            JobId = jobId,
        });
    
        var collections = Std.Coalesce.Invoke(new()
        {
            Input = new[]
            {
                @this.Apply(@this => @this.Apply(getCloudBackupCollectionRestoreJobCollectionsResult => getCloudBackupCollectionRestoreJobCollectionsResult.Results)),
                new[] {},
            },
        }).Result;
    
        var sourceNamespace = Std.Coalesce.Invoke(new()
        {
            Input = new[]
            {
                sourceNamespaceConfig,
                collections.Length > 0 ? collections[collections.Length - 1].SourceNamespace : null,
            },
        }).Result;
    
        var thisGetCloudBackupCollectionRestoreJobCollection = Mongodbatlas.GetCloudBackupCollectionRestoreJobCollection.Invoke(new()
        {
            ProjectId = projectId,
            ClusterName = clusterName,
            JobId = jobId,
            SourceNamespace = sourceNamespace,
        });
    
        return new Dictionary<string, object?>
        {
            ["collectionStates"] = .Select(c => 
            {
                return 
                {
                    { "sourceNamespace", c.SourceNamespace },
                    { "targetNamespace", c.TargetNamespace },
                    { "effectiveTargetNamespace", c.EffectiveTargetNamespace },
                    { "state", c.State },
                    { "indexStatus", c.IndexStatus },
                    { "documents", $"{c.RestoredDocuments} / {c.TotalDocuments}" },
                };
            }).ToList(),
            ["collectionState"] = thisGetCloudBackupCollectionRestoreJobCollection.Apply(getCloudBackupCollectionRestoreJobCollectionResult => getCloudBackupCollectionRestoreJobCollectionResult.State),
        };
    });
    
    Example coming soon!
    
    Example coming soon!
    
    pulumi {
      required_providers {
        mongodbatlas = {
          source = "pulumi/mongodbatlas"
        }
      }
    }
    
    data "mongodbatlas_getcloudbackupcollectionrestorejobcollections" "this" {
      project_id   = projectId
      cluster_name = clusterName
      job_id       = jobId
    }
    data "std_coalesce" "invoke_1" {
      input = [data.mongodbatlas_getcloudbackupcollectionrestorejobcollections.this.results, []]
    }
    data "std_coalesce" "invoke_2" {
      input = [sourceNamespaceConfig, length(local.collections) > 0 ? local.collections[length(local.collections) - 1].source_namespace : null]
    }
    data "mongodbatlas_getcloudbackupcollectionrestorejobcollection" "thisGetCloudBackupCollectionRestoreJobCollection" {
      project_id       = projectId
      cluster_name     = clusterName
      job_id           = jobId
      source_namespace = local.sourceNamespace
    }
    
    # Per-collection read-back for the resolved collection restore job.
    locals {
      collections = data.std_coalesce.invoke_1.result
    }
    locals {
      sourceNamespace = data.std_coalesce.invoke_2.result
    }
    output "collectionStates" {
      value = [for c in local.collections : {
        "sourceNamespace"          = c.sourceNamespace
        "targetNamespace"          = c.targetNamespace
        "effectiveTargetNamespace" = c.effectiveTargetNamespace
        "state"                    = c.state
        "indexStatus"              = c.indexStatus
        "documents"                ="${c.restoredDocuments} / ${c.totalDocuments}"
      } ]
    }
    output "collectionState" {
      value = data.mongodbatlas_getcloudbackupcollectionrestorejobcollection.thisGetCloudBackupCollectionRestoreJobCollection.state
    }
    

    Further Examples

    • Restore job inspection
    • Snapshot restore
    • Point-in-time restore
    • Snapshot discovery

    Using getCloudBackupCollectionRestoreJobCollections

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCloudBackupCollectionRestoreJobCollections(args: GetCloudBackupCollectionRestoreJobCollectionsArgs, opts?: InvokeOptions): Promise<GetCloudBackupCollectionRestoreJobCollectionsResult>
    function getCloudBackupCollectionRestoreJobCollectionsOutput(args: GetCloudBackupCollectionRestoreJobCollectionsOutputArgs, opts?: InvokeOutputOptions): Output<GetCloudBackupCollectionRestoreJobCollectionsResult>
    def get_cloud_backup_collection_restore_job_collections(cluster_name: Optional[str] = None,
                                                            job_id: Optional[str] = None,
                                                            project_id: Optional[str] = None,
                                                            source_namespace: Optional[str] = None,
                                                            state: Optional[str] = None,
                                                            target_namespace: Optional[str] = None,
                                                            opts: Optional[InvokeOptions] = None) -> GetCloudBackupCollectionRestoreJobCollectionsResult
    def get_cloud_backup_collection_restore_job_collections_output(cluster_name: pulumi.Input[Optional[str]] = None,
                                                            job_id: pulumi.Input[Optional[str]] = None,
                                                            project_id: pulumi.Input[Optional[str]] = None,
                                                            source_namespace: pulumi.Input[Optional[str]] = None,
                                                            state: pulumi.Input[Optional[str]] = None,
                                                            target_namespace: pulumi.Input[Optional[str]] = None,
                                                            opts: Optional[InvokeOutputOptions] = None) -> Output[GetCloudBackupCollectionRestoreJobCollectionsResult]
    func LookupCloudBackupCollectionRestoreJobCollections(ctx *Context, args *LookupCloudBackupCollectionRestoreJobCollectionsArgs, opts ...InvokeOption) (*LookupCloudBackupCollectionRestoreJobCollectionsResult, error)
    func LookupCloudBackupCollectionRestoreJobCollectionsOutput(ctx *Context, args *LookupCloudBackupCollectionRestoreJobCollectionsOutputArgs, opts ...InvokeOption) LookupCloudBackupCollectionRestoreJobCollectionsResultOutput

    > Note: This function is named LookupCloudBackupCollectionRestoreJobCollections in the Go SDK.

    public static class GetCloudBackupCollectionRestoreJobCollections 
    {
        public static Task<GetCloudBackupCollectionRestoreJobCollectionsResult> InvokeAsync(GetCloudBackupCollectionRestoreJobCollectionsArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudBackupCollectionRestoreJobCollectionsResult> Invoke(GetCloudBackupCollectionRestoreJobCollectionsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudBackupCollectionRestoreJobCollectionsResult> Invoke(GetCloudBackupCollectionRestoreJobCollectionsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetCloudBackupCollectionRestoreJobCollectionsResult> getCloudBackupCollectionRestoreJobCollections(GetCloudBackupCollectionRestoreJobCollectionsArgs args, InvokeOptions options)
    public static Output<GetCloudBackupCollectionRestoreJobCollectionsResult> getCloudBackupCollectionRestoreJobCollections(GetCloudBackupCollectionRestoreJobCollectionsArgs args, InvokeOptions options)
    public static Output<GetCloudBackupCollectionRestoreJobCollectionsResult> getCloudBackupCollectionRestoreJobCollections(GetCloudBackupCollectionRestoreJobCollectionsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: mongodbatlas:index/getCloudBackupCollectionRestoreJobCollections:getCloudBackupCollectionRestoreJobCollections
      arguments:
        # arguments dictionary
    data "mongodbatlas_get_cloud_backup_collection_restore_job_collections" "name" {
        # arguments
    }

    The following arguments are supported:

    ClusterName string
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    JobId string
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    SourceNamespace string
    Source namespace to filter by (e.g. db.collection).
    State string
    Collection-level state to filter by.
    TargetNamespace string
    Target namespace to filter by (e.g. db.collection).
    ClusterName string
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    JobId string
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    SourceNamespace string
    Source namespace to filter by (e.g. db.collection).
    State string
    Collection-level state to filter by.
    TargetNamespace string
    Target namespace to filter by (e.g. db.collection).
    cluster_name string
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    job_id string
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    project_id string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    source_namespace string
    Source namespace to filter by (e.g. db.collection).
    state string
    Collection-level state to filter by.
    target_namespace string
    Target namespace to filter by (e.g. db.collection).
    clusterName String
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    jobId String
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    sourceNamespace String
    Source namespace to filter by (e.g. db.collection).
    state String
    Collection-level state to filter by.
    targetNamespace String
    Target namespace to filter by (e.g. db.collection).
    clusterName string
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    jobId string
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    sourceNamespace string
    Source namespace to filter by (e.g. db.collection).
    state string
    Collection-level state to filter by.
    targetNamespace string
    Target namespace to filter by (e.g. db.collection).
    cluster_name str
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    job_id str
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    source_namespace str
    Source namespace to filter by (e.g. db.collection).
    state str
    Collection-level state to filter by.
    target_namespace str
    Target namespace to filter by (e.g. db.collection).
    clusterName String
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    jobId String
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    sourceNamespace String
    Source namespace to filter by (e.g. db.collection).
    state String
    Collection-level state to filter by.
    targetNamespace String
    Target namespace to filter by (e.g. db.collection).

    getCloudBackupCollectionRestoreJobCollections Result

    The following output properties are available:

    ClusterName string
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    JobId string
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    Results List<GetCloudBackupCollectionRestoreJobCollectionsResult>
    List of returned documents that MongoDB Cloud provides when completing this request.
    SourceNamespace string
    Source namespace to filter by (e.g. db.collection).
    State string
    Collection-level state to filter by.
    TargetNamespace string
    Target namespace to filter by (e.g. db.collection).
    ClusterName string
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    JobId string
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    Results []GetCloudBackupCollectionRestoreJobCollectionsResult
    List of returned documents that MongoDB Cloud provides when completing this request.
    SourceNamespace string
    Source namespace to filter by (e.g. db.collection).
    State string
    Collection-level state to filter by.
    TargetNamespace string
    Target namespace to filter by (e.g. db.collection).
    cluster_name string
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    job_id string
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    project_id string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results list(object)
    List of returned documents that MongoDB Cloud provides when completing this request.
    source_namespace string
    Source namespace to filter by (e.g. db.collection).
    state string
    Collection-level state to filter by.
    target_namespace string
    Target namespace to filter by (e.g. db.collection).
    clusterName String
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    jobId String
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results List<GetCloudBackupCollectionRestoreJobCollectionsResult>
    List of returned documents that MongoDB Cloud provides when completing this request.
    sourceNamespace String
    Source namespace to filter by (e.g. db.collection).
    state String
    Collection-level state to filter by.
    targetNamespace String
    Target namespace to filter by (e.g. db.collection).
    clusterName string
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    jobId string
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results GetCloudBackupCollectionRestoreJobCollectionsResult[]
    List of returned documents that MongoDB Cloud provides when completing this request.
    sourceNamespace string
    Source namespace to filter by (e.g. db.collection).
    state string
    Collection-level state to filter by.
    targetNamespace string
    Target namespace to filter by (e.g. db.collection).
    cluster_name str
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    job_id str
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results Sequence[GetCloudBackupCollectionRestoreJobCollectionsResult]
    List of returned documents that MongoDB Cloud provides when completing this request.
    source_namespace str
    Source namespace to filter by (e.g. db.collection).
    state str
    Collection-level state to filter by.
    target_namespace str
    Target namespace to filter by (e.g. db.collection).
    clusterName String
    Human-readable label that identifies the cluster with the collection restore job you want to return.
    jobId String
    Unique 24-hexadecimal digit string that identifies the collection restore job.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results List<Property Map>
    List of returned documents that MongoDB Cloud provides when completing this request.
    sourceNamespace String
    Source namespace to filter by (e.g. db.collection).
    state String
    Collection-level state to filter by.
    targetNamespace String
    Target namespace to filter by (e.g. db.collection).

    Supporting Types

    GetCloudBackupCollectionRestoreJobCollectionsResult

    EffectiveTargetNamespace string
    Actual target namespace after restore (e.g. after conflict rename).
    IndexStatus GetCloudBackupCollectionRestoreJobCollectionsResultIndexStatus
    Index build status for a collection within a restore job.
    RestoredDocuments int
    Number of documents restored so far.
    SourceNamespace string
    Source namespace that was requested to restore.
    State string
    Current state of this collection within the restore job.
    TargetNamespace string
    Requested target namespace for the restored collection.
    TotalDocuments int
    Total document count for this collection.
    EffectiveTargetNamespace string
    Actual target namespace after restore (e.g. after conflict rename).
    IndexStatus GetCloudBackupCollectionRestoreJobCollectionsResultIndexStatus
    Index build status for a collection within a restore job.
    RestoredDocuments int
    Number of documents restored so far.
    SourceNamespace string
    Source namespace that was requested to restore.
    State string
    Current state of this collection within the restore job.
    TargetNamespace string
    Requested target namespace for the restored collection.
    TotalDocuments int
    Total document count for this collection.
    effective_target_namespace string
    Actual target namespace after restore (e.g. after conflict rename).
    index_status object
    Index build status for a collection within a restore job.
    restored_documents number
    Number of documents restored so far.
    source_namespace string
    Source namespace that was requested to restore.
    state string
    Current state of this collection within the restore job.
    target_namespace string
    Requested target namespace for the restored collection.
    total_documents number
    Total document count for this collection.
    effectiveTargetNamespace String
    Actual target namespace after restore (e.g. after conflict rename).
    indexStatus GetCloudBackupCollectionRestoreJobCollectionsResultIndexStatus
    Index build status for a collection within a restore job.
    restoredDocuments Integer
    Number of documents restored so far.
    sourceNamespace String
    Source namespace that was requested to restore.
    state String
    Current state of this collection within the restore job.
    targetNamespace String
    Requested target namespace for the restored collection.
    totalDocuments Integer
    Total document count for this collection.
    effectiveTargetNamespace string
    Actual target namespace after restore (e.g. after conflict rename).
    indexStatus GetCloudBackupCollectionRestoreJobCollectionsResultIndexStatus
    Index build status for a collection within a restore job.
    restoredDocuments number
    Number of documents restored so far.
    sourceNamespace string
    Source namespace that was requested to restore.
    state string
    Current state of this collection within the restore job.
    targetNamespace string
    Requested target namespace for the restored collection.
    totalDocuments number
    Total document count for this collection.
    effective_target_namespace str
    Actual target namespace after restore (e.g. after conflict rename).
    index_status GetCloudBackupCollectionRestoreJobCollectionsResultIndexStatus
    Index build status for a collection within a restore job.
    restored_documents int
    Number of documents restored so far.
    source_namespace str
    Source namespace that was requested to restore.
    state str
    Current state of this collection within the restore job.
    target_namespace str
    Requested target namespace for the restored collection.
    total_documents int
    Total document count for this collection.
    effectiveTargetNamespace String
    Actual target namespace after restore (e.g. after conflict rename).
    indexStatus Property Map
    Index build status for a collection within a restore job.
    restoredDocuments Number
    Number of documents restored so far.
    sourceNamespace String
    Source namespace that was requested to restore.
    state String
    Current state of this collection within the restore job.
    targetNamespace String
    Requested target namespace for the restored collection.
    totalDocuments Number
    Total document count for this collection.

    GetCloudBackupCollectionRestoreJobCollectionsResultIndexStatus

    ErrorMessage string
    Error message if index build failed.
    FailedIndexes List<string>
    List of index specifications that failed to build (up to 64 items).
    State string
    Index build state indicating the status of index creation during or after a restore operation.
    ErrorMessage string
    Error message if index build failed.
    FailedIndexes []string
    List of index specifications that failed to build (up to 64 items).
    State string
    Index build state indicating the status of index creation during or after a restore operation.
    error_message string
    Error message if index build failed.
    failed_indexes list(string)
    List of index specifications that failed to build (up to 64 items).
    state string
    Index build state indicating the status of index creation during or after a restore operation.
    errorMessage String
    Error message if index build failed.
    failedIndexes List<String>
    List of index specifications that failed to build (up to 64 items).
    state String
    Index build state indicating the status of index creation during or after a restore operation.
    errorMessage string
    Error message if index build failed.
    failedIndexes string[]
    List of index specifications that failed to build (up to 64 items).
    state string
    Index build state indicating the status of index creation during or after a restore operation.
    error_message str
    Error message if index build failed.
    failed_indexes Sequence[str]
    List of index specifications that failed to build (up to 64 items).
    state str
    Index build state indicating the status of index creation during or after a restore operation.
    errorMessage String
    Error message if index build failed.
    failedIndexes List<String>
    List of index specifications that failed to build (up to 64 items).
    state String
    Index build state indicating the status of index creation during or after a restore operation.

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo mongodbatlas logo
    Viewing docs for MongoDB Atlas v4.15.0
    published on Friday, Aug 28, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial