mongodbatlas logo
MongoDB Atlas v3.7.2, Mar 31 23

mongodbatlas.getOnlineArchives

Explore with Pulumi AI

mongodbatlas.OnlineArchive Describes the list of all the online archives for a cluster

NOTE: Groups and projects are synonymous terms. You may find group_id in the official documentation.

Attributes reference

Each object in the results array represents an online archive with the following attributes:

  • archive_id - ID of the online archive.
  • db_name - Name of the database that contains the collection.
  • coll_name - Name of the collection.
  • collection_type - Classification of MongoDB database collection that you want to return, “TIMESERIES” or “STANDARD”. Default is “STANDARD”.
  • criteria - Criteria to use for archiving data.
  • criteria.type - Type of criteria (DATE, CUSTOM)
  • criteria.date_field - Name of an already indexed date field from the documents. Data is archived when the current date is greater than the value of the date field specified here plus the number of days specified via the expire_after_days parameter.
  • criteria.date_format - the date format. Valid values: ISODATE (default), EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS
  • criteria.expire_after_days - Number of days that specifies the age limit for the data in the live Atlas cluster.
  • criteria.query - JSON query to use to select documents for archiving. Only for CUSTOM type
  • partition_fields - Fields to use to partition data.
  • partition_fields.field_name - Name of the field. To specify a nested field, use the dot notation.
  • partition_fields.order - Position of the field in the partition. Value can be: 0,1,2 By default, the date field specified in the criteria.dateField parameter is in the first position of the partition.
  • partitio_fields.field_type - Type of the partition field
  • state - Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted

See MongoDB Atlas API Documentation for more information.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = Mongodbatlas.GetOnlineArchives.Invoke(new()
    {
        ProjectId = @var.Project_id,
        ClusterName = @var.Cluster_name,
    });

});
package main

import (
	"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := mongodbatlas.LookupOnlineArchives(ctx, &mongodbatlas.LookupOnlineArchivesArgs{
			ProjectId:   _var.Project_id,
			ClusterName: _var.Cluster_name,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.inputs.GetOnlineArchivesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var test = MongodbatlasFunctions.getOnlineArchives(GetOnlineArchivesArgs.builder()
            .projectId(var_.project_id())
            .clusterName(var_.cluster_name())
            .build());

    }
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.get_online_archives(project_id=var["project_id"],
    cluster_name=var["cluster_name"])
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = mongodbatlas.getOnlineArchives({
    projectId: _var.project_id,
    clusterName: _var.cluster_name,
});
variables:
  test:
    fn::invoke:
      Function: mongodbatlas:getOnlineArchives
      Arguments:
        projectId: ${var.project_id}
        clusterName: ${var.cluster_name}

Using getOnlineArchives

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 getOnlineArchives(args: GetOnlineArchivesArgs, opts?: InvokeOptions): Promise<GetOnlineArchivesResult>
function getOnlineArchivesOutput(args: GetOnlineArchivesOutputArgs, opts?: InvokeOptions): Output<GetOnlineArchivesResult>
def get_online_archives(cluster_name: Optional[str] = None,
                        project_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetOnlineArchivesResult
def get_online_archives_output(cluster_name: Optional[pulumi.Input[str]] = None,
                        project_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetOnlineArchivesResult]
func LookupOnlineArchives(ctx *Context, args *LookupOnlineArchivesArgs, opts ...InvokeOption) (*LookupOnlineArchivesResult, error)
func LookupOnlineArchivesOutput(ctx *Context, args *LookupOnlineArchivesOutputArgs, opts ...InvokeOption) LookupOnlineArchivesResultOutput

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

public static class GetOnlineArchives 
{
    public static Task<GetOnlineArchivesResult> InvokeAsync(GetOnlineArchivesArgs args, InvokeOptions? opts = null)
    public static Output<GetOnlineArchivesResult> Invoke(GetOnlineArchivesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetOnlineArchivesResult> getOnlineArchives(GetOnlineArchivesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: mongodbatlas:index/getOnlineArchives:getOnlineArchives
  arguments:
    # arguments dictionary

The following arguments are supported:

ClusterName string

Name of the cluster that contains the collection.

ProjectId string

The unique ID for the project.

ClusterName string

Name of the cluster that contains the collection.

ProjectId string

The unique ID for the project.

clusterName String

Name of the cluster that contains the collection.

projectId String

The unique ID for the project.

clusterName string

Name of the cluster that contains the collection.

projectId string

The unique ID for the project.

cluster_name str

Name of the cluster that contains the collection.

project_id str

The unique ID for the project.

clusterName String

Name of the cluster that contains the collection.

projectId String

The unique ID for the project.

getOnlineArchives Result

The following output properties are available:

ClusterName string
Id string

The provider-assigned unique ID for this managed resource.

ProjectId string
Results List<GetOnlineArchivesResult>
TotalCount int
ClusterName string
Id string

The provider-assigned unique ID for this managed resource.

ProjectId string
Results []GetOnlineArchivesResult
TotalCount int
clusterName String
id String

The provider-assigned unique ID for this managed resource.

projectId String
results List<GetOnlineArchivesResult>
totalCount Integer
clusterName string
id string

The provider-assigned unique ID for this managed resource.

projectId string
results GetOnlineArchivesResult[]
totalCount number
cluster_name str
id str

The provider-assigned unique ID for this managed resource.

project_id str
results Sequence[GetOnlineArchivesResult]
total_count int
clusterName String
id String

The provider-assigned unique ID for this managed resource.

projectId String
results List<Property Map>
totalCount Number

Supporting Types

GetOnlineArchivesResult

ArchiveId string
ClusterName string

Name of the cluster that contains the collection.

CollName string
CollectionType string
Criterias List<GetOnlineArchivesResultCriteria>
DbName string
PartitionFields List<GetOnlineArchivesResultPartitionField>
Paused bool
ProjectId string

The unique ID for the project.

State string
ArchiveId string
ClusterName string

Name of the cluster that contains the collection.

CollName string
CollectionType string
Criterias []GetOnlineArchivesResultCriteria
DbName string
PartitionFields []GetOnlineArchivesResultPartitionField
Paused bool
ProjectId string

The unique ID for the project.

State string
archiveId String
clusterName String

Name of the cluster that contains the collection.

collName String
collectionType String
criterias List<GetOnlineArchivesResultCriteria>
dbName String
partitionFields List<GetOnlineArchivesResultPartitionField>
paused Boolean
projectId String

The unique ID for the project.

state String
archiveId string
clusterName string

Name of the cluster that contains the collection.

collName string
collectionType string
criterias GetOnlineArchivesResultCriteria[]
dbName string
partitionFields GetOnlineArchivesResultPartitionField[]
paused boolean
projectId string

The unique ID for the project.

state string
archiveId String
clusterName String

Name of the cluster that contains the collection.

collName String
collectionType String
criterias List<Property Map>
dbName String
partitionFields List<Property Map>
paused Boolean
projectId String

The unique ID for the project.

state String

GetOnlineArchivesResultCriteria

DateField string
DateFormat string
ExpireAfterDays int
Query string
Type string
DateField string
DateFormat string
ExpireAfterDays int
Query string
Type string
dateField String
dateFormat String
expireAfterDays Integer
query String
type String
dateField string
dateFormat string
expireAfterDays number
query string
type string
dateField String
dateFormat String
expireAfterDays Number
query String
type String

GetOnlineArchivesResultPartitionField

FieldName string
FieldType string
Order int
FieldName string
FieldType string
Order int
fieldName String
fieldType String
order Integer
fieldName string
fieldType string
order number
fieldName String
fieldType String
order Number

Package Details

Repository
MongoDB Atlas pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes

This Pulumi package is based on the mongodbatlas Terraform Provider.