mongodbatlas

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

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 (
	// 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 = 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 struct {
	Client RequestDoer
}

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 string, 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 string, 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 string, 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 AcknowledgeRequest added in v0.2.0

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

AlertsRequest contains the request Body Parameters

type Action added in v0.1.2

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 Alert added in v0.2.0

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

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.
	Notifications          []Notification   `json:"notifications,omitempty"`          // Notifications are sending when an alert condition is detected.
}

AlertConfiguration represents MongoDB Alert Configuration.

type AlertConfigurationsResponse added in v0.1.3

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

AlertConfigurationsService is an interface of the Alert Configuration endpoints of the MongoDB Atlas API. See more: hhttps://docs.atlas.mongodb.com/reference/api/alert-configurations

type AlertConfigurationsServiceOp added in v0.1.3

type AlertConfigurationsServiceOp struct {
	Client RequestDoer
}

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

func (*AlertConfigurationsServiceOp) Create added in v0.1.3

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

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

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

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

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

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

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

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

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

AlertsListOptions contains the list of options for Alerts

type AlertsResponse added in v0.2.0

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

AlertResponse is the response from the AlertService.List.

type AlertsService added in v0.2.0

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

type AlertsServiceOp struct {
	Client RequestDoer
}

AlertServiceOp handles communication with the Alert related methods of the MongoDB Atlas API

func (*AlertsServiceOp) Acknowledge added in v0.2.0

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

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

func (*AlertsServiceOp) Get added in v0.2.0

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

GetAnAlert 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 added in v0.2.0

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

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

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

type AtlasRole added in v0.1.2

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

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

type AtlasUserAssigned added in v0.1.2

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

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

AtlasUsers represents a array of project

type AtlasUsersService added in v0.1.2

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

type AtlasUsersServiceOp struct {
	Client RequestDoer
}

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

func (*AtlasUsersServiceOp) Create added in v0.1.2

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

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

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

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

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

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

type AuditingsServiceOp struct {
	Client RequestDoer
}

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

func (*AuditingsServiceOp) Configure added in v0.1.2

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

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 {
	DiskGBEnabled *bool    `json:"diskGBEnabled,omitempty"`
	Compute       *Compute `json:"compute,omitempty"`
}

AutoScaling configures your cluster to automatically scale its storage

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
}

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 Checkpoint added in v0.2.0

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

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

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

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

type CheckpointsServiceOp struct {
	Client RequestDoer
}

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

func (CheckpointsServiceOp) Get added in v0.2.0

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

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
	ProjectIPWhitelist                  ProjectIPWhitelistService
	Projects                            ProjectsService
	Clusters                            ClustersService
	CloudProviderSnapshots              CloudProviderSnapshotsService
	APIKeys                             APIKeysService
	ProjectAPIKeys                      ProjectAPIKeysService
	CloudProviderSnapshotRestoreJobs    CloudProviderSnapshotRestoreJobsService
	Peers                               PeersService
	Containers                          ContainersService
	EncryptionsAtRest                   EncryptionsAtRestService
	WhitelistAPIKeys                    WhitelistAPIKeysService
	PrivateIPMode                       PrivateIPModeService
	MaintenanceWindows                  MaintenanceWindowsService
	Teams                               TeamsService
	AtlasUsers                          AtlasUsersService
	GlobalClusters                      GlobalClustersService
	Auditing                            AuditingsService
	AlertConfigurations                 AlertConfigurationsService
	PrivateEndpoints                    PrivateEndpointsService
	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
	// 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 added in v0.2.0

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) 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 are options for New.

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

CloudProviderSnapshot represents a cloud provider snapshot.

type CloudProviderSnapshotBackupPoliciesService added in v0.2.0

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

type CloudProviderSnapshotBackupPoliciesServiceOp struct {
	Client RequestDoer
}

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

func (*CloudProviderSnapshotBackupPoliciesServiceOp) Get added in v0.2.0

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

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

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

CloudProviderSnapshotBackupPolicy represents a cloud provider snapshot schedule.

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

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 CloudProviderSnapshotRestoreJobsService

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

type CloudProviderSnapshotRestoreJobsServiceOp

type CloudProviderSnapshotRestoreJobsServiceOp struct {
	Client RequestDoer
}

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) 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) 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/

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 struct {
	Client RequestDoer
}

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) 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/

type Cluster

type Cluster struct {
	AutoScaling              *AutoScaling             `json:"autoScaling,omitempty"`
	BackupEnabled            *bool                    `json:"backupEnabled,omitempty"`
	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"`
	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"`
}

Cluster represents MongoDB cluster.

type ClustersService

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 struct {
	Client RequestDoer
}

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 string, 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 string, 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 added in v0.1.1

func (s *ClustersServiceOp) GetProcessArgs(ctx context.Context, groupID string, 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) 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) Update

func (s *ClustersServiceOp) Update(ctx context.Context, groupID string, 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 added in v0.1.1

func (s *ClustersServiceOp) UpdateProcessArgs(ctx context.Context, groupID string, 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 added in v0.2.0

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

type Completer interface {
	OnRequestCompleted(RequestCompletionCallback)
}

type Compute added in v0.3.0

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

type ConnectionStrings struct {
	Standard          string            `json:"standard,omitempty"`
	StandardSrv       string            `json:"standardSrv,omitempty"`
	AwsPrivateLink    map[string]string `json:"awsPrivateLink,omitempty"`
	AwsPrivateLinkSrv map[string]string `json:"awsPrivateLinkSrv,omitempty"`
	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"`
	RegionName          string `json:"regionName,omitempty"`
	VNetName            string `json:"vnetName,omitempty"`
	VPCID               string `json:"vpcId,omitempty"`
}

Container represents MongoDB network peering containter.

type ContainersListOptions added in v0.1.2

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

type ContainersService

ContainersService is an interface for interfacing with the Network Peering Containers endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/vpc/

type ContainersServiceOp

type ContainersServiceOp struct {
	Client RequestDoer
}

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)

Add 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 string, 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 string, containerID string) (*Container, *Response, error)

Get gets 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-get-container/

func (*ContainersServiceOp) List

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

List all containers in the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/vpc-get-containers-list/

func (*ContainersServiceOp) Update

func (s *ContainersServiceOp) Update(ctx context.Context, groupID string, 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 added in v0.2.0

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

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

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

type ContinuousRestoreJobsServiceOp added in v0.2.0

type ContinuousRestoreJobsServiceOp struct {
	Client RequestDoer
}

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

func (*ContinuousRestoreJobsServiceOp) Create added in v0.2.0

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

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

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

List list all continuous backup jobs in Atlas See more: https://docs.atlas.mongodb.com/reference/api/restore-jobs-get-all/

type ContinuousSnapshot added in v0.2.0

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

CloudProviderSnapshot represents a cloud provider snapshot.

type ContinuousSnapshots added in v0.2.0

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

CloudProviderSnapshots represents all cloud provider snapshots.

type ContinuousSnapshotsService added in v0.2.0

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

type ContinuousSnapshotsServiceOp struct {
	Client RequestDoer
}

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

func (*ContinuousSnapshotsServiceOp) ChangeExpiry added in v0.2.0

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

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

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

List 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 added in v0.2.0

func (s *ContinuousSnapshotsServiceOp) List(ctx context.Context, groupID string, 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 CurrentValue added in v0.1.3

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

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

CustomDBRole represents a Custom MongoDB Role in your cluster.

type CustomDBRolesService added in v0.1.2

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

type CustomDBRolesServiceOp struct {
	Client RequestDoer
}

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

func (*CustomDBRolesServiceOp) Create added in v0.1.2

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

func (s *CustomDBRolesServiceOp) Delete(ctx context.Context, groupID string, 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 added in v0.1.2

func (s *CustomDBRolesServiceOp) Get(ctx context.Context, groupID string, 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 added in v0.1.2

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

func (s *CustomDBRolesServiceOp) Update(ctx context.Context, groupID string, 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 added in v0.1.2

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

CustomZoneMapping represents the custom zone mapping.

type CustomZoneMappingsRequest added in v0.1.2

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

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

type CustomerX509 added in v0.2.0

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 DataPoints added in v0.2.0

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

DataPoints represents a MongoDB DataPoints.

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"`
	GroupID         string  `json:"groupId,omitempty"`
	Roles           []Role  `json:"roles,omitempty"`
	Password        string  `json:"password,omitempty"`
	Username        string  `json:"username,omitempty"`
}

DatabaseUser represents MongoDB users in your cluster.

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 struct {
	Client RequestDoer
}

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 string, 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 added in v0.2.0

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

DateRangetOptions specifies an optional date range query.

type Delivery added in v0.2.0

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 Doer added in v0.2.0

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

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 struct {
	Client RequestDoer
}

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 ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response
	//The error code, which is simply the HTTP status code.
	ErrorCode int `json:"Error"`

	//A short description of the error, which is simply the HTTP status phrase.
	Reason string `json:"reason"`

	//A 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

type Event added in v0.2.0

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

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

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

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

type EventsServiceOp struct {
	Client RequestDoer
}

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

func (*EventsServiceOp) GetOrganizationEvent added in v0.2.0

func (s *EventsServiceOp) GetOrganizationEvent(ctx context.Context, orgID string, 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 added in v0.2.0

func (s *EventsServiceOp) GetProjectEvent(ctx context.Context, groupID string, 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 added in v0.2.0

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

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 GZipRequestDoer added in v0.2.0

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

type GlobalCluster added in v0.1.2

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

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

type GlobalClustersServiceOp struct {
	Client RequestDoer
}

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

func (*GlobalClustersServiceOp) AddCustomZoneMappings added in v0.1.2

func (s *GlobalClustersServiceOp) AddCustomZoneMappings(ctx context.Context, groupID string, 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 added in v0.1.2

func (s *GlobalClustersServiceOp) AddManagedNamespace(ctx context.Context, groupID string, 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 added in v0.1.2

func (s *GlobalClustersServiceOp) DeleteCustomZoneMappings(ctx context.Context, groupID string, 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 added in v0.1.2

func (s *GlobalClustersServiceOp) DeleteManagedNamespace(ctx context.Context, groupID string, 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 added in v0.1.2

func (s *GlobalClustersServiceOp) Get(ctx context.Context, groupID string, 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 added in v0.2.0

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

type IndexConfiguration added in v0.2.0

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 IndexOptions added in v0.2.0

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 mdb index options See: https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#options

type IndexesService added in v0.2.0

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

type IndexesServiceOp struct {
	Client RequestDoer
}

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

func (*IndexesServiceOp) Create added in v0.2.0

func (s *IndexesServiceOp) Create(ctx context.Context, groupID string, 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 added in v0.1.2

type InheritedRole struct {
	Db   string `json:"db,omitempty"`
	Role string `json:"role,omitempty"`
}

An InheritedRole describes the role that this Role inherits from.

type InterfaceEndpointConnection added in v0.2.0

type InterfaceEndpointConnection 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.
}

InterfaceEndpointConnection represents MongoDB Interface Endpoint Connection.

type Label added in v0.1.3

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

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

type LogsService added in v0.2.0

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

type LogsServiceOp struct {
	Client GZipRequestDoer
}

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

func (*LogsServiceOp) Get added in v0.2.0

func (s *LogsServiceOp) Get(ctx context.Context, groupID string, hostName string, 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 added in v0.1.2

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

MaintenanceWindow represents MongoDB Maintenance Windows

type MaintenanceWindowsService added in v0.1.2

type MaintenanceWindowsService interface {
	Get(context.Context, string) (*MaintenanceWindow, *Response, error)
	Update(context.Context, string, *MaintenanceWindow) (*Response, error)
	Defer(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 added in v0.1.2

type MaintenanceWindowsServiceOp struct {
	Client RequestDoer
}

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

func (*MaintenanceWindowsServiceOp) Defer added in v0.1.2

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

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

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

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

type ManagedNamespace struct {
	Db             string `json:"db"`
	Collection     string `json:"collection"`
	CustomShardKey string `json:"customShardKey,omitempty"`
}

ManagedNamespace represents the information about managed namespace configuration.

type Matcher added in v0.1.3

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

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

Measurements represents a MongoDB Measurement.

type MetricThreshold added in v0.1.3

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,omitempty"`  // 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 added in v0.2.0

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 NamespaceFilter added in v0.2.0

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

type Notification added in v0.1.3

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.
	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 Part added in v0.2.0

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

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

type PeersService interface {
	List(context.Context, string, *ListOptions) ([]Peer, *Response, error)
	Get(context.Context, string, string) (*Peer, *Response, error)
	Create(context.Context, string, *Peer) (*Peer, *Response, error)
	Update(context.Context, string, string, *Peer) (*Peer, *Response, error)
	Delete(context.Context, string, string) (*Response, error)
}

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

type PeersServiceOp

type PeersServiceOp struct {
	Client RequestDoer
}

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)

Add 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 string, 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 string, 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 *ListOptions) ([]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 string, 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 Policy added in v0.2.0

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

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 PrivateEndpointConnection added in v0.2.0

type PrivateEndpointConnection 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.
}

PrivateEndpointConnection represents MongoDB Private Endpoint Connection.

type PrivateEndpointsService added in v0.2.0

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-endpoint/

type PrivateEndpointsServiceOp added in v0.2.0

type PrivateEndpointsServiceOp struct {
	Client RequestDoer
}

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

func (*PrivateEndpointsServiceOp) AddOneInterfaceEndpoint added in v0.2.0

func (s *PrivateEndpointsServiceOp) AddOneInterfaceEndpoint(ctx context.Context, groupID, privateLinkID, interfaceEndpointID string) (*InterfaceEndpointConnection, *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 (*PrivateEndpointsServiceOp) Create added in v0.2.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 (*PrivateEndpointsServiceOp) Delete added in v0.2.0

func (s *PrivateEndpointsServiceOp) 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 (*PrivateEndpointsServiceOp) DeleteOneInterfaceEndpoint added in v0.2.0

func (s *PrivateEndpointsServiceOp) 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 (*PrivateEndpointsServiceOp) Get added in v0.2.0

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

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 (*PrivateEndpointsServiceOp) GetOneInterfaceEndpoint added in v0.2.0

func (s *PrivateEndpointsServiceOp) GetOneInterfaceEndpoint(ctx context.Context, groupID, privateLinkID, interfaceEndpointID string) (*InterfaceEndpointConnection, *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 (*PrivateEndpointsServiceOp) List added in v0.2.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 added in v0.1.0

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

PrivateIPMode represents MongoDB Private IP Mode Configutation.

type PrivateIPModeService added in v0.1.3

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

type PrivateIPModeServiceOp struct {
	Client RequestDoer
}

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

func (*PrivateIPModeServiceOp) Get added in v0.1.3

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

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 Process added in v0.2.0

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

Process represents a MongoDB process.

type ProcessArgs added in v0.1.1

type ProcessArgs struct {
	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 added in v0.2.0

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

ProcessDatabase is the database information of a process

type ProcessDatabaseMeasurements added in v0.2.0

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

ProcessDatabaseMeasurements represents a MongoDB process database measurements.

type ProcessDatabaseMeasurementsService added in v0.2.0

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

type ProcessDatabaseMeasurementsServiceOp struct {
	Client RequestDoer
}

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

func (*ProcessDatabaseMeasurementsServiceOp) List added in v0.2.0

List list measurements for a specific Atlas MongoDB database. See more: https://docs.atlas.mongodb.com/reference/api/process-databases-measurements/

type ProcessDatabasesResponse added in v0.2.0

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

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

type ProcessDatabasesServiceOp struct {
	Client RequestDoer
}

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

func (*ProcessDatabasesServiceOp) List added in v0.2.0

List gets databases for a specific Atlas MongoDB process. See more: https://docs.atlas.mongodb.com/reference/api/process-databases/

type ProcessDisk added in v0.2.0

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

ProcessDisk is the partition information of a process

type ProcessDiskMeasurements added in v0.2.0

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

ProcessDiskMeasurements represents a MongoDB Process Disk Measurements.

type ProcessDiskMeasurementsService added in v0.2.0

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

type ProcessDiskMeasurementsServiceOp struct {
	Client RequestDoer
}

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

func (*ProcessDiskMeasurementsServiceOp) List added in v0.2.0

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

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

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

type ProcessDisksServiceOp struct {
	Client RequestDoer
}

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

func (*ProcessDisksServiceOp) List added in v0.2.0

func (s *ProcessDisksServiceOp) List(ctx context.Context, groupID string, 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 added in v0.2.0

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

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

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

type ProcessMeasurementsServiceOp struct {
	Client RequestDoer
}

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

func (*ProcessMeasurementsServiceOp) List added in v0.2.0

List lists measurements for a specific Atlas MongoDB process. See more: https://docs.atlas.mongodb.com/reference/api/process-measurements/

type ProcessesService added in v0.2.0

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

ProcessesService is for interfacing with the project Processes endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/monitoring-and-logs/

type ProcessesServiceOp added in v0.2.0

type ProcessesServiceOp struct {
	Client RequestDoer
}

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

func (*ProcessesServiceOp) List added in v0.2.0

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

List 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"`
	Links        []*Link `json:"links,omitempty"`
}

Project represents the structure of a project.

type ProjectAPIKeysOp

type ProjectAPIKeysOp struct {
	Client RequestDoer
}

ProjectAPIKeysOp handles communication with the APIKey related methods of the MongoDB Atlas API

func (*ProjectAPIKeysOp) Assign

func (s *ProjectAPIKeysOp) Assign(ctx context.Context, groupID string, keyID string, assignAPIKeyRequest *AssignAPIKey) (*Response, error)

Assign an API-KEY related to {GROUP-ID} to a the project with {API-KEY-ID}. See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/assign-one-org-apiKey-to-one-project/

func (*ProjectAPIKeysOp) Create

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

Create an API Key by the {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/create-one-apiKey-in-one-project/

func (*ProjectAPIKeysOp) List

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

List all API-KEY in the organization associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/get-all-apiKeys-in-one-project/

func (*ProjectAPIKeysOp) Unassign

func (s *ProjectAPIKeysOp) Unassign(ctx context.Context, groupID string, keyID string) (*Response, error)

Unassign an API-KEY related to {GROUP-ID} to a the project with {API-KEY-ID}. See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/delete-one-apiKey-in-one-project/

type ProjectAPIKeysService

type ProjectAPIKeysService interface {
	List(context.Context, string, *ListOptions) ([]APIKey, *Response, error)
	Create(context.Context, string, *APIKeyInput) (*APIKey, *Response, error)
	Assign(context.Context, string, string, *AssignAPIKey) (*Response, error)
	Unassign(context.Context, string, string) (*Response, error)
}

ProjectAPIKeysService is an interface for interfacing with the APIKeys endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/apiKeys/#organization-api-keys-on-projects-endpoints

type ProjectIPWhitelist

type ProjectIPWhitelist struct {
	GroupID          string `json:"groupId,omitempty"`          // The unique identifier for the project for which you want to update one or more whitelist entries.
	AwsSecurityGroup string `json:"awsSecurityGroup,omitempty"` // ID of the whitelisted AWS security group to update. Mutually exclusive with cidrBlock and ipAddress.
	CIDRBlock        string `json:"cidrBlock,omitempty"`        // Whitelist entry in Classless Inter-Domain Routing (CIDR) notation to update. Mutually exclusive with awsSecurityGroup and ipAddress.
	IPAddress        string `json:"ipAddress,omitempty"`        // Whitelisted IP address to update. Mutually exclusive with awsSecurityGroup and cidrBlock.
	Comment          string `json:"comment,omitempty"`          // Optional The comment associated with the whitelist entry. Specify an empty string "" to delete the comment associated to an IP address.
	DeleteAfterDate  string `json:"deleteAfterDate,omitempty"`  // Optional The ISO-8601-formatted UTC date after which Atlas removes the entry from the whitelist. The specified date must be in the future and within one week of the time you make the API request. To update a temporary whitelist entry to be permanent, set the value of this field to null
}

ProjectIPWhitelist represents MongoDB project's IP whitelist.

type ProjectIPWhitelistService

ProjectIPWhitelistService is an interface for interfacing with the Project IP Whitelist endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/whitelist/

type ProjectIPWhitelistServiceOp

type ProjectIPWhitelistServiceOp struct {
	Client RequestDoer
}

ProjectIPWhitelistServiceOp handles communication with the ProjectIPWhitelist related methods of the MongoDB Atlas API

func (*ProjectIPWhitelistServiceOp) Create

func (s *ProjectIPWhitelistServiceOp) Create(ctx context.Context, groupID string, createRequest []*ProjectIPWhitelist) ([]ProjectIPWhitelist, *Response, error)

Create adds one or more whitelist entries to the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/

func (*ProjectIPWhitelistServiceOp) Delete

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

Delete the whitelist entry specified to {WHITELIST-ENTRY} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/whitelist-delete-one/

func (*ProjectIPWhitelistServiceOp) Get

func (s *ProjectIPWhitelistServiceOp) Get(ctx context.Context, groupID string, whiteListEntry string) (*ProjectIPWhitelist, *Response, error)

Get gets the whitelist entry specified to {WHITELIST-ENTRY} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/whitelist-get-one-entry/

func (*ProjectIPWhitelistServiceOp) List

List all whitelist entries in the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/whitelist-get-all/

func (*ProjectIPWhitelistServiceOp) Update

func (s *ProjectIPWhitelistServiceOp) Update(ctx context.Context, groupID string, updateRequest []*ProjectIPWhitelist) ([]ProjectIPWhitelist, *Response, error)

Update one or more whitelist entries in the project associated to {GROUP-ID} See more: https://docs.atlas.mongodb.com/reference/api/whitelist-update-one/

type ProjectTeam added in v0.1.2

type ProjectTeam struct {
	TeamID    string   `json:"teamId,omitempty"`
	RoleNames []string `json:"roleNames,omitempty"`
}

ProjectTeam reperesents the kind of role that has the team

type Projects

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

Projects represents a array of project

type ProjectsService

type ProjectsService interface {
	GetAllProjects(context.Context, *ListOptions) (*Projects, *Response, error)
	GetOneProject(context.Context, string) (*Project, *Response, error)
	GetOneProjectByName(context.Context, string) (*Project, *Response, error)
	Create(context.Context, *Project) (*Project, *Response, error)
	Delete(context.Context, string) (*Response, error)
	GetProjectTeamsAssigned(context.Context, string) (*TeamsAssigned, *Response, error)
	AddTeamsToProject(context.Context, string, []*ProjectTeam) (*TeamsAssigned, *Response, error)
}

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

type ProjectsServiceOp

type ProjectsServiceOp struct {
	Client RequestDoer
}

ProjectsServiceOp handles communication with the Projects related methods of the MongoDB Atlas API

func (*ProjectsServiceOp) AddTeamsToProject

func (s *ProjectsServiceOp) AddTeamsToProject(ctx context.Context, projectID string, createRequest []*ProjectTeam) (*TeamsAssigned, *Response, error)

AddTeamsToProject adds teams to a project See more: https://docs.atlas.mongodb.com/reference/api/project-add-team/

func (*ProjectsServiceOp) Create

func (s *ProjectsServiceOp) Create(ctx context.Context, createRequest *Project) (*Project, *Response, error)

Create creates a project. See more: https://docs.atlas.mongodb.com/reference/api/project-create-one/

func (*ProjectsServiceOp) Delete

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

Delete deletes a project. See more: https://docs.atlas.mongodb.com/reference/api/project-delete-one/

func (*ProjectsServiceOp) GetAllProjects

func (s *ProjectsServiceOp) GetAllProjects(ctx context.Context, listOptions *ListOptions) (*Projects, *Response, error)

GetAllProjects gets all project. See more: https://docs.atlas.mongodb.com/reference/api/project-get-all/

func (*ProjectsServiceOp) GetOneProject

func (s *ProjectsServiceOp) GetOneProject(ctx context.Context, projectID string) (*Project, *Response, error)

GetOneProject gets a single project. See more: https://docs.atlas.mongodb.com/reference/api/project-get-one/

func (*ProjectsServiceOp) GetOneProjectByName

func (s *ProjectsServiceOp) GetOneProjectByName(ctx context.Context, projectName string) (*Project, *Response, error)

GetOneProjectByName gets a single project by its name. See more: https://docs.atlas.mongodb.com/reference/api/project-get-one-by-name/

func (*ProjectsServiceOp) GetProjectTeamsAssigned

func (s *ProjectsServiceOp) GetProjectTeamsAssigned(ctx context.Context, projectID string) (*TeamsAssigned, *Response, error)

GetProjectTeamsAssigned gets all the teams assigned to a project. See more: https://docs.atlas.mongodb.com/reference/api/project-get-teams/

type ProviderSettings

type ProviderSettings struct {
	BackingProviderName string       `json:"backingProviderName,omitempty"`
	DiskIOPS            *int64       `json:"diskIOPS,omitempty"`
	DiskTypeName        string       `json:"diskTypeName,omitempty"`
	EncryptEBSVolume    *bool        `json:"encryptEBSVolume,omitempty"`
	InstanceSizeName    string       `json:"instanceSizeName,omitempty"`
	ProviderName        string       `json:"providerName,omitempty"`
	RegionName          string       `json:"regionName,omitempty"`
	VolumeType          string       `json:"volumeType,omitempty"`
	AutoScaling         *AutoScaling `json:"autoScaling,omitempty"`
}

ProviderSettings configuration for the provisioned servers on which MongoDB runs. The available options are specific to the cloud service provider.

type RegionsConfig

type RegionsConfig struct {
	AnalyticsNodes *int64 `json:"analyticsNodes,omitempty"`
	ElectableNodes *int64 `json:"electableNodes,omitempty"`
	Priority       *int64 `json:"priority,omitempty"`
	ReadOnlyNodes  *int64 `json:"readOnlyNodes,omitempty"`
}

RegionsConfig describes the region’s priority in elections and the number and type of MongoDB nodes Atlas deploys to the region.

type ReplicationSpec

type ReplicationSpec struct {
	ID            string                   `json:"id,omitempty"`
	NumShards     *int64                   `json:"numShards,omitempty"`
	ZoneName      string                   `json:"zoneName,omitempty"`
	RegionsConfig map[string]RegionsConfig `json:"regionsConfig,omitempty"`
}

ReplicationSpec represents a configuration for cluster regions

type RequestCompletionCallback

type RequestCompletionCallback func(*http.Request, *http.Response)

RequestCompletionCallback defines the type of the request callback function

type RequestDoer added in v0.2.0

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

type Resource added in v0.1.2

type Resource struct {
	Collection string `json:"collection,omitempty"`
	Db         string `json:"db,omitempty"`
	Cluster    *bool  `json:"cluster,omitempty"`
}

A Resource describes a specific resource the Role will allow operating on.

type Response

type Response struct {
	*http.Response

	// Links that were returned with the response.
	Links []*Link `json:"links"`
}

Response is a MongoDBAtlas response. This wraps the standard http.Response returned from MongoDBAtlas API.

func (*Response) CurrentPage

func (resp *Response) CurrentPage() (int, error)

CurrentPage gets the current page for list pagination request.

func (*Response) IsLastPage

func (resp *Response) IsLastPage() bool

IsLastPage returns true if the current page is the last page

type Result

type Result struct {
	Links     []*Link  `json:"links"`
	RoleNames []string `json:"roleNames"`
	TeamID    string   `json:"teamId"`
}

Result is part og TeamsAssigned structure

type Role

type Role struct {
	RoleName       string `json:"roleName,omitempty"`
	DatabaseName   string `json:"databaseName,omitempty"`
	CollectionName string `json:"collectionName,omitempty"`
}

Role allows the user to perform particular actions on the specified database. A role on the admin database can include privileges that apply to the other databases as well.

type SnapshotPart added in v0.2.0

type SnapshotPart struct {
	ClusterID          string `json:"clusterId"`
	CompressionSetting string `json:"compressionSetting"`
	DataSizeBytes      int64  `json:"dataSizeBytes"`
	EncryptionEnabled  bool   `json:"encryptionEnabled"`
	FileSizeBytes      int64  `json:"fileSizeBytes"`
	MasterKeyUUID      string `json:"masterKeyUUID,omitempty"`
	MongodVersion      string `json:"mongodVersion"`
	StorageSizeBytes   int64  `json:"storageSizeBytes"`
}

type SnapshotReqPathParameters

type SnapshotReqPathParameters struct {
	GroupID     string `json:"groupId,omitempty"`     // The unique identifier of the project for the Atlas cluster.
	SnapshotID  string `json:"snapshotId,omitempty"`  // The unique identifier of the snapshot you want to retrieve.
	ClusterName string `json:"clusterName,omitempty"` // The name of the Atlas cluster that contains the snapshots you want to retrieve.
	JobID       string `json:"jobId,omitempty"`       //The unique identifier of the restore job to retrieve.
}

SnapshotReqPathParameters represents all the pissible parameters to make the request

type SnapshotTimestamp added in v0.2.0

type SnapshotTimestamp struct {
	Date      string `json:"date"`
	Increment int64  `json:"increment"`
}

type Team

type Team struct {
	ID        string   `json:"id,omitempty"`
	Name      string   `json:"name"`
	Usernames []string `json:"usernames,omitempty"`
}

type TeamRoles added in v0.1.2

type TeamRoles struct {
	Links     []*Link  `json:"links"`
	RoleNames []string `json:"roleNames"`
	TeamID    string   `json:"teamId"`
}

type TeamUpdateRoles added in v0.1.2

type TeamUpdateRoles struct {
	RoleNames []string `json:"roleNames"`
}

type TeamUpdateRolesResponse added in v0.1.2

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

type TeamsAssigned

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

TeamsAssigned represents the one team assigned to the project.

type TeamsResponse added in v0.1.2

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

Teams represents a array of project

type TeamsService added in v0.1.2

type TeamsService interface {
	List(context.Context, string, *ListOptions) ([]Team, *Response, error)
	Get(context.Context, string, string) (*Team, *Response, error)
	GetOneTeamByName(context.Context, string, string) (*Team, *Response, error)
	GetTeamUsersAssigned(context.Context, string, string) ([]AtlasUser, *Response, error)
	Create(context.Context, string, *Team) (*Team, *Response, error)
	Rename(context.Context, string, string, string) (*Team, *Response, error)
	UpdateTeamRoles(context.Context, string, string, *TeamUpdateRoles) ([]TeamRoles, *Response, error)
	AddUsersToTeam(context.Context, string, string, []string) ([]AtlasUser, *Response, error)
	RemoveUserToTeam(context.Context, string, string, string) (*Response, error)
	RemoveTeamFromOrganization(context.Context, string, string) (*Response, error)
	RemoveTeamFromProject(context.Context, string, string) (*Response, error)
}

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

type TeamsServiceOp added in v0.1.2

type TeamsServiceOp struct {
	Client RequestDoer
}

TeamsServiceOp handles communication with the Teams related methods of the MongoDB Atlas API

func (*TeamsServiceOp) AddUsersToTeam added in v0.1.3

func (s *TeamsServiceOp) AddUsersToTeam(ctx context.Context, orgID, teamID string, usersID []string) ([]AtlasUser, *Response, error)

AddUsersToTeam adds a users from the organization associated with {ORG-ID} to the team with ID {TEAM-ID}. See more: https://docs.atlas.mongodb.com/reference/api/teams-add-user/

func (*TeamsServiceOp) Create added in v0.1.2

func (s *TeamsServiceOp) Create(ctx context.Context, orgID string, createRequest *Team) (*Team, *Response, error)

Create creates a team. See more: https://docs.atlas.mongodb.com/reference/api/teams-create-one/

func (*TeamsServiceOp) Get added in v0.1.2

func (s *TeamsServiceOp) Get(ctx context.Context, orgID string, teamID string) (*Team, *Response, error)

Get gets a single team in the organization by team ID. See more: https://docs.atlas.mongodb.com/reference/api/teams-get-one-by-id/

func (*TeamsServiceOp) GetOneTeamByName added in v0.1.2

func (s *TeamsServiceOp) GetOneTeamByName(ctx context.Context, orgID, teamName string) (*Team, *Response, error)

GetOneTeamByName gets a single project by its name. See more: https://docs.atlas.mongodb.com/reference/api/project-get-one-by-name/

func (*TeamsServiceOp) GetTeamUsersAssigned added in v0.1.2

func (s *TeamsServiceOp) GetTeamUsersAssigned(ctx context.Context, orgID, teamID string) ([]AtlasUser, *Response, error)

GetTeamUsersAssigned gets all the users assigned to a team. See more: https://docs.atlas.mongodb.com/reference/api/teams-get-all-users/

func (*TeamsServiceOp) List added in v0.1.2

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

GetAllTeams gets all teams. See more: https://docs.atlas.mongodb.com/reference/api/project-get-all/

func (*TeamsServiceOp) RemoveTeamFromOrganization added in v0.1.2

func (s *TeamsServiceOp) RemoveTeamFromOrganization(ctx context.Context, orgID, teamID string) (*Response, error)

RemoveTeamFromOrganization deletes the team with ID {TEAM-ID} from the organization specified to {ORG-ID}. See more: https://docs.atlas.mongodb.com/reference/api/teams-delete-one/

func (*TeamsServiceOp) RemoveTeamFromProject added in v0.1.2

func (s *TeamsServiceOp) RemoveTeamFromProject(ctx context.Context, groupID, teamID string) (*Response, error)

RemoveTeamFromProject removes the specified team from the specified project. See more: https://docs.atlas.mongodb.com/reference/api/teams-remove-from-project/

func (*TeamsServiceOp) RemoveUserToTeam added in v0.1.2

func (s *TeamsServiceOp) RemoveUserToTeam(ctx context.Context, orgID, teamID, userID string) (*Response, error)

RemoveUserToTeam removes the specified user from the specified team. See more: https://docs.atlas.mongodb.com/reference/api/teams-remove-user/

func (*TeamsServiceOp) Rename added in v0.1.2

func (s *TeamsServiceOp) Rename(ctx context.Context, orgID, teamID, teamName string) (*Team, *Response, error)

RenameTeam renames a team See more: https://docs.atlas.mongodb.com/reference/api/teams-rename-one/

func (*TeamsServiceOp) UpdateTeamRoles added in v0.1.2

func (s *TeamsServiceOp) UpdateTeamRoles(ctx context.Context, orgID string, teamID string, updateTeamRolesRequest *TeamUpdateRoles) ([]TeamRoles, *Response, error)

UpdateTeamRoles Update the roles of a team in an Atlas project. See more: https://docs.atlas.mongodb.com/reference/api/teams-update-roles/

type UserCertificate added in v0.2.0

type UserCertificate struct {
	Username              string `json:"username,omitempty"`              // Username of the database user to create a certificate for.
	MonthsUntilExpiration int    `json:"monthsUntilExpiration,omitempty"` // A number of months that the created certificate is valid for before expiry, up to 24 months.default 3.
	Certificate           string `json:"certificate,omitempty"`

	ID        *int64 `json:"_id,omitempty"`       // Serial number of this certificate.
	CreatedAt string `json:"createdAt,omitempty"` // Timestamp in ISO 8601 date and time format in UTC when Atlas created this X.509 certificate.
	GroupID   string `json:"groupId,omitempty"`   // Unique identifier of the Atlas project to which this certificate belongs.
	NotAfter  string `json:"notAfter,omitempty"`  // Timestamp in ISO 8601 date and time format in UTC when this certificate expires.
	Subject   string `json:"subject,omitempty"`   // Fully distinguished name of the database user to which this certificate belongs. To learn more, see RFC 2253.
}

UserCertificate represents an X.509 Certificate for a User.

type UserCertificates added in v0.2.0

type UserCertificates struct {
	Links      []*Link           `json:"links"`      // One or more links to sub-resources and/or related resources.
	Results    []UserCertificate `json:"results"`    // Array of objects where each details one unexpired database user certificate.
	TotalCount int               `json:"totalCount"` // Total number of unexpired certificates returned in this response.
}

UserCertificates is Array of objects where each details one unexpired database user certificate.

type UserSecurity added in v0.2.0

type UserSecurity struct {
	CustomerX509 CustomerX509 `json:"customerX509,omitempty"` // CustomerX509 represents Customer-managed X.509 configuration for an Atlas project.
}

UserSecurity represents the wrapper CustomerX509 struct

type WhitelistAPIKey added in v0.0.2

type WhitelistAPIKey struct {
	CidrBlock       string  `json:"cidrBlock,omitempty"`       // CIDR-notated range of whitelisted 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 whitelist.
	IPAddress       string  `json:"ipAddress,omitempty"`       // Whitelisted IP address.
	LastUsed        string  `json:"lastUsed,omitempty"`        // Date of the most recent request that originated from this IP address. This field only appears if at least one request has originated from this IP address, and is only updated when a whitelisted 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.}
}

WhitelistAPIKey represents a Whitelist API key.

type WhitelistAPIKeys added in v0.0.2

type WhitelistAPIKeys struct {
	Results    []*WhitelistAPIKey `json:"results,omitempty"`    // Includes one WhitelistAPIKey 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.
}

WhitelistAPIKeys represents all Whitelist API keys.

type WhitelistAPIKeysReq added in v0.0.2

type WhitelistAPIKeysReq struct {
	IPAddress string `json:"ipAddress,omitempty"` // IP address to be added to the whitelist for the API key.
	CidrBlock string `json:"cidrBlock,omitempty"` // Whitelist entry in CIDR notation to be added for the API key.
}

WhitelistAPIKeysReq represents the request to the mehtod create

type WhitelistAPIKeysService added in v0.0.2

WhitelistAPIKeysService is an interface for interfacing with the Whitelist API Keys endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/apiKeys/#organization-api-key-endpoints

type WhitelistAPIKeysServiceOp added in v0.0.2

type WhitelistAPIKeysServiceOp struct {
	Client RequestDoer
}

WhitelistAPIKeysServiceOp handles communication with the Whitelist API keys related methods of the MongoDB Atlas API

func (*WhitelistAPIKeysServiceOp) Create added in v0.0.2

func (s *WhitelistAPIKeysServiceOp) Create(ctx context.Context, orgID string, apiKeyID string, createRequest []*WhitelistAPIKeysReq) (*WhitelistAPIKeys, *Response, error)

Create a submit a POST request containing ipAddress or cidrBlock values which are not already present in the whitelist, Atlas adds those entries to the list of existing entries in the whitelist. See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-org-whitelist-create/

func (*WhitelistAPIKeysServiceOp) Delete added in v0.0.2

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

Delete deletes the Whitelist API keys. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-delete-one/

func (*WhitelistAPIKeysServiceOp) Get added in v0.0.2

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

Get gets the Whitelist API keys. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-get-one/

func (*WhitelistAPIKeysServiceOp) List added in v0.0.2

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

List gets all Whitelist API keys. See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-org-whitelist-get-all/

type X509AuthDBUsersService added in v0.2.0

type X509AuthDBUsersService interface {
	CreateUserCertificate(context.Context, string, string, int) (*UserCertificate, *Response, error)
	GetUserCertificates(context.Context, string, string) ([]UserCertificate, *Response, error)
	SaveConfiguration(context.Context, string, *CustomerX509) (*CustomerX509, *Response, error)
	GetCurrentX509Conf(context.Context, string) (*CustomerX509, *Response, error)
	DisableCustomerX509(context.Context, string) (*Response, error)
}

X509AuthDBUsersService is an interface for interfacing with the x509 Authentication Database Users. See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration/

type X509AuthDBUsersServiceOp added in v0.2.0

type X509AuthDBUsersServiceOp struct {
	Client RequestDoer
}

X509AuthDBUsersServiceOp handles communication with the X509AuthDBUsers related methods of the MongoDB Atlas API

func (*X509AuthDBUsersServiceOp) CreateUserCertificate added in v0.2.0

func (s *X509AuthDBUsersServiceOp) CreateUserCertificate(ctx context.Context, groupID, username string, monthsUntilExpiration int) (*UserCertificate, *Response, error)

CreateUserCertificate generates an Atlas-managed X.509 certificate for a MongoDB user that authenticates using X.509 certificates. See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-create-certificate/

func (*X509AuthDBUsersServiceOp) DisableCustomerX509 added in v0.2.0

func (s *X509AuthDBUsersServiceOp) DisableCustomerX509(ctx context.Context, groupID string) (*Response, error)

DisableCustomerX509 clears customer-managed X.509 settings on a project. This disables customer-managed X.509. See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-disable-advanced/

func (*X509AuthDBUsersServiceOp) GetCurrentX509Conf added in v0.2.0

func (s *X509AuthDBUsersServiceOp) GetCurrentX509Conf(ctx context.Context, groupID string) (*CustomerX509, *Response, error)

GetCurrentX509Conf gets the current customer-managed X.509 configuration details for an Atlas project. See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-get-current/

func (*X509AuthDBUsersServiceOp) GetUserCertificates added in v0.2.0

func (s *X509AuthDBUsersServiceOp) GetUserCertificates(ctx context.Context, groupID, username string) ([]UserCertificate, *Response, error)

GetUserCertificates gets a list of all Atlas-managed, unexpired certificates for a user. See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-get-certificates/

func (*X509AuthDBUsersServiceOp) SaveConfiguration added in v0.2.0

func (s *X509AuthDBUsersServiceOp) SaveConfiguration(ctx context.Context, groupID string, customerX509 *CustomerX509) (*CustomerX509, *Response, error)

SaveConfiguration saves a customer-managed X.509 configuration for an Atlas project. See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-save/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL