mongodbatlas

package
Version: v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 15 Imported by: 23

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 the version of the current API client. Should be set to the next version planned to be released.
	Version = "0.16.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"
)

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 CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.

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 AWSIAMRole added in v0.6.0

type AWSIAMRole 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 ID of this role.
}

AWSIAMRole is the response from the CloudProviderAccessService.ListRoles.

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 {
	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"`
}

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) (*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) (*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) 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 {
	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 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 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 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
	ProjectAPIKeys                      ProjectAPIKeysService
	CloudProviderSnapshotRestoreJobs    CloudProviderSnapshotRestoreJobsService
	Peers                               PeersService
	Containers                          ContainersService
	EncryptionsAtRest                   EncryptionsAtRestService
	WhitelistAPIKeys                    WhitelistAPIKeysService
	AccessListAPIKeys                   AccessListAPIKeysService
	PrivateIPMode                       PrivateIPModeService
	MaintenanceWindows                  MaintenanceWindowsService
	Teams                               TeamsService
	AtlasUsers                          AtlasUsersService
	GlobalClusters                      GlobalClustersService
	Auditing                            AuditingsService
	AlertConfigurations                 AlertConfigurationsService
	PrivateEndpoints                    PrivateEndpointsService
	PrivateEndpointsDeprecated          PrivateEndpointsServiceDeprecated
	X509AuthDBUsers                     X509AuthDBUsersService
	ContinuousSnapshots                 ContinuousSnapshotsService
	ContinuousRestoreJobs               ContinuousRestoreJobsService
	Checkpoints                         CheckpointsService
	Alerts                              AlertsService
	CloudProviderSnapshotBackupPolicies CloudProviderSnapshotBackupPoliciesService
	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
	// 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.

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.

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 CloudProviderAccessRoleRequest added in v0.6.0

type CloudProviderAccessRoleRequest struct {
	ProviderName string `json:"providerName"`
}

CloudProviderAccessRoleRequest represent a new role creation.

type CloudProviderAccessRoles added in v0.6.0

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

CloudProviderAccessRoles an array of awsIamRoles objects.

type CloudProviderAccessService added in v0.6.0

CloudProviderAccessService provides access to the cloud provider access functions in the Atlas API.

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

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

func (s *CloudProviderAccessServiceOp) AuthorizeRole(ctx context.Context, groupID, roleID string, request *CloudProviderAuthorizationRequest) (*AWSIAMRole, *Response, error)

AuthorizeRole authorizes and configure an AWS Assumed IAM role.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-access-authorize-one-role/

func (*CloudProviderAccessServiceOp) CreateRole added in v0.6.0

CreateRole creates an AWS IAM role.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-access-create-one-role/

func (*CloudProviderAccessServiceOp) DeauthorizeRole added in v0.6.0

DeauthorizeRole deauthorizes an AWS Assumed IAM role.

See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-access-deauthorize-one-role/

func (*CloudProviderAccessServiceOp) ListRoles added in v0.6.0

ListRoles retrieve existing AWS IAM roles.

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

type CloudProviderAuthorizationRequest added in v0.6.0

type CloudProviderAuthorizationRequest struct {
	ProviderName      string `json:"providerName"`
	IAMAssumedRoleARN string `json:"iamAssumedRoleArn"`
}

CloudProviderAuthorizationRequest represents an authorization request.

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
}

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 bucket 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 {
	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"`
	ConnectionStrings        *ConnectionStrings       `json:"connectionStrings,omitempty"`
	Links                    []*Link                  `json:"links,omitempty"`
	VersionReleaseSystem     string                   `json:"versionReleaseSystem,omitempty"`
}

Cluster represents MongoDB cluster.

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) (*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)
}

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) (*Response, error)

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

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

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://docs.atlas.mongodb.com/reference/api/clusters-get-advanced-configuration-options/#get-advanced-configuration-options-for-one-cluster

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://docs.atlas.mongodb.com/reference/api/clusters-modify-advanced-configuration-options/

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 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 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 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"`
}

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 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 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.

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

type InterfaceEndpointConnection

type InterfaceEndpointConnection struct {
	ID                            string         `json:"id,omitempty"`                            // Unique identifier of the private endpoint you created in your AWS VPC or Azure VNet.
	InterfaceEndpointID           string         `json:"interfaceEndpointId,omitempty"`           // Unique identifier of the interface endpoint.
	PrivateEndpointConnectionName string         `json:"privateEndpointConnectionName,omitempty"` // Name of the connection for this private endpoint that Atlas generates.
	PrivateEndpointIPAddress      string         `json:"privateEndpointIPAddress,omitempty"`      // Private IP address of the private endpoint network interface.
	PrivateEndpointResourceID     string         `json:"privateEndpointResourceId,omitempty"`     // Unique identifier of the private endpoint.
	DeleteRequested               *bool          `json:"deleteRequested,omitempty"`               // Indicates if Atlas received a request to remove the interface endpoint from the private endpoint connection.
	ErrorMessage                  string         `json:"errorMessage,omitempty"`                  // Error message pertaining to the interface endpoint. Returns null if there are no errors.
	AWSConnectionStatus           string         `json:"connectionStatus,omitempty"`              // Status of the interface endpoint: NONE, PENDING_ACCEPTANCE, PENDING, AVAILABLE, REJECTED, DELETING.
	Status                        string         `json:"status,omitempty"`                        // Status of the interface endpoint AZURE: INITIATING, AVAILABLE, FAILED, DELETING. GCP: INITIATING, AVAILABLE, FAILED, DELETING, VERIFIED
	EndpointGroupName             string         `json:"endpointGroupName,omitempty"`             // Unique identifier of the endpoint group. The endpoint group encompasses all of the endpoints that you created in GCP.
	GCPProjectID                  string         `json:"gcpProjectId,omitempty"`                  // Unique identifier of the GCP project in which you created your endpoints.
	Endpoints                     []*GCPEndpoint `json:"endpoints,omitempty"`                     // Collection of individual private endpoints that comprise your endpoint group.
}

InterfaceEndpointConnection represents MongoDB Interface Endpoint Connection.

type InterfaceEndpointConnectionDeprecated added in v0.6.0

type InterfaceEndpointConnectionDeprecated struct {
	ID               string `json:"interfaceEndpointId,omitempty"` // Unique identifier of the interface endpoint.
	DeleteRequested  *bool  `json:"deleteRequested,omitempty"`     // Indicates if Atlas received a request to remove the interface endpoint from the private endpoint connection.
	ErrorMessage     string `json:"errorMessage,omitempty"`        // Error message pertaining to the interface endpoint. Returns null if there are no errors.
	ConnectionStatus string `json:"connectionStatus,omitempty"`    // Status of the interface endpoint: NONE, PENDING_ACCEPTANCE, PENDING, AVAILABLE, REJECTED, DELETING.
}

InterfaceEndpointConnectionDeprecated represents MongoDB Interface Endpoint Connection.

type Invitation added in v0.9.0

type Invitation struct {
	ID              string   `json:"id,omitempty"`
	OrgID           string   `json:"orgId,omitempty"`
	OrgName         string   `json:"orgName,omitempty"`
	GroupID         string   `json:"groupId,omitempty"`
	GroupName       string   `json:"groupName,omitempty"`
	CreatedAt       string   `json:"createdAt,omitempty"`
	ExpiresAt       string   `json:"expiresAt,omitempty"`
	InviterUsername string   `json:"inviterUsername,omitempty"`
	Username        string   `json:"username,omitempty"`
	Roles           []string `json:"roles,omitempty"`
	TeamIDs         []string `json:"teamIds,omitempty"`
}

Invitation represents the structure of an Invitation.

type InvitationOptions added in v0.9.0

type InvitationOptions struct {
	Username string `url:"username,omitempty"`
}

InvitationOptions filtering options for invitations.

type LDAP added in v0.5.0

type LDAP struct {
	AuthenticationEnabled bool               `json:"authenticationEnabled,omitempty"` // Specifies whether user authentication with LDAP is enabled.
	AuthorizationEnabled  bool               `json:"authorizationEnabled,omitempty"`  // The current status of the LDAP over TLS/SSL configuration.
	Hostname              string             `json:"hostname,omitempty"`              // The hostname or IP address of the LDAP server
	Port                  int                `json:"port,omitempty"`                  // The port to which the LDAP server listens for client connections.
	BindUsername          string             `json:"bindUsername,omitempty"`          // The user DN that Atlas uses to connect to the LDAP server.
	UserToDNMapping       []*UserToDNMapping `json:"userToDNMapping,omitempty"`       // Maps an LDAP username for authentication to an LDAP Distinguished Name (DN).
	BindPassword          string             `json:"bindPassword,omitempty"`          // The password used to authenticate the bindUsername.
	CaCertificate         string             `json:"caCertificate,omitempty"`         // CA certificate used to verify the identify of the LDAP server.
	AuthzQueryTemplate    string             `json:"authzQueryTemplate,omitempty"`    // An LDAP query template that Atlas executes to obtain the LDAP groups to which the authenticated user belongs.
}

LDAP specifies an LDAP configuration for a Atlas project.

type LDAPConfiguration added in v0.5.0

type LDAPConfiguration struct {
	RequestID   string            `json:"requestId,omitempty"`   // Identifier for the Atlas project associated with the request to verify an LDAP over TLS/SSL configuration.
	GroupID     string            `json:"groupId,omitempty"`     // Unique identifier of the project that owns this alert configuration.
	Request     *LDAPRequest      `json:"request,omitempty"`     // Contains the details of the request to verify an LDAP over TLS/SSL configuration.
	Status      string            `json:"status,omitempty"`      // The current status of the LDAP over TLS/SSL configuration.
	Validations []*LDAPValidation `json:"validations,omitempty"` // Array of validation messages related to the verification of the provided LDAP over TLS/SSL configuration details.
	Links       []*Link           `json:"links,omitempty"`
	LDAP        *LDAP             `json:"ldap,omitempty"` // Specifies the LDAP over TLS/SSL configuration details for an Atlas group.
}

LDAPConfiguration represents MongoDB LDAP Configuration.

type LDAPConfigurationsService added in v0.5.0

LDAPConfigurationsService is an interface of the LDAP Configuration endpoints of the MongoDB Atlas API.

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

type LDAPConfigurationsServiceOp added in v0.5.0

type LDAPConfigurationsServiceOp service

LDAPConfigurationsServiceOp handles communication with the LDAP Configuration related methods of the MongoDB Atlas API.

func (*LDAPConfigurationsServiceOp) Delete added in v0.5.0

Delete removes the current userToDNMapping from the LDAP configuration for an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/ldaps-configuration-remove-usertodnmapping/

func (*LDAPConfigurationsServiceOp) Get added in v0.5.0

Get retrieves the current LDAP configuration for an Atlas project.

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

func (*LDAPConfigurationsServiceOp) GetStatus added in v0.5.0

func (s *LDAPConfigurationsServiceOp) GetStatus(ctx context.Context, groupID, requestID string) (*LDAPConfiguration, *Response, error)

GetStatus retrieves the status of a request for verification of an LDAP configuration.

See more: https://docs.atlas.mongodb.com/reference/api/ldaps-configuration-verification-status/

func (*LDAPConfigurationsServiceOp) Save added in v0.5.0

Save saves an LDAP configuration for a Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/ldaps-configuration-save/

func (*LDAPConfigurationsServiceOp) Verify added in v0.5.0

func (s *LDAPConfigurationsServiceOp) Verify(ctx context.Context, groupID string, configuration *LDAP) (*LDAPConfiguration, *Response, error)

Verify requests verification of an LDAP configuration. Use this endpoint to test your LDAP configuration details before saving them.

See more: https://docs.atlas.mongodb.com/reference/api/ldaps-configuration-request-verification/

type LDAPRequest added in v0.5.0

type LDAPRequest struct {
	Hostname     string `json:"hostname,omitempty"`     // The hostname or IP address of the LDAP server.
	Port         int    `json:"port,omitempty"`         // The port to which the LDAP server listens for client connections from Atlas.
	BindUsername string `json:"bindUsername,omitempty"` // The user DN that Atlas uses to connect to the LDAP server.
}

LDAPRequest contains the details of the request to verify an LDAP over TLS/SSL configuration.

type LDAPValidation added in v0.5.0

type LDAPValidation struct {
	Status         string `json:"status,omitempty"`         // The status of the validation.
	ValidationType string `json:"validationType,omitempty"` // The type of the validation.
}

LDAPValidation contains an array of validation messages related to the verification of the provided LDAP over TLS/SSL configuration details.

type Label

type Label struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

Label containing key-value pairs that tag and categorize the database user.

type Link struct {
	Rel  string `json:"rel,omitempty"`
	Href string `json:"href,omitempty"`
}

Link is the link to sub-resources and/or related resources.

type LinkToken added in v0.12.0

type LinkToken struct {
	LinkToken string `json:"linkToken,omitempty"` // Atlas-generated token that links the source (Cloud Manager or Ops Manager) and destination (Atlas) clusters for migration.
}

type ListOptions

type ListOptions struct {
	// For paginated result sets, page of results to retrieve.
	PageNum int `url:"pageNum,omitempty"`

	// For paginated result sets, the number of results to include per page.
	ItemsPerPage int `url:"itemsPerPage,omitempty"`

	// Flag that indicates whether Atlas returns the totalCount parameter in the response body.
	IncludeCount bool `url:"includeCount,omitempty"`
}

ListOptions specifies the optional parameters to List methods that support pagination.

type LiveMigration added in v0.12.0

type LiveMigration struct {
	Source          *Source      `json:"source,omitempty"`          // Source describes the Cloud Manager or Ops Manager source of the migrating cluster.
	Destination     *Destination `json:"destination,omitempty"`     // Destination describes the Atlas destination of the migrating Cloud Manager or Ops Manager cluster.
	MigrationHosts  []string     `json:"migrationHosts,omitempty"`  // MigrationHosts is a list of hosts running the MongoDB Agent that can transfer your MongoDB data from the source (Cloud Manager or Ops Manager) to destination (Atlas) deployments.
	DropEnabled     *bool        `json:"dropEnabled,omitempty"`     // DropEnabled indicates whether this process should drop existing collections from the destination (Atlas) cluster given in destination.clusterName before starting the migration of data from the source cluster.
	ID              string       `json:"_id,omitempty"`             // ID Unique 24-hexadecimal digit string that identifies the migration.
	Status          string       `json:"status,omitempty"`          // Status of the migration when you submitted this request.
	ReadyForCutover *bool        `json:"readyForCutover,omitempty"` // ReadyForCutover indicates whether the live migration process is ready to start the cutover process.
}

LiveMigration represents a live migration.

type LiveMigrationService added in v0.12.0

LiveMigrationService is an interface for interfacing with the Live Migration endpoints of the MongoDB Atlas API.

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

type LiveMigrationServiceOp added in v0.12.0

type LiveMigrationServiceOp service

LiveMigrationServiceOp provides an implementation of AlertsService.

func (*LiveMigrationServiceOp) Create added in v0.12.0

Create creates one new live migration.

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

func (*LiveMigrationServiceOp) CreateLinkToken added in v0.12.0

func (s *LiveMigrationServiceOp) CreateLinkToken(ctx context.Context, orgID string, body *TokenCreateRequest) (*LinkToken, *Response, error)

CreateLinkToken create one new link-token.

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

func (*LiveMigrationServiceOp) CreateValidation added in v0.12.0

func (s *LiveMigrationServiceOp) CreateValidation(ctx context.Context, groupID string, body *LiveMigration) (*Validation, *Response, error)

CreateValidation creates one new validation request.

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

func (*LiveMigrationServiceOp) DeleteLinkToken added in v0.12.0

func (s *LiveMigrationServiceOp) DeleteLinkToken(ctx context.Context, orgID string) (*Response, error)

DeleteLinkToken deletes one link-token.

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

func (*LiveMigrationServiceOp) Get added in v0.12.0

func (s *LiveMigrationServiceOp) Get(ctx context.Context, groupID, id string) (*LiveMigration, *Response, error)

Get returns one migration job.

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

func (*LiveMigrationServiceOp) GetValidationStatus added in v0.12.0

func (s *LiveMigrationServiceOp) GetValidationStatus(ctx context.Context, groupID, id string) (*Validation, *Response, error)

GetValidationStatus returns one validation job.

See more: https://docs.atlas.mongodb.com/reference/api/live-migration/return-one-specific-validation-job/

func (*LiveMigrationServiceOp) Start added in v0.12.0

func (s *LiveMigrationServiceOp) Start(ctx context.Context, groupID, id string) (*Validation, *Response, error)

Start starts the migration of one deployment.

See more: https://docs.atlas.mongodb.com/reference/api/live-migration/start-the-migration-cutover/

type LogsService

type LogsService interface {
	Get(context.Context, string, string, string, io.Writer, *DateRangetOptions) (*Response, error)
}

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

type LogsServiceOp

type LogsServiceOp struct {
	Client GZipRequestDoer
}

LogsServiceOp handles communication with the Logs related methods of the MongoDB Atlas API.

func (*LogsServiceOp) Get

func (s *LogsServiceOp) Get(ctx context.Context, groupID, hostName, logName string, out io.Writer, opts *DateRangetOptions) (*Response, error)

Get gets a compressed (.gz) log file that contains a range of log messages for a particular host. Note: The input parameter out (io.Writer) is not closed by this function.

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

type MaintenanceWindow

type MaintenanceWindow struct {
	DayOfWeek            int   `json:"dayOfWeek,omitempty"`            // Day of the week when you would like the maintenance window to start as a 1-based integer.Sunday 	1, Monday 	2, Tuesday 	3, Wednesday 	4, Thursday 5, Friday 6, Saturday 7
	HourOfDay            *int  `json:"hourOfDay,omitempty"`            // Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12.
	StartASAP            *bool `json:"startASAP,omitempty"`            // Flag indicating whether project maintenance has been directed to start immediately.
	NumberOfDeferrals    int   `json:"numberOfDeferrals,omitempty"`    // Number of times the current maintenance event for this project has been deferred.
	AutoDeferOnceEnabled *bool `json:"autoDeferOnceEnabled,omitempty"` // Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.
}

MaintenanceWindow represents MongoDB Maintenance Windows.

type MaintenanceWindowsService

type MaintenanceWindowsService interface {
	Get(context.Context, string) (*MaintenanceWindow, *Response, error)
	Update(context.Context, string, *MaintenanceWindow) (*Response, error)
	Defer(context.Context, string) (*Response, error)
	AutoDefer(context.Context, string) (*Response, error)
	Reset(context.Context, string) (*Response, error)
}

MaintenanceWindowsService is an interface for interfacing with the Maintenance Windows endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/maintenance-windows/

type MaintenanceWindowsServiceOp

type MaintenanceWindowsServiceOp service

MaintenanceWindowsServiceOp handles communication with the MaintenanceWindows related methods of the MongoDB Atlas API.

func (*MaintenanceWindowsServiceOp) AutoDefer added in v0.11.0

func (s *MaintenanceWindowsServiceOp) AutoDefer(ctx context.Context, groupID string) (*Response, error)

AutoDefer any scheduled maintenance for the given project for one week.

See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-auto-defer/

func (*MaintenanceWindowsServiceOp) Defer

func (s *MaintenanceWindowsServiceOp) Defer(ctx context.Context, groupID string) (*Response, error)

Defer maintenance for the given project for one week.

See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-defer/

func (*MaintenanceWindowsServiceOp) Get

Get gets the current user-defined maintenance window for the given project.

See more: https://docs.atlas.mongodb.com/reference/api/maintenance-windows-view-in-one-project/

func (*MaintenanceWindowsServiceOp) Reset

func (s *MaintenanceWindowsServiceOp) Reset(ctx context.Context, groupID string) (*Response, error)

Reset clears the current maintenance window for the given project.

See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-clear/

func (*MaintenanceWindowsServiceOp) Update

func (s *MaintenanceWindowsServiceOp) Update(ctx context.Context, groupID string, updateRequest *MaintenanceWindow) (*Response, error)

Update the current maintenance window for the given project.

See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-update/

type ManagedNamespace

type ManagedNamespace struct {
	Db                     string `json:"db"` //nolint:stylecheck // not changing this as is a breaking change
	Collection             string `json:"collection"`
	CustomShardKey         string `json:"customShardKey,omitempty"`
	IsCustomShardKeyHashed *bool  `json:"isCustomShardKeyHashed,omitempty"` // Flag that specifies whether the custom shard key for the collection is hashed.
	IsShardKeyUnique       *bool  `json:"isShardKeyUnique,omitempty"`       // Flag that specifies whether the underlying index enforces a unique constraint.
}

ManagedNamespace represents the information about managed namespace configuration.

type Matcher

type Matcher struct {
	FieldName string `json:"fieldName,omitempty"` // Name of the field in the target object to match on.
	Operator  string `json:"operator,omitempty"`  // The operator to test the field’s value.
	Value     string `json:"value,omitempty"`     // Value to test with the specified operator.
}

Matcher represents the Rules to apply when matching an object against this alert configuration. Only entities that match all these rules are checked for an alert condition.

type Measurements

type Measurements struct {
	DataPoints []*DataPoints `json:"dataPoints,omitempty"`
	Name       string        `json:"name"`
	Units      string        `json:"units"`
}

Measurements represents a MongoDB Measurement.

type Member added in v0.14.0

type Member struct {
	ID             string `json:"id,omitempty"`             // Cloud provider that stores this snapshot.
	CloudProvider  string `json:"cloudProvider,omitempty"`  // Unique identifier for the sharded cluster snapshot.
	ReplicaSetName string `json:"replicaSetName,omitempty"` // Label given to a shard or config server from which Atlas took this snapshot.
}

Member represents all member of cloud provider snapshot.

type MetricThreshold

type MetricThreshold struct {
	MetricName string  `json:"metricName,omitempty"` // Name of the metric to check.
	Operator   string  `json:"operator,omitempty"`   // Operator to apply when checking the current metric value against the threshold value.
	Threshold  float64 `json:"threshold"`            // Threshold value outside of which an alert will be triggered.
	Units      string  `json:"units,omitempty"`      // The units for the threshold value.
	Mode       string  `json:"mode,omitempty"`       // This must be set to AVERAGE. Atlas computes the current metric value as an average.
}

MetricThreshold causes an alert to be triggered. Required if "eventTypeName" : "OUTSIDE_METRIC_THRESHOLD".

type MissingShard

type MissingShard struct {
	ID             string `json:"id"`
	GroupID        string `json:"groupId"`
	TypeName       string `json:"typeName"`
	ClusterName    string `json:"clusterName,omitempty"`
	ShardName      string `json:"shardName,omitempty"`
	ReplicaSetName string `json:"replicaSetName"`
	LastHeartbeat  string `json:"lastHeartbeat"`
}

type Namespace added in v0.5.0

type Namespace struct {
	Namespace string `json:"namespace,omitempty"` // A namespace on the specified host.
	Type      string `json:"type,omitempty"`      // The type of namespace.
}

Namespace represents a Namespace.

type NamespaceFilter

type NamespaceFilter struct {
	FilterList []string `json:"filterList"`
	FilterType string   `json:"filterType"`
}

type NamespaceOptions added in v0.5.0

type NamespaceOptions struct {
	Since    int64 `url:"since,omitempty"`    // Point in time, specified as milliseconds since the Unix Epoch, from which you want to receive results.
	Duration int64 `url:"duration,omitempty"` // 	Length of time from the since parameter, in milliseconds, for which you want to receive results.
}

NamespaceOptions contains the request query parameters for the API request.

type Namespaces added in v0.5.0

type Namespaces struct {
	Namespaces []*Namespace `json:"namespaces,omitempty"`
}

Namespaces represents a list of Namespace.

type Notification

type Notification struct {
	APIToken            string   `json:"apiToken,omitempty"`            // Slack API token or Bot token. Populated for the SLACK notifications type. If the token later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
	ChannelName         string   `json:"channelName,omitempty"`         // Slack channel name. Populated for the SLACK notifications type.
	DatadogAPIKey       string   `json:"datadogApiKey,omitempty"`       // Datadog API Key. Found in the Datadog dashboard. Populated for the DATADOG notifications type.
	DatadogRegion       string   `json:"datadogRegion,omitempty"`       // Region that indicates which API URL to use
	DelayMin            *int     `json:"delayMin,omitempty"`            // Number of minutes to wait after an alert condition is detected before sending out the first notification.
	EmailAddress        string   `json:"emailAddress,omitempty"`        // Email address to which alert notifications are sent. Populated for the EMAIL notifications type.
	EmailEnabled        *bool    `json:"emailEnabled,omitempty"`        // Flag indicating if email notifications should be sent. Populated for ORG, GROUP, and USER notifications types.
	FlowdockAPIToken    string   `json:"flowdockApiToken,omitempty"`    // The Flowdock personal API token. Populated for the FLOWDOCK notifications type. If the token later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
	FlowName            string   `json:"flowName,omitempty"`            // Flowdock flow namse in lower-case letters.
	IntervalMin         int      `json:"intervalMin,omitempty"`         // Number of minutes to wait between successive notifications for unacknowledged alerts that are not resolved.
	MobileNumber        string   `json:"mobileNumber,omitempty"`        // Mobile number to which alert notifications are sent. Populated for the SMS notifications type.
	OpsGenieAPIKey      string   `json:"opsGenieApiKey,omitempty"`      // Opsgenie API Key. Populated for the OPS_GENIE notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
	OpsGenieRegion      string   `json:"opsGenieRegion,omitempty"`      // Region that indicates which API URL to use.
	OrgName             string   `json:"orgName,omitempty"`             // Flowdock organization name in lower-case letters. This is the name that appears after www.flowdock.com/app/ in the URL string. Populated for the FLOWDOCK notifications type.
	ServiceKey          string   `json:"serviceKey,omitempty"`          // PagerDuty service key. Populated for the PAGER_DUTY notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
	SMSEnabled          *bool    `json:"smsEnabled,omitempty"`          // Flag indicating if text message notifications should be sent. Populated for ORG, GROUP, and USER notifications types.
	TeamID              string   `json:"teamId,omitempty"`              // Unique identifier of a team.
	TeamName            string   `json:"teamName,omitempty"`            // Label for the team that receives this notification.
	TypeName            string   `json:"typeName,omitempty"`            // Type of alert notification.
	Username            string   `json:"username,omitempty"`            // Name of the Atlas user to which to send notifications. Only a user in the project that owns the alert configuration is allowed here. Populated for the USER notifications type.
	VictorOpsAPIKey     string   `json:"victorOpsApiKey,omitempty"`     // VictorOps API key. Populated for the VICTOR_OPS notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
	VictorOpsRoutingKey string   `json:"victorOpsRoutingKey,omitempty"` // VictorOps routing key. Populated for the VICTOR_OPS notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
	Roles               []string `json:"roles,omitempty"`               // The following roles grant privileges within a project.

}

Notification sends when an alert condition is detected.

type OnlineArchive

type OnlineArchive struct {
	ID              string                 `json:"_id,omitempty"`
	ClusterName     string                 `json:"clusterName,omitempty"`
	CollName        string                 `json:"collName,omitempty"`
	Criteria        *OnlineArchiveCriteria `json:"criteria,omitempty"`
	DBName          string                 `json:"dbName,omitempty"`
	GroupID         string                 `json:"groupId,omitempty"`
	PartitionFields []*PartitionFields     `json:"partitionFields,omitempty"`
	Paused          *bool                  `json:"paused,omitempty"`
	State           string                 `json:"state,omitempty"`
}

OnlineArchive represents the structure of an online archive.

type OnlineArchiveCriteria

type OnlineArchiveCriteria struct {
	DateField       string   `json:"dateField,omitempty"` // DateField is mandatory when Type is DATE
	DateFormat      string   `json:"dateFormat,omitempty"`
	ExpireAfterDays *float64 `json:"expireAfterDays,omitempty"`
	Query           string   `json:"query,omitempty"` // Query is mandatory when Type is CUSTOM
	Type            string   `json:"type,omitempty"`
}

OnlineArchiveCriteria criteria to use for archiving data.

type OnlineArchiveServiceOp

type OnlineArchiveServiceOp service

OnlineArchiveServiceOp provides an implementation of the OnlineArchiveService interface.

func (*OnlineArchiveServiceOp) Create

func (s *OnlineArchiveServiceOp) Create(ctx context.Context, projectID, clusterName string, r *OnlineArchive) (*OnlineArchive, *Response, error)

Create creates a new online archive.

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

func (*OnlineArchiveServiceOp) CreatePrivateLinkEndpoint added in v0.15.0

CreatePrivateLinkEndpoint creates one private link endpoint in Online Archive project.

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

func (*OnlineArchiveServiceOp) Delete

func (s *OnlineArchiveServiceOp) Delete(ctx context.Context, projectID, clusterName, archiveID string) (*Response, error)

Delete deletes an online archive.

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

func (*OnlineArchiveServiceOp) DeletePrivateLinkEndpoint added in v0.15.0

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

DeletePrivateLinkEndpoint deletes the Online Archive private link endpoint with a given endpoint id.

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

func (*OnlineArchiveServiceOp) Get

func (s *OnlineArchiveServiceOp) Get(ctx context.Context, projectID, clusterName, archiveID string) (*OnlineArchive, *Response, error)

Get gets a single online archive.

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

func (*OnlineArchiveServiceOp) GetPrivateLinkEndpoint added in v0.15.0

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

GetPrivateLinkEndpoint gets the Online Archive private link endpoint associated with a specific group and endpointID.

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

func (*OnlineArchiveServiceOp) List

func (s *OnlineArchiveServiceOp) List(ctx context.Context, projectID, clusterName string, listOptions *ListOptions) (*OnlineArchives, *Response, error)

List gets all online archives.

See more: https://docs.atlas.mongodb.com/reference/api/online-archive-get-all-for-cluster/#api-online-archive-get-all-for-clstr

func (*OnlineArchiveServiceOp) ListPrivateLinkEndpoint added in v0.15.0

ListPrivateLinkEndpoint gets all private link endpoints for Online Archive 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 (*OnlineArchiveServiceOp) Update

func (s *OnlineArchiveServiceOp) Update(ctx context.Context, projectID, clusterName, archiveID string, r *OnlineArchive) (*OnlineArchive, *Response, error)

Update let's you pause or resume archiving for an online archive or modify the archiving criteria.

See more: https://docs.atlas.mongodb.com/reference/api/online-archive-update-one/

type OnlineArchives added in v0.6.0

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

OnlineArchives is a collection of OnlineArchive.

type Operation added in v0.5.0

type Operation struct {
	Raw        string                   `json:"raw,omitempty"`        // Raw log line produced by the query.
	Stats      Stats                    `json:"stats,omitempty"`      // Query statistics.
	Predicates []map[string]interface{} `json:"predicates,omitempty"` // Documents containing the search criteria used by the query.
}

Operation represents a document with specific information and log lines for individual queries.

type Organization

type Organization struct {
	ID        string  `json:"id,omitempty"`
	IsDeleted *bool   `json:"isDeleted,omitempty"`
	Links     []*Link `json:"links,omitempty"`
	Name      string  `json:"name,omitempty"`
}

Organization represents the structure of an organization.

type Organizations

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

Organizations represents an array of organization.

type OrganizationsListOptions added in v0.6.0

type OrganizationsListOptions struct {
	Name               string `url:"name,omitempty"`
	IncludeDeletedOrgs *bool  `url:"includeDeletedOrgs,omitempty"`
	ListOptions
}

OrganizationsListOptions filtering options for organizations.

type OrganizationsService

OrganizationsService provides access to the organization related functions in the Atlas API.

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

type OrganizationsServiceOp

type OrganizationsServiceOp service

OrganizationsServiceOp provides an implementation of the OrganizationsService interface.

func (*OrganizationsServiceOp) Delete

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

Delete deletes an organization.

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

func (*OrganizationsServiceOp) DeleteInvitation added in v0.9.0

func (s *OrganizationsServiceOp) DeleteInvitation(ctx context.Context, orgID, invitationID string) (*Response, error)

DeleteInvitation deletes one unaccepted invitation to the specified Atlas organization. You can't delete an invitation that a user has accepted.

See more: https://docs.atlas.mongodb.com/reference/api/organization-delete-invitation/

func (*OrganizationsServiceOp) Get

Get gets a single organization.

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

func (*OrganizationsServiceOp) Invitation added in v0.9.0

func (s *OrganizationsServiceOp) Invitation(ctx context.Context, orgID, invitationID string) (*Invitation, *Response, error)

Invitation gets details for one unaccepted invitation to the specified Atlas organization.

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

func (*OrganizationsServiceOp) Invitations added in v0.9.0

func (s *OrganizationsServiceOp) Invitations(ctx context.Context, orgID string, opts *InvitationOptions) ([]*Invitation, *Response, error)

Invitations gets all unaccepted invitations to the specified Atlas organization.

See more: https://docs.atlas.mongodb.com/reference/api/organization-get-invitations/

func (*OrganizationsServiceOp) InviteUser added in v0.9.0

func (s *OrganizationsServiceOp) InviteUser(ctx context.Context, orgID string, invitation *Invitation) (*Invitation, *Response, error)

InviteUser invites one user to the Atlas organization that you specify.

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

func (*OrganizationsServiceOp) List

List gets all organizations.

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

func (*OrganizationsServiceOp) Projects

func (s *OrganizationsServiceOp) Projects(ctx context.Context, orgID string, opts *ListOptions) (*Projects, *Response, error)

Projects gets all projects for the given organization ID.

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

func (*OrganizationsServiceOp) UpdateInvitation added in v0.9.0

func (s *OrganizationsServiceOp) UpdateInvitation(ctx context.Context, orgID string, invitation *Invitation) (*Invitation, *Response, error)

UpdateInvitation updates one pending invitation to the Atlas organization that you specify.

See more: https://docs.atlas.mongodb.com/reference/api/organization-update-one-invitation/

func (*OrganizationsServiceOp) UpdateInvitationByID added in v0.9.0

func (s *OrganizationsServiceOp) UpdateInvitationByID(ctx context.Context, orgID, invitationID string, invitation *Invitation) (*Invitation, *Response, error)

UpdateInvitationByID updates one invitation to the Atlas organization.

See more: https://docs.atlas.mongodb.com/reference/api/organization-update-one-invitation-by-id/

func (*OrganizationsServiceOp) Users

Users gets all users for the given organization ID.

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

type Part

type Part struct {
	ReplicaSetName string `json:"replicaSetName"`
	TypeName       string `json:"typeName"`
	SnapshotPart
	CheckpointPart
}

type PartitionFields

type PartitionFields struct {
	FieldName string   `json:"fieldName,omitempty"`
	FieldType string   `json:"fieldType,omitempty"`
	Order     *float64 `json:"order,omitempty"`
}

PartitionFields fields to use to partition data.

type Peer

type Peer struct {
	AccepterRegionName  string `json:"accepterRegionName,omitempty"`
	AWSAccountID        string `json:"awsAccountId,omitempty"`
	ConnectionID        string `json:"connectionId,omitempty"`
	ContainerID         string `json:"containerId,omitempty"`
	ErrorStateName      string `json:"errorStateName,omitempty"`
	ID                  string `json:"id,omitempty"`
	ProviderName        string `json:"providerName,omitempty"`
	RouteTableCIDRBlock string `json:"routeTableCidrBlock,omitempty"`
	StatusName          string `json:"statusName,omitempty"`
	VpcID               string `json:"vpcId,omitempty"`
	AtlasCIDRBlock      string `json:"atlasCidrBlock,omitempty"`
	AzureDirectoryID    string `json:"azureDirectoryId,omitempty"`
	AzureSubscriptionID string `json:"azureSubscriptionId,omitempty"`
	ResourceGroupName   string `json:"resourceGroupName,omitempty"`
	VNetName            string `json:"vnetName,omitempty"`
	ErrorState          string `json:"errorState,omitempty"`
	Status              string `json:"status,omitempty"`
	GCPProjectID        string `json:"gcpProjectId,omitempty"`
	NetworkName         string `json:"networkName,omitempty"`
	ErrorMessage        string `json:"errorMessage,omitempty"`
}

Peer represents MongoDB peer connection.

type PeersService

PeersService is an interface for interfacing with the Peers endpoints of the MongoDB Atlas API.

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

type PeersServiceOp

type PeersServiceOp service

PeersServiceOp handles communication with the Network Peering Connection related methods of the MongoDB Atlas API.

func (*PeersServiceOp) Create

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

Create a peer connection to the project associated to {GROUP-ID}.

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

func (*PeersServiceOp) Delete

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

Delete the peer connection specified to {PEER-ID} from the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/vpc-delete-peering-connection/

func (*PeersServiceOp) Get

func (s *PeersServiceOp) Get(ctx context.Context, groupID, peerID string) (*Peer, *Response, error)

Get gets the netwprk peering connection specified to {PEER-ID} from the project associated to {GROUP-ID}.

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

func (*PeersServiceOp) List

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

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

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

func (*PeersServiceOp) Update

func (s *PeersServiceOp) Update(ctx context.Context, groupID, peerID string, updateRequest *Peer) (*Peer, *Response, error)

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

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

type PerformanceAdvisorService added in v0.5.0

type PerformanceAdvisorService interface {
	GetNamespaces(context.Context, string, string, *NamespaceOptions) (*Namespaces, *Response, error)
	GetSlowQueries(context.Context, string, string, *SlowQueryOptions) (*SlowQueries, *Response, error)
	GetSuggestedIndexes(context.Context, string, string, *SuggestedIndexOptions) (*SuggestedIndexes, *Response, error)
	EnableManagedSlowOperationThreshold(context.Context, string) (*Response, error)
	DisableManagedSlowOperationThreshold(context.Context, string) (*Response, error)
}

PerformanceAdvisorService is an interface of the Performance Advisor endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/performance-advisor/

type PerformanceAdvisorServiceOp added in v0.5.0

type PerformanceAdvisorServiceOp service

PerformanceAdvisorServiceOp handles communication with the Performance Advisor related methods of the MongoDB Atlas API.

func (*PerformanceAdvisorServiceOp) DisableManagedSlowOperationThreshold added in v0.13.0

func (s *PerformanceAdvisorServiceOp) DisableManagedSlowOperationThreshold(ctx context.Context, groupID string) (*Response, error)

DisableManagedSlowOperationThreshold disables the Atlas managed slow operation threshold for your project.

See more: https://docs.atlas.mongodb.com/reference/api/pa-managed-slow-ms-disable/

func (*PerformanceAdvisorServiceOp) EnableManagedSlowOperationThreshold added in v0.13.0

func (s *PerformanceAdvisorServiceOp) EnableManagedSlowOperationThreshold(ctx context.Context, groupID string) (*Response, error)

EnableManagedSlowOperationThreshold enables the Atlas managed slow operation threshold for your project.

See more: https://docs.atlas.mongodb.com/reference/api/pa-managed-slow-ms-enable/

func (*PerformanceAdvisorServiceOp) GetNamespaces added in v0.5.0

func (s *PerformanceAdvisorServiceOp) GetNamespaces(ctx context.Context, groupID, processName string, opts *NamespaceOptions) (*Namespaces, *Response, error)

GetNamespaces retrieves the namespaces for collections experiencing slow queries for a specified host.

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

func (*PerformanceAdvisorServiceOp) GetSlowQueries added in v0.5.0

func (s *PerformanceAdvisorServiceOp) GetSlowQueries(ctx context.Context, groupID, processName string, opts *SlowQueryOptions) (*SlowQueries, *Response, error)

GetSlowQueries gets log lines for slow queries as determined by the Performance Advisor.

See more: https://docs.atlas.mongodb.com/reference/api/pa-get-slow-query-logs/

func (*PerformanceAdvisorServiceOp) GetSuggestedIndexes added in v0.5.0

func (s *PerformanceAdvisorServiceOp) GetSuggestedIndexes(ctx context.Context, groupID, processName string, opts *SuggestedIndexOptions) (*SuggestedIndexes, *Response, error)

GetSuggestedIndexes gets suggested indexes as determined by the Performance Advisor.

See more: https://docs.atlas.mongodb.com/reference/api/pa-suggested-indexes-get-all/

type PlainRequestDoer added in v0.7.1

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

PlainRequestDoer minimum interface for any service of the client that should handle plain text.

type Policy

type Policy struct {
	ID          string       `json:"id,omitempty"`          // Unique identifier of the backup policy.
	PolicyItems []PolicyItem `json:"policyItems,omitempty"` // A list of specifications for a policy.
}

Policy represents for the snapshot and an array of backup policy items.

type PolicyItem

type PolicyItem struct {
	ID                string `json:"id,omitempty"`                // Unique identifier of the backup policy item.
	FrequencyInterval int    `json:"frequencyInterval,omitempty"` // Desired frequency of the new backup policy item specified by frequencyType.
	FrequencyType     string `json:"frequencyType,omitempty"`     // Frequency associated with the backup policy item. One of the following values: hourly, daily, weekly or monthly.
	RetentionUnit     string `json:"retentionUnit,omitempty"`     // Metric of duration of the backup policy item: days, weeks, or months.
	RetentionValue    int    `json:"retentionValue,omitempty"`    // Duration for which the backup is kept. Associated with retentionUnit.
}

PolicyItem represents a specifications for a backup policy.

type PrivateEndpoint added in v0.7.1

type PrivateEndpoint struct {
	ConnectionString    string     `json:"connectionString,omitempty"`
	Endpoints           []Endpoint `json:"endpoints,omitempty"`
	SRVConnectionString string     `json:"srvConnectionString,omitempty"`
	Type                string     `json:"type,omitempty"`
}

PrivateEndpoint connection strings. Each object describes the connection strings you can use to connect to this cluster through a private endpoint. Atlas returns this parameter only if you deployed a private endpoint to all regions to which you deployed this cluster's nodes.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	ID                           string   `json:"id,omitempty"`                           // Unique identifier of the AWS PrivateLink connection or Azure Private Link Service.
	ProviderName                 string   `json:"providerName,omitempty"`                 // Name of the cloud provider for which you want to create the private endpoint service. Atlas accepts AWS, AZURE or GCP.
	Region                       string   `json:"region,omitempty"`                       // Cloud provider region for which you want to create the private endpoint service.
	EndpointServiceName          string   `json:"endpointServiceName,omitempty"`          // Name of the PrivateLink endpoint service in AWS. Returns null while the endpoint service is being created.
	ErrorMessage                 string   `json:"errorMessage,omitempty"`                 // Error message pertaining to the AWS PrivateLink connection or Azure Private Link Service or GCP Private Service Connect. Returns null if there are no errors.
	InterfaceEndpoints           []string `json:"interfaceEndpoints,omitempty"`           // Unique identifiers of the interface endpoints in your VPC that you added to the AWS PrivateLink connection.
	PrivateEndpoints             []string `json:"privateEndpoints,omitempty"`             // All private endpoints that you have added to this Azure Private Link Service.
	PrivateLinkServiceName       string   `json:"privateLinkServiceName,omitempty"`       // Name of the Azure Private Link Service that Atlas manages.
	PrivateLinkServiceResourceID string   `json:"privateLinkServiceResourceId,omitempty"` // Resource ID of the Azure Private Link Service that Atlas manages.
	Status                       string   `json:"status,omitempty"`                       // Status of the AWS, Azure OR GCP PrivateLink connection: INITIATING, WAITING_FOR_USER, FAILED, DELETING, AVAILABLE.
	EndpointGroupNames           []string `json:"endpointGroupNames,omitempty"`           // GCP network endpoint groups corresponding to the Private Service Connect endpoint service.
	RegionName                   string   `json:"regionName,omitempty"`                   // GCP region name for the Private Service Connect endpoint service.
	ServiceAttachmentNames       []string `json:"serviceAttachmentNames,omitempty"`       // Unique alphanumeric and special character strings that identify the service attachments associated with the GCP Private Service Connect endpoint service. Returns an empty list while Atlas creates the service attachments.
}

PrivateEndpointConnection represents MongoDB Private Endpoint Connection.

type PrivateEndpointConnectionDeprecated added in v0.6.0

type PrivateEndpointConnectionDeprecated struct {
	ID                  string   `json:"id,omitempty"`                  // Unique identifier of the AWS PrivateLink connection.
	ProviderName        string   `json:"providerName,omitempty"`        // Name of the cloud provider you want to create the private endpoint connection for. Must be AWS.
	Region              string   `json:"region,omitempty"`              // Cloud provider region in which you want to create the private endpoint connection.
	EndpointServiceName string   `json:"endpointServiceName,omitempty"` // Name of the PrivateLink endpoint service in AWS. Returns null while the endpoint service is being created.
	ErrorMessage        string   `json:"errorMessage,omitempty"`        // Error message pertaining to the AWS PrivateLink connection. Returns null if there are no errors.
	InterfaceEndpoints  []string `json:"interfaceEndpoints,omitempty"`  // Unique identifiers of the interface endpoints in your VPC that you added to the AWS PrivateLink connection.
	Status              string   `json:"status,omitempty"`              // Status of the AWS PrivateLink connection: INITIATING, WAITING_FOR_USER, FAILED, DELETING.
}

PrivateEndpointConnectionDeprecated represents MongoDB Private Endpoint Connection.

type PrivateEndpointsService

PrivateEndpointsService is an interface for interfacing with the Private Endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints/

type PrivateEndpointsServiceDeprecated added in v0.6.0

PrivateEndpointsServiceDeprecated is an interface for interfacing with the Private Endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint/

type PrivateEndpointsServiceOp

type PrivateEndpointsServiceOp service

PrivateEndpointsServiceOp handles communication with the PrivateEndpoints related methods of the MongoDB Atlas API.

func (*PrivateEndpointsServiceOp) AddOnePrivateEndpoint added in v0.6.0

func (s *PrivateEndpointsServiceOp) AddOnePrivateEndpoint(ctx context.Context, groupID, cloudProvider, endpointServiceID string, createRequest *InterfaceEndpointConnection) (*InterfaceEndpointConnection, *Response, error)

AddOnePrivateEndpoint Adds one private endpoint for AWS or Azure in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints-endpoint-create-one/

func (*PrivateEndpointsServiceOp) Create

Create one private endpoint service for AWS or Azure in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints-service-create-one/

func (*PrivateEndpointsServiceOp) Delete

func (s *PrivateEndpointsServiceOp) Delete(ctx context.Context, groupID, cloudProvider, endpointServiceID string) (*Response, error)

Delete one private endpoint service for AWS or Azure in an Atlas project.

See more https://docs.atlas.mongodb.com/reference/api/private-endpoints-service-delete-one/

func (*PrivateEndpointsServiceOp) DeleteOnePrivateEndpoint added in v0.6.0

func (s *PrivateEndpointsServiceOp) DeleteOnePrivateEndpoint(ctx context.Context, groupID, cloudProvider, endpointServiceID, privateEndpointID string) (*Response, error)

DeleteOnePrivateEndpoint remove one private endpoint for AWS or Azure from an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints-endpoint-delete-one/

func (*PrivateEndpointsServiceOp) Get

func (s *PrivateEndpointsServiceOp) Get(ctx context.Context, groupID, cloudProvider, endpointServiceID string) (*PrivateEndpointConnection, *Response, error)

Get retrieve details for one private endpoint service for AWS or Azure in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints-service-get-one/

func (*PrivateEndpointsServiceOp) GetOnePrivateEndpoint added in v0.6.0

func (s *PrivateEndpointsServiceOp) GetOnePrivateEndpoint(ctx context.Context, groupID, cloudProvider, endpointServiceID, privateEndpointID string) (*InterfaceEndpointConnection, *Response, error)

GetOnePrivateEndpoint retrieve details for one private endpoint for AWS or Azure in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints-endpoint-get-one/

func (*PrivateEndpointsServiceOp) GetRegionalizedPrivateEndpointSetting added in v0.7.1

func (s *PrivateEndpointsServiceOp) GetRegionalizedPrivateEndpointSetting(ctx context.Context, groupID string) (*RegionalizedPrivateEndpointSetting, *Response, error)

GetRegionalizedPrivateEndpointSetting updates the regionalized private endpoint setting for one Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints-get-regional-mode

func (*PrivateEndpointsServiceOp) List

func (s *PrivateEndpointsServiceOp) List(ctx context.Context, groupID, cloudProvider string, listOptions *ListOptions) ([]PrivateEndpointConnection, *Response, error)

List retrieve details for all private endpoint services for AWS or Azure in one Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints-service-get-all/

func (*PrivateEndpointsServiceOp) UpdateRegionalizedPrivateEndpointSetting added in v0.7.1

func (s *PrivateEndpointsServiceOp) UpdateRegionalizedPrivateEndpointSetting(ctx context.Context, groupID string, enabled bool) (*RegionalizedPrivateEndpointSetting, *Response, error)

UpdateRegionalizedPrivateEndpointSetting updates the regionalized private endpoint setting for one Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints-update-regional-mode

type PrivateEndpointsServiceOpDeprecated added in v0.6.0

type PrivateEndpointsServiceOpDeprecated service

PrivateEndpointsServiceOpDeprecated handles communication with the PrivateEndpoints related methods of the MongoDB Atlas API.

func (*PrivateEndpointsServiceOpDeprecated) AddOneInterfaceEndpoint added in v0.6.0

func (s *PrivateEndpointsServiceOpDeprecated) AddOneInterfaceEndpoint(ctx context.Context, groupID, privateLinkID, interfaceEndpointID string) (*InterfaceEndpointConnectionDeprecated, *Response, error)

AddOneInterfaceEndpoint adds one interface endpoint to a private endpoint connection in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-create-one-interface-endpoint/

func (*PrivateEndpointsServiceOpDeprecated) Create added in v0.6.0

Create one private endpoint connection in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-create-one-private-endpoint-connection/

func (*PrivateEndpointsServiceOpDeprecated) Delete added in v0.6.0

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

Delete removes one private endpoint connection in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-delete-one-private-endpoint-connection/

func (*PrivateEndpointsServiceOpDeprecated) DeleteOneInterfaceEndpoint added in v0.6.0

func (s *PrivateEndpointsServiceOpDeprecated) DeleteOneInterfaceEndpoint(ctx context.Context, groupID, privateLinkID, interfaceEndpointID string) (*Response, error)

DeleteOneInterfaceEndpoint removes one interface endpoint from a private endpoint connection in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-delete-one-interface-endpoint/

func (*PrivateEndpointsServiceOpDeprecated) Get added in v0.6.0

Get retrieves details for one private endpoint connection by ID in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-get-one-private-endpoint-connection/

func (*PrivateEndpointsServiceOpDeprecated) GetOneInterfaceEndpoint added in v0.6.0

func (s *PrivateEndpointsServiceOpDeprecated) GetOneInterfaceEndpoint(ctx context.Context, groupID, privateLinkID, interfaceEndpointID string) (*InterfaceEndpointConnectionDeprecated, *Response, error)

GetOneInterfaceEndpoint retrieves one interface endpoint in a private endpoint connection in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-get-one-interface-endpoint/

func (*PrivateEndpointsServiceOpDeprecated) List added in v0.6.0

List retrieves details for all private endpoint connections in an Atlas project.

See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-get-all-private-endpoint-connections/

type PrivateIPMode

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

PrivateIPMode represents MongoDB Private IP Mode Configutation.

type PrivateIPModeService

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

PrivateIPModeService is an interface for interfacing with the PrivateIpMode endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/get-private-ip-mode-for-project/

type PrivateIPModeServiceOp

type PrivateIPModeServiceOp service

PrivateIPModeServiceOp handles communication with the Private IP Mode related methods of the MongoDB Atlas API.

func (*PrivateIPModeServiceOp) Get

Get Verify Connect via Peering Only Mode from the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/get-private-ip-mode-for-project/

func (*PrivateIPModeServiceOp) Update

func (s *PrivateIPModeServiceOp) Update(ctx context.Context, groupID string, updateRequest *PrivateIPMode) (*PrivateIPMode, *Response, error)

Update connection via Peering Only Mode in the project associated to {GROUP-ID}.

See more: https://docs.atlas.mongodb.com/reference/api/set-private-ip-mode-for-project/

type PrivateLinkEndpointDataLake added in v0.15.0

type PrivateLinkEndpointDataLake struct {
	Comment    string `json:"comment,omitempty"`
	EndpointID string `json:"endpointId,omitempty"`
	Provider   string `json:"provider,omitempty"`
	Type       string `json:"type,omitempty"`
}

PrivateLinkEndpointDataLake represents the private link result for data lake.

type PrivateLinkEndpointDataLakeResponse added in v0.15.0

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

PrivateLinkEndpointDataLakeResponse represents MongoDB Private Endpoint Connection to DataLake.

type PrivateLinkEndpointOnlineArchive added in v0.15.0

type PrivateLinkEndpointOnlineArchive struct {
	Comment    string `json:"comment,omitempty"`
	EndpointID string `json:"endpointId,omitempty"`
	Provider   string `json:"provider,omitempty"`
	Type       string `json:"type,omitempty"`
}

PrivateLinkEndpointOnlineArchive represents the private link result for Online Archive.

type PrivateLinkEndpointOnlineArchiveResponse added in v0.15.0

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

PrivateLinkEndpointOnlineArchiveResponse represents MongoDB Private Endpoint Connection to Online Archive.

type Process

type Process struct {
	Created        string  `json:"created"`
	GroupID        string  `json:"groupId"`
	Hostname       string  `json:"hostname"`
	ID             string  `json:"id"`
	LastPing       string  `json:"lastPing"`
	Links          []*Link `json:"links"`
	Port           int     `json:"port"`
	ShardName      string  `json:"shardName"`
	ReplicaSetName string  `json:"replicaSetName"`
	TypeName       string  `json:"typeName"`
	Version        string  `json:"version"`
	UserAlias      string  `json:"userAlias"`
}

Process represents a MongoDB process.

type ProcessArgs

type ProcessArgs struct {
	DefaultReadConcern               string `json:"defaultReadConcern,omitempty"`
	DefaultWriteConcern              string `json:"defaultWriteConcern,omitempty"`
	FailIndexKeyTooLong              *bool  `json:"failIndexKeyTooLong,omitempty"`
	JavascriptEnabled                *bool  `json:"javascriptEnabled,omitempty"`
	MinimumEnabledTLSProtocol        string `json:"minimumEnabledTlsProtocol,omitempty"`
	NoTableScan                      *bool  `json:"noTableScan,omitempty"`
	OplogSizeMB                      *int64 `json:"oplogSizeMB,omitempty"`
	SampleSizeBIConnector            *int64 `json:"sampleSizeBIConnector,omitempty"`
	SampleRefreshIntervalBIConnector *int64 `json:"sampleRefreshIntervalBIConnector,omitempty"`
}

ProcessArgs represents the advanced configuration options for the cluster.

type ProcessDatabase

type ProcessDatabase struct {
	Links        []*Link `json:"links"`
	DatabaseName string  `json:"databaseName"`
}

ProcessDatabase is the database information of a process.

type ProcessDatabaseMeasurements

type ProcessDatabaseMeasurements struct {
	*ProcessMeasurements
	DatabaseName string `json:"databaseName"`
}

ProcessDatabaseMeasurements represents a MongoDB process database measurements.

type ProcessDatabaseMeasurementsService

type ProcessDatabaseMeasurementsService interface {
	List(context.Context, string, string, int, string, *ProcessMeasurementListOptions) (*ProcessDatabaseMeasurements, *Response, error)
}

ProcessDatabaseMeasurementsService is an interface for interfacing with the process database measurements endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/process-databases-measurements/

type ProcessDatabaseMeasurementsServiceOp

type ProcessDatabaseMeasurementsServiceOp service

ProcessDatabaseMeasurementsServiceOp handles communication with the process database measurements related methods of the MongoDB Atlas API.

func (*ProcessDatabaseMeasurementsServiceOp) List

List list measurements for a specific Atlas MongoDB database.

See more: https://docs.atlas.mongodb.com/reference/api/process-databases-measurements/

type ProcessDatabasesResponse

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

ProcessDatabasesResponse is the response from the ProcessDatabasesService.List.

type ProcessDatabasesService

type ProcessDatabasesService interface {
	List(context.Context, string, string, int, *ListOptions) (*ProcessDatabasesResponse, *Response, error)
}

ProcessDatabasesService is an interface for interfacing with the Process Measurements endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/process-databases/

type ProcessDatabasesServiceOp

type ProcessDatabasesServiceOp service

ProcessDatabasesServiceOp handles communication with the process disks related methods of the MongoDB Atlas API.

func (*ProcessDatabasesServiceOp) List

func (s *ProcessDatabasesServiceOp) List(ctx context.Context, groupID, host string, port int, opts *ListOptions) (*ProcessDatabasesResponse, *Response, error)

List gets databases for a specific Atlas MongoDB process.

See more: https://docs.atlas.mongodb.com/reference/api/process-databases/

type ProcessDisk

type ProcessDisk struct {
	Links         []*Link `json:"links"`
	PartitionName string  `json:"partitionName"`
}

ProcessDisk is the partition information of a process.

type ProcessDiskMeasurements

type ProcessDiskMeasurements struct {
	*ProcessMeasurements
	PartitionName string `json:"partitionName"`
}

ProcessDiskMeasurements represents a MongoDB Process Disk Measurements.

type ProcessDiskMeasurementsService

type ProcessDiskMeasurementsService interface {
	List(context.Context, string, string, int, string, *ProcessMeasurementListOptions) (*ProcessDiskMeasurements, *Response, error)
}

ProcessDiskMeasurementsService is an interface for interfacing with the Process Disk Measurements endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/process-disks-measurements/#get-measurements-of-a-disk-for-a-mongodb-process

type ProcessDiskMeasurementsServiceOp

type ProcessDiskMeasurementsServiceOp service

ProcessDiskMeasurementsServiceOp handles communication with the Process Disk Measurements related methods of the MongoDB Atlas API.

func (*ProcessDiskMeasurementsServiceOp) List

List lists measurements for a specific Atlas MongoDB disk.

See more: https://docs.atlas.mongodb.com/reference/api/process-disks-measurements/#get-measurements-of-a-disk-for-a-mongodb-process

type ProcessDisksResponse

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

ProcessDisksResponse is the response from the ProcessDisksService.List.

type ProcessDisksService

type ProcessDisksService interface {
	List(context.Context, string, string, int, *ListOptions) (*ProcessDisksResponse, *Response, error)
}

ProcessDisksService is an interface for interfacing with the Process Measurements endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/process-disks/

type ProcessDisksServiceOp

type ProcessDisksServiceOp service

ProcessDisksServiceOp handles communication with the process disks related methods of the MongoDB Atlas API.

func (*ProcessDisksServiceOp) List

func (s *ProcessDisksServiceOp) List(ctx context.Context, groupID, host string, port int, opts *ListOptions) (*ProcessDisksResponse, *Response, error)

List gets partitions for a specific Atlas MongoDB process.

See more: https://docs.atlas.mongodb.com/reference/api/process-disks/

type ProcessMeasurementListOptions

type ProcessMeasurementListOptions struct {
	*ListOptions
	Granularity string   `url:"granularity"`
	Period      string   `url:"period,omitempty"`
	Start       string   `url:"start,omitempty"`
	End         string   `url:"end,omitempty"`
	M           []string `url:"m,omitempty"`
}

ProcessMeasurementListOptions contains the list of options for Process Measurements.

type ProcessMeasurements

type ProcessMeasurements struct {
	End          string          `json:"end"`
	Granularity  string          `json:"granularity"`
	GroupID      string          `json:"groupId"`
	HostID       string          `json:"hostId"`
	Links        []*Link         `json:"links,omitempty"`
	Measurements []*Measurements `json:"measurements"`
	ProcessID    string          `json:"processId"`
	Start        string          `json:"start"`
}

ProcessMeasurements represents a MongoDB Process Measurements.

type ProcessMeasurementsService

type ProcessMeasurementsService interface {
	List(context.Context, string, string, int, *ProcessMeasurementListOptions) (*ProcessMeasurements, *Response, error)
}

ProcessMeasurementsService is an interface for interfacing with the Process Measurements endpoints of the MongoDB Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/process-measurements/

type ProcessMeasurementsServiceOp

type ProcessMeasurementsServiceOp service

ProcessMeasurementsServiceOp handles communication with the Process Measurements related methods of the MongoDB Atlas API.

func (*ProcessMeasurementsServiceOp) List

List lists measurements for a specific Atlas MongoDB process.

See more: https://docs.atlas.mongodb.com/reference/api/process-measurements/

type ProcessesListOptions

type ProcessesListOptions struct {
	ListOptions
	ClusterID string `url:"clusterId,omitempty"` // ClusterID is only available for Ops Manager and CLoud Manager.
}

ProcessesListOptions filter options for the processes API.

type ProcessesService

type ProcessesService interface {
	List(context.Context, string, *ProcessesListOptions) ([]*Process, *Response, error)
}

ProcessesService provides access to the alert processes related functions in the Atlas API.

See more: https://docs.atlas.mongodb.com/reference/api/monitoring-and-logs/

type ProcessesServiceOp

type ProcessesServiceOp service

ProcessesServiceOp handles communication with the Process related methods of the MongoDB Atlas API.

func (*ProcessesServiceOp) List

func (s *ProcessesServiceOp) List(ctx context.Context, groupID string, listOptions *ProcessesListOptions) ([]*Process, *Response, error)

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

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

type Project

type Project struct {
	ID                        string  `json:"id,omitempty"`
	OrgID                     string  `json:"orgId,omitempty"`
	Name                      string  `json:"name,omitempty"`
	ClusterCount              int     `json:"clusterCount,omitempty"`
	Created                   string  `json:"created,omitempty"`
	RegionUsageRestrictions   string  `json:"regionUsageRestrictions,omitempty"` // RegionUsageRestrictions for cloud.mongodbgov.com, valid values are GOV_REGIONS_ONLY, COMMERCIAL_FEDRAMP_REGIONS_ONLY, NONE
	Links                     []*Link `json:"links,omitem