mongodbatlas

package
v0.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 15 Imported by: 47

Documentation

Overview

Package mongodbatlas provides a client for using the MongoDB Atlas API.

Usage

import "go.mongodb.org/atlas/mongodbatlas"

Construct a new Atlas client, then use the various services on the client to access different parts of the Ops Manager API. For example:

client := mongodbatlas.NewClient(nil)

The services of a client divide the API into logical chunks and correspond to the structure of the Ops Manager API documentation at https://docs.atlas.mongodb.com/api/.

NOTE: Using the https://godoc.org/context package, one can easily pass cancellation signals and deadlines to various services of the client for handling a request. In case there is no context available, then context.Background() can be used as a starting point.

Authentication:

The mongodbatlas library does not directly handle authentication. Instead, when creating a new client, pass an http.Client that can handle Digest Access authentication for you. The easiest way to do this is using the https://github.com/mongodb-forks/digest library, but you can always use any other library that provides an `http.Client`. If you have a private and public API token pair (https://docs.atlas.mongodb.com/configure-api-access), you can use it with the digest library using:

import (
	"context"
	"log"

	"github.com/mongodb-forks/digest"
	"go.mongodb.org/atlas/mongodbatlas"
)

func main() {
	t := digest.NewTransport("your public key", "your private key")
	tc, err := t.Client()
	if err != nil {
		log.Fatalf(err.Error())
	}

	client := mongodbatlas.NewClient(tc)
	orgs, _, err := client.Projects.GetAllProjects(context.Background(), nil)
}

Note that when using an authenticated Client, all calls made by the client will include the specified tokens. Therefore, authenticated clients should almost never be shared between different users.

Index

Constants

View Source
const (
	// CaCentral1 represents the CA_CENTRAL_1 America region for AWS Configuration.
	CaCentral1 = "CA_CENTRAL_1"
	// UsEast1 represents the US_EAST_1 America region for AWS Configuration.
	UsEast1 = "US_EAST_1"
	// UsEast2 represents the US_EAST_2 America region for AWS Configuration.
	UsEast2 = "US_EAST_2"
	// UsWest1 represents the US_WEST_1 America region for AWS Configuration.
	UsWest1 = "US_WEST_1"
	// UsWest2 represents the US_WEST_2 America region for AWS Configuration.
	UsWest2 = "US_WEST_2"
	// SaEast1 represents the SA_EAST_1 America region for AWS Configuration.
	SaEast1 = "SA_EAST_1"

	// ApNortheast1 represents the AP_NORTHEAST_1 Asia region for AWS Configuration.
	ApNortheast1 = "AP_NORTHEAST_1"
	// ApNortheast2 represents the AP_NORTHEAST_2 Asia region for AWS Configuration.
	ApNortheast2 = "AP_NORTHEAST_2"
	// ApSouth1 represents the AP_SOUTH_1 Asia region for AWS Configuration.
	ApSouth1 = "AP_SOUTH_1"
	// ApSoutheast1 represents the AP_SOUTHEAST_1 Asia region for AWS Configuration.
	ApSoutheast1 = "AP_SOUTHEAST_1"
	// ApSoutheast2 represents the AP_SOUTHEAST_2 Asia region for AWS Configuration.
	ApSoutheast2 = "AP_SOUTHEAST_2"

	// EuCentral1 represents the EU_CENTRAL_1 Europe region for AWS Configuration.
	EuCentral1 = "EU_CENTRAL_1"
	// EuWest1 represents the EU_WEST_1 Europe region for AWS Configuration.
	EuWest1 = "EU_WEST_1"
	// EuWest2 represents the EU_WEST_2 Europe region for AWS Configuration.
	EuWest2 = "EU_WEST_2"
	// EuWest3 represents the EU_WEST_3 Europe region for AWS Configuration.
	EuWest3 = "EU_WEST_3"

	// Azure represents `AZURE` where the Azure account credentials reside.
	Azure = "AZURE"
	// AzureChina represents `AZURE_CHINA` AZURE where the Azure account credentials reside.
	AzureChina = "AZURE_CHINA"
	// AzureGermany represents `AZURE_GERMANY` AZURE where the Azure account credentials reside.
	AzureGermany = "AZURE_GERMANY"
)
View Source
const (

	// Sunday day of the week when you would like the maintenance window to start.
	Sunday = 1
	// Monday day of the week when you would like the maintenance window to start.
	Monday = 2
	// Tuesday day of the week when you would like the maintenance window to start.
	Tuesday = 3
	// Wednesday day of the week when you would like the maintenance window to start.
	Wednesday = 4
	// Thursday day of the week when you would like the maintenance window to start.
	Thursday = 5
	// Friday day of the week when you would like the maintenance window to start.
	Friday = 6
	// Saturday day of the week when you would like the maintenance window to start.
	Saturday = 7
)
View Source
const (
	// CloudURL is default base URL for the services.
	CloudURL = "https://cloud.mongodb.com/"

	// Version of the current API client. Should be set to the next version planned to be released.
	Version = "0.36.0"
)
View Source
const (
	// GroupOwner - Project Owner.
	GroupOwner = "GROUP_OWNER"
	// GroupReadOnly - Project Read Only.
	GroupReadOnly = "GROUP_READ_ONLY"
	// GroupDataAccessAdmin - Project Data Access Admin.
	GroupDataAccessAdmin = "GROUP_DATA_ACCESS_ADMIN"
	// GroupDataAccessReadWrite - Project Data Access Read/Write.
	GroupDataAccessReadWrite = "GROUP_DATA_ACCESS_READ_WRITE"
	// GroupDataAccessReadOnly - Project Data Access Read Only.
	GroupDataAccessReadOnly = "GROUP_DATA_ACCESS_READ_ONLY"
)
View Source
const (
	BackupCompliancePolicyBasePath = "api/atlas/v1.0/groups/%s/backupCompliancePolicy"
)

Variables

View Source
var DefaultDiskSizeGB = map[string]map[string]float64{
	"TENANT": {
		"M2": 2,
		"M5": 5,
	},
	"AWS": {
		"M10":       10,
		"M20":       20,
		"M30":       40,
		"M40":       80,
		"R40":       80,
		"M40_NVME":  380,
		"M50":       160,
		"R50":       160,
		"M50_NVME":  760,
		"M60":       320,
		"R60":       320,
		"M60_NVME":  1600,
		"M80":       750,
		"R80":       750,
		"M80_NVME":  1600,
		"M140":      1000,
		"M200":      1500,
		"R200":      1500,
		"M200_NVME": 3100,
		"M300":      2000,
		"R300":      2000,
		"R400":      3000,
		"M400_NVME": 4000,
	},
	"GCP": {
		"M10":  10,
		"M20":  20,
		"M30":  40,
		"M40":  80,
		"M50":  160,
		"M60":  320,
		"M80":  750,
		"M200": 1500,
		"M300": 2200,
	},
	"AZURE": {
		"M10":  32,
		"M20":  32,
		"M30":  32,
		"M40":  128,
		"M50":  128,
		"M60":  128,
		"M80":  256,
		"M200": 256,
	},
}

DefaultDiskSizeGB represents the Tier and the default disk size for each one it can be use like: DefaultDiskSizeGB["AWS"]["M10"].

Functions

func DoRequestWithClient

func DoRequestWithClient(
	ctx context.Context,
	client *http.Client,
	req *http.Request) (*http.Response, error)

DoRequestWithClient submits an HTTP request using the specified client.

Types

type APIKey

type APIKey struct {
	ID         string      `json:"id,omitempty"`
	Desc       string      `json:"desc,omitempty"`
	Roles      []AtlasRole `json:"roles,omitempty"`
	PrivateKey string      `json:"privateKey,omitempty"`
	PublicKey  string      `json:"publicKey,omitempty"`
}

APIKey represents MongoDB API Key.

type APIKeyInput

type APIKeyInput struct {
	Desc  string   `json:"desc,omitempty"`
	Roles []string `json:"roles,omitempty"`
}

APIKeyInput represents MongoDB API key input request for Create.

type APIKeysService

APIKeysService is an interface for interfacing with the APIKeys endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/apiKeys/

type APIKeysServiceOp

type APIKeysServiceOp service

APIKeysServiceOp handles communication with the APIKey related methods of the MongoDB Atlas API.

func (*APIKeysServiceOp) Create

func (s *APIKeysServiceOp) Create(ctx context.Context, orgID string, createRequest *APIKeyInput) (*APIKey, *Response, error)

Create an API Key by the {ORG-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-orgs-create-one/

func (*APIKeysServiceOp) Delete

func (s *APIKeysServiceOp) Delete(ctx context.Context, orgID, apiKeyID string) (*Response, error)

Delete the API Key specified to {API-KEY-ID} from the organization associated to {ORG-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/apiKey-delete-one-apiKey/

func (*APIKeysServiceOp) Get

func (s *APIKeysServiceOp) Get(ctx context.Context, orgID, apiKeyID string) (*APIKey, *Response, error)

Get gets the APIKey specified to {API-KEY-ID} from the organization associated to {ORG-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-orgs-get-one/

func (*APIKeysServiceOp) List

func (s *APIKeysServiceOp) List(ctx context.Context, orgID string, listOptions *ListOptions) ([]APIKey, *Response, error)

List all API-KEY in the organization associated to {ORG-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-orgs-get-all/

func (*APIKeysServiceOp) Update

func (s *APIKeysServiceOp) Update(ctx context.Context, orgID, apiKeyID string, updateRequest *APIKeyInput) (*APIKey, *Response, error)

Update a API Key in the organization associated to {ORG-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-orgs-update-one/

type AWSCustomDNSService

type AWSCustomDNSService interface {
	Get(context.Context, string) (*AWSCustomDNSSetting, *Response, error)
	Update(context.Context, string, *AWSCustomDNSSetting) (*AWSCustomDNSSetting, *Response, error)
}

AWSCustomDNSService provides access to the custom AWS DNS related functions in the Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/aws-custom-dns/

type AWSCustomDNSServiceOp

type AWSCustomDNSServiceOp service

AWSCustomDNSServiceOp provides an implementation of the CustomAWSDNS interface.

func (*AWSCustomDNSServiceOp) Get

Get retrieves the custom DNS configuration of an Atlas project’s clusters deployed to AWS.

See more: https://docs.atlas.mongodb.com/reference/api/aws-custom-dns-get/

func (*AWSCustomDNSServiceOp) Update

Update updates the custom DNS configuration of an Atlas project’s clusters deployed to AWS.

See more: https://docs.atlas.mongodb.com/reference/api/aws-custom-dns-update/

type AWSCustomDNSSetting

type AWSCustomDNSSetting struct {
	Enabled bool `json:"enabled"`
}

AWSCustomDNSSetting represents the dns settings.

type AccessListAPIKey added in v0.7.0

type AccessListAPIKey struct {
	CidrBlock       string  `json:"cidrBlock,omitempty"`       // CIDR-notated range of permitted IP addresses.
	Count           int     `json:"count,omitempty"`           // Total number of requests that have originated from this IP address.
	Created         string  `json:"created,omitempty"`         // Date this IP address was added to the access list.
	IPAddress       string  `json:"ipAddress,omitempty"`       // IP address in the API access list.
	LastUsed        string  `json:"lastUsed,omitempty"`        // Timestamp in ISO 8601 date and time format in UTC when the most recent request that originated from this IP address. This parameter only appears if at least one request has originated from this IP address, and is only updated when a permitted resource is accessed.
	LastUsedAddress string  `json:"lastUsedAddress,omitempty"` // IP address from which the last call to the API was issued. This field only appears if at least one request has originated from this IP address.
	Links           []*Link `json:"links,omitempty"`           // An array of documents, representing a link to one or more sub-resources and/or related resources such as list pagination. See Linking for more information.}
}

AccessListAPIKey represents a AccessList API key.

type AccessListAPIKeys added in v0.7.0

type AccessListAPIKeys struct {
	Results    []*AccessListAPIKey `json:"results,omitempty"`    // Includes one AccessListAPIKey object for each item detailed in the results array section.
	Links      []*Link             `json:"links,omitempty"`      // One or more links to sub-resources and/or related resources.
	TotalCount int                 `json:"totalCount,omitempty"` // Count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.
}

AccessListAPIKeys represents all AccessList API keys.

type AccessListAPIKeysReq added in v0.7.0

type AccessListAPIKeysReq struct {
	IPAddress string `json:"ipAddress,omitempty"` // IP address to be added to the access list for the API key.
	CidrBlock string `json:"cidrBlock,omitempty"` // CIDR-notation block of IP addresses to be added to the access list for the API key.
}

AccessListAPIKeysReq represents the request to the mehtod create.

type AccessListAPIKeysService added in v0.7.0

AccessListAPIKeysService is an interface for interfacing with the AccessList API Keys endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/apiKeys#organization-api-key-access-list-endpoints

type AccessListAPIKeysServiceOp added in v0.7.0

type AccessListAPIKeysServiceOp service

AccessListAPIKeysServiceOp handles communication with the AccessList API keys related methods of the MongoDB Atlas API.

func (*AccessListAPIKeysServiceOp) Create added in v0.7.0

func (s *AccessListAPIKeysServiceOp) Create(ctx context.Context, orgID, apiKeyID string, createRequest []*AccessListAPIKeysReq) (*AccessListAPIKeys, *Response, error)

Create creates one or more new access list entries for the specified API Key.

See more: https://docs.atlas.mongodb.com/reference/api/api-access-list/create-api-access-entries/

func (*AccessListAPIKeysServiceOp) Delete added in v0.7.0

func (s *AccessListAPIKeysServiceOp) Delete(ctx context.Context, orgID, apiKeyID, ipAddress string) (*Response, error)

Delete deletes the AccessList API keys.

See more: https://docs.atlas.mongodb.com/reference/api/api-access-list/delete-one-api-access-entry/

func (*AccessListAPIKeysServiceOp) Get added in v0.7.0

func (s *AccessListAPIKeysServiceOp) Get(ctx context.Context, orgID, apiKeyID, ipAddress string) (*AccessListAPIKey, *Response, error)

Get retrieves information on a single API Key access list entry using the unique identifier for the API Key and desired permitted address.

See more: https://docs.atlas.mongodb.com/reference/api/api-access-list/get-one-api-access-entry/

func (*AccessListAPIKeysServiceOp) List added in v0.7.0

func (s *AccessListAPIKeysServiceOp) List(ctx context.Context, orgID, apiKeyID string, listOptions *ListOptions) (*AccessListAPIKeys, *Response, error)

List gets all AccessList API keys.

See more: https://docs.atlas.mongodb.com/reference/api/api-access-list/get-all-api-access-entries/

type AccessLogOptions added in v0.12.0

type AccessLogOptions struct {
	Start      string `url:"start,omitempty"`      // Start is the timestamp in the number of milliseconds that have elapsed since the UNIX epoch for the first entry that Atlas returns from the database access logs.
	End        string `url:"end,omitempty"`        // End is the timestamp in the number of milliseconds that have elapsed since the UNIX epoch for the last entry that Atlas returns from the database access logs.
	NLogs      int    `url:"nLogs,omitempty"`      // NLogs is the maximum number of log entries to return. Atlas accepts values between 0 and 20000, inclusive.
	IPAddress  string `url:"ipAddress,omitempty"`  // IPAddress is the single IP address that attempted to authenticate with the database. Atlas filters the returned logs to include documents with only this IP address.
	AuthResult *bool  `url:"authResult,omitempty"` // AuthResult indicates whether to return either successful or failed authentication attempts. When set to true, Atlas filters the log to return only successful authentication attempts. When set to false, Atlas filters the log to return only failed authentication attempts.
}

AccessLogOptions represents the query options of AccessTrackingService.List.

type AccessLogSettings added in v0.12.0

type AccessLogSettings struct {
	AccessLogs []*AccessLogs `json:"accessLogs,omitempty"` // AccessLogs contains the authentication attempts made against the cluster.
}

AccessLogSettings represents database access history settings.

type AccessLogs added in v0.12.0

type AccessLogs struct {
	GroupID       string `json:"groupId,omitempty"`       // GroupID is the unique identifier for the project.
	Hostname      string `json:"hostname,omitempty"`      // Hostname is the hostname of the target node that received the authentication attempt.
	ClusterName   string `json:"clusterName,omitempty"`   // ClusterName is the name associated with the cluster.
	IPAddress     string `json:"ipAddress,omitempty"`     // IPAddress is the IP address that the authentication attempt originated from.
	AuthResult    *bool  `json:"authResult,omitempty"`    // AuthResult is the result of the authentication attempt. Returns true if the authentication request was successful. Returns false if the authentication request resulted in failure.
	LogLine       string `json:"logLine,omitempty"`       // LogLine is the text of the server log concerning the authentication attempt.
	Timestamp     string `json:"timestamp,omitempty"`     // Timestamp is the UTC timestamp of the authentication attempt.
	Username      string `json:"username,omitempty"`      // Username is the username that attempted to authenticate.
	FailureReason string `json:"failureReason,omitempty"` // FailureReason is the reason that the request failed to authenticate. Returns null if the authentication request was successful.
	AuthSource    string `json:"authSource,omitempty"`    // AuthSource is the database that the request attempted to authenticate against. Returns admin if the authentication source for the user is SCRAM-SHA. Returns $external if the authentication source for the user is LDAP.
}

AccessLogs represents authentication attempts made against the cluster.

type AccessTrackingService added in v0.12.0

type AccessTrackingService interface {
	ListByCluster(context.Context, string, string, *AccessLogOptions) (*AccessLogSettings, *Response, error)
	ListByHostname(context.Context, string, string, *AccessLogOptions) (*AccessLogSettings, *Response, error)
}

AccessTrackingService is an interface for interfacing with the Access Tracking endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/access-tracking/

type AccessTrackingServiceOp added in v0.12.0

type AccessTrackingServiceOp service

AccessTrackingServiceOp handles communication with the AccessTrackingService related methods of the MongoDB Atlas API.

func (*AccessTrackingServiceOp) ListByCluster added in v0.12.0

func (s *AccessTrackingServiceOp) ListByCluster(ctx context.Context, groupID, clusterName string, opts *AccessLogOptions) (*AccessLogSettings, *Response, error)

ListByCluster retrieves the access logs of a cluster by hostname.

See more: https://docs.atlas.mongodb.com/reference/api/access-tracking-get-database-history-hostname/

func (*AccessTrackingServiceOp) ListByHostname added in v0.12.0

func (s *AccessTrackingServiceOp) ListByHostname(ctx context.Context, groupID, hostname string, opts *AccessLogOptions) (*AccessLogSettings, *Response, error)

ListByHostname retrieves the access logs of a cluster by hostname.

See more: https://docs.atlas.mongodb.com/reference/api/access-tracking-get-database-history-hostname/

type AcknowledgeRequest

type AcknowledgeRequest struct {
	AcknowledgedUntil      *string `json:"acknowledgedUntil,omitempty"`      // The date through which the alert has been acknowledged. Will not be present if the alert has never been acknowledged.
	AcknowledgementComment string  `json:"acknowledgementComment,omitempty"` // The comment left by the user who acknowledged the alert. Will not be present if the alert has never been acknowledged.
}

AcknowledgeRequest contains the request Body Parameters.

type Action

type Action struct {
	Action    string     `json:"action,omitempty"`
	Resources []Resource `json:"resources,omitempty"`
}

An Action describes the operation the role will include, for a specific set of Resources.

type AdvancedAutoScaling added in v0.9.0

type AdvancedAutoScaling struct {
	DiskGB  *DiskGB  `json:"diskGB,omitempty"`
	Compute *Compute `json:"compute,omitempty"`
}

type AdvancedCluster added in v0.9.0

type AdvancedCluster struct {
	AcceptDataRisksAndForceReplicaSetReconfig string                     `json:"acceptDataRisksAndForceReplicaSetReconfig,omitempty"`
	BackupEnabled                             *bool                      `json:"backupEnabled,omitempty"`
	BiConnector                               *BiConnector               `json:"biConnector,omitempty"`
	ClusterType                               string                     `json:"clusterType,omitempty"`
	ConnectionStrings                         *ConnectionStrings         `json:"connectionStrings,omitempty"`
	DiskSizeGB                                *float64                   `json:"diskSizeGB,omitempty"`
	EncryptionAtRestProvider                  string                     `json:"encryptionAtRestProvider,omitempty"`
	GroupID                                   string                     `json:"groupId,omitempty"`
	ID                                        string                     `json:"id,omitempty"`
	Labels                                    []Label                    `json:"labels,omitempty"`
	MongoDBMajorVersion                       string                     `json:"mongoDBMajorVersion,omitempty"`
	MongoDBVersion                            string                     `json:"mongoDBVersion,omitempty"`
	Name                                      string                     `json:"name,omitempty"`
	Paused                                    *bool                      `json:"paused,omitempty"`
	PitEnabled                                *bool                      `json:"pitEnabled,omitempty"`
	StateName                                 string                     `json:"stateName,omitempty"`
	ReplicationSpecs                          []*AdvancedReplicationSpec `json:"replicationSpecs,omitempty"`
	CreateDate                                string                     `json:"createDate,omitempty"`
	RootCertType                              string                     `json:"rootCertType,omitempty"`
	VersionReleaseSystem                      string                     `json:"versionReleaseSystem,omitempty"`
	TerminationProtectionEnabled              *bool                      `json:"terminationProtectionEnabled,omitempty"`
	Tags                                      []*Tag                     `json:"tags,omitempty"`
}

AdvancedCluster represents MongoDB cluster.

type AdvancedClustersResponse added in v0.9.0

type AdvancedClustersResponse struct {
	Links      []*Link            `json:"links,omitempty"`
	Results    []*AdvancedCluster `json:"results,omitempty"`
	TotalCount int                `json:"totalCount,omitempty"`
}

AdvancedClustersResponse is the response from the AdvancedClustersService.List.

type AdvancedClustersService added in v0.9.0

type AdvancedClustersService interface {
	List(ctx context.Context, groupID string, options *ListOptions) (*AdvancedClustersResponse, *Response, error)
	Get(ctx context.Context, groupID, clusterName string) (*AdvancedCluster, *Response, error)
	Create(ctx context.Context, groupID string, cluster *AdvancedCluster) (*AdvancedCluster, *Response, error)
	Update(ctx context.Context, groupID, clusterName string, cluster *AdvancedCluster) (*AdvancedCluster, *Response, error)
	Delete(ctx context.Context, groupID, clusterName string, options *DeleteAdvanceClusterOptions) (*Response, error)
	TestFailover(ctx context.Context, groupID, clusterName string) (*Response, error)
}

AdvancedClustersService is an interface for interfacing with the Clusters (Advanced) endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/clusters-advanced/

type AdvancedClustersServiceOp added in v0.9.0

type AdvancedClustersServiceOp service

AdvancedClustersServiceOp handles communication with the Cluster (Advanced) related methods of the MongoDB Atlas API.

func (*AdvancedClustersServiceOp) Create added in v0.9.0

func (s *AdvancedClustersServiceOp) Create(ctx context.Context, groupID string, createRequest *AdvancedCluster) (*AdvancedCluster, *Response, error)

Create adds a cluster to the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/cluster-advanced/create-one-cluster-advanced/

func (*AdvancedClustersServiceOp) Delete added in v0.9.0

func (s *AdvancedClustersServiceOp) Delete(ctx context.Context, groupID, clusterName string, options *DeleteAdvanceClusterOptions) (*Response, error)

Delete the cluster specified to {CLUSTER-NAME} from the project associated to {GROUP-ID}.

func (*AdvancedClustersServiceOp) Get added in v0.9.0

func (s *AdvancedClustersServiceOp) Get(ctx context.Context, groupID, clusterName string) (*AdvancedCluster, *Response, error)

Get gets the cluster specified to {ClUSTER-NAME} from the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/cluster-advanced/get-one-cluster-advanced/

func (*AdvancedClustersServiceOp) List added in v0.9.0

List all clusters in the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/cluster-advanced/get-all-cluster-advanced/

func (*AdvancedClustersServiceOp) TestFailover added in v0.22.0

func (s *AdvancedClustersServiceOp) TestFailover(ctx context.Context, groupID, clusterName string) (*Response, error)

TestFailover starts a failover test for the specified cluster in the specified project

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Multi-Cloud-Clusters/operation/testFailover

func (*AdvancedClustersServiceOp) Update added in v0.9.0

func (s *AdvancedClustersServiceOp) Update(ctx context.Context, groupID, clusterName string, updateRequest *AdvancedCluster) (*AdvancedCluster, *Response, error)

Update a cluster in the project associated to {GROUP-ID}

See more: https://docs.atlas.mongodb.com/reference/api/cluster-advanced/modify-one-cluster-advanced/

type AdvancedRegionConfig added in v0.9.0

type AdvancedRegionConfig struct {
	AnalyticsAutoScaling *AdvancedAutoScaling `json:"analyticsAutoScaling,omitempty"`
	AnalyticsSpecs       *Specs               `json:"analyticsSpecs,omitempty"`
	ElectableSpecs       *Specs               `json:"electableSpecs,omitempty"`
	ReadOnlySpecs        *Specs               `json:"readOnlySpecs,omitempty"`
	AutoScaling          *AdvancedAutoScaling `json:"autoScaling,omitempty"`
	BackingProviderName  string               `json:"backingProviderName,omitempty"`
	Priority             *int                 `json:"priority,omitempty"`
	ProviderName         string               `json:"providerName,omitempty"`
	RegionName           string               `json:"regionName,omitempty"`
}

type AdvancedReplicationSpec added in v0.10.0

type AdvancedReplicationSpec struct {
	NumShards     int                     `json:"numShards,omitempty"`
	ID            string                  `json:"id,omitempty"`
	ZoneName      string                  `json:"zoneName,omitempty"`
	RegionConfigs []*AdvancedRegionConfig `json:"regionConfigs,omitempty"`
}

type Alert

type Alert struct {
	ID                     string           `json:"id,omitempty"`                     // Unique identifier.
	GroupID                string           `json:"groupId,omitempty"`                // Unique identifier of the project that owns this alert configuration.
	AlertConfigID          string           `json:"alertConfigId,omitempty"`          // ID of the alert configuration that triggered this alert.
	EventTypeName          string           `json:"eventTypeName,omitempty"`          // The type of event that will trigger an alert.
	Created                string           `json:"created,omitempty"`                // Timestamp in ISO 8601 date and time format in UTC when this alert was opened.
	Updated                string           `json:"updated,omitempty"`                // Timestamp in ISO 8601 date and time format in UTC when this alert was last updated.
	Enabled                *bool            `json:"enabled,omitempty"`                // If omitted, the configuration is disabled.
	Resolved               string           `json:"resolved,omitempty"`               // When the alert was closed. Only present if the status is CLOSED.
	Status                 string           `json:"status,omitempty"`                 // The current state of the alert. Possible values are: TRACKING, OPEN, CLOSED, CANCELLED
	LastNotified           string           `json:"lastNotified,omitempty"`           // When the last notification was sent for this alert. Only present if notifications have been sent.
	AcknowledgedUntil      string           `json:"acknowledgedUntil,omitempty"`      // The date through which the alert has been acknowledged. Will not be present if the alert has never been acknowledged.
	AcknowledgementComment string           `json:"acknowledgementComment,omitempty"` // The comment left by the user who acknowledged the alert. Will not be present if the alert has never been acknowledged.
	AcknowledgingUsername  string           `json:"acknowledgingUsername,omitempty"`  // The username of the user who acknowledged the alert. Will not be present if the alert has never been acknowledged.
	HostnameAndPort        string           `json:"hostnameAndPort,omitempty"`        // The hostname and port of each host to which the alert applies. Only present for alerts of type HOST, HOST_METRIC, and REPLICA_SET.
	MetricName             string           `json:"metricName,omitempty"`             // The name of the measurement whose value went outside the threshold. Only present if eventTypeName is set to OUTSIDE_METRIC_THRESHOLD.
	CurrentValue           *CurrentValue    `json:"currentValue,omitempty"`           // CurrentValue represents current value of the metric that triggered the alert. Only present for alerts of type HOST_METRIC.
	ReplicaSetName         string           `json:"replicaSetName,omitempty"`         // Name of the replica set. Only present for alerts of type HOST, HOST_METRIC, BACKUP, and REPLICA_SET.
	ClusterName            string           `json:"clusterName,omitempty"`            // The name the cluster to which this alert applies. Only present for alerts of type BACKUP, REPLICA_SET, and CLUSTER.
	Matchers               []Matcher        `json:"matchers,omitempty"`               // You can filter using the matchers array only when the EventTypeName specifies an event for a host, replica set, or sharded cluster.
	MetricThreshold        *MetricThreshold `json:"metricThreshold,omitempty"`        // MetricThreshold  causes an alert to be triggered.
	Notifications          []Notification   `json:"notifications,omitempty"`          // Notifications are sending when an alert condition is detected.
}

Alert represents MongoDB Alert.

type AlertConfiguration

type AlertConfiguration struct {
	ID                     string           `json:"id,omitempty"`                     // Unique identifier.
	GroupID                string           `json:"groupId,omitempty"`                // Unique identifier of the project that owns this alert configuration.
	AlertConfigID          string           `json:"alertConfigId,omitempty"`          // ID of the alert configuration that triggered this alert.
	EventTypeName          string           `json:"eventTypeName,omitempty"`          // The type of event that will trigger an alert.
	Created                string           `json:"created,omitempty"`                // Timestamp in ISO 8601 date and time format in UTC when this alert configuration was created.
	Status                 string           `json:"status,omitempty"`                 // The current state of the alert. Possible values are: TRACKING, OPEN, CLOSED, CANCELLED
	AcknowledgedUntil      string           `json:"acknowledgedUntil,omitempty"`      // The date through which the alert has been acknowledged. Will not be present if the alert has never been acknowledged.
	AcknowledgementComment string           `json:"acknowledgementComment,omitempty"` // The comment left by the user who acknowledged the alert. Will not be present if the alert has never been acknowledged.
	AcknowledgingUsername  string           `json:"acknowledgingUsername,omitempty"`  // The username of the user who acknowledged the alert. Will not be present if the alert has never been acknowledged.
	Updated                string           `json:"updated,omitempty"`                // Timestamp in ISO 8601 date and time format in UTC when this alert configuration was last updated.
	Resolved               string           `json:"resolved,omitempty"`               // When the alert was closed. Only present if the status is CLOSED.
	LastNotified           string           `json:"lastNotified,omitempty"`           // When the last notification was sent for this alert. Only present if notifications have been sent.
	HostnameAndPort        string           `json:"hostnameAndPort,omitempty"`        // The hostname and port of each host to which the alert applies. Only present for alerts of type HOST, HOST_METRIC, and REPLICA_SET.
	HostID                 string           `json:"hostId,omitempty"`                 // ID of the host to which the metric pertains. Only present for alerts of type HOST, HOST_METRIC, and REPLICA_SET.
	ReplicaSetName         string           `json:"replicaSetName,omitempty"`         // Name of the replica set. Only present for alerts of type HOST, HOST_METRIC, BACKUP, and REPLICA_SET.
	MetricName             string           `json:"metricName,omitempty"`             // The name of the measurement whose value went outside the threshold. Only present if eventTypeName is set to OUTSIDE_METRIC_THRESHOLD.
	Enabled                *bool            `json:"enabled,omitempty"`                // If omitted, the configuration is disabled.
	ClusterID              string           `json:"clusterId,omitempty"`              // The ID of the cluster to which this alert applies. Only present for alerts of type BACKUP, REPLICA_SET, and CLUSTER.
	ClusterName            string           `json:"clusterName,omitempty"`            // The name the cluster to which this alert applies. Only present for alerts of type BACKUP, REPLICA_SET, and CLUSTER.
	SourceTypeName         string           `json:"sourceTypeName,omitempty"`         // For alerts of the type BACKUP, the type of server being backed up.
	CurrentValue           *CurrentValue    `json:"currentValue,omitempty"`           // CurrentValue represents current value of the metric that triggered the alert. Only present for alerts of type HOST_METRIC.
	Matchers               []Matcher        `json:"matchers,omitempty"`               // You can filter using the matchers array only when the EventTypeName specifies an event for a host, replica set, or sharded cluster.
	MetricThreshold        *MetricThreshold `json:"metricThreshold,omitempty"`        // MetricThreshold  causes an alert to be triggered.
	Threshold              *Threshold       `json:"threshold,omitempty"`              // Threshold  causes an alert to be triggered.
	Notifications          []Notification   `json:"notifications,omitempty"`          // Notifications are sending when an alert condition is detected.
}

AlertConfiguration represents MongoDB Alert Configuration.

type AlertConfigurationsResponse

type AlertConfigurationsResponse struct {
	Links      []*Link              `json:"links"`
	Results    []AlertConfiguration `json:"results"`
	TotalCount int                  `json:"totalCount"`
}

AlertConfigurationsResponse is the response from the AlertConfigurationsService.List.

type AlertConfigurationsService

AlertConfigurationsService provides access to the alert configuration related functions in the Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations

type AlertConfigurationsServiceOp

type AlertConfigurationsServiceOp service

AlertConfigurationsServiceOp handles communication with the AlertConfiguration related methods of the MongoDB Atlas API.

func (*AlertConfigurationsServiceOp) Create

Create creates an alert configuration for the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-create-config/

func (*AlertConfigurationsServiceOp) Delete

func (s *AlertConfigurationsServiceOp) Delete(ctx context.Context, groupID, alertConfigID string) (*Response, error)

Delete the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-delete-config/

func (*AlertConfigurationsServiceOp) EnableAnAlertConfig

func (s *AlertConfigurationsServiceOp) EnableAnAlertConfig(ctx context.Context, groupID, alertConfigID string, enabled *bool) (*AlertConfiguration, *Response, error)

EnableAnAlertConfig Enables/disables the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-enable-disable-config/

func (*AlertConfigurationsServiceOp) GetAnAlertConfig

func (s *AlertConfigurationsServiceOp) GetAnAlertConfig(ctx context.Context, groupID, alertConfigID string) (*AlertConfiguration, *Response, error)

GetAnAlertConfig gets the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-get-config/

func (*AlertConfigurationsServiceOp) GetOpenAlertsConfig

func (s *AlertConfigurationsServiceOp) GetOpenAlertsConfig(ctx context.Context, groupID, alertConfigID string) ([]AlertConfiguration, *Response, error)

GetOpenAlertsConfig gets all open alerts for the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-get-open-alerts/

func (*AlertConfigurationsServiceOp) List

List gets all alert configurations for the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-get-all-configs/

func (*AlertConfigurationsServiceOp) ListMatcherFields

func (s *AlertConfigurationsServiceOp) ListMatcherFields(ctx context.Context) ([]string, *Response, error)

ListMatcherFields gets all field names that the matchers.fieldName parameter accepts when you create or update an Alert Configuration.

See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-get-matchers-field-names/

func (*AlertConfigurationsServiceOp) Update

func (s *AlertConfigurationsServiceOp) Update(ctx context.Context, groupID, alertConfigID string, updateReq *AlertConfiguration) (*AlertConfiguration, *Response, error)

Update the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-update-config/

type AlertsListOptions

type AlertsListOptions struct {
	Status string `url:"status,omitempty"`
	ListOptions
}

AlertsListOptions contains the list of options for Alerts.

type AlertsResponse

type AlertsResponse struct {
	Links      []*Link `json:"links"`
	Results    []Alert `json:"results"`
	TotalCount int     `json:"totalCount"`
}

AlertsResponse is the response from the AlertService.List.

type AlertsService

AlertsService is an interface for interfacing with the Alerts endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/alerts/

type AlertsServiceOp

type AlertsServiceOp service

AlertsServiceOp provides an implementation of AlertsService.

func (*AlertsServiceOp) Acknowledge

func (s *AlertsServiceOp) Acknowledge(ctx context.Context, groupID, alertID string, params *AcknowledgeRequest) (*Alert, *Response, error)

Acknowledge allows to acknowledge an alert.

See more: https://docs.atlas.mongodb.com/reference/api/alerts-acknowledge-alert/

func (*AlertsServiceOp) Get

func (s *AlertsServiceOp) Get(ctx context.Context, groupID, alertID string) (*Alert, *Response, error)

Get gets the alert specified to {ALERT-ID} for the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/alerts-get-alert/

func (*AlertsServiceOp) List

func (s *AlertsServiceOp) List(ctx context.Context, groupID string, listOptions *AlertsListOptions) (*AlertsResponse, *Response, error)

List gets all alert for the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/alerts-get-all-alerts/

type ArgError

type ArgError struct {
	// contains filtered or unexported fields
}

ArgError is an error that represents an error with an input to godo. It identifies the argument and the cause (if possible).

func NewArgError

func NewArgError(arg, reason string) *ArgError

NewArgError creates an InputError.

func (*ArgError) Error

func (e *ArgError) Error() string

type AssignAPIKey

type AssignAPIKey struct {
	Roles []string `json:"roles"`
}

AssignAPIKey contains the roles to be assigned to an Organization API key into a Project.

type AssociatedOrgs added in v0.17.0

type AssociatedOrgs struct {
	DomainAllowList          []string        `json:"domainAllowList,omitempty"`
	DomainRestrictionEnabled *bool           `json:"domainRestrictionEnabled,omitempty"`
	IdentityProviderID       string          `json:"identityProviderId,omitempty"`
	OrgID                    string          `json:"orgId,omitempty"`
	PostAuthRoleGrants       []string        `json:"postAuthRoleGrants,omitempty"`
	RoleMappings             []*RoleMappings `json:"roleMappings,omitempty"`
	UserConflicts            *UserConflicts  `json:"userConflicts,omitempty"`
}

type AtlasRole

type AtlasRole struct {
	GroupID  string `json:"groupId,omitempty"`
	OrgID    string `json:"orgId,omitempty"`
	RoleName string `json:"roleName,omitempty"`
}

AtlasRole represents a role name of API key.

type AtlasUser

type AtlasUser struct {
	EmailAddress string      `json:"emailAddress"`
	FirstName    string      `json:"firstName"`
	ID           string      `json:"id,omitempty"`
	LastName     string      `json:"lastName"`
	Roles        []AtlasRole `json:"roles"`
	TeamIds      []string    `json:"teamIds,omitempty"`
	Username     string      `json:"username"`
	MobileNumber string      `json:"mobileNumber"`
	Password     string      `json:"password"`
	Country      string      `json:"country"`
}

AtlasUser represents a user.

type AtlasUserAssigned

type AtlasUserAssigned struct {
	Links      []*Link     `json:"links"`
	Results    []AtlasUser `json:"results"`
	TotalCount int         `json:"totalCount"`
}

AtlasUserAssigned represents the user assigned to the project.

type AtlasUsersResponse

type AtlasUsersResponse struct {
	Links      []*Link     `json:"links"`
	Results    []AtlasUser `json:"results"`
	TotalCount int         `json:"totalCount"`
}

AtlasUsersResponse represents a array of users.

type AtlasUsersService

type AtlasUsersService interface {
	List(context.Context, string, *ListOptions) ([]AtlasUser, *Response, error)
	Get(context.Context, string) (*AtlasUser, *Response, error)
	GetByName(context.Context, string) (*AtlasUser, *Response, error)
	Create(context.Context, *AtlasUser) (*AtlasUser, *Response, error)
}

AtlasUsersService is an interface for interfacing with the AtlasUsers endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/users/

type AtlasUsersServiceOp

type AtlasUsersServiceOp service

AtlasUsersServiceOp handles communication with the AtlasUsers related methods of the MongoDB Atlas API.

func (*AtlasUsersServiceOp) Create

func (s *AtlasUsersServiceOp) Create(ctx context.Context, createRequest *AtlasUser) (*AtlasUser, *Response, error)

Create creates an Atlas User.

See more: https://docs.atlas.mongodb.com/reference/api/user-create/

func (*AtlasUsersServiceOp) Get

func (s *AtlasUsersServiceOp) Get(ctx context.Context, userID string) (*AtlasUser, *Response, error)

Get gets a single atlas user.

See more: https://docs.atlas.mongodb.com/reference/api/user-get-by-id/

func (*AtlasUsersServiceOp) GetByName

func (s *AtlasUsersServiceOp) GetByName(ctx context.Context, username string) (*AtlasUser, *Response, error)

GetByName gets a single atlas user by name.

See more: https://docs.atlas.mongodb.com/reference/api/user-get-one-by-name/

func (*AtlasUsersServiceOp) List

func (s *AtlasUsersServiceOp) List(ctx context.Context, orgID string, listOptions *ListOptions) ([]AtlasUser, *Response, error)

List gets all users.

See more: https://docs.atlas.mongodb.com/reference/api/user-get-all/

type Auditing

type Auditing struct {
	AuditAuthorizationSuccess *bool  `json:"auditAuthorizationSuccess,omitempty"` // Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess
	AuditFilter               string `json:"auditFilter,omitempty"`               // JSON-formatted audit filter used by the project
	ConfigurationType         string `json:"configurationType,omitempty"`         // Denotes the configuration method for the audit filter. Possible values are: NONE - auditing not configured for the project.m FILTER_BUILDER - auditing configured via Atlas UI filter builderm FILTER_JSON - auditing configured via Atlas custom filter or API
	Enabled                   *bool  `json:"enabled,omitempty"`                   // Denotes whether or not the project associated with the {GROUP-ID} has database auditing enabled.
}

Auditing represents MongoDB Maintenance Windows.

type AuditingsService

type AuditingsService interface {
	Get(context.Context, string) (*Auditing, *Response, error)
	Configure(context.Context, string, *Auditing) (*Auditing, *Response, error)
}

AuditingsService is an interface for interfacing with the Auditing endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/auditing/

type AuditingsServiceOp

type AuditingsServiceOp service

AuditingsServiceOp handles communication with the Auditings related methods of the MongoDB Atlas API.

func (*AuditingsServiceOp) Configure

func (s *AuditingsServiceOp) Configure(ctx context.Context, groupID string, configRequest *Auditing) (*Auditing, *Response, error)

Configure the audit configuration for the project associated with {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/auditing-set-auditLog/

func (*AuditingsServiceOp) Get

func (s *AuditingsServiceOp) Get(ctx context.Context, groupID string) (*Auditing, *Response, error)

Get audit configuration for the project associated with {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/auditing-get-auditLog/

type AutoScaling

type AutoScaling struct {
	AutoIndexingEnabled *bool    `json:"autoIndexingEnabled,omitempty"` // Autopilot mode is only available if you are enrolled in the Auto Pilot Early Access program.
	Compute             *Compute `json:"compute,omitempty"`
	DiskGBEnabled       *bool    `json:"diskGBEnabled,omitempty"`
}

AutoScaling configures your cluster to automatically scale its storage.

type AvailableRegion added in v0.8.0

type AvailableRegion struct {
	Name    string `json:"name,omitempty"`
	Default bool   `json:"default,omitempty"`
}

AvailableRegion represents an available region of the MongoDB Atlas API.

type AwsCloudProviderConfig

type AwsCloudProviderConfig struct {
	ExternalID        string `json:"externalId,omitempty"`
	IAMAssumedRoleARN string `json:"iamAssumedRoleARN,omitempty"`
	IAMUserARN        string `json:"iamUserARN,omitempty"`
	RoleID            string `json:"roleId,omitempty"`
	TestS3Bucket      string `json:"testS3Bucket,omitempty"`
}

AwsCloudProviderConfig is the data lake configuration for AWS.

type AwsKms

type AwsKms struct {
	Enabled             *bool  `json:"enabled,omitempty"`             // Specifies whether Encryption at Rest is enabled for an Atlas project, To disable Encryption at Rest, pass only this parameter with a value of false, When you disable Encryption at Rest, Atlas also removes the configuration details.
	AccessKeyID         string `json:"accessKeyID,omitempty"`         // The IAM access key ID with permissions to access the customer master key specified by customerMasterKeyID.
	SecretAccessKey     string `json:"secretAccessKey,omitempty"`     // The IAM secret access key with permissions to access the customer master key specified by customerMasterKeyID.
	CustomerMasterKeyID string `json:"customerMasterKeyID,omitempty"` // The AWS customer master key used to encrypt and decrypt the MongoDB master keys.
	Region              string `json:"region,omitempty"`              // The AWS region in which the AWS customer master key exists: CA_CENTRAL_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, SA_EAST_1
	RoleID              string `json:"roleId,omitempty"`              // ID of an AWS IAM role authorized to manage an AWS customer master key.
	Valid               *bool  `json:"valid,omitempty"`               // Specifies whether the encryption key set for the provider is valid and may be used to encrypt and decrypt data.
}

AwsKms specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.

type AzureKeyVault

type AzureKeyVault struct {
	Enabled           *bool  `json:"enabled,omitempty"`           // Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
	ClientID          string `json:"clientID,omitempty"`          // The Client ID, also known as the application ID, for an Azure application associated with the Azure AD tenant.
	AzureEnvironment  string `json:"azureEnvironment,omitempty"`  // The Azure environment where the Azure account credentials reside. Valid values are the following: AZURE, AZURE_CHINA, AZURE_GERMANY
	SubscriptionID    string `json:"subscriptionID,omitempty"`    // The unique identifier associated with an Azure subscription.
	ResourceGroupName string `json:"resourceGroupName,omitempty"` // The name of the Azure Resource group that contains an Azure Key Vault.
	KeyVaultName      string `json:"keyVaultName,omitempty"`      // The name of an Azure Key Vault containing your key.
	KeyIdentifier     string `json:"keyIdentifier,omitempty"`     // The unique identifier of a key in an Azure Key Vault.
	Secret            string `json:"secret,omitempty"`            // The secret associated with the Azure Key Vault specified by azureKeyVault.tenantID.
	TenantID          string `json:"tenantID,omitempty"`          // The unique identifier for an Azure AD tenant within an Azure subscription.
}

AzureKeyVault specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.

type BackupCompliancePolicy added in v0.25.0

type BackupCompliancePolicy struct {
	AuthorizedEmail         string                `json:"authorizedEmail,omitempty"`
	AuthorizedUserFirstName string                `json:"authorizedUserFirstName,omitempty"`
	AuthorizedUserLastName  string                `json:"authorizedUserLastName,omitempty"`
	CopyProtectionEnabled   *bool                 `json:"copyProtectionEnabled,omitempty"`
	EncryptionAtRestEnabled *bool                 `json:"encryptionAtRestEnabled,omitempty"`
	OnDemandPolicyItem      PolicyItem            `json:"onDemandPolicyItem,omitempty"`
	PitEnabled              *bool                 `json:"pitEnabled,omitempty"`
	ProjectID               string                `json:"projectId,omitempty"`
	RestoreWindowDays       *int64                `json:"restoreWindowDays,omitempty"`
	ScheduledPolicyItems    []ScheduledPolicyItem `json:"scheduledPolicyItems,omitempty"`
	State                   string                `json:"state,omitempty"`
	UpdatedDate             string                `json:"updatedDate,omitempty"`
	UpdatedUser             string                `json:"updatedUser,omitempty"`
}

BackupCompliancePolicy represents a backup compiance policy.

type BackupCompliancePolicyService added in v0.25.0

type BackupCompliancePolicyService interface {
	Get(context.Context, string) (*BackupCompliancePolicy, *Response, error)
	Update(context.Context, string, *BackupCompliancePolicy) (*BackupCompliancePolicy, *Response, error)
}

BackupCompliancePolicyService is an interface for interfacing with the Backup Compliance Policy endpoints of the MongoDB Atlas API.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cloud-Backups/operation/updateDataProtectionSettings

type BackupCompliancePolicyServiceOp added in v0.25.0

type BackupCompliancePolicyServiceOp service

CloudProviderSnapshotBackupPolicyServiceOp handles communication with the BackupCompliancePolicyService related methods of the MongoDB Atlas API.

func (*BackupCompliancePolicyServiceOp) Get added in v0.25.0

Get gets the current snapshot schedule and retention settings for the cluster with {CLUSTER-NAME}. See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cloud-Backups/operation/getDataProtectionSettings

func (*BackupCompliancePolicyServiceOp) Update added in v0.25.0

Update updates the snapshot schedule or retention settings for the cluster with {CLUSTER-NAME}. See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cloud-Backups/operation/updateDataProtectionSettings

type BiConnector

type BiConnector struct {
	Enabled        *bool  `json:"enabled,omitempty"`
	ReadPreference string `json:"readPreference,omitempty"`
}

BiConnector specifies BI Connector for Atlas configuration on this cluster.

type Certificates added in v0.17.0

type Certificates struct {
	NotAfter  time.Time `json:"notAfter,omitempty"`
	NotBefore time.Time `json:"notBefore,omitempty"`
}

type ChangeStatus added in v0.8.0

type ChangeStatus string
const (
	// ChangeStatusApplied signals when changes to the deployments have completed.
	ChangeStatusApplied ChangeStatus = "APPLIED"
	// ChangeStatusPending signals when changes to the deployments are still pending.
	ChangeStatusPending ChangeStatus = "PENDING"
)

type Checkpoint

type Checkpoint struct {
	ClusterID  string  `json:"clusterId"`
	Completed  string  `json:"completed,omitempty"`
	GroupID    string  `json:"groupId"`
	ID         string  `json:"id,omitempty"`    // Unique identifier of the checkpoint.
	Links      []*Link `json:"links,omitempty"` // One or more links to sub-resources and/or related resources.
	Parts      []*Part `json:"parts,omitempty"`
	Restorable bool    `json:"restorable"`
	Started    string  `json:"started"`
	Timestamp  string  `json:"timestamp"`
}

Checkpoint represents MongoDB Checkpoint.

type CheckpointPart

type CheckpointPart struct {
	ShardName       string            `json:"shardName"`
	TokenDiscovered bool              `json:"tokenDiscovered"`
	TokenTimestamp  SnapshotTimestamp `json:"tokenTimestamp"`
}

CheckpointPart represents the individual parts that comprise the complete checkpoint.

type Checkpoints

type Checkpoints struct {
	Results    []*Checkpoint `json:"results,omitempty"`    // Includes one Checkpoint object for each item detailed in the results array section.
	Links      []*Link       `json:"links,omitempty"`      // One or more links to sub-resources and/or related resources.
	TotalCount int           `json:"totalCount,omitempty"` // Count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.
}

Checkpoints represents all the backup checkpoints related to a cluster.

type CheckpointsService

type CheckpointsService interface {
	List(context.Context, string, string, *ListOptions) (*Checkpoints, *Response, error)
	Get(context.Context, string, string, string) (*Checkpoint, *Response, error)
}

CheckpointsService is an interface for interfacing with the Checkpoint endpoints of the MongoDB Atlas API.

type CheckpointsServiceOp

type CheckpointsServiceOp service

CheckpointsServiceOp handles communication with the checkpoint related methods of the MongoDB Atlas API.

func (CheckpointsServiceOp) Get

func (s CheckpointsServiceOp) Get(ctx context.Context, groupID, clusterName, checkpointID string) (*Checkpoint, *Response, error)

Get one checkpoint for the specified sharded cluster.

See more: https://docs.atlas.mongodb.com/reference/api/checkpoints-get-one/

func (CheckpointsServiceOp) List

func (s CheckpointsServiceOp) List(ctx context.Context, groupID, clusterName string, listOptions *ListOptions) (*Checkpoints, *Response, error)

List all checkpoints for the specified sharded cluster.

See more: https://docs.atlas.mongodb.com/reference/api/checkpoints-get-all/

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string

	// Services used for communicating with the API
	CustomDBRoles                       CustomDBRolesService
	DatabaseUsers                       DatabaseUsersService
	ProjectIPAccessList                 ProjectIPAccessListService
	Organizations                       OrganizationsService
	Projects                            ProjectsService
	Clusters                            ClustersService
	CloudProviderSnapshots              CloudProviderSnapshotsService
	APIKeys                             APIKeysService
	Root                                RootService
	ProjectAPIKeys                      ProjectAPIKeysService
	CloudProviderSnapshotRestoreJobs    CloudProviderSnapshotRestoreJobsService
	Peers                               PeersService
	Containers                          ContainersService
	EncryptionsAtRest                   EncryptionsAtRestService
	AccessListAPIKeys                   AccessListAPIKeysService
	PrivateIPMode                       PrivateIPModeService
	MaintenanceWindows                  MaintenanceWindowsService
	Teams                               TeamsService
	AtlasUsers                          AtlasUsersService
	GlobalClusters                      GlobalClustersService
	Auditing                            AuditingsService
	AlertConfigurations                 AlertConfigurationsService
	PrivateEndpoints                    PrivateEndpointsService
	ServerlessPrivateEndpoints          ServerlessPrivateEndpointsService
	PrivateEndpointsDeprecated          PrivateEndpointsServiceDeprecated
	X509AuthDBUsers                     X509AuthDBUsersService
	ContinuousSnapshots                 ContinuousSnapshotsService
	ContinuousRestoreJobs               ContinuousRestoreJobsService
	Checkpoints                         CheckpointsService
	Alerts                              AlertsService
	CloudProviderSnapshotBackupPolicies CloudProviderSnapshotBackupPoliciesService
	BackupCompliancePolicy              BackupCompliancePolicyService
	Events                              EventsService
	Processes                           ProcessesService
	ProcessMeasurements                 ProcessMeasurementsService
	ProcessDisks                        ProcessDisksService
	ProcessDiskMeasurements             ProcessDiskMeasurementsService
	ProcessDatabases                    ProcessDatabasesService
	ProcessDatabaseMeasurements         ProcessDatabaseMeasurementsService
	Indexes                             IndexesService
	Logs                                LogsService
	DataLakes                           DataLakeService
	OnlineArchives                      OnlineArchiveService
	Search                              SearchService
	CustomAWSDNS                        AWSCustomDNSService
	Integrations                        IntegrationsService
	LDAPConfigurations                  LDAPConfigurationsService
	PerformanceAdvisor                  PerformanceAdvisorService
	CloudProviderAccess                 CloudProviderAccessService
	DefaultMongoDBMajorVersion          DefaultMongoDBMajorVersionService
	IPInfo                              IPInfoService
	AdvancedClusters                    AdvancedClustersService
	ServerlessInstances                 ServerlessInstancesService
	LiveMigration                       LiveMigrationService
	AccessTracking                      AccessTrackingService
	ServiceVersion                      ServiceVersionService
	CloudProviderSnapshotExportBuckets  CloudProviderSnapshotExportBucketsService
	CloudProviderSnapshotExportJobs     CloudProviderSnapshotExportJobsService
	FederatedSettings                   FederatedSettingsService
	DataFederation                      DataFederationService
	ClusterOutageSimulation             ClusterOutageSimulationService
	DataLakePipeline                    DataLakePipelineService
	// contains filtered or unexported fields
}

Client manages communication with MongoDBAtlas v1.0 API.

func New

func New(httpClient *http.Client, opts ...ClientOpt) (*Client, error)

New returns a new MongoDBAtlas API client instance.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new MongoDBAtlas API Client.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*Client) NewGZipRequest

func (c *Client) NewGZipRequest(ctx context.Context, method, urlStr string) (*http.Request, error)

NewGZipRequest creates an API request that accepts gzip. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash.

func (*Client) NewPlainRequest added in v0.7.1

func (c *Client) NewPlainRequest(ctx context.Context, method, urlStr string) (*http.Request, error)

NewPlainRequest creates an API request that accepts plain text. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included in as the request body.

func (*Client) OnRequestCompleted

func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)

OnRequestCompleted sets the DO API request completion callback.

func (*Client) OnResponseProcessed added in v0.17.0

func (c *Client) OnResponseProcessed(rc ResponseProcessedCallback)

OnResponseProcessed sets the DO API request completion callback after it has been processed.

type ClientOpt

type ClientOpt func(*Client) error

ClientOpt configures a Client.

func Options added in v0.7.1

func Options(opts ...ClientOpt) ClientOpt

Options turns a list of ClientOpt instances into a ClientOpt.

func SetBaseURL

func SetBaseURL(bu string) ClientOpt

SetBaseURL is a client option for setting the base URL.

func SetUserAgent

func SetUserAgent(ua string) ClientOpt

SetUserAgent is a client option for setting the user agent.

func SetWithRaw added in v0.17.0

func SetWithRaw() ClientOpt

SetWithRaw is a client option for getting raw atlas server response within Response structure.

type CloudProvider added in v0.8.0

type CloudProvider struct {
	Provider      string          `json:"provider,omitempty"`
	InstanceSizes []*InstanceSize `json:"instanceSizes,omitempty"`
}

CloudProvider represents a cloud provider of the MongoDB Atlas API.

type CloudProviderAccessRole added in v0.32.0

type CloudProviderAccessRole struct {
	AtlasAWSAccountARN         string          `json:"atlasAWSAccountArn,omitempty"`         // ARN associated with the Atlas AWS account used to assume IAM roles in your AWS account.
	AtlasAssumedRoleExternalID string          `json:"atlasAssumedRoleExternalId,omitempty"` // Unique external ID Atlas uses when assuming the IAM role in your AWS account.
	AuthorizedDate             string          `json:"authorizedDate,omitempty"`             //	Date on which this role was authorized.
	CreatedDate                string          `json:"createdDate,omitempty"`                // Date on which this role was created.
	FeatureUsages              []*FeatureUsage `json:"featureUsages,omitempty"`              // Atlas features this AWS IAM role is linked to.
	IAMAssumedRoleARN          string          `json:"iamAssumedRoleArn,omitempty"`          // ARN of the IAM Role that Atlas assumes when accessing resources in your AWS account.
	ProviderName               string          `json:"providerName,omitempty"`               // Name of the cloud provider. Currently limited to AWS.
	RoleID                     string          `json:"roleId,omitempty"`                     // Unique 24-hexadecimal digit string that identifies the role.
	AzureID                    *string         `json:"_id,omitempty"`                        // Unique 24-hexadecimal digit string that identifies the Azure Service Principal in Atlas.
	AtlasAzureAppID            *string         `json:"atlasAzureAppId,omitempty"`            // Azure Active Directory Application ID of Atlas.
	LastUpdatedDate            string          `json:"lastUpdatedDate,omitempty"`            // UUID string that identifies the Azure Service Principal.
	AzureServicePrincipalID    *string         `json:"servicePrincipalId,omitempty"`         // Unique ID of this role.
	AzureTenantID              *string         `json:"tenantId,omitempty"`                   // UUID String that identifies the Azure Active Directory Tenant ID.
}

CloudProviderAccessRole is the response from the CloudProviderAccessService.ListRoles.

type CloudProviderAccessRoleRequest added in v0.6.0

type CloudProviderAccessRoleRequest struct {
	ProviderName            string  `json:"providerName"`                 // Human-readable label that identifies the cloud provider of the role.
	IAMAssumedRoleARN       *string `json:"iamAssumedRoleArn,omitempty"`  // Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account.
	AtlasAzureAppID         *string `json:"atlasAzureAppId,omitempty"`    // Date and time when this Azure Service Principal was last updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
	AzureServicePrincipalID *string `json:"servicePrincipalId,omitempty"` // Unique AzureID of this role.
	AzureTenantID           *string `json:"tenantId,omitempty"`           // UUID String that identifies the Azure Active Directory Tenant AzureID.

}

CloudProviderAccessRoleRequest represent a new role creation.

type CloudProviderAccessRoles added in v0.6.0

type CloudProviderAccessRoles struct {
	AWSIAMRoles            []CloudProviderAccessRole `json:"awsIamRoles,omitempty"`            // Unique identifier of AWS security group in this access list entry.
	AzureServicePrincipals []CloudProviderAccessRole `json:"azureServicePrincipals,omitempty"` // Unique identifier of Azure security group in this access list entry.
}

CloudProviderAccessRoles an array of awsIamRoles objects.

type CloudProviderAccessServiceOp added in v0.6.0

type CloudProviderAccessServiceOp service

CloudProviderAccessServiceOp provides an implementation of the CloudProviderAccessService interface.

func (*CloudProviderAccessServiceOp) AuthorizeRole added in v0.6.0

AuthorizeRole authorizes and configure an AWS Assumed IAM role.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Provider-Access/operation/authorizeCloudProviderAccessRole

func (*CloudProviderAccessServiceOp) DeauthorizeRole added in v0.6.0

DeauthorizeRole deauthorizes an AWS Assumed IAM role.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Provider-Access/operation/deauthorizeCloudProviderAccessRole

func (*CloudProviderAccessServiceOp) GetRole added in v0.30.0

GetRole Returns the Amazon Web Services (AWS) Identity and Access Management (IAM) role with the specified id and with access to the specified project.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Provider-Access/operation/getCloudProviderAccessRole

func (*CloudProviderAccessServiceOp) ListRoles added in v0.6.0

ListRoles retrieves existing AWS IAM roles.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Provider-Access/operation/listCloudProviderAccessRoles

type CloudProviderConfig

type CloudProviderConfig struct {
	AWSConfig AwsCloudProviderConfig `json:"aws,omitempty"`
}

CloudProviderConfig represents the configuration for all supported cloud providers.

type CloudProviderDeauthorizationRequest added in v0.6.0

type CloudProviderDeauthorizationRequest struct {
	ProviderName string
	GroupID      string
	RoleID       string
}

CloudProviderDeauthorizationRequest represents a request to remove authorization.

type CloudProviderRegionsOptions added in v0.8.0

type CloudProviderRegionsOptions struct {
	Providers []*string `url:"providers,omitempty"`
	Tier      string    `url:"tier,omitempty"`
}

CloudProviderRegionsOptions specifies the optional parameters to the CloudProviderRegions Get method.

type CloudProviderSnapshot

type CloudProviderSnapshot struct {
	ID                     string    `json:"id,omitempty"`                     // Unique identifier of the snapshot.
	RetentionInDays        int       `json:"retentionInDays,omitempty"`        // The number of days that Atlas should retain the on-demand snapshot. Must be at least 1 .
	CreatedAt              string    `json:"createdAt,omitempty"`              // UTC ISO 8601 formatted point in time when Atlas took the snapshot.
	ExpiresAt              string    `json:"expiresAt,omitempty"`              // UTC ISO 8601 formatted point in time when Atlas will delete the snapshot.
	Description            string    `json:"description,omitempty"`            // Description of the on-demand snapshot.
	Links                  []*Link   `json:"links,omitempty"`                  // One or more links to sub-resources and/or related resources.
	MasterKeyUUID          string    `json:"masterKeyUUID,omitempty"`          // Unique ID of the AWS KMS Customer Master Key used to encrypt the snapshot. Only visible for clusters using Encryption at Rest via Customer KMS.
	MongodVersion          string    `json:"mongodVersion,omitempty"`          // Version of the MongoDB server.
	SnapshotType           string    `json:"snapshotType,omitempty"`           // Specified the type of snapshot. Valid values are onDemand and scheduled.
	Status                 string    `json:"status,omitempty"`                 // Current status of the snapshot. One of the following values: queued, inProgress, completed, failed
	StorageSizeBytes       int       `json:"storageSizeBytes,omitempty"`       // Specifies the size of the snapshot in bytes.
	Type                   string    `json:"type,omitempty"`                   // Specifies the type of cluster: replicaSet or shardedCluster.
	CloudProvider          string    `json:"cloudProvider,omitempty"`          // Cloud provider that stores this snapshot. Atlas returns this parameter when "type": "replicaSet".
	Members                []*Member `json:"members,omitempty"`                // List of ReplicaSetName and the cloud provider where the snapshots are stored. Atlas returns this parameter when "type": "shardedCluster".
	ReplicaSetName         string    `json:"replicaSetName,omitempty"`         // Label given to the replica set from which Atlas took this snapshot. Atlas returns this parameter when "type": "replicaSet".
	SnapshotsIds           []string  `json:"snapshotIds,omitempty"`            // Unique identifiers of the snapshots created for the shards and config server for a sharded cluster.
	ServerlessInstanceName string    `json:"serverlessInstanceName,omitempty"` // Human-readable label given to the serverless instance from which Atlas took this snapshot.
}

CloudProviderSnapshot represents a cloud provider snapshot.

type CloudProviderSnapshotBackupPoliciesService

CloudProviderSnapshotBackupPoliciesService is an interface for interfacing with the Cloud Provider Snapshots Backup Policy endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-schedule/

type CloudProviderSnapshotBackupPoliciesServiceOp

type CloudProviderSnapshotBackupPoliciesServiceOp service

CloudProviderSnapshotBackupPoliciesServiceOp handles communication with the CloudProviderSnapshotBackupPoliciesService related methods of the MongoDB Atlas API.

func (*CloudProviderSnapshotBackupPoliciesServiceOp) Delete added in v0.9.0

Delete deletes all cloud backup schedules.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/schedule/delete-all-schedules/

func (*CloudProviderSnapshotBackupPoliciesServiceOp) Get

Get gets the current snapshot schedule and retention settings for the cluster with {CLUSTER-NAME}. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-schedule-get-all/

func (*CloudProviderSnapshotBackupPoliciesServiceOp) Update

Update updates the snapshot schedule or retention settings for the cluster with {CLUSTER-NAME}. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-schedule-modify-one/

type CloudProviderSnapshotBackupPolicy

type CloudProviderSnapshotBackupPolicy struct {
	ClusterID                         string               `json:"clusterId,omitempty"`                         //	Unique identifier of the Atlas cluster.
	ClusterName                       string               `json:"clusterName,omitempty"`                       //	Name of the Atlas cluster.
	ReferenceHourOfDay                *int64               `json:"referenceHourOfDay,omitempty"`                // UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
	ReferenceMinuteOfHour             *int64               `json:"referenceMinuteOfHour,omitempty"`             // UTC Minutes after referenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive. Number of days back in time you can restore to with point-in-time accuracy.
	RestoreWindowDays                 *int64               `json:"restoreWindowDays,omitempty"`                 // Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
	UpdateSnapshots                   *bool                `json:"updateSnapshots,omitempty"`                   // Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
	NextSnapshot                      string               `json:"nextSnapshot,omitempty"`                      // UTC ISO 8601 formatted point in time when Atlas will take the next snapshot.
	Policies                          []Policy             `json:"policies,omitempty"`                          // A list of policy definitions for the cluster.
	AutoExportEnabled                 *bool                `json:"autoExportEnabled,omitempty"`                 // Specify true to enable automatic export of cloud backup snapshots to the AWS bucket. You must also define the export policy using export. Specify false to disable automatic export.
	Export                            *Export              `json:"export,omitempty"`                            // Export struct that represents a policy for automatically exporting cloud backup snapshots to AWS bucket.
	UseOrgAndGroupNamesInExportPrefix *bool                `json:"useOrgAndGroupNamesInExportPrefix,omitempty"` // Specifies whether to use organization and project names instead of organization and project UUIDs in the path to the metadata files that Atlas uploads to your S3 bucket after it finishes exporting the snapshots
	Links                             []*Link              `json:"links,omitempty"`                             // One or more links to sub-resources and/or related resources.
	CopySettings                      []CopySetting        `json:"copySettings"`                                // List that contains a document for each copy setting item in the desired backup policy.
	DeleteCopiedBackups               []DeleteCopiedBackup `json:"deleteCopiedBackups,omitempty"`               // List that contains a document for each deleted copy setting whose backup copies you want to delete.
}

CloudProviderSnapshotBackupPolicy represents a cloud provider snapshot schedule.

type CloudProviderSnapshotExportBucket added in v0.15.0

type CloudProviderSnapshotExportBucket struct {
	ID            string `json:"_id,omitempty"`           // Unique identifier of the S3 bucket.
	BucketName    string `json:"bucketName,omitempty"`    // Name of the bucket that the role ID is authorized to access.
	CloudProvider string `json:"cloudProvider,omitempty"` // Name of the provider of the cloud service where Atlas can access the S3 bucket. Atlas only supports AWS.
	IAMRoleID     string `json:"iamRoleId,omitempty"`     // Unique identifier of the role that Atlas can use to access the bucket. If necessary, use the UI or API to retrieve the role ID. You must also specify the bucketName.
}

CloudProviderSnapshotExportBucket represents one cloud provider snapshot export buckets.

type CloudProviderSnapshotExportBuckets added in v0.15.0

type CloudProviderSnapshotExportBuckets struct {
	Results    []*CloudProviderSnapshotExportBucket `json:"results,omitempty"`    // Includes one CloudProviderSnapshotExportBucket object for each item detailed in the results array section.
	Links      []*Link                              `json:"links,omitempty"`      // One or more links to sub-resources and/or related resources.
	TotalCount int                                  `json:"totalCount,omitempty"` // Count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.
}

CloudProviderSnapshotExportBuckets represents all cloud provider snapshot export buckets.

type CloudProviderSnapshotExportBucketsService added in v0.15.0

CloudProviderSnapshotExportBucketsService is an interface for interfacing with the Cloud Provider Snapshots Export Buckets endpoints of the MongoDB Atlas API.

type CloudProviderSnapshotExportBucketsServiceOp added in v0.15.0

type CloudProviderSnapshotExportBucketsServiceOp service

CloudProviderSnapshotExportBucketsServiceOp handles communication with the CloudProviderSnapshotExportBucketsService related methods of the MongoDB Atlas API.

func (CloudProviderSnapshotExportBucketsServiceOp) Create added in v0.15.0

Create Allows you to grant Atlas access to the specified bucket for exporting backup snapshots.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/export/create-one-export-bucket/

func (CloudProviderSnapshotExportBucketsServiceOp) Delete added in v0.15.0

func (c CloudProviderSnapshotExportBucketsServiceOp) Delete(ctx context.Context, projectID, bucketID string) (*Response, error)

Delete Allows you to remove one bucket specified by the bucket ID.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/export/delete-one-export-bucket/

func (CloudProviderSnapshotExportBucketsServiceOp) Get added in v0.15.0

Get Allows you to retrieve one bucket specified by the bucket ID.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/export/get-one-export-bucket/

func (CloudProviderSnapshotExportBucketsServiceOp) List added in v0.15.0

List Retrieve all the buckets for the specified project.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/export/get-all-export-buckets/

type CloudProviderSnapshotExportJob added in v0.16.0

type CloudProviderSnapshotExportJob struct {
	ID             string                                      `json:"id,omitempty"`             // Unique identifier of the export job.
	Components     []*CloudProviderSnapshotExportJobComponent  `json:"components,omitempty"`     // Returned for sharded clusters only. Export job details for each replica set in the sharded cluster.
	CreatedAt      string                                      `json:"createdAt,omitempty"`      // Timestamp in ISO 8601 date and time format in UTC when the export job was created.
	CustomData     []*CloudProviderSnapshotExportJobCustomData `json:"customData,omitempty"`     // Custom data for the metadata file named .complete that Atlas uploads to the bucket when the export job finishes.
	ErrMsg         string                                      `json:"errMsg,omitempty"`         // Error message, only if the export job failed.
	ExportBucketID string                                      `json:"exportBucketId,omitempty"` // Unique identifier of the bucket.
	ExportStatus   *CloudProviderSnapshotExportJobStatus       `json:"exportStatus,omitempty"`   // Returned for replica set only. Status of the export job.
	FinishedAt     string                                      `json:"finishedAt,omitempty"`     // Timestamp in ISO 8601 date and time format in UTC when the export job completes.
	Prefix         string                                      `json:"prefix,omitempty"`         // Full path on the cloud provider bucket to the folder where the snapshot is exported. The path is in the following format: /exported_snapshots/{ORG-NAME}/{PROJECT-NAME}/{CLUSTER-NAME}/{SNAPSHOT-INITIATION-DATE}/{TIMESTAMP}
	SnapshotID     string                                      `json:"snapshotId,omitempty"`     // Unique identifier of the snapshot.
	State          string                                      `json:"state,omitempty"`          // Status of the export job.
}

CloudProviderSnapshotExportJob represents one cloud provider snapshot export jobs.

type CloudProviderSnapshotExportJobComponent added in v0.16.0

type CloudProviderSnapshotExportJobComponent struct {
	ExportID       string `json:"exportId,omitempty"`       // Returned for sharded clusters only. Unique identifier of the export job for the replica set.
	ReplicaSetName string `json:"replicaSetName,omitempty"` // Returned for sharded clusters only. Name of the replica set.
}

type CloudProviderSnapshotExportJobCustomData added in v0.16.0

type CloudProviderSnapshotExportJobCustomData struct {
	Key   string `json:"key,omitempty"`   // Custom data specified as key in the key and value pair.
	Value string `json:"value,omitempty"` // Value for the key specified using CloudProviderSnapshotExportJobCustomData.key.
}

type CloudProviderSnapshotExportJobStatus added in v0.16.0

type CloudProviderSnapshotExportJobStatus struct {
	ExportedCollections int `json:"exportedCollections,omitempty"` // Returned for replica set only. Number of collections that have been exported.
	TotalCollections    int `json:"totalCollections,omitempty"`    // Returned for replica set only. Total number of collections to export.
}

type CloudProviderSnapshotExportJobs added in v0.16.0

type CloudProviderSnapshotExportJobs struct {
	Results    []*CloudProviderSnapshotExportJob `json:"results,omitempty"`    // Includes one CloudProviderSnapshotExportJob object for each item detailed in the results array section.
	Links      []*Link                           `json:"links,omitempty"`      // One or more links to sub-resources and/or related resources.
	TotalCount int                               `json:"totalCount,omitempty"` // Count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.
}

CloudProviderSnapshotExportJobs represents all cloud provider snapshot export jobs.

type CloudProviderSnapshotExportJobsService added in v0.16.0

CloudProviderSnapshotExportJobsService is an interface for interfacing with the Cloud Provider Snapshots Export Jobs of the MongoDB Atlas API.

type CloudProviderSnapshotExportJobsServiceOp added in v0.16.0

type CloudProviderSnapshotExportJobsServiceOp service

CloudProviderSnapshotExportJobsServiceOp handles communication with the CloudProviderSnapshotExportJobsService related methods of the MongoDB Atlas API.

func (CloudProviderSnapshotExportJobsServiceOp) Create added in v0.16.0

Create Allows you to grant Atlas access to the specified export job for exporting backup snapshots.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/export/create-one-export-job/

func (CloudProviderSnapshotExportJobsServiceOp) Get added in v0.16.0

Get Allows you to retrieve one export job specified by the export job ID.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/export/get-one-export-job/

func (CloudProviderSnapshotExportJobsServiceOp) List added in v0.16.0

List Retrieve all the export jobs for the specified project.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/export/get-all-export-jobs/

type CloudProviderSnapshotRestoreJob

type CloudProviderSnapshotRestoreJob struct {
	ID                    string       `json:"id,omitempty"`                    // The unique identifier of the restore job.
	SnapshotID            string       `json:"snapshotId,omitempty"`            // Unique identifier of the snapshot to restore.
	Components            []*Component `json:"components,omitempty"`            // Collection of clusters to be downloaded. Atlas returns this parameter when restoring a sharded cluster and "deliveryType" : "download".
	DeliveryType          string       `json:"deliveryType,omitempty"`          // Type of restore job to create. Possible values are: automated or download or pointInTime
	DeliveryURL           []string     `json:"deliveryUrl,omitempty"`           // One or more URLs for the compressed snapshot files for manual download. Only visible if deliveryType is download.
	TargetClusterName     string       `json:"targetClusterName,omitempty"`     // Name of the target Atlas cluster to which the restore job restores the snapshot. Only required if deliveryType is automated.
	TargetGroupID         string       `json:"targetGroupId,omitempty"`         // Unique ID of the target Atlas project for the specified targetClusterName. Only required if deliveryType is automated.
	Cancelled             bool         `json:"cancelled,omitempty"`             // Indicates whether the restore job was canceled.
	CreatedAt             string       `json:"createdAt,omitempty"`             // UTC ISO 8601 formatted point in time when Atlas created the restore job.
	Expired               bool         `json:"expired,omitempty"`               // Indicates whether the restore job expired.
	ExpiresAt             string       `json:"expiresAt,omitempty"`             // UTC ISO 8601 formatted point in time when the restore job expires.
	FinishedAt            string       `json:"finishedAt,omitempty"`            // UTC ISO 8601 formatted point in time when the restore job completed.
	Links                 []*Link      `json:"links,omitempty"`                 // One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
	Timestamp             string       `json:"timestamp,omitempty"`             // Timestamp in ISO 8601 date and time format in UTC when the snapshot associated to snapshotId was taken.
	OplogTs               int64        `json:"oplogTs,omitempty"`               //nolint:stylecheck // not changing this // Timestamp in the number of seconds that have elapsed since the UNIX epoch from which to you want to restore this snapshot. This is the first part of an Oplog timestamp.
	OplogInc              int64        `json:"oplogInc,omitempty"`              // Oplog operation number from which to you want to restore this snapshot. This is the second part of an Oplog timestamp.
	PointInTimeUTCSeconds int64        `json:"pointInTimeUTCSeconds,omitempty"` // Timestamp in the number of seconds that have elapsed since the UNIX epoch from which you want to restore this snapshot.
	SourceClusterName     string       `json:"sourceClusterName,omitempty"`
	Failed                *bool        `json:"failed,omitempty"`
}

CloudProviderSnapshotRestoreJob represents the structure of a cloudProviderSnapshotRestoreJob.

type CloudProviderSnapshotRestoreJobs

type CloudProviderSnapshotRestoreJobs struct {
	Links      []*Link                            `json:"links"`
	Results    []*CloudProviderSnapshotRestoreJob `json:"results"`
	TotalCount int                                `json:"totalCount"`
}

CloudProviderSnapshotRestoreJobs represents an array of cloudProviderSnapshotRestoreJob.

type CloudProviderSnapshotRestoreJobsServiceOp

type CloudProviderSnapshotRestoreJobsServiceOp service

CloudProviderSnapshotRestoreJobsServiceOp handles communication with the CloudProviderSnapshotRestoreJobs related methods of the MongoDB Atlas API.

func (*CloudProviderSnapshotRestoreJobsServiceOp) Create

Create creates a new restore job from a cloud provider snapshot associated to the specified cluster.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-create-one/

func (*CloudProviderSnapshotRestoreJobsServiceOp) CreateForServerlessBackupRestore added in v0.15.0

func (s *CloudProviderSnapshotRestoreJobsServiceOp) CreateForServerlessBackupRestore(ctx context.Context, projectID, instanceName string, createRequest *CloudProviderSnapshotRestoreJob) (*CloudProviderSnapshotRestoreJob, *Response, error)

CreateForServerlessBackupRestore creates a new restore job from a serverless cloud provider snapshot associated to the specified cluster.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/restore/restore-one-snapshot-of-one-serverless-instance/

func (*CloudProviderSnapshotRestoreJobsServiceOp) Delete

Delete cancels the cloud provider snapshot manual download restore job associated to {JOB-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-delete-one/

func (*CloudProviderSnapshotRestoreJobsServiceOp) Get

Get gets one cloud provider snapshot restore jobs for the specified cluster.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-get-one/

func (*CloudProviderSnapshotRestoreJobsServiceOp) GetForServerlessBackupRestore added in v0.15.0

func (s *CloudProviderSnapshotRestoreJobsServiceOp) GetForServerlessBackupRestore(ctx context.Context, projectID, instanceName, jobID string) (*CloudProviderSnapshotRestoreJob, *Response, error)

GetForServerlessBackupRestore gets one cloud provider serverless snapshot restore jobs for the specified cluster.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/restore/return-one-restore-job-for-one-serverless-instance/

func (*CloudProviderSnapshotRestoreJobsServiceOp) List

List gets all cloud provider snapshot restore jobs for the specified cluster.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-get-all/

func (*CloudProviderSnapshotRestoreJobsServiceOp) ListForServerlessBackupRestore added in v0.15.0

func (s *CloudProviderSnapshotRestoreJobsServiceOp) ListForServerlessBackupRestore(ctx context.Context, projectID, instanceName string, listOptions *ListOptions) (*CloudProviderSnapshotRestoreJobs, *Response, error)

ListForServerlessBackupRestore gets all cloud provider snapshot serverless restore jobs for the specified cluster.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/restore/return-all-restore-jobs-for-one-serverless-instance/

type CloudProviderSnapshots

type CloudProviderSnapshots struct {
	Results    []*CloudProviderSnapshot `json:"results,omitempty"`    // Includes one CloudProviderSnapshot object for each item detailed in the results array section.
	Links      []*Link                  `json:"links,omitempty"`      // One or more links to sub-resources and/or related resources.
	TotalCount int                      `json:"totalCount,omitempty"` // Count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.
}

CloudProviderSnapshots represents all cloud provider snapshots.

type CloudProviderSnapshotsService

CloudProviderSnapshotsService is an interface for interfacing with the Cloud Provider Snapshots endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot/

type CloudProviderSnapshotsServiceOp

type CloudProviderSnapshotsServiceOp service

CloudProviderSnapshotsServiceOp handles communication with the CloudProviderSnapshotsService related methods of the MongoDB Atlas API.

func (*CloudProviderSnapshotsServiceOp) Create

Create takes one on-demand snapshot. Atlas takes on-demand snapshots immediately, unlike scheduled snapshots which occur at regular intervals.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-take-one-ondemand/

func (*CloudProviderSnapshotsServiceOp) Delete

Delete deletes the snapshot associated to {SNAPSHOT-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-delete-one/

func (*CloudProviderSnapshotsServiceOp) GetAllCloudProviderSnapshots

func (s *CloudProviderSnapshotsServiceOp) GetAllCloudProviderSnapshots(ctx context.Context, requestParameters *SnapshotReqPathParameters, listOptions *ListOptions) (*CloudProviderSnapshots, *Response, error)

GetAllCloudProviderSnapshots gets all cloud provider snapshots for the specified cluster.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-get-all/

func (*CloudProviderSnapshotsServiceOp) GetAllServerlessSnapshots added in v0.15.0

func (s *CloudProviderSnapshotsServiceOp) GetAllServerlessSnapshots(ctx context.Context, requestParameters *SnapshotReqPathParameters, listOptions *ListOptions) (*CloudProviderSnapshots, *Response, error)

GetAllServerlessSnapshots Return all snapshots of one serverless instance from the specified project.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-backup/backup/return-all-snapshots-of-one-serverless-instance/

func (*CloudProviderSnapshotsServiceOp) GetOneCloudProviderSnapshot

func (s *CloudProviderSnapshotsServiceOp) GetOneCloudProviderSnapshot(ctx context.Context, requestParameters *SnapshotReqPathParameters) (*CloudProviderSnapshot, *Response, error)

GetOneCloudProviderSnapshot gets the snapshot associated to {SNAPSHOT-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-get-one/

func (*CloudProviderSnapshotsServiceOp) GetOneServerlessSnapshot added in v0.15.0

func (s *CloudProviderSnapshotsServiceOp) GetOneServerlessSnapshot(ctx context.Context, requestParameters *SnapshotReqPathParameters) (*CloudProviderSnapshot, *Response, error)

GetOneServerlessSnapshot Return one snapshot of one serverless instance from the specified project.

See more: // GetOneCloudProviderSnapshot https://docs.atlas.mongodb.com/reference/api/cloud-backup/backup/return-one-snapshot-of-one-serverless-instance/

type CloudProviders added in v0.8.0

type CloudProviders struct {
	Links      []*Link          `json:"links,omitempty"`
	Results    []*CloudProvider `json:"results,omitempty"`
	TotalCount int              `json:"totalCount,omitempty"`
}

CloudProviders represents the response from CloudProviderRegionsService.Get.

type Cluster

type Cluster struct {
	AcceptDataRisksAndForceReplicaSetReconfig string                   `json:"acceptDataRisksAndForceReplicaSetReconfig,omitempty"`
	AutoScaling                               *AutoScaling             `json:"autoScaling,omitempty"`
	BackupEnabled                             *bool                    `json:"backupEnabled,omitempty"` // Deprecated: Use ProviderBackupEnabled instead
	BiConnector                               *BiConnector             `json:"biConnector,omitempty"`
	ClusterType                               string                   `json:"clusterType,omitempty"`
	DiskSizeGB                                *float64                 `json:"diskSizeGB,omitempty"`
	EncryptionAtRestProvider                  string                   `json:"encryptionAtRestProvider,omitempty"`
	Labels                                    []Label                  `json:"labels,omitempty"`
	ID                                        string                   `json:"id,omitempty"`
	GroupID                                   string                   `json:"groupId,omitempty"`
	MongoDBVersion                            string                   `json:"mongoDBVersion,omitempty"`
	MongoDBMajorVersion                       string                   `json:"mongoDBMajorVersion,omitempty"`
	MongoURI                                  string                   `json:"mongoURI,omitempty"`
	MongoURIUpdated                           string                   `json:"mongoURIUpdated,omitempty"`
	MongoURIWithOptions                       string                   `json:"mongoURIWithOptions,omitempty"`
	Name                                      string                   `json:"name,omitempty"`
	CreateDate                                string                   `json:"createDate,omitempty"`
	NumShards                                 *int64                   `json:"numShards,omitempty"`
	Paused                                    *bool                    `json:"paused,omitempty"`
	PitEnabled                                *bool                    `json:"pitEnabled,omitempty"`
	ProviderBackupEnabled                     *bool                    `json:"providerBackupEnabled,omitempty"`
	ProviderSettings                          *ProviderSettings        `json:"providerSettings,omitempty"`
	ReplicationFactor                         *int64                   `json:"replicationFactor,omitempty"`
	ReplicationSpec                           map[string]RegionsConfig `json:"replicationSpec,omitempty"`
	ReplicationSpecs                          []ReplicationSpec        `json:"replicationSpecs,omitempty"`
	SrvAddress                                string                   `json:"srvAddress,omitempty"`
	StateName                                 string                   `json:"stateName,omitempty"`
	ServerlessBackupOptions                   *ServerlessBackupOptions `json:"serverlessBackupOptions,omitempty"`
	ConnectionStrings                         *ConnectionStrings       `json:"connectionStrings,omitempty"`
	Links                                     []*Link                  `json:"links,omitempty"`
	VersionReleaseSystem                      string                   `json:"versionReleaseSystem,omitempty"`
	RootCertType                              string                   `json:"rootCertType,omitempty"`
	TerminationProtectionEnabled              *bool                    `json:"terminationProtectionEnabled,omitempty"`
	Tags                                      *[]*Tag                  `json:"tags,omitempty"`
}

Cluster represents MongoDB cluster.

type ClusterOutageSimulation added in v0.22.0

type ClusterOutageSimulation struct {
	// Human-readable label that identifies the cluster that undergoes outage simulation.
	ClusterName *string `json:"clusterName,omitempty"`
	// Unique 24-hexadecimal character string that identifies the project that contains the cluster to undergo outage simulation.
	GroupID *string `json:"groupId,omitempty"`
	// Unique 24-hexadecimal character string that identifies the outage simulation.
	ID *string `json:"id,omitempty"`
	// List of settings that specify the type of cluster outage simulation.
	OutageFilters []ClusterOutageSimulationOutageFilter `json:"outageFilters,omitempty"`
	// Date and time when MongoDB Cloud started the regional outage simulation.
	StartRequestDate *string `json:"startRequestDate,omitempty"`
	// Phase of the outage simulation.  | State       | Indication | |-------------|------------| | `START_REQUESTED`    | User has requested cluster outage simulation.| | `STARTING`           | MongoDB Cloud is starting cluster outage simulation.| | `SIMULATING`         | MongoDB Cloud is simulating cluster outage.| | `RECOVERY_REQUESTED` | User has requested recovery from the simulated outage.| | `RECOVERING`         | MongoDB Cloud is recovering the cluster from the simulated outage.| | `COMPLETE`           | MongoDB Cloud has completed the cluster outage simulation.|
	State *string `json:"state,omitempty"`
}

type ClusterOutageSimulationOutageFilter added in v0.22.0

type ClusterOutageSimulationOutageFilter struct {
	// The cloud provider of the region that undergoes the outage simulation.
	CloudProvider *string `json:"cloudProvider,omitempty"`
	// The name of the region to undergo an outage simulation.
	RegionName *string `json:"regionName,omitempty"`
	// The type of cluster outage to simulate.  | Type       | Description | |------------|-------------| | `REGION`   | Simulates a cluster outage for a region.|
	Type *string `json:"type,omitempty"`
}

type ClusterOutageSimulationRequest added in v0.22.0

type ClusterOutageSimulationRequest struct {
	OutageFilters []ClusterOutageSimulationOutageFilter `json:"outageFilters,omitempty"`
}

type ClusterOutageSimulationService added in v0.22.0

type ClusterOutageSimulationService interface {
	EndOutageSimulation(context.Context, string, string) (*ClusterOutageSimulation, *Response, error)
	GetOutageSimulation(context.Context, string, string) (*ClusterOutageSimulation, *Response, error)
	StartOutageSimulation(context.Context, string, string, *ClusterOutageSimulationRequest) (*ClusterOutageSimulation, *Response, error)
}

ClusterOutageSimulationService is an interface for interfacing with the cluster outage endpoints of the MongoDB Atlas API.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cluster-Outage-Simulation

type ClusterOutageSimulationServiceOp added in v0.22.0

type ClusterOutageSimulationServiceOp service

ClusterOutageSimulationServiceOp handles communication with the ClusterOutageSimulationService related methods of the MongoDB Atlas API.

func (ClusterOutageSimulationServiceOp) EndOutageSimulation added in v0.22.0

func (s ClusterOutageSimulationServiceOp) EndOutageSimulation(ctx context.Context, groupID, clusterName string) (*ClusterOutageSimulation, *Response, error)

EndOutageSimulation ends a cluster outage simulation.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cluster-Outage-Simulation/operation/endOutageSimulation

func (ClusterOutageSimulationServiceOp) GetOutageSimulation added in v0.22.0

func (s ClusterOutageSimulationServiceOp) GetOutageSimulation(ctx context.Context, groupID, clusterName string) (*ClusterOutageSimulation, *Response, error)

GetOutageSimulation returns one outage simulation for one cluster.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cluster-Outage-Simulation/operation/getOutageSimulation

func (ClusterOutageSimulationServiceOp) StartOutageSimulation added in v0.22.0

func (s ClusterOutageSimulationServiceOp) StartOutageSimulation(ctx context.Context, groupID, clusterName string, request *ClusterOutageSimulationRequest) (*ClusterOutageSimulation, *Response, error)

StartOutageSimulation starts a cluster outage simulation.

See more:https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cluster-Outage-Simulation/operation/startOutageSimulation

type ClusterStatus added in v0.8.0

type ClusterStatus struct {
	ChangeStatus ChangeStatus `json:"changeStatus"`
}

ClusterStatus is the status of the operations on the cluster.

type ClustersResponse added in v0.11.0

type ClustersResponse struct {
	Links      []*Link    `json:"links,omitempty"`
	Results    []*Cluster `json:"results,omitempty"`
	TotalCount int        `json:"totalCount,omitempty"`
}

ClustersResponse represents the response of ServerlessInstancesService.List.

type ClustersService

type ClustersService interface {
	List(ctx context.Context, groupID string, options *ListOptions) ([]Cluster, *Response, error)
	Get(ctx context.Context, groupID, clusterName string) (*Cluster, *Response, error)
	Create(ctx context.Context, groupID string, cluster *Cluster) (*Cluster, *Response, error)
	Update(ctx context.Context, groupID, clusterName string, cluster *Cluster) (*Cluster, *Response, error)
	Delete(ctx context.Context, groupID, clusterName string, options *DeleteAdvanceClusterOptions) (*Response, error)
	UpdateProcessArgs(ctx context.Context, groupID, clusterName string, args *ProcessArgs) (*ProcessArgs, *Response, error)
	GetProcessArgs(ctx context.Context, groupID, clusterName string) (*ProcessArgs, *Response, error)
	Status(ctx context.Context, groupID, clusterName string) (ClusterStatus, *Response, error)
	LoadSampleDataset(ctx context.Context, groupID, clusterName string) (*SampleDatasetJob, *Response, error)
	GetSampleDatasetStatus(ctx context.Context, groupID, id string) (*SampleDatasetJob, *Response, error)
	ListCloudProviderRegions(context.Context, string, *CloudProviderRegionsOptions) (*CloudProviders, *Response, error)
	Upgrade(ctx context.Context, groupID string, cluster *Cluster) (*Cluster, *Response, error)
}

ClustersService is an interface for interfacing with the Clusters endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/clusters/

type ClustersServiceOp

type ClustersServiceOp service

ClustersServiceOp handles communication with the Cluster related methods of the MongoDB Atlas API.

func (*ClustersServiceOp) Create

func (s *ClustersServiceOp) Create(ctx context.Context, groupID string, createRequest *Cluster) (*Cluster, *Response, error)

Create adds a cluster to the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/clusters-create-one/

func (*ClustersServiceOp) Delete

func (s *ClustersServiceOp) Delete(ctx context.Context, groupID, clusterName string, options *DeleteAdvanceClusterOptions) (*Response, error)

Delete the cluster specified to {CLUSTER-NAME} from the project associated to {GROUP-ID}.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Clusters/operation/deleteLegacyCluster

func (*ClustersServiceOp) Get

func (s *ClustersServiceOp) Get(ctx context.Context, groupID, clusterName string) (*Cluster, *Response, error)

Get gets the cluster specified to {ClUSTER-NAME} from the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/clusters-get-one/

func (*ClustersServiceOp) GetProcessArgs

func (s *ClustersServiceOp) GetProcessArgs(ctx context.Context, groupID, clusterName string) (*ProcessArgs, *Response, error)

GetProcessArgs gets the Advanced Configuration Options for One Cluster

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#operation/returnOneAdvancedConfigurationOptionsForOneCluster

func (*ClustersServiceOp) GetSampleDatasetStatus added in v0.8.0

func (s *ClustersServiceOp) GetSampleDatasetStatus(ctx context.Context, groupID, id string) (*SampleDatasetJob, *Response, error)

GetSampleDatasetStatus gets the Sample Dataset job

See more: https://docs.atlas.mongodb.com/reference/api/cluster/check-dataset-status/

func (*ClustersServiceOp) List

func (s *ClustersServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) ([]Cluster, *Response, error)

List all clusters in the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/clusters-get-all/

func (*ClustersServiceOp) ListCloudProviderRegions added in v0.8.0

func (s *ClustersServiceOp) ListCloudProviderRegions(ctx context.Context, groupID string, options *CloudProviderRegionsOptions) (*CloudProviders, *Response, error)

ListCloudProviderRegions gets the available regions for each cloud provider

See more: https://docs.atlas.mongodb.com/reference/api/cluster-get-regions/

func (*ClustersServiceOp) LoadSampleDataset added in v0.8.0

func (s *ClustersServiceOp) LoadSampleDataset(ctx context.Context, groupID, clusterName string) (*SampleDatasetJob, *Response, error)

LoadSampleDataset loads the sample dataset into your cluster.

See more: https://docs.atlas.mongodb.com/reference/api/cluster/load-dataset/

func (*ClustersServiceOp) Status added in v0.8.0

func (s *ClustersServiceOp) Status(ctx context.Context, groupID, clusterName string) (ClusterStatus, *Response, error)

Status gets the status of the operation on the Cluster.

See more: https://docs.atlas.mongodb.com/reference/api/clusters-check-operation-status/

func (*ClustersServiceOp) Update

func (s *ClustersServiceOp) Update(ctx context.Context, groupID, clusterName string, updateRequest *Cluster) (*Cluster, *Response, error)

Update a cluster in the project associated to {GROUP-ID}

See more: https://docs.atlas.mongodb.com/reference/api/clusters-modify-one/

func (*ClustersServiceOp) UpdateProcessArgs

func (s *ClustersServiceOp) UpdateProcessArgs(ctx context.Context, groupID, clusterName string, updateRequest *ProcessArgs) (*ProcessArgs, *Response, error)

UpdateProcessArgs Modifies Advanced Configuration Options for One Cluster

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#operation/updateAdvancedConfigurationOptionsForOneCluster

func (*ClustersServiceOp) Upgrade added in v0.17.0

func (s *ClustersServiceOp) Upgrade(ctx context.Context, groupID string, upgradeRequest *Cluster) (*Cluster, *Response, error)

Upgrade a cluster in the project associated to {GROUP-ID}

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#operation/upgradeOneTenantCluster

type CollationOptions

type CollationOptions struct {
	Locale          string `json:"locale,omitempty"`
	CaseLevel       bool   `json:"caseLevel,omitempty"`
	CaseFirst       string `json:"caseFirst,omitempty"`
	Strength        int    `json:"strength,omitempty"`
	NumericOrdering bool   `json:"numericOrdering,omitempty"`
	Alternate       string `json:"alternate,omitempty"`
	MaxVariable     string `json:"maxVariable,omitempty"`
	Normalization   bool   `json:"normalization,omitempty"`
	Backwards       bool   `json:"backwards,omitempty"`
}

CollationOptions represents options for collation indexes.

See: https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#option-for-collation

type Completer

type Completer interface {
	OnRequestCompleted(RequestCompletionCallback)
}

Completer interface for clients with callback.

type Component added in v0.7.1

type Component struct {
	DownloadURL    string `json:"downloadUrl"`    // DownloadURL from which the snapshot of the components.replicaSetName should be downloaded. Atlas returns null for this parameter if the download URL has expired, has been used, or hasn't been created.
	ReplicaSetName string `json:"replicaSetName"` // ReplicaSetName of the shard or config server included in the snapshot.
}

type Compute

type Compute struct {
	Enabled          *bool  `json:"enabled,omitempty"`
	ScaleDownEnabled *bool  `json:"scaleDownEnabled,omitempty"`
	MinInstanceSize  string `json:"minInstanceSize,omitempty"`
	MaxInstanceSize  string `json:"maxInstanceSize,omitempty"`
}

Compute Specifies whether the cluster automatically scales its cluster tier and whether the cluster can scale down.

type ConnectionStrings

type ConnectionStrings struct {
	Standard          string            `json:"standard,omitempty"`
	StandardSrv       string            `json:"standardSrv,omitempty"`
	PrivateEndpoint   []PrivateEndpoint `json:"privateEndpoint,omitempty"`
	AwsPrivateLink    map[string]string `json:"awsPrivateLink,omitempty"`    // Deprecated: Use connectionStrings.PrivateEndpoint[n].ConnectionString
	AwsPrivateLinkSrv map[string]string `json:"awsPrivateLinkSrv,omitempty"` // Deprecated: Use ConnectionStrings.privateEndpoint[n].SRVConnectionString
	Private           string            `json:"private,omitempty"`
	PrivateSrv        string            `json:"privateSrv,omitempty"`
}

ConnectionStrings configuration for applications use to connect to this cluster.

type Container

type Container struct {
	AtlasCIDRBlock      string   `json:"atlasCidrBlock,omitempty"`
	AzureSubscriptionID string   `json:"azureSubscriptionId,omitempty"`
	GCPProjectID        string   `json:"gcpProjectId,omitempty"`
	ID                  string   `json:"id,omitempty"`
	NetworkName         string   `json:"networkName,omitempty"`
	ProviderName        string   `json:"providerName,omitempty"`
	Provisioned         *bool    `json:"provisioned,omitempty"`
	Region              string   `json:"region,omitempty"`     // Region is available for AZURE
	Regions             []string `json:"regions,omitempty"`    // Regions are available for GCP
	RegionName          string   `json:"regionName,omitempty"` // RegionName is available for AWS
	VNetName            string   `json:"vnetName,omitempty"`
	VPCID               string   `json:"vpcId,omitempty"`
}

Container represents MongoDB network peering containter.

type ContainersListOptions

type ContainersListOptions struct {
	ProviderName string `url:"providerName,omitempty"`
	ListOptions
}

ContainersListOptions filtering options for containers.

type ContainersService

ContainersService provides access to the network peering containers related functions in the Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/vpc/

type ContainersServiceOp

type ContainersServiceOp service

ContainersServiceOp handles communication with the Network Peering Container related methods of the MongoDB Atlas API.

func (*ContainersServiceOp) Create

func (s *ContainersServiceOp) Create(ctx context.Context, groupID string, createRequest *Container) (*Container, *Response, error)

Create adds a network peering container to the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/vpc-create-container/

func (*ContainersServiceOp) Delete

func (s *ContainersServiceOp) Delete(ctx context.Context, groupID, containerID string) (*Response, error)

Delete the network peering container specified to {CONTAINER-ID} from the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/vpc-delete-one-container/

func (*ContainersServiceOp) Get

func (s *ContainersServiceOp) Get(ctx context.Context, groupID, containerID string) (*Container, *Response, error)

Get gets details for one network peering container in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/vpc-get-container/

func (*ContainersServiceOp) List

func (s *ContainersServiceOp) List(ctx context.Context, groupID string, listOptions *ContainersListOptions) ([]Container, *Response, error)

List gets details for all network peering containers in an Atlas project for a single cloud provider.

See more: https://docs.atlas.mongodb.com/reference/api/vpc-get-containers-list/

func (*ContainersServiceOp) ListAll

func (s *ContainersServiceOp) ListAll(ctx context.Context, groupID string, listOptions *ListOptions) ([]Container, *Response, error)

ListAll gets details for all network peering containers in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/vpc-get-containers-list-all/

func (*ContainersServiceOp) Update

func (s *ContainersServiceOp) Update(ctx context.Context, groupID, containerID string, updateRequest *Container) (*Container, *Response, error)

Update a network peering container in the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/vpc-update-container/

type ContinuousJob

type ContinuousJob struct {
	BatchID           string            `json:"batchId,omitempty"`
	ClusterID         string            `json:"clusterId,omitempty"`
	Created           string            `json:"created"`
	ClusterName       string            `json:"clusterName,omitempty"`
	Delivery          *Delivery         `json:"delivery,omitempty"`
	EncryptionEnabled bool              `json:"encryptionEnabled"`
	GroupID           string            `json:"groupId"`
	Hashes            []*Hash           `json:"hashes,omitempty"`
	ID                string            `json:"id"`
	Links             []*Link           `json:"links,omitempty"`
	MasterKeyUUID     string            `json:"masterKeyUUID,omitempty"`
	SnapshotID        string            `json:"snapshotId"`
	StatusName        string            `json:"statusName"`
	PointInTime       *bool             `json:"pointInTime,omitempty"`
	Timestamp         SnapshotTimestamp `json:"timestamp"`
}

type ContinuousJobRequest

type ContinuousJobRequest struct {
	CheckPointID         string   `json:"checkPointId,omitempty"`
	Delivery             Delivery `json:"delivery"`
	OplogTS              string   `json:"oplogTs,omitempty"`
	OplogInc             int64    `json:"oplogInc,omitempty"`
	PointInTimeUTCMillis float64  `json:"pointInTimeUTCMillis,omitempty"`
	SnapshotID           string   `json:"snapshotId,omitempty"`
}

type ContinuousJobs

type ContinuousJobs struct {
	Results    []*ContinuousJob `json:"results,omitempty"`
	Links      []*Link          `json:"links,omitempty"`
	TotalCount int64            `json:"totalCount,omitempty"`
}

type ContinuousRestoreJobsService

ContinuousRestoreJobsService provides access to the restore jobs related functions in the Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/legacy-backup/restore/restores/

type ContinuousRestoreJobsServiceOp

type ContinuousRestoreJobsServiceOp service

ContinuousRestoreJobsServiceOp handles communication with the Continuous Backup Restore Jobs related methods of the MongoDB Atlas API.

func (*ContinuousRestoreJobsServiceOp) Create

func (s *ContinuousRestoreJobsServiceOp) Create(ctx context.Context, groupID, clusterID string, request *ContinuousJobRequest) (*ContinuousJobs, *Response, error)

Create creates a continuous backup job in Atlas

See more: https://docs.atlas.mongodb.com/reference/api/restore-jobs-create-one/

func (*ContinuousRestoreJobsServiceOp) Get

func (s *ContinuousRestoreJobsServiceOp) Get(ctx context.Context, groupID, clusterID, jobID string) (*ContinuousJob, *Response, error)

Get gets a continuous backup job in Atlas

See more: https://docs.atlas.mongodb.com/reference/api/restore-jobs-get-one/

func (*ContinuousRestoreJobsServiceOp) List

func (s *ContinuousRestoreJobsServiceOp) List(ctx context.Context, groupID, clusterID string, opts *ListOptions) (*ContinuousJobs, *Response, error)

List lists all continuous backup jobs in Atlas

See more: https://docs.atlas.mongodb.com/reference/api/restore-jobs-get-all/

type ContinuousSnapshot

type ContinuousSnapshot struct {
	ClusterID                 string             `json:"clusterId,omitempty"`
	Complete                  bool               `json:"complete,omitempty"`
	Created                   *SnapshotTimestamp `json:"created,omitempty"`
	DoNotDelete               *bool              `json:"doNotDelete,omitempty"`
	Expires                   string             `json:"expires,omitempty"`
	GroupID                   string             `json:"groupId,omitempty"`
	ID                        string             `json:"id,omitempty"` // Unique identifier of the snapshot.
	IsPossiblyInconsistent    *bool              `json:"isPossiblyInconsistent,omitempty"`
	LastOplogAppliedTimestamp *SnapshotTimestamp `json:"lastOplogAppliedTimestamp,omitempty"`
	Links                     []*Link            `json:"links,omitempty"` // One or more links to sub-resources and/or related resources.
	NamespaceFilterList       *NamespaceFilter   `json:"namespaceFilterList,omitempty"`
	MissingShards             []*MissingShard    `json:"missingShards,omitempty"`
	Parts                     []*Part            `json:"parts,omitempty"`
}

ContinuousSnapshot represents a cloud provider snapshot.

type ContinuousSnapshots

type ContinuousSnapshots struct {
	Results    []*ContinuousSnapshot `json:"results,omitempty"`    // Includes one ContinuousSnapshots object for each item detailed in the results array section.
	Links      []*Link               `json:"links,omitempty"`      // One or more links to sub-resources and/or related resources.
	TotalCount int                   `json:"totalCount,omitempty"` // Count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.
}

ContinuousSnapshots represents all cloud provider snapshots.

type ContinuousSnapshotsService

ContinuousSnapshotsService is an interface for interfacing with the Continuous Snapshots endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/snapshots/

type ContinuousSnapshotsServiceOp

type ContinuousSnapshotsServiceOp service

ContinuousSnapshotsServiceOp handles communication with the Continuous Snapshots related methods of the MongoDB Atlas API.

func (*ContinuousSnapshotsServiceOp) ChangeExpiry

func (s *ContinuousSnapshotsServiceOp) ChangeExpiry(ctx context.Context, groupID, clusterID, snapshotID string, updateRequest *ContinuousSnapshot) (*ContinuousSnapshot, *Response, error)

ChangeExpiry changes the expiry date for the given cluster and snapshot ID

See more: https://docs.atlas.mongodb.com/reference/api/snapshots-change-expiration/

func (*ContinuousSnapshotsServiceOp) Delete

func (s *ContinuousSnapshotsServiceOp) Delete(ctx context.Context, groupID, clusterID, snapshotID string) (*Response, error)

Delete deletes the given continuous snapshot

See more: https://docs.atlas.mongodb.com/reference/api/snapshots-delete-one/

func (*ContinuousSnapshotsServiceOp) Get

func (s *ContinuousSnapshotsServiceOp) Get(ctx context.Context, groupID, clusterID, snapshotID string) (*ContinuousSnapshot, *Response, error)

Get gets the continuous snapshot for the given cluster and snapshot ID

See more: https://docs.atlas.mongodb.com/reference/api/snapshots-get-one/

func (*ContinuousSnapshotsServiceOp) List

func (s *ContinuousSnapshotsServiceOp) List(ctx context.Context, groupID, clusterID string, listOptions *ListOptions) (*ContinuousSnapshots, *Response, error)

List lists continuous snapshots for the given cluster

See more: https://docs.atlas.mongodb.com/reference/api/snapshots-get-all/

type CopySetting added in v0.20.0

type CopySetting struct {
	CloudProvider     *string  `json:"cloudProvider,omitempty"`     // Identifies the cloud provider that stores the snapshot copy.
	RegionName        *string  `json:"regionName,omitempty"`        // Target region to copy snapshots belonging to replicationSpecId to.
	ReplicationSpecID *string  `json:"replicationSpecId,omitempty"` // Unique identifier that identifies the replication object for a zone in a cluster.
	ShouldCopyOplogs  *bool    `json:"shouldCopyOplogs,omitempty"`  // Flag that indicates whether to copy the oplogs to the target region.
	Frequencies       []string `json:"frequencies,omitempty"`       // List that describes which types of snapshots to copy.
}

CopySetting is autogenerated from the json schema.

type CreateOrganizationRequest added in v0.23.0

type CreateOrganizationRequest struct {
	APIKey               *APIKeyInput `json:"apiKey,omitempty"`
	FederationSettingsID *string      `json:"federationSettingsId,omitempty"`
	Name                 string       `json:"name"`
	OrgOwnerID           *string      `json:"orgOwnerId,omitempty"`
}

CreateOrganizationRequest struct for CreateOrganizationRequest.

type CreateOrganizationResponse added in v0.23.0

type CreateOrganizationResponse struct {
	APIKey               *APIKey       `json:"apiKey,omitempty"`
	FederationSettingsID *string       `json:"federationSettingsId,omitempty"`
	OrgOwnerID           *string       `json:"orgOwnerId,omitempty"`
	Organization         *Organization `json:"organization,omitempty"`
}

CreateOrganizationResponse struct for CreateOrganizationResponse.

type CreateProjectOptions added in v0.13.0

type CreateProjectOptions struct {
	ProjectOwnerID string `url:"projectOwnerId,omitempty"` // Unique 24-hexadecimal digit string that identifies the Atlas user account to be granted the Project Owner role on the specified project.
}

type CurrentValue

type CurrentValue struct {
	Number *float64 `json:"number,omitempty"` // The value of the metric.
	Units  string   `json:"units,omitempty"`  // The units for the value. Depends on the type of metric.
}

CurrentValue represents current value of the metric that triggered the alert. Only present for alerts of type HOST_METRIC.

type CustomDBRole

type CustomDBRole struct {
	Actions        []Action        `json:"actions,omitempty"`
	InheritedRoles []InheritedRole `json:"inheritedRoles"`
	RoleName       string          `json:"roleName,omitempty"`
}

CustomDBRole represents a Custom MongoDB Role in your cluster.

type CustomDBRolesService

CustomDBRolesService is an interface for working wit the Custom MongoDB Roles endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/custom-roles/

type CustomDBRolesServiceOp

type CustomDBRolesServiceOp service

CustomDBRolesServiceOp handles communication with the CustomDBRoles related methods of the MongoDB Atlas API.

func (*CustomDBRolesServiceOp) Create

func (s *CustomDBRolesServiceOp) Create(ctx context.Context, groupID string, createRequest *CustomDBRole) (*CustomDBRole, *Response, error)

Create create a new Custom MongoDB Role in the project.

See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-create-a-role/

func (*CustomDBRolesServiceOp) Delete

func (s *CustomDBRolesServiceOp) Delete(ctx context.Context, groupID, roleName string) (*Response, error)

Delete deletes a single Custom MongoDB Role.

See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-delete-a-role/

func (*CustomDBRolesServiceOp) Get

func (s *CustomDBRolesServiceOp) Get(ctx context.Context, groupID, roleName string) (*CustomDBRole, *Response, error)

Get gets a single Custom MongoDB Role in the project.

See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-get-single-role/

func (*CustomDBRolesServiceOp) List

func (s *CustomDBRolesServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) (*[]CustomDBRole, *Response, error)

List gets all custom db roles in the project.

See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-get-all-roles/

func (*CustomDBRolesServiceOp) Update

func (s *CustomDBRolesServiceOp) Update(ctx context.Context, groupID, roleName string, updateRequest *CustomDBRole) (*CustomDBRole, *Response, error)

Update updates a single Custom MongoDB Role.

See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-update-a-role/

type CustomZoneMapping

type CustomZoneMapping struct {
	Location string `json:"location"`
	Zone     string `json:"zone"`
}

CustomZoneMapping represents the custom zone mapping.

type CustomZoneMappingsRequest

type CustomZoneMappingsRequest struct {
	CustomZoneMappings []CustomZoneMapping `json:"customZoneMappings"`
}

CustomZoneMappingsRequest represents the request related to add custom zone mappings to a global cluster.

type CustomerX509

type CustomerX509 struct {
	Cas string `json:"cas,omitempty"` // PEM string containing one or more customer CAs for database user authentication.
}

CustomerX509 represents Customer-managed X.509 configuration for an Atlas project.

type DataFederationCollection added in v0.26.0

type DataFederationCollection struct {
	DataSources []*DataFederationDataSource `json:"dataSources,omitempty"`
	Name        string                      `json:"name,omitempty"`
}

DataFederationCollection represents queryable collections for this data federation.

type DataFederationDataSource added in v0.26.0

type DataFederationDataSource struct {
	AllowInsecure       *bool     `json:"allowInsecure,omitempty"`
	Collection          string    `json:"collection,omitempty"`
	CollectionRegex     string    `json:"collectionRegex,omitempty"`
	Database            string    `json:"database,omitempty"`
	DatabaseRegex       string    `json:"databaseRegex,omitempty"`
	DefaultFormat       string    `json:"defaultFormat,omitempty"`
	Path                string    `json:"path,omitempty"`
	ProvenanceFieldName string    `json:"provenanceFieldName,omitempty"`
	StoreName           string    `json:"storeName,omitempty"`
	Urls                []*string `json:"urls,omitempty"`
}

DataFederationDataSource represents data stores that map to a collection for this data federation.

type DataFederationDatabase added in v0.26.0

type DataFederationDatabase struct {
	Collections            []*DataFederationCollection   `json:"collections,omitempty"`
	Views                  []*DataFederationDatabaseView `json:"views,omitempty"`
	MaxWildcardCollections int32                         `json:"maxWildcardCollections,omitempty"`
	Name                   string                        `json:"name,omitempty"`
}

DataFederationDatabase represents queryable databases and collections for this data federation.

type DataFederationDatabaseView added in v0.26.0

type DataFederationDatabaseView struct {
	Name     string `json:"name,omitempty"`
	Source   string `json:"source,omitempty"`
	Pipeline string `json:"pipeline,omitempty"`
}

DataFederationDatabaseView represents any view under a DataFederationDatabase.

type DataFederationInstance added in v0.26.0

type DataFederationInstance struct {
	CloudProviderConfig *CloudProviderConfig   `json:"cloudProviderConfig,omitempty"`
	DataProcessRegion   *DataProcessRegion     `json:"dataProcessRegion,omitempty"`
	Storage             *DataFederationStorage `json:"storage,omitempty"`
	Name                string                 `json:"name,omitempty"`
	State               string                 `json:"state,omitempty"`
	Hostnames           []string               `json:"hostnames,omitempty"`
}

DataFederationInstance is the data federation configuration.

type DataFederationQueryLimit added in v0.27.0

type DataFederationQueryLimit struct {
	CurrentUsage     int64  `json:"currentUsage,omitempty"`
	DefaultLimit     int64  `json:"defaultLimit,omitempty"`
	LastModifiedDate string `json:"lastModifiedDate,omitempty"`
	MaximumLimit     int64  `json:"maximumLimit,omitempty"`
	Name             string `json:"name,omitempty"`
	OverrunPolicy    string `json:"overrunPolicy,omitempty"`
	TenantName       string `json:"tenantName,omitempty"`
	Value            int64  `json:"value,omitempty"`
}

DataFederationQueryLimit Details of a tenant-level query limit for Data Federation.

type DataFederationServiceOp added in v0.26.0

type DataFederationServiceOp service

DataFederationServiceOp handles communication with the DataFederationService related methods of the MongoDB Atlas API.

func (*DataFederationServiceOp) ConfigureQueryLimit added in v0.27.0

func (s *DataFederationServiceOp) ConfigureQueryLimit(ctx context.Context, groupID, name, limitName string, queryLimit *DataFederationQueryLimit) (*DataFederationQueryLimit, *Response, error)

ConfigureQueryLimit Creates or updates one query limit for one federated database instance.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Federation/operation/createOneDataFederationQueryLimit

func (*DataFederationServiceOp) Create added in v0.26.0

Create creates one federated database instance in the specified project.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Federation/operation/createFederatedDatabase

func (*DataFederationServiceOp) Delete added in v0.26.0

func (s *DataFederationServiceOp) Delete(ctx context.Context, groupID, name string) (*Response, error)

Delete removes one federated database instance from the specified project.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Federation/operation/deleteFederatedDatabase

func (*DataFederationServiceOp) DeleteQueryLimit added in v0.27.0

func (s *DataFederationServiceOp) DeleteQueryLimit(ctx context.Context, groupID, name, limitName string) (*Response, error)

func (*DataFederationServiceOp) Get added in v0.26.0

Get gets the details of one federated database instance within the specified project.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Federation/operation/getFederatedDatabase

func (*DataFederationServiceOp) GetQueryLimit added in v0.27.0

func (s *DataFederationServiceOp) GetQueryLimit(ctx context.Context, groupID, name, limitName string) (*DataFederationQueryLimit, *Response, error)

func (*DataFederationServiceOp) List added in v0.26.0

List gets the details of all federated database instances in the specified project.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Federation/operation/listFederatedDatabases

func (*DataFederationServiceOp) ListQueryLimits added in v0.27.0

func (s *DataFederationServiceOp) ListQueryLimits(ctx context.Context, groupID, name string) ([]*DataFederationQueryLimit, *Response, error)

func (*DataFederationServiceOp) Update added in v0.26.0

Update updates the details of one federated database instance in the specified project.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Federation/operation/updateFederatedDatabase

type DataFederationStorage added in v0.26.0

type DataFederationStorage struct {
	Databases []*DataFederationDatabase `json:"databases,omitempty"`
	Stores    []*DataFederationStore    `json:"stores,omitempty"`
}

DataFederationStorage represents the storage configuration for a data lake.

type DataFederationStore added in v0.26.0

type DataFederationStore struct {
	ReadPreference           *ReadPreference `json:"readPreference,omitempty"`
	AdditionalStorageClasses []*string       `json:"additionalStorageClasses,omitempty"`
	Urls                     []*string       `json:"urls,omitempty"`
	Name                     string          `json:"name,omitempty"`
	Provider                 string          `json:"provider,omitempty"`
	ClusterName              string          `json:"clusterName,omitempty"`
	ClusterID                string          `json:"clusterId,omitempty"`
	Region                   string          `json:"region,omitempty"`
	Bucket                   string          `json:"bucket,omitempty"`
	Prefix                   string          `json:"prefix,omitempty"`
	Delimiter                string          `json:"delimiter,omitempty"`
	ProjectID                string          `json:"projectId,omitempty"`
	DefaultFormat            string          `json:"defaultFormat,omitempty"`
	IncludeTags              *bool           `json:"includeTags,omitempty"`
	Public                   *bool           `json:"public,omitempty"`
	AllowInsecure            *bool           `json:"allowInsecure,omitempty"`
}

DataFederationStore represents data stores for the data federation.

type DataFederationUpdateOptions added in v0.26.0

type DataFederationUpdateOptions struct {
	// Flag that indicates whether this request should check if the requesting IAM role can read from the S3 bucket.
	// AWS checks if the role can list the objects in the bucket before writing to it.
	// Some IAM roles only need write permissions. This flag allows you to skip that check.
	SkipRoleValidation bool `url:"skipRoleValidation"`
}

DataFederationUpdateOptions specifies the optional parameters to Update method.

type DataLake

type DataLake struct {
	CloudProviderConfig CloudProviderConfig `json:"cloudProviderConfig,omitempty"` // Configuration for the cloud service where Data Lake source data is stored.
	DataProcessRegion   DataProcessRegion   `json:"dataProcessRegion,omitempty"`   // Cloud provider region which clients are routed to for data processing.
	GroupID             string              `json:"groupId,omitempty"`             // Unique identifier for the project.
	Hostnames           []string            `json:"hostnames,omitempty"`           // List of hostnames for the data lake.
	Name                string              `json:"name,omitempty"`                // Name of the data lake.
	State               string              `json:"state,omitempty"`               // Current state of the data lake.
	Storage             Storage             `json:"storage,omitempty"`             // Configuration for each data store and its mapping to MongoDB collections / databases.
}

DataLake represents a data lake.

type DataLakeCollection

type DataLakeCollection struct {
	Name        string               `json:"name,omitempty"`
	DataSources []DataLakeDataSource `json:"dataSources,omitempty"`
}

DataLakeCollection represents collections under a DataLakeDatabase.

type DataLakeCreateRequest

type DataLakeCreateRequest struct {
	Name                string               `json:"name,omitempty"`
	CloudProviderConfig *CloudProviderConfig `json:"cloudProviderConfig,omitempty"`
}

DataLakeCreateRequest represents the required fields to create a new data lake.

type DataLakeDataSource

type DataLakeDataSource struct {
	StoreName     string `json:"storeName,omitempty"`
	DefaultFormat string `json:"defaultFormat,omitempty"`
	Path          string `json:"path,omitempty"`
}

DataLakeDataSource represents the data source of a data lake.

type DataLakeDatabase

type DataLakeDatabase struct {
	Name                   string                 `json:"name,omitempty"`
	Collections            []DataLakeCollection   `json:"collections,omitempty"`
	Views                  []DataLakeDatabaseView `json:"views,omitempty"`
	MaxWildcardCollections *int64                 `json:"maxWildcardCollections,omitempty"`
}

DataLakeDatabase represents the mapping of a data lake to a database. Docs: https://docs.mongodb.com/datalake/reference/format/data-lake-configuration/#databases

type DataLakeDatabaseView

type DataLakeDatabaseView struct {
	Name     string `json:"name,omitempty"`
	Source   string `json:"source,omitempty"`
	Pipeline string `json:"pipeline,omitempty"`
}

DataLakeDatabaseView represents any view under a DataLakeDatabase.

type DataLakePipeline added in v0.27.0

type DataLakePipeline struct {
	ID              string                            `json:"_id,omitempty"`             // Unique 24-hexadecimal digit string that identifies the Data Lake Pipeline.
	GroupID         string                            `json:"groupId,omitempty"`         // Unique identifier for the project.
	Name            string                            `json:"name,omitempty"`            // Name of this Data Lake Pipeline.
	CreatedDate     string                            `json:"createdDate,omitempty"`     // Timestamp that indicates when the Data Lake Pipeline was created.
	LastUpdatedDate string                            `json:"lastUpdatedDate,omitempty"` // Timestamp that indicates the last time that the Data Lake Pipeline was updated.
	State           string                            `json:"state,omitempty"`           // State of this Data Lake Pipeline.
	Sink            *DataLakePipelineSink             `json:"sink,omitempty"`            // Ingestion destination of a Data Lake Pipeline.
	Source          *DataLakePipelineSource           `json:"source,omitempty"`          // Ingestion Source of a Data Lake Pipeline.
	Transformations []*DataLakePipelineTransformation `json:"transformations,omitempty"` // Fields to be excluded for this Data Lake Pipeline.
}

DataLakePipeline represents a store of data lake data. Docs: https://docs.mongodb.com/datalake/reference/format/data-lake-configuration/#stores

type DataLakePipelineIngestionSchedule added in v0.27.0

type DataLakePipelineIngestionSchedule struct {
	ID                string `json:"id,omitempty"`                // Unique 24-hexadecimal digit string that identifies this backup policy item.
	FrequencyType     string `json:"frequencyType,omitempty"`     // Human-readable label that identifies the frequency type associated with the backup policy.
	RetentionUnit     string `json:"retentionUnit,omitempty"`     // Unit of time in which MongoDB Cloud measures snapshot retention.
	FrequencyInterval int32  `json:"frequencyInterval,omitempty"` // Number that indicates the frequency interval for a set of snapshots.
	RetentionValue    int32  `json:"retentionValue,omitempty"`    // Duration in days, weeks, or months that MongoDB Cloud retains the snapshot.
}

DataLakePipelineIngestionSchedule represents a backup schedule policy item that you can use as a Data Lake Pipeline source.

type DataLakePipelinePartitionField added in v0.27.0

type DataLakePipelinePartitionField struct {
	FieldName string `json:"fieldName,omitempty"`
	Order     int32  `json:"order,omitempty"`
}

DataLakePipelinePartitionField represents ordered fields used to physically organize data in the destination.

type DataLakePipelineRun added in v0.27.0

type DataLakePipelineRun struct {
	ID                  string                    `json:"_id,omitempty"`                 // Unique 24-hexadecimal character string that identifies a Data Lake Pipeline run.
	BackupFrequencyType string                    `json:"backupFrequencyType,omitempty"` // Backup schedule interval of the Data Lake Pipeline.
	CreatedDate         string                    `json:"createdDate,omitempty"`         // Timestamp that indicates when the pipeline run was created.
	DatasetName         string                    `json:"datasetName,omitempty"`         // Human-readable label that identifies the dataset that Atlas generates during this pipeline run.
	GroupID             string                    `json:"groupId,omitempty"`             // Unique 24-hexadecimal character string that identifies the project.
	LastUpdatedDate     string                    `json:"lastUpdatedDate,omitempty"`     // Timestamp that indicates the last time that the pipeline run was updated.
	Phase               string                    `json:"phase,omitempty"`               // Processing phase of the Data Lake Pipeline.
	PipelineID          string                    `json:"pipelineId,omitempty"`          // Unique 24-hexadecimal character string that identifies a Data Lake Pipeline.
	SnapshotID          string                    `json:"snapshotId,omitempty"`          // Unique 24-hexadecimal character string that identifies the snapshot of a cluster.
	State               string                    `json:"state,omitempty"`               // State of the pipeline run.
	Stats               *DataLakePipelineRunStats `json:"stats,omitempty"`               // Runtime statistics for this Data Lake Pipeline run.
}

DataLakePipelineRun represents a DataLake Pipeline Run.

type DataLakePipelineRunStats added in v0.27.0

type DataLakePipelineRunStats struct {
	BytesExported int64 `json:"bytesExported,omitempty"` // Total data size in bytes exported for this pipeline run.
	NumDocs       int64 `json:"numDocs,omitempty"`       // Number of docs ingested for a this pipeline run.
}

DataLakePipelineRunStats represents runtime statistics for this Data Lake Pipeline run.

type DataLakePipelineRunsResponse added in v0.27.0

type DataLakePipelineRunsResponse struct {
	Links      []*Link                `json:"links,omitempty"`      // List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both.
	Results    []*DataLakePipelineRun `json:"results,omitempty"`    // List of returned documents that MongoDB Cloud providers when completing this request.
	TotalCount int                    `json:"totalCount,omitempty"` // Number of documents returned in this response.
}

DataLakePipelineRunsResponse represents the response of DataLakePipelineService.ListRuns.

type DataLakePipelineServiceOp added in v0.27.0

type DataLakePipelineServiceOp service

DataLakePipelineServiceOp handles communication with the DataLakePipelineService related methods of the MongoDB Atlas API.

func (*DataLakePipelineServiceOp) Create added in v0.27.0

func (s *DataLakePipelineServiceOp) Create(ctx context.Context, groupID string, createRequest *DataLakePipeline) (*DataLakePipeline, *Response, error)

Create creates one Data Lake Pipeline.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Lake-Pipelines/operation/createPipeline

func (*DataLakePipelineServiceOp) Delete added in v0.27.0

func (s *DataLakePipelineServiceOp) Delete(ctx context.Context, groupID, name string) (*Response, error)

Delete deletes one Data Lake Pipeline.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Lake-Pipelines/operation/deletePipeline

func (*DataLakePipelineServiceOp) Get added in v0.27.0

Get gets the details of one Data Lake Pipeline within the specified project.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Lake-Pipelines/operation/getPipeline

func (*DataLakePipelineServiceOp) GetRun added in v0.27.0

func (s *DataLakePipelineServiceOp) GetRun(ctx context.Context, groupID, name, id string) (*DataLakePipelineRun, *Response, error)

GetRun gets the details of one Data Lake Pipeline run within the specified project.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Lake-Pipelines/operation/getPipelineRun

func (*DataLakePipelineServiceOp) List added in v0.27.0

List gets a list of Data Lake Pipelines.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Lake-Pipelines/operation/listPipelines

func (*DataLakePipelineServiceOp) ListIngestionSchedules added in v0.27.0

func (s *DataLakePipelineServiceOp) ListIngestionSchedules(ctx context.Context, groupID, name string) ([]*DataLakePipelineIngestionSchedule, *Response, error)

ListIngestionSchedules gets a list of backup schedule policy items that you can use as a Data Lake Pipeline source.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Lake-Pipelines/operation/listPipelineSchedules

func (*DataLakePipelineServiceOp) ListRuns added in v0.27.0

ListRuns gets a list of past Data Lake Pipeline runs.

https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Lake-Pipelines/operation/listPipelineRuns

func (*DataLakePipelineServiceOp) ListSnapshots added in v0.27.0

ListSnapshots gets a list of backup snapshots that you can use to trigger an on demand pipeline run.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Lake-Pipelines/operation/listPipelineSchedules

func (*DataLakePipelineServiceOp) Update added in v0.27.0

func (s *DataLakePipelineServiceOp) Update(ctx context.Context, groupID, name string, updateRequest *DataLakePipeline) (*DataLakePipeline, *Response, error)

Update updates one Data Lake Pipeline.

See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Data-Lake-Pipelines/operation/updatePipeline

type DataLakePipelineSink added in v0.27.0

type DataLakePipelineSink struct {
	Type             string                            `json:"type,omitempty"`             // Type of ingestion destination of this Data Lake Pipeline.
	MetadataProvider string                            `json:"metadataProvider,omitempty"` // Target cloud provider for this Data Lake Pipeline.
	MetadataRegion   string                            `json:"metadataRegion,omitempty"`   // Target cloud provider region for this Data Lake Pipeline.
	PartitionFields  []*DataLakePipelinePartitionField `json:"partitionFields,omitempty"`  // Ordered fields used to physically organize data in the destination.
}

DataLakePipelineSink represents ingestion destination of a Data Lake Pipeline.

type DataLakePipelineSnapshot added in v0.27.0

type DataLakePipelineSnapshot struct {
	ID               string   `json:"id,omitempty"`               // Unique 24-hexadecimal digit string that identifies the snapshot.
	CloudProvider    string   `json:"cloudProvider,omitempty"`    // Human-readable label that identifies the cloud provider that stores this snapshot.
	CreatedAt        string   `json:"createdAt,omitempty"`        // Date and time when MongoDB Cloud took the snapshot.
	Description      string   `json:"description,omitempty"`      // Human-readable phrase or sentence that explains the purpose of the snapshot.
	ExpiresAt        string   `json:"expiresAt,omitempty"`        // Date and time when MongoDB Cloud deletes the snapshot.
	FrequencyType    string   `json:"frequencyType,omitempty"`    // Human-readable label that identifies how often this snapshot triggers.
	MasterKeyUUID    string   `json:"masterKeyUUID,omitempty"`    // Unique string that identifies the Amazon Web Services (AWS) Key Management Service (KMS) Customer Master Key (CMK) used to encrypt the snapshot.
	MongodVersion    string   `json:"mongodVersion,omitempty"`    // Version of the MongoDB host that this snapshot backs up.
	ReplicaSetName   string   `json:"replicaSetName,omitempty"`   // Human-readable label that identifies the replica set from which MongoDB Cloud took this snapshot.
	SnapshotType     string   `json:"snapshotType,omitempty"`     // Human-readable label that identifies when this snapshot triggers.
	Status           string   `json:"status,omitempty"`           // Human-readable label that indicates the stage of the backup process for this snapshot.
	Type             string   `json:"type,omitempty"`             // Human-readable label that categorizes the cluster as a replica set or sharded cluster.
	StorageSizeBytes int64    `json:"storageSizeBytes,omitempty"` // Number of bytes taken to store the backup snapshot.
	CopyRegions      []string `json:"copyRegions,omitempty"`      // List that identifies the regions to which MongoDB Cloud copies the snapshot.
	PolicyItems      []string `json:"policyItems,omitempty"`      // List that contains unique identifiers for the policy items.
	Links            []*Link  `json:"links,omitempty"`            // List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both.
}

DataLakePipelineSnapshot represents a snapshot that you can use to trigger an on demand pipeline run.

type DataLakePipelineSnapshotsResponse added in v0.27.0

type DataLakePipelineSnapshotsResponse struct {
	Links      []*Link                     `json:"links,omitempty"`      // List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both.
	Results    []*DataLakePipelineSnapshot `json:"results,omitempty"`    // List of returned documents that MongoDB Cloud providers when completing this request.
	TotalCount int                         `json:"totalCount,omitempty"` // Number of documents returned in this response.
}

DataLakePipelineSnapshotsResponse represents the response of DataLakePipelineService.ListSnapshots.

type DataLakePipelineSource added in v0.27.0

type DataLakePipelineSource struct {
	Type           string `json:"type,omitempty"`           // Type of ingestion source of this Data Lake Pipeline.
	ClusterName    string `json:"clusterName,omitempty"`    // Human-readable name that identifies the cluster.
	CollectionName string `json:"collectionName,omitempty"` // Human-readable name that identifies the collection.
	DatabaseName   string `json:"databaseName,omitempty"`   // Human-readable name that identifies the database.
	PolicyItemID   string `json:"policyItemId,omitempty"`   // Unique 24-hexadecimal character string that identifies a policy item.
	GroupID        string `json:"groupId,omitempty"`        // Unique 24-hexadecimal character string that identifies the project.
}

DataLakePipelineSource represents the storage configuration for a data lake.

type DataLakePipelineTransformation added in v0.27.0

type DataLakePipelineTransformation struct {
	Field string `json:"field,omitempty"` // Key in the document.
	Type  string `json:"type,omitempty"`  // Type of transformation applied during the export of the namespace in a Data Lake Pipeline.
}

DataLakePipelineTransformation represents fields to be excluded for this Data Lake Pipeline.

type DataLakeService

DataLakeService is an interface for interfacing with the Data Lake endpoints of the MongoDB Atlas API.

See more: https://docs.mongodb.com/datalake/reference/api/datalakes-api

type DataLakeServiceOp

type DataLakeServiceOp service

DataLakeServiceOp handles communication with the DataLakeService related methods of the MongoDB Atlas API.

func (*DataLakeServiceOp) Create

func (s *DataLakeServiceOp) Create(ctx context.Context, groupID string, createRequest *DataLakeCreateRequest) (*DataLake, *Response, error)

Create creates a new Data Lake.

See more: https://docs.mongodb.com/datalake/reference/api/dataLakes-create-one-tenant/

func (*DataLakeServiceOp) CreatePrivateLinkEndpoint added in v0.15.0

func (s *DataLakeServiceOp) CreatePrivateLinkEndpoint(ctx context.Context, groupID string, createRequest *PrivateLinkEndpointDataLake) (*PrivateLinkEndpointDataLakeResponse, *Response, error)

CreatePrivateLinkEndpoint creates one private link endpoint in Data Lake Atlas project.

See more: https://docs.mongodb.com/datalake/reference/api/dataLakes-private-link-create-one/#std-label-api-pvt-link-create-one

func (*DataLakeServiceOp) Delete

func (s *DataLakeServiceOp) Delete(ctx context.Context, groupID, name string) (*Response, error)

Delete deletes the Data Lake with a given name.

See more: https://docs.mongodb.com/datalake/reference/api/dataLakes-delete-one-tenant/

func (*DataLakeServiceOp) DeletePrivateLinkEndpoint added in v0.15.0

func (s *DataLakeServiceOp) DeletePrivateLinkEndpoint(ctx context.Context, groupID, endpointID string) (*Response, error)

DeletePrivateLinkEndpoint deletes the Data Lake private link endpoint with a given endpoint id.

See more: https://docs.mongodb.com/datalake/reference/api/dataLakes-private-link-delete-one/#std-label-api-pvt-link-delete-one

func (*DataLakeServiceOp) Get

func (s *DataLakeServiceOp) Get(ctx context.Context, groupID, name string) (*DataLake, *Response, error)

Get gets the data laked associated with a specific name.

See more: https://docs.mongodb.com/datalake/reference/api/dataLakes-get-one-tenant/

func (*DataLakeServiceOp) GetPrivateLinkEndpoint added in v0.15.0

func (s *DataLakeServiceOp) GetPrivateLinkEndpoint(ctx context.Context, groupID, endpointID string) (*PrivateLinkEndpointDataLake, *Response, error)

GetPrivateLinkEndpoint gets the data lake private link endpoint associated with a specific group and endpointID.

See more: https://docs.mongodb.com/datalake/reference/api/dataLakes-private-link-get-one/#std-label-api-pvt-link-get-one

func (*DataLakeServiceOp) List

func (s *DataLakeServiceOp) List(ctx context.Context, groupID string) ([]DataLake, *Response, error)

List gets all data lakes for the specified group.

See more: https://docs.mongodb.com/datalake/reference/api/dataLakes-get-all-tenants

func (*DataLakeServiceOp) ListPrivateLinkEndpoint added in v0.15.0

func (s *DataLakeServiceOp) ListPrivateLinkEndpoint(ctx context.Context, groupID string) (*PrivateLinkEndpointDataLakeResponse, *Response, error)

ListPrivateLinkEndpoint gets all private link endpoints for data lake for the specified group.

See more: https://docs.atlas.mongodb.com/reference/api/online-archive-private-link-get-all/#std-label-api-online-archive-pvt-link-get-all

func (*DataLakeServiceOp) Update

func (s *DataLakeServiceOp) Update(ctx context.Context, groupID, name string, updateRequest *DataLakeUpdateRequest) (*DataLake, *Response, error)

Update updates an existing Data Lake.

See more: https://docs.mongodb.com/datalake/reference/api/dataLakes-update-one-tenant/

type DataLakeStore

type DataLakeStore struct {
	Name                     string   `json:"name,omitempty"`
	Provider                 string   `json:"provider,omitempty"`
	Region                   string   `json:"region,omitempty"`
	Bucket                   string   `json:"bucket,omitempty"`
	Prefix                   string   `json:"prefix,omitempty"`
	Delimiter                string   `json:"delimiter,omitempty"`
	IncludeTags              *bool    `json:"includeTags,omitempty"`
	AdditionalStorageClasses []string `json:"additionalStorageClasses,omitempty"`
}

DataLakeStore represents a store of data lake data. Docs: https://docs.mongodb.com/datalake/reference/format/data-lake-configuration/#stores

type DataLakeUpdateRequest

type DataLakeUpdateRequest struct {
	CloudProviderConfig *CloudProviderConfig `json:"cloudProviderConfig,omitempty"`
	DataProcessRegion   *DataProcessRegion   `json:"dataProcessRegion,omitempty"`
}

DataLakeUpdateRequest represents all possible fields that can be updated in a data lake.

type DataPoints

type DataPoints struct {
	Timestamp string   `json:"timestamp"`
	Value     *float32 `json:"value"`
}

DataPoints represents a MongoDB DataPoints.

type DataProcessRegion

type DataProcessRegion struct {
	CloudProvider string `json:"cloudProvider,omitempty"`
	Region        string `json:"region,omitempty"`
}

DataProcessRegion represents the region where a data lake is processed.

type DatabaseUser

type DatabaseUser struct {
	DatabaseName    string  `json:"databaseName,omitempty"`
	DeleteAfterDate string  `json:"deleteAfterDate,omitempty"`
	Labels          []Label `json:"labels,omitempty"`
	LDAPAuthType    string  `json:"ldapAuthType,omitempty"`
	X509Type        string  `json:"x509Type,omitempty"`
	AWSIAMType      string  `json:"awsIAMType,omitempty"`
	GroupID         string  `json:"groupId,omitempty"`
	Roles           []Role  `json:"roles,omitempty"`
	Scopes          []Scope `json:"scopes"`
	Password        string  `json:"password,omitempty"`
	Username        string  `json:"username,omitempty"`
	OIDCAuthType    string  `json:"oidcAuthType,omitempty"`
}

DatabaseUser represents MongoDB users in your cluster.

func (*DatabaseUser) GetAuthDB added in v0.5.0

func (user *DatabaseUser) GetAuthDB() (name string)

GetAuthDB determines the authentication database based on the type of user. LDAP, X509 and AWSIAM should all use $external. SCRAM-SHA should use admin.

type DatabaseUsersService

DatabaseUsersService is an interface for interfacing with the Database Users endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/database-users/index.html

type DatabaseUsersServiceOp

type DatabaseUsersServiceOp service

DatabaseUsersServiceOp handles communication with the DatabaseUsers related methods of the MongoDB Atlas API.

func (*DatabaseUsersServiceOp) Create

func (s *DatabaseUsersServiceOp) Create(ctx context.Context, groupID string, createRequest *DatabaseUser) (*DatabaseUser, *Response, error)

Create creates a user for the project.

See more: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/

func (*DatabaseUsersServiceOp) Delete

func (s *DatabaseUsersServiceOp) Delete(ctx context.Context, databaseName, groupID, username string) (*Response, error)

Delete deletes a user for the project.

See more: https://docs.atlas.mongodb.com/reference/api/database-users-delete-a-user/

func (*DatabaseUsersServiceOp) Get

func (s *DatabaseUsersServiceOp) Get(ctx context.Context, databaseName, groupID, username string) (*DatabaseUser, *Response, error)

Get gets a single user in the project.

See more: https://docs.atlas.mongodb.com/reference/api/database-users-get-single-user/

func (*DatabaseUsersServiceOp) List

func (s *DatabaseUsersServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) ([]DatabaseUser, *Response, error)

List gets all users in the project.

See more: https://docs.atlas.mongodb.com/reference/api/database-users-get-all-users/

func (*DatabaseUsersServiceOp) Update

func (s *DatabaseUsersServiceOp) Update(ctx context.Context, groupID, username string, updateRequest *DatabaseUser) (*DatabaseUser, *Response, error)

Update updates a user for the project.

See more: https://docs.atlas.mongodb.com/reference/api/database-users-update-a-user/

type DateRangetOptions

type DateRangetOptions struct {
	StartDate string `url:"startDate,omitempty"`
	EndDate   string `url:"endDate,omitempty"`
}

DateRangetOptions specifies an optional date range query.

type DefaultMongoDBMajorVersionService added in v0.7.1

type DefaultMongoDBMajorVersionService interface {
	Get(context.Context) (string, *Response, error)
}

DefaultMongoDBMajorVersionService this service is to be used by other MongoDB tools to determine the current default major version of MongoDB Server in Atlas.

We currently make no promise to support or document this service or endpoint beyond what can be seen here.

type DefaultMongoDBMajorVersionServiceOp added in v0.7.1

type DefaultMongoDBMajorVersionServiceOp struct {
	Client PlainRequestDoer
}

DefaultMongoDBMajorVersionServiceOp is an implementation of DefaultMongoDBMajorVersionService.

func (*DefaultMongoDBMajorVersionServiceOp) Get added in v0.7.1

Get gets the current major MongoDB version in Atlas.

type DeleteAdvanceClusterOptions added in v0.29.0

type DeleteAdvanceClusterOptions struct {
	// Flag that indicates whether to retain backup snapshots for the deleted dedicated cluster.
	RetainBackups *bool `url:"retainBackups,omitempty"`
}

type DeleteCopiedBackup added in v0.20.0

type DeleteCopiedBackup struct {
	CloudProvider     *string `json:"cloudProvider,omitempty"`     // Identifies the cloud provider that stores the snapshot copy.
	RegionName        *string `json:"regionName,omitempty"`        // Target region to copy snapshots belonging to replicationSpecId to.
	ReplicationSpecID *string `json:"replicationSpecId,omitempty"` // Unique identifier that identifies the replication object for a zone in a cluster.
}

DeleteCopiedBackup is autogenerated from the json schema.

type Delivery

type Delivery struct {
	Expires           string `json:"expires,omitempty"`
	ExpirationHours   int64  `json:"expirationHours,omitempty"`
	MaxDownloads      int64  `json:"maxDownloads,omitempty"`
	MethodName        string `json:"methodName"`
	StatusName        string `json:"statusName,omitempty"`
	URL               string `json:"url,omitempty"`
	TargetClusterID   string `json:"targetClusterId,omitempty"`
	TargetClusterName string `json:"targetClusterName,omitempty"`
	TargetGroupID     string `json:"targetGroupId,omitempty"`
}

type Destination added in v0.12.0

type Destination struct {
	ClusterName string `json:"clusterName,omitempty"` // Human-readable label that identifies the Atlas destination cluster.
	GroupID     string `json:"groupId,omitempty"`     // Unique 24-hexadecimal digit string that identifies the Atlas destination project.
}

Destination represents settings of the Atlas destination.

type DiskGB added in v0.9.0

type DiskGB struct {
	Enabled *bool `json:"enabled,omitempty"`
}

type Doer

type Doer interface {
	Do(context.Context, *http.Request, interface{}) (*Response, error)
}

Doer basic interface of a client to be able to do a request.

type EncryptionAtRest

type EncryptionAtRest struct {
	GroupID        string                            `json:"groupId,omitempty"` // The unique identifier for the project.
	AwsKms         `json:"awsKms,omitempty"`         // AwsKms specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
	AzureKeyVault  `json:"azureKeyVault,omitempty"`  // AzureKeyVault specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
	GoogleCloudKms `json:"googleCloudKms,omitempty"` // Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
}

EncryptionAtRest represents a configuration Encryption at Rest for an Atlas project.

type EncryptionsAtRestService

type EncryptionsAtRestService interface {
	Create(context.Context, *EncryptionAtRest) (*EncryptionAtRest, *Response, error)
	Get(context.Context, string) (*EncryptionAtRest, *Response, error)
	Delete(context.Context, string) (*Response, error)
}

EncryptionsAtRestService is an interface for interfacing with the Encryption at Rest endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/encryption-at-rest/

type EncryptionsAtRestServiceOp

type EncryptionsAtRestServiceOp service

EncryptionsAtRestServiceOp handles communication with the DatabaseUsers related methods of the MongoDB Atlas API.

func (*EncryptionsAtRestServiceOp) Create

Create takes one on-demand snapshot. Atlas takes on-demand snapshots immediately, unlike scheduled snapshots which occur at regular intervals.

See more: https://docs.atlas.mongodb.com/reference/api/enable-configure-encryptionatrest/

func (*EncryptionsAtRestServiceOp) Delete

func (s *EncryptionsAtRestServiceOp) Delete(ctx context.Context, groupID string) (*Response, error)

Delete disable the AWS, Azure and Google Encryption at Rest.

See more: https://docs.atlas.mongodb.com/reference/api/enable-configure-encryptionatrest/

func (*EncryptionsAtRestServiceOp) Get

Get retrieves the current configuration for Encryption at Rest for an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/get-configuration-encryptionatrest/

type Endpoint added in v0.7.1

type Endpoint struct {
	EndpointID   string `json:"endpointId,omitempty"`
	ProviderName string `json:"providerName,omitempty"`
	Region       string `json:"region,omitempty"`
}

Endpoint through which you connect to Atlas.

type ErrorResponse

type ErrorResponse struct {
	// Response that caused this error
	Response *http.Response
	// ErrorCode is the code as specified in https://docs.atlas.mongodb.com/reference/api/api-errors/
	ErrorCode string `json:"errorCode"`
	// HTTPCode status code.
	HTTPCode int `json:"error"`
	// Reason is short description of the error, which is simply the HTTP status phrase.
	Reason string `json:"reason"`
	// Detail is more detailed description of the error.
	Detail string `json:"detail,omitempty"`
}

ErrorResponse reports the error caused by an API request.

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

func (*ErrorResponse) Is added in v0.9.0

func (r *ErrorResponse) Is(target error) bool

type Event

type Event struct {
	AlertID         string        `json:"alertId"`
	AlertConfigID   string        `json:"alertConfigId"`
	APIKeyID        string        `json:"apiKeyId,omitempty"`
	Collection      string        `json:"collection,omitempty"`
	Created         string        `json:"created"`
	CurrentValue    *CurrentValue `json:"currentValue,omitempty"`
	Database        string        `json:"database,omitempty"`
	EventTypeName   string        `json:"eventTypeName"`
	GroupID         string        `json:"groupId,omitempty"`
	Hostname        string        `json:"hostname"`
	ID              string        `json:"id"`
	InvoiceID       string        `json:"invoiceId,omitempty"`
	IsGlobalAdmin   bool          `json:"isGlobalAdmin,omitempty"`
	Links           []*Link       `json:"links"`
	MetricName      string        `json:"metricName,omitempty"`
	OpType          string        `json:"opType,omitempty"`
	OrgID           string        `json:"orgId,omitempty"`
	PaymentID       string        `json:"paymentId,omitempty"`
	Port            int           `json:"Port,omitempty"`
	PublicKey       string        `json:"publicKey,omitempty"`
	RemoteAddress   string        `json:"remoteAddress,omitempty"`
	ReplicaSetName  string        `json:"replicaSetName,omitempty"`
	ShardName       string        `json:"shardName,omitempty"`
	TargetPublicKey string        `json:"targetPublicKey,omitempty"`
	TargetUsername  string        `json:"targetUsername,omitempty"`
	TeamID          string        `json:"teamId,omitempty"`
	UserID          string        `json:"userId,omitempty"`
	Username        string        `json:"username,omitempty"`
	WhitelistEntry  string        `json:"whitelistEntry,omitempty"`
}

Event represents an event of the MongoDB Atlas API.

type EventListOptions

type EventListOptions struct {
	ListOptions
	EventType []string `url:"eventType,omitempty"`
	MinDate   string   `url:"minDate,omitempty"`
	MaxDate   string   `url:"maxDate,omitempty"`
}

EventListOptions specifies the optional parameters to the Event List methods.

type EventResponse

type EventResponse struct {
	Links      []*Link  `json:"links,omitempty"`
	Results    []*Event `json:"results,omitempty"`
	TotalCount int      `json:"totalCount,omitempty"`
}

EventResponse is the response from the EventsService.List.

type EventsService

type EventsService interface {
	ListOrganizationEvents(context.Context, string, *EventListOptions) (*EventResponse, *Response, error)
	GetOrganizationEvent(context.Context, string, string) (*Event, *Response, error)
	ListProjectEvents(context.Context, string, *EventListOptions) (*EventResponse, *Response, error)
	GetProjectEvent(context.Context, string, string) (*Event, *Response, error)
}

EventsService is an interface for interfacing with the Events endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/events/

type EventsServiceOp

type EventsServiceOp service

EventsServiceOp handles communication with the Event related methods of the MongoDB Atlas API.

func (*EventsServiceOp) GetOrganizationEvent

func (s *EventsServiceOp) GetOrganizationEvent(ctx context.Context, orgID, eventID string) (*Event, *Response, error)

GetOrganizationEvent gets the alert specified to {EVENT-ID} from the organization associated to {ORG-ID}.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/events/get-one-event-for-org/

func (*EventsServiceOp) GetProjectEvent

func (s *EventsServiceOp) GetProjectEvent(ctx context.Context, groupID, eventID string) (*Event, *Response, error)

GetProjectEvent gets the alert specified to {EVENT-ID} from the project associated to {PROJECT-ID}.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/events/get-one-event-for-project/

func (*EventsServiceOp) ListOrganizationEvents

func (s *EventsServiceOp) ListOrganizationEvents(ctx context.Context, orgID string, listOptions *EventListOptions) (*EventResponse, *Response, error)

ListOrganizationEvents lists all events in the organization associated to {ORG-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/events-orgs-get-all/

func (*EventsServiceOp) ListProjectEvents

func (s *EventsServiceOp) ListProjectEvents(ctx context.Context, groupID string, listOptions *EventListOptions) (*EventResponse, *Response, error)

ListProjectEvents lists all events in the project associated to {PROJECT-ID}.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/events/get-all-events-for-project/

type Export added in v0.16.0

type Export struct {
	ExportBucketID string `json:"exportBucketId,omitempty"` // Unique identifier of the AWS bucket to export the cloud backup snapshot to.
	FrequencyType  string `json:"frequencyType,omitempty"`  // Frequency associated with the export policy.
}

Export represents a policy for automatically exporting cloud backup snapshots to AWS bucket.

type FeatureUsage added in v0.6.0

type FeatureUsage struct {
	FeatureType string      `json:"featureType,omitempty"`
	FeatureID   interface{} `json:"featureId,omitempty"`
}

FeatureUsage represents where the role sis being used.

type FederatedSettings added in v0.17.0

type FederatedSettings struct {
	FederatedDomains       []string `json:"federatedDomains,omitempty"`
	HasRoleMappings        *bool    `json:"hasRoleMappings,omitempty"`
	ID                     string   `json:"id,omitempty"`
	IdentityProviderID     string   `json:"identityProviderId,omitempty"`
	IdentityProviderStatus string   `json:"identityProviderStatus,omitempty"`
}

FederatedSettings represents a FederatedSettings List.

type FederatedSettingsConnectedOrganization added in v0.17.0

type FederatedSettingsConnectedOrganization struct {
	DomainAllowList          []string        `json:"domainAllowList,omitempty"`
	DomainRestrictionEnabled *bool           `json:"domainRestrictionEnabled,omitempty"`
	IdentityProviderID       string          `json:"identityProviderId,omitempty"`
	OrgID                    string          `json:"orgId,omitempty"`
	PostAuthRoleGrants       []string        `json:"postAuthRoleGrants,omitempty"`
	RoleMappings             []*RoleMappings `json:"roleMappings,omitempty"`
	UserConflicts            *UserConflicts  `json:"userConflicts,omitempty"`
}

type FederatedSettingsConnectedOrganizations added in v0.17.0

type FederatedSettingsConnectedOrganizations struct {
	Links      []*Link                                   `json:"links,omitempty"`
	Results    []*FederatedSettingsConnectedOrganization `json:"results,omitempty"`
	TotalCount int                                       `json:"totalCount,omitempty"`
}

FederatedSettings represents a FederatedSettings Connected Organization.

type FederatedSettingsIdentityProvider added in v0.17.0

type FederatedSettingsIdentityProvider struct {
	AcsURL                     string            `json:"acsUrl,omitempty"`
	AssociatedDomains          []string          `json:"associatedDomains,omitempty"`
	AssociatedOrgs             []*AssociatedOrgs `json:"associatedOrgs,omitempty"`
	AudienceURI                string            `json:"audienceUri,omitempty"`
	DisplayName                string            `json:"displayName,omitempty"`
	IssuerURI                  string            `json:"issuerUri,omitempty"`
	OktaIdpID                  string            `json:"oktaIdpId,omitempty"`
	PemFileInfo                *PemFileInfo      `json:"pemFileInfo,omitempty"`
	RequestBinding             string            `json:"requestBinding,omitempty"`
	ResponseSignatureAlgorithm string            `json:"responseSignatureAlgorithm,omitempty"`
	SsoDebugEnabled            *bool             `json:"ssoDebugEnabled,omitempty"`
	SsoURL                     string            `json:"ssoUrl,omitempty"`
	Status                     string            `json:"status,omitempty"`
}

type FederatedSettingsIdentityProviders added in v0.17.0

type FederatedSettingsIdentityProviders struct {
	Links      []*Link                             `json:"links,omitempty"`
	Results    []FederatedSettingsIdentityProvider `json:"results,omitempty"`
	TotalCount int                                 `json:"totalCount,omitempty"`
}

FederatedSettings represents a FederatedSettings List.

type FederatedSettingsOrganizationRoleMapping added in v0.17.0

type FederatedSettingsOrganizationRoleMapping struct {
	ExternalGroupName string             `json:"externalGroupName,omitempty"`
	ID                string             `json:"id,omitempty"`
	RoleAssignments   []*RoleAssignments `json:"roleAssignments,omitempty"`
}

type FederatedSettingsOrganizationRoleMappings added in v0.17.0

type FederatedSettingsOrganizationRoleMappings struct {
	Links      []*Link                                     `json:"links,omitempty"`
	Results    []*FederatedSettingsOrganizationRoleMapping `json:"results,omitempty"`
	TotalCount int                                         `json:"totalCount,omitempty"`
}

FederatedSettings represents a FederatedSettings Organization Connection..

type FederatedSettingsService added in v0.17.0

type FederatedSettingsService interface {
	Get(context.Context, string) (*FederatedSettings, *Response, error)
	Delete(context.Context, string) (*Response, error)
	ListConnectedOrgs(context.Context, string, *ListOptions) (*FederatedSettingsConnectedOrganizations, *Response, error)
	GetConnectedOrg(context.Context, string, string) (*FederatedSettingsConnectedOrganization, *Response, error)
	UpdateConnectedOrg(context.Context, string, string, *FederatedSettingsConnectedOrganization) (*FederatedSettingsConnectedOrganization, *Response, error)
	DeleteConnectedOrg(context.Context, string, string) (*Response, error)
	ListRoleMappings(context.Context, string, string, *ListOptions) (*FederatedSettingsOrganizationRoleMappings, *Response, error)
	GetRoleMapping(context.Context, string, string, string) (*FederatedSettingsOrganizationRoleMapping, *Response, error)
	CreateRoleMapping(context.Context, string, string, *FederatedSettingsOrganizationRoleMapping) (*FederatedSettingsOrganizationRoleMapping, *Response, error)
	UpdateRoleMapping(context.Context, string, string, string, *FederatedSettingsOrganizationRoleMapping) (*FederatedSettingsOrganizationRoleMapping, *Response, error)
	DeleteRoleMapping(context.Context, string, string, string) (*Response, error)
	ListIdentityProviders(context.Context, string, *ListOptions) ([]FederatedSettingsIdentityProvider, *Response, error)
	GetIdentityProvider(context.Context, string, string) (*FederatedSettingsIdentityProvider, *Response, error)
	UpdateIdentityProvider(context.Context, string, string, *FederatedSettingsIdentityProvider) (*FederatedSettingsIdentityProvider, *Response, error)
}

FederatedSettingsService is an interface for working with the Federation Settings endpoints of the MongoDB Atlas API.

See more: https://www.mongodb.com/docs/atlas/reference/api/federation-configuration/

type FederatedSettingsServiceOp added in v0.17.0

type FederatedSettingsServiceOp service

FederatedSettingsServiceOp handles communication with the FederatedSettings related methods of the MongoDB Atlas API.

func (*FederatedSettingsServiceOp) CreateRoleMapping added in v0.17.0

CreateRoleMapping creates one new Federated Settings Role Mapping for an organization.

See more: https://docs.atlas.mongodb.com/reference/api/live-migration/create-one-migration/

func (*FederatedSettingsServiceOp) Delete added in v0.17.0

func (s *FederatedSettingsServiceOp) Delete(ctx context.Context, federationSettingsID string) (*Response, error)

Delete deletes federation setting.

See more: https://www.mongodb.com/docs/atlas/reference/api/federation-delete-one/

func (*FederatedSettingsServiceOp) DeleteConnectedOrg added in v0.17.0

func (s *FederatedSettingsServiceOp) DeleteConnectedOrg(ctx context.Context, federationSettingsID, orgID string) (*Response, error)

DeleteConnectedOrg deletes federation setting for org mapping.

See more: https://www.mongodb.com/docs/atlas/reference/api/org-mapping-remove-one/

func (*FederatedSettingsServiceOp) DeleteRoleMapping added in v0.17.0

func (s *FederatedSettingsServiceOp) DeleteRoleMapping(ctx context.Context, federationSettingsID, orgID, roleMappingID string) (*Response, error)

DeleteRoleMapping deletes Federated Settings Role Mapping for an organization.

See more: https://www.mongodb.com/docs/atlas/reference/api/role-mapping-delete-one/

func (*FederatedSettingsServiceOp) Get added in v0.17.0

func (*FederatedSettingsServiceOp) GetConnectedOrg added in v0.17.0

func (s *FederatedSettingsServiceOp) GetConnectedOrg(ctx context.Context, federationSettingsID, orgID string) (*FederatedSettingsConnectedOrganization, *Response, error)

GetConnectedOrg gets Federated Settings Connected Organization (Org-Mapping).

See more: https://www.mongodb.com/docs/atlas/reference/api/org-mapping-return-one/

func (*FederatedSettingsServiceOp) GetIdentityProvider added in v0.17.0

func (s *FederatedSettingsServiceOp) GetIdentityProvider(ctx context.Context, federationSettingsID, idpID string) (*FederatedSettingsIdentityProvider, *Response, error)

GetIdentityProvider gets Federated Settings Identity Providers for an organization.

See more: https://www.mongodb.com/docs/atlas/reference/api/identity-provider-return-one/

func (*FederatedSettingsServiceOp) GetRoleMapping added in v0.17.0

func (s *FederatedSettingsServiceOp) GetRoleMapping(ctx context.Context, federationSettingsID, orgID, roleMappingID string) (*FederatedSettingsOrganizationRoleMapping, *Response, error)

GetRoleMapping gets Federated Settings Role Mapping for an organization.

See more: https://www.mongodb.com/docs/atlas/reference/api/role-mapping-return-one/

func (*FederatedSettingsServiceOp) ListConnectedOrgs added in v0.17.0

func (s *FederatedSettingsServiceOp) ListConnectedOrgs(ctx context.Context, federationSettingsID string, opts *ListOptions) (*FederatedSettingsConnectedOrganizations, *Response, error)

ListConnectedOrgs gets all Federated Settings Connected Organization (Org-Mappings).

See more: https://www.mongodb.com/docs/atlas/reference/api/org-mappings-return-all/

func (*FederatedSettingsServiceOp) ListIdentityProviders added in v0.17.0

func (s *FederatedSettingsServiceOp) ListIdentityProviders(ctx context.Context, federationSettingsID string, opts *ListOptions) ([]FederatedSettingsIdentityProvider, *Response, error)

ListIdentityProviders gets all Federated Settings Identity Providers for an organization.

See more: https://www.mongodb.com/docs/atlas/reference/api/identity-provider-return-all/

func (*FederatedSettingsServiceOp) ListRoleMappings added in v0.17.0

func (s *FederatedSettingsServiceOp) ListRoleMappings(ctx context.Context, federationSettingsID, orgID string, opts *ListOptions) (*FederatedSettingsOrganizationRoleMappings, *Response, error)

ListRoleMappings gets all Federated Settings Role Mappings for an organization.

See more: https://www.mongodb.com/docs/atlas/reference/api/role-mapping-return-all/

func (*FederatedSettingsServiceOp) UpdateConnectedOrg added in v0.17.0

func (s *FederatedSettingsServiceOp) UpdateConnectedOrg(ctx context.Context, federationSettingsID, orgID string, updateRequest *FederatedSettingsConnectedOrganization) (*FederatedSettingsConnectedOrganization, *Response, error)

UpdateConnectedOrg updates Federated Settings Connected Organization (Org-Mapping).

See more: https://www.mongodb.com/docs/atlas/reference/api/org-mapping-update-one/

func (*FederatedSettingsServiceOp) UpdateIdentityProvider added in v0.17.0

func (s *FederatedSettingsServiceOp) UpdateIdentityProvider(ctx context.Context, federationSettingsID, idpID string, updateRequest *FederatedSettingsIdentityProvider) (*FederatedSettingsIdentityProvider, *Response, error)

UpdateIdentityProvider updates Federated Settings Identity Providers for an organization.

See more: https://www.mongodb.com/docs/atlas/reference/api/identity-provider-update-one/

func (*FederatedSettingsServiceOp) UpdateRoleMapping added in v0.17.0

func (s *FederatedSettingsServiceOp) UpdateRoleMapping(ctx context.Context, federationSettingsID, orgID, roleMappingID string, updateRequest *FederatedSettingsOrganizationRoleMapping) (*FederatedSettingsOrganizationRoleMapping, *Response, error)

UpdateRoleMapping updates Federated Settings Federated Settings Role Mapping for an organization

See more: https://www.mongodb.com/docs/atlas/reference/api/role-mapping-create-one/

type GCPEndpoint added in v0.14.0

type GCPEndpoint struct {
	IPAddress             string `json:"ipAddress,omitempty"`             // Private IP address of the endpoint you created in GCP.
	EndpointName          string `json:"endpointName,omitempty"`          // Forwarding rule that corresponds to the endpoint you created in GCP.
	Status                string `json:"status,omitempty"`                // Status of the endpoint. Atlas returns one of the values shown above.
	ServiceAttachmentName string `json:"serviceAttachmentName,omitempty"` // Unique alphanumeric and special character strings that identify the service attachment associated with the endpoint.
}

GCPEndpoint represents MongoDB GCP endpoint group.

type GZipRequestDoer

type GZipRequestDoer interface {
	Doer
	Completer
	NewGZipRequest(context.Context, string, string) (*http.Request, error)
}

GZipRequestDoer minimum interface for any service of the client that should handle gzip downloads.

type GlobalCluster

type GlobalCluster struct {
	CustomZoneMapping map[string]string  `json:"customZoneMapping"`
	ManagedNamespaces []ManagedNamespace `json:"managedNamespaces"`
}

GlobalCluster represents MongoDB Global Cluster Configuration in your Global Cluster.

type GlobalClustersService

type GlobalClustersService interface {
	Get(context.Context, string, string) (*GlobalCluster, *Response, error)
	AddManagedNamespace(context.Context, string, string, *ManagedNamespace) (*GlobalCluster, *Response, error)
	DeleteManagedNamespace(context.Context, string, string, *ManagedNamespace) (*GlobalCluster, *Response, error)
	AddCustomZoneMappings(context.Context, string, string, *CustomZoneMappingsRequest) (*GlobalCluster, *Response, error)
	DeleteCustomZoneMappings(context.Context, string, string) (*GlobalCluster, *Response, error)
}

GlobalClustersService is an interface for interfacing with the Global Clusters endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/global-clusters/

type GlobalClustersServiceOp

type GlobalClustersServiceOp service

GlobalClustersServiceOp handles communication with the GlobalClusters related methods of the MongoDB Atlas API.

func (*GlobalClustersServiceOp) AddCustomZoneMappings

func (s *GlobalClustersServiceOp) AddCustomZoneMappings(ctx context.Context, groupID, clusterName string, createRequest *CustomZoneMappingsRequest) (*GlobalCluster, *Response, error)

AddCustomZoneMappings adds an entry to the list of custom zone mappings for the specified Global Cluster.

See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-add-customzonemapping/

func (*GlobalClustersServiceOp) AddManagedNamespace

func (s *GlobalClustersServiceOp) AddManagedNamespace(ctx context.Context, groupID, clusterName string, createRequest *ManagedNamespace) (*GlobalCluster, *Response, error)

AddManagedNamespace adds a managed namespace to the specified Global Cluster.

See more: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/

func (*GlobalClustersServiceOp) DeleteCustomZoneMappings

func (s *GlobalClustersServiceOp) DeleteCustomZoneMappings(ctx context.Context, groupID, clusterName string) (*GlobalCluster, *Response, error)

DeleteCustomZoneMappings removes all custom zone mappings from the specified Global Cluster.

See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-delete-namespace/

func (*GlobalClustersServiceOp) DeleteManagedNamespace

func (s *GlobalClustersServiceOp) DeleteManagedNamespace(ctx context.Context, groupID, clusterName string, deleteRequest *ManagedNamespace) (*GlobalCluster, *Response, error)

DeleteManagedNamespace deletes the managed namespace configuration of the global cluster given.

See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-delete-namespace/

func (*GlobalClustersServiceOp) Get

func (s *GlobalClustersServiceOp) Get(ctx context.Context, groupID, clusterName string) (*GlobalCluster, *Response, error)

Get retrieves all managed namespaces and custom zone mappings associated with the specified Global Cluster.

See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-retrieve-namespaces/

type GoogleCloudKms

type GoogleCloudKms struct {
	Enabled              *bool  `json:"enabled,omitempty"`              // Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
	ServiceAccountKey    string `json:"serviceAccountKey,omitempty"`    // String-formatted JSON object containing GCP KMS credentials from your GCP account.
	KeyVersionResourceID string `json:"keyVersionResourceID,omitempty"` // 	The Key Version Resource ID from your GCP account.
}

GoogleCloudKms specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.

type Hash

type Hash struct {
	TypeName string `json:"typeName"`
	FileName string `json:"fileName"`
	Hash     string `json:"hash"`
}

type IPInfo added in v0.8.0

type IPInfo struct {
	CurrentIPv4Address string `json:"currentIpv4Address"`
}

type IPInfoService added in v0.8.0

type IPInfoService interface {
	Get(context.Context) (*IPInfo, *Response, error)
}

IPInfoService is used to determine the public ip address of the client

We currently make no promise to support or document this service or endpoint beyond what can be seen here.

type IPInfoServiceOp added in v0.8.0

type IPInfoServiceOp service

IPInfoServiceOp is an implementation of IPInfoService.

func (*IPInfoServiceOp) Get added in v0.8.0

func (s *IPInfoServiceOp) Get(ctx context.Context) (*IPInfo, *Response, error)

Get gets the public ip address of the client.

type IndexConfiguration

type IndexConfiguration struct {
	DB         string              `json:"db"`                  // DB the database of the index
	Collection string              `json:"collection"`          // Collection the collection of the index
	Keys       []map[string]string `json:"keys"`                // Keys array of keys to index and their type, sorting of keys is important for an index
	Options    *IndexOptions       `json:"options,omitempty"`   // Options MongoDB index options
	Collation  *CollationOptions   `json:"collation,omitempty"` // Collation Mongo collation index options
}

IndexConfiguration represents a new index requests for a given database and collection.

type IndexMapping

type IndexMapping struct {
	Dynamic bool                    `json:"dynamic"`
	Fields  *map[string]interface{} `json:"fields,omitempty"`
}

IndexMapping containing index specifications for the collection fields.

type IndexOptions

type IndexOptions struct {
	Background              bool                    `json:"background,omitempty"`
	PartialFilterExpression *map[string]interface{} `json:"partialFilterExpression,omitempty"`
	StorageEngine           *map[string]interface{} `json:"storageEngine,omitempty"`
	Weights                 *map[string]int         `json:"weights,omitempty"`
	DefaultLanguage         string                  `json:"default_language,omitempty"`
	LanguageOverride        string                  `json:"language_override,omitempty"`
	TextIndexVersion        int                     `json:"textIndexVersion,omitempty"`
	TwodsphereIndexVersion  int                     `json:"2dsphereIndexVersion,omitempty"`
	Bits                    int                     `json:"bits,omitempty"`
	Unique                  bool                    `json:"unique,omitempty"`
	Sparse                  bool                    `json:"sparse,omitempty"`
	GeoMin                  int                     `json:"min,omitempty"`
	GeoMax                  int                     `json:"max,omitempty"`
	BucketSize              int                     `json:"bucketSize,omitempty"`
	Name                    string                  `json:"name,omitempty"`
	ExpireAfterSeconds      int                     `json:"expireAfterSeconds,omitempty"`
}

IndexOptions represents mongodb index options.

See: https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#options

type IndexesService

type IndexesService interface {
	Create(context.Context, string, string, *IndexConfiguration) (*Response, error)
}

IndexesService is an interface for interfacing with the clusters indexes endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/indexes/

type IndexesServiceOp

type IndexesServiceOp service

IndexesServiceOp handles communication with the Cluster related methods of the MongoDB Atlas API.

func (*IndexesServiceOp) Create

func (s *IndexesServiceOp) Create(ctx context.Context, groupID, clusterName string, createReq *IndexConfiguration) (*Response, error)

Create creates a request for a rolling index creation for the project associated to {GROUP-ID} and the {CLUSTER-NAME}.

See more: https://docs.atlas.mongodb.com/reference/api/rolling-index-create-one/

type InheritedRole

type InheritedRole struct {
	Db   string `json:"db,omitempty"` //nolint:stylecheck // not changing this as is a breaking change
	Role string `json:"role,omitempty"`
}

An InheritedRole describes the role that this Role inherits from.

type InstanceSize added in v0.8.0

type InstanceSize struct {
	Name             string             `json:"name,omitempty"`
	AvailableRegions []*AvailableRegion `json:"availableRegions,omitempty"`
}

InstanceSize represents an instance size of the MongoDB Atlas API.

type IntegrationsService added in v0.5.0

IntegrationsService is an interface for interfacing with the Third-Party Integrations endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/third-party-integration-settings/

type IntegrationsServiceOp added in v0.5.0

type IntegrationsServiceOp service

IntegrationsServiceOp handles communication with the third-party integrations related methods of the MongoDB Atlas API.

func (*IntegrationsServiceOp) Create added in v0.5.0

func (s *IntegrationsServiceOp) Create(ctx context.Context, projectID, integrationType string, body *ThirdPartyIntegration) (*ThirdPartyIntegrations, *Response, error)

Create adds a new third-party integration configuration.

See more: https://docs.atlas.mongodb.com/reference/api/third-party-integration-settings-create/index.html

func (*IntegrationsServiceOp) Delete added in v0.5.0

func (s *IntegrationsServiceOp) Delete(ctx context.Context, projectID, integrationType string) (*Response, error)

Delete removes the third-party integration configuration

https://docs.atlas.mongodb.com/reference/api/third-party-integration-settings-delete/

func (*IntegrationsServiceOp) Get added in v0.5.0

func (s *IntegrationsServiceOp) Get(ctx context.Context, projectID, integrationType string) (*ThirdPartyIntegration, *Response, error)

Get retrieves a specific third-party integration configuration

https://docs.atlas.mongodb.com/reference/api/third-party-integration-settings-get-one/

func (*IntegrationsServiceOp) List added in v0.5.0

List retrieves all third-party integration configurations.

See more: https://docs.atlas.mongodb.com/reference/api/third-party-integration-settings-get-all/

func (*IntegrationsServiceOp) Replace added in v0.5.0

func (s *IntegrationsServiceOp) Replace(ctx context.Context, projectID, integrationType string, body *ThirdPartyIntegration) (*ThirdPartyIntegrations, *Response, error)

Replace replaces the third-party integration configuration with a new configuration, or add a new configuration if there is no configuration.