opsmngr

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package opsmngr provides a client for using the MongoDB Ops Manager and Cloud Manager API.

Usage:

import "go.mongodb.org/ops-manager/opsmngr"

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

client := opsmngr.NewClient(nil)

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

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

Authentication

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

import (
	"context"
	"log"

	"github.com/mongodb-forks/digest"
	"go.mongodb.org/ops-manager/opsmngr"
)

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

	// Note: If no Base URL is set the client is set to work with Cloud Manager by default
	clientops := opsmngr.SetBaseURL("https://opsmanagerurl/" + opsmngr.APIPublicV1Path)
	client, err := opsmngr.New(tc, clientops)
	orgs, _, err := client.Organizations.List(context.Background(), nil)
}

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

To get your API Keys please refer to our docs for:

- Ops Manager: https://docs.opsmanager.mongodb.com/current/tutorial/configure-public-api-access/,

- Cloud Manager: https://docs.cloudmanager.mongodb.com/tutorial/manage-programmatic-api-keys/.

Index

Constants

View Source
const (
	DefaultBaseURL = "https://cloud.mongodb.com/"

	// ClientVersion of the current API client. Should be set to the next version planned to be released.
	ClientVersion = "0.56.0"
)

Variables

This section is empty.

Functions

func DoRequestWithClient added in v0.56.0

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

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

APIKey represents MongoDB API Key.

type APIKeyInput added in v0.55.1

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

APIKeyInput represents MongoDB API key input request for Create.

type APIKeysResponse added in v0.23.0

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

APIKeysResponse is the response from the APIKeysService.List.

type APIKeysService added in v0.56.0

APIKeysService is an interface for interfacing with the APIKeys.

type APIKeysServiceOp added in v0.23.0

type APIKeysServiceOp service

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

func (*APIKeysServiceOp) Create added in v0.23.0

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.opsmanager.mongodb.com/current/reference/api/api-keys/org/create-one-org-api-key/

func (*APIKeysServiceOp) Delete added in v0.23.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/org/delete-one-api-key/

func (*APIKeysServiceOp) Get added in v0.23.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/org/get-one-org-api-key/

func (*APIKeysServiceOp) List added in v0.23.0

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.opsmanager.mongodb.com/current/reference/api/api-keys/org/get-all-org-api-keys/

func (*APIKeysServiceOp) Update added in v0.23.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/org/update-one-org-api-key/

type AccessListAPIKey added in v0.55.2

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

AccessListAPIKey represents a AccessList API key.

type AccessListAPIKeys added in v0.55.1

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

AccessListAPIKeys represents all AccessList API keys.

type AccessListAPIKeysReq added in v0.55.1

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

AccessListAPIKeysReq represents the request to the method create.

type AccessListAPIKeysService added in v0.56.0

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

type AccessListAPIKeysServiceOp added in v0.23.0

type AccessListAPIKeysServiceOp service

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

func (*AccessListAPIKeysServiceOp) Create added in v0.23.0

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

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

func (*AccessListAPIKeysServiceOp) Delete added in v0.23.0

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

Delete deletes the AccessList API keys.

func (*AccessListAPIKeysServiceOp) Get added in v0.23.0

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

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

func (*AccessListAPIKeysServiceOp) List added in v0.23.0

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

List gets all AccessList API keys.

type AcknowledgeRequest added in v0.48.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.
}

AcknowledgeRequest contains the request Body Parameters.

type AdminBackupConfig added in v0.10.0

type AdminBackupConfig struct {
	ID                   string   `json:"id,omitempty"`
	URI                  string   `json:"uri,omitempty"`
	WriteConcern         string   `json:"writeConcern,omitempty"`
	Labels               []string `json:"labels,omitempty"`
	SSL                  *bool    `json:"ssl,omitempty"`
	AssignmentEnabled    *bool    `json:"assignmentEnabled,omitempty"`
	EncryptedCredentials *bool    `json:"encryptedCredentials,omitempty"`
	UsedSize             int64    `json:"usedSize,omitempty"`
}

AdminBackupConfig contains the common fields of backup administrator structs.

type Agent

type Agent struct {
	TypeName  string  `json:"typeName"`
	Hostname  string  `json:"hostname"`
	ConfCount int64   `json:"confCount"`
	LastConf  string  `json:"lastConf"`
	StateName string  `json:"stateName"`
	PingCount int64   `json:"pingCount"`
	IsManaged bool    `json:"isManaged"`
	LastPing  string  `json:"lastPing"`
	Tag       *string `json:"tag"`
}

Agent represents an Ops Manager agent.

type AgentAPIKey

type AgentAPIKey struct {
	ID            string  `json:"_id"` //nolint:tagliatelle // correct from API
	Key           string  `json:"key"`
	Desc          string  `json:"desc"`
	CreatedTime   int64   `json:"createdTime"`
	CreatedUserID *string `json:"createdUserId"`
	CreatedIPAddr *string `json:"createdIpAddr"`
	CreatedBy     string  `json:"createdBy"`
}

AgentAPIKey defines the structure for an Agent API key.

type AgentAPIKeysRequest

type AgentAPIKeysRequest struct {
	Desc string `json:"desc"`
}

AgentAPIKeysRequest a creation request for Agent API keys.

type AgentConfig added in v0.6.0

type AgentConfig struct {
	LogPath                 string                  `json:"logPath,omitempty"`
	LogPathWindows          string                  `json:"logPathWindows,omitempty"`
	LogRotate               *LogRotate              `json:"logRotate,omitempty"`
	ConfigOverrides         *map[string]string      `json:"configOverrides,omitempty"`
	HasPassword             *bool                   `json:"hasPassword,omitempty"`
	Username                string                  `json:"username,omitempty"`
	Password                string                  `json:"password,omitempty"`
	SSLPEMKeyFile           string                  `json:"sslPEMKeyFile,omitempty"`        //nolint:tagliatelle // correct from API
	SSLPEMKeyFileWindows    string                  `json:"sslPEMKeyFileWindows,omitempty"` //nolint:tagliatelle // correct from API
	SSLPEMKeyPwd            string                  `json:"sslPEMKeyPwd,omitempty"`         //nolint:tagliatelle // correct from API
	KerberosPrincipal       string                  `json:"kerberosPrincipal,omitempty"`
	KerberosKeytab          string                  `json:"kerberosKeytab,omitempty"`
	KerberosWindowsUsername string                  `json:"kerberosWindowsUsername,omitempty"`
	KerberosWindowsPassword string                  `json:"kerberosWindowsPassword,omitempty"`
	HasSslPEMKeyPwd         *bool                   `json:"hasSslPEMKeyPwd,omitempty"` //nolint:tagliatelle // correct from API
	LDAPGroupDN             string                  `json:"ldapGroupDN,omitempty"`     //nolint:tagliatelle // correct from API
	URLs                    *map[string]interface{} `json:"urls,omitempty"`            //nolint:tagliatelle // correct from API
}

type AgentVersion added in v0.10.0

type AgentVersion struct {
	Address             string `json:"address"`
	ConfCount           int    `json:"confCount"`
	Hostname            string `json:"hostname"`
	HostnameShort       string `json:"hostnameShort"`
	IsManaged           bool   `json:"isManaged"`
	IsModule            bool   `json:"isModule"`
	IsPrimary           bool   `json:"isPrimary"`
	IsVersionOld        bool   `json:"isVersionOld"`
	IsVersionDeprecated bool   `json:"isVersionDeprecated"`
	LastConf            int64  `json:"lastConf"`
	LastPing            int64  `json:"lastPing"`
	MsSinceLastConf     int64  `json:"msSinceLastConf"`
	NumProcess          int    `json:"numProcess"`
	PingCount           int    `json:"pingCount"`
	PingState           string `json:"pingState"`
	TagName             string `json:"tagName"`
	Version             string `json:"version"`
}

type AgentVersions added in v0.10.0

type AgentVersions struct {
	Count                       int             `json:"count"`
	Entries                     []*AgentVersion `json:"entries"`
	IsAnyAgentNotManaged        bool            `json:"isAnyAgentNotManaged"`
	IsAnyAgentVersionDeprecated bool            `json:"isAnyAgentVersionDeprecated"`
	IsAnyAgentVersionOld        bool            `json:"isAnyAgentVersionOld"`
	Links                       []*Link         `json:"links"`
	MinimumAgentVersionDetected string          `json:"minimumAgentVersionDetected"`
	MinimumVersion              string          `json:"minimumVersion"`
}

AgentVersions is a set of available agents and agent versions for a project.

type Agents

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

Agents is a paginated collection of Agent.

type AgentsService

type AgentsService interface {
	ListAgentLinks(context.Context, string) (*Agents, *Response, error)
	ListAgentsByType(context.Context, string, string, *ListOptions) (*Agents, *Response, error)
	CreateAgentAPIKey(context.Context, string, *AgentAPIKeysRequest) (*AgentAPIKey, *Response, error)
	ListAgentAPIKeys(context.Context, string) ([]*AgentAPIKey, *Response, error)
	DeleteAgentAPIKey(context.Context, string, string) (*Response, error)
	GlobalVersions(context.Context) (*SoftwareVersions, *Response, error)
	ProjectVersions(context.Context, string) (*AgentVersions, *Response, error)
}

AgentsService provides access to the agent related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/agents/

type AgentsServiceOp

type AgentsServiceOp service

AgentsServiceOp provides an implementation of the AgentsService interface.

func (*AgentsServiceOp) CreateAgentAPIKey added in v0.5.0

func (s *AgentsServiceOp) CreateAgentAPIKey(ctx context.Context, projectID string, agent *AgentAPIKeysRequest) (*AgentAPIKey, *Response, error)

CreateAgentAPIKey creates a new agent API key.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/agentapikeys/create-one-agent-api-key/

func (*AgentsServiceOp) DeleteAgentAPIKey added in v0.5.0

func (s *AgentsServiceOp) DeleteAgentAPIKey(ctx context.Context, projectID, agentAPIKey string) (*Response, error)

DeleteAgentAPIKey removes an agent API key from a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/agentapikeys/delete-one-agent-api-key/

func (*AgentsServiceOp) GlobalVersions added in v0.10.0

func (s *AgentsServiceOp) GlobalVersions(ctx context.Context) (*SoftwareVersions, *Response, error)

GlobalVersions returns the supported versions of different software components supported by the Ops Manager installation.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/agents/get-agent-versions-global/

func (*AgentsServiceOp) ListAgentAPIKeys added in v0.5.0

func (s *AgentsServiceOp) ListAgentAPIKeys(ctx context.Context, projectID string) ([]*AgentAPIKey, *Response, error)

ListAgentAPIKeys lists agent API keys.

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

func (s *AgentsServiceOp) ListAgentLinks(ctx context.Context, groupID string) (*Agents, *Response, error)

ListAgentLinks gets links to monitoring, backup, and automation agent resources for a project.

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

func (*AgentsServiceOp) ListAgentsByType added in v0.5.0

func (s *AgentsServiceOp) ListAgentsByType(ctx context.Context, groupID, agentType string, listOptions *ListOptions) (*Agents, *Response, error)

ListAgentsByType gets agents of a specified type (i.e. Monitoring, Backup, or Automation) for a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/agents-get-by-type/

func (*AgentsServiceOp) ProjectVersions added in v0.10.0

func (s *AgentsServiceOp) ProjectVersions(ctx context.Context, groupID string) (*AgentVersions, *Response, error)

ProjectVersions returns a list of versions of all MongoDB Agents, in the provided project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/agents/get-agent-versions-per-project/

type Alert added in v0.48.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"`                 //nolint:misspell // 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.55.1

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

AlertConfiguration represents MongoDB Alert Configuration.

type AlertConfigurationsResponse added in v0.56.0

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

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

type AlertConfigurationsServiceOp added in v0.23.0

type AlertConfigurationsServiceOp service

AlertConfigurationsServiceOp handles communication with the AlertConfiguration related methods.

func (*AlertConfigurationsServiceOp) Create added in v0.23.0

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

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

func (*AlertConfigurationsServiceOp) Delete added in v0.23.0

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.opsmanager.mongodb.com/current/reference/api/alert-configurations-delete-config/

func (*AlertConfigurationsServiceOp) EnableAnAlertConfig added in v0.23.0

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.opsmanager.mongodb.com/current/reference/api/alert-configurations-enable-disable-config/

func (*AlertConfigurationsServiceOp) GetAnAlertConfig added in v0.23.0

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.opsmanager.mongodb.com/current/reference/api/alert-configurations-get-config/

func (*AlertConfigurationsServiceOp) GetOpenAlertsConfig added in v0.23.0

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.opsmanager.mongodb.com/current/reference/api/alert-configurations-get-open-alerts/

func (*AlertConfigurationsServiceOp) List added in v0.23.0

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

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

func (*AlertConfigurationsServiceOp) ListMatcherFields added in v0.23.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.opsmanager.mongodb.com/current/reference/api/alert-configurations-get-matchers-field-names/

func (*AlertConfigurationsServiceOp) Update added in v0.23.0

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.opsmanager.mongodb.com/current/reference/api/alert-configurations-update-config/

type AlertsListOptions added in v0.48.0

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

AlertsListOptions contains the list of options for Alerts.

type AlertsResponse added in v0.48.0

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

AlertsResponse is the response from the AlertService.List.

type AlertsService added in v0.56.0

AlertsService is an interface for interfacing with the Alerts.

type AlertsServiceOp added in v0.23.0

type AlertsServiceOp service

AlertsServiceOp provides an implementation of AlertsService.

func (*AlertsServiceOp) Acknowledge added in v0.23.0

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

Acknowledge allows to acknowledge an alert.

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

func (*AlertsServiceOp) Get added in v0.23.0

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

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

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

func (*AlertsServiceOp) List added in v0.23.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.opsmanager.mongodb.com/current/reference/api/alerts-get-all-alerts/

type AllClustersCluster

type AllClustersCluster struct {
	ClusterID     string   `json:"clusterId"`
	Name          string   `json:"name"`
	Type          string   `json:"type"`
	Availability  string   `json:"availability"`
	Versions      []string `json:"versions"`
	BackupEnabled bool     `json:"backupEnabled"`
	AuthEnabled   bool     `json:"authEnabled"`
	SSLEnabled    bool     `json:"sslEnabled"`
	AlertCount    int64    `json:"alertCount"`
	DataSizeBytes int64    `json:"dataSizeBytes"`
	NodeCount     int64    `json:"nodeCount"`
}

AllClustersCluster represents MongoDB cluster.

type AllClustersProject

type AllClustersProject struct {
	GroupName string               `json:"groupName"`
	OrgName   string               `json:"orgName"`
	PlanType  string               `json:"planType,omitempty"`
	GroupID   string               `json:"groupId"`
	OrgID     string               `json:"orgId"`
	Tags      []string             `json:"tags"`
	Clusters  []AllClustersCluster `json:"clusters"`
}

type AllClustersProjects

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

type ArgError added in v0.56.0

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

func NewArgError(arg, reason string) *ArgError

NewArgError creates an InputError.

func (*ArgError) Error added in v0.56.0

func (e *ArgError) Error() string

type Args26

type Args26 struct {
	AuditLog           *AuditLog               `json:"auditLog,omitempty"` // AuditLog configuration for audit logs
	BasisTech          *map[string]interface{} `json:"basisTech,omitempty"`
	NET                Net                     `json:"net"` // NET configuration for db connection (ports)
	OperationProfiling *map[string]interface{} `json:"operationProfiling,omitempty"`
	ProcessManagement  *map[string]interface{} `json:"processManagement,omitempty"`
	Replication        *Replication            `json:"replication,omitempty"` // Replication configuration for ReplicaSets, omit this field if setting Sharding
	SetParameter       *map[string]interface{} `json:"setParameter,omitempty"`
	Security           *map[string]interface{} `json:"security,omitempty"`
	Sharding           *Sharding               `json:"sharding,omitempty"` // Replication configuration for sharded clusters, omit this field if setting Replication
	Storage            *Storage                `json:"storage,omitempty"`  // Storage configuration for dbpath, config servers don't define this
	SNMP               *map[string]interface{} `json:"snmp,omitempty"`
	SystemLog          SystemLog               `json:"systemLog"` // SystemLog configuration for the dblog
}

Args26 part of the internal Process struct.

type AssignAPIKey added in v0.55.4

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

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

type AuditLog added in v0.7.0

type AuditLog struct {
	Destination string `json:"destination,omitempty"`
	Path        string `json:"path,omitempty"`
	Format      string `json:"format,omitempty"`
	Filter      string `json:"filter,omitempty"`
}

AuditLog part of the internal Process struct.

type Auth

type Auth struct {
	AuthoritativeSet         bool                  `json:"authoritativeSet"`             // AuthoritativeSet indicates if the MongoDBUsers should be synced with the current list of UsersWanted
	AutoAuthMechanism        string                `json:"autoAuthMechanism"`            // AutoAuthMechanism is the currently active agent authentication mechanism. This is a read only field
	AutoAuthMechanisms       []string              `json:"autoAuthMechanisms,omitempty"` // AutoAuthMechanisms is a list of auth mechanisms the Automation Agent is able to use
	AutoAuthRestrictions     []interface{}         `json:"autoAuthRestrictions"`
	AutoKerberosKeytabPath   string                `json:"autoKerberosKeytabPath,omitempty"`
	AutoLdapGroupDN          string                `json:"autoLdapGroupDN,omitempty"`          //nolint:tagliatelle // AutoLdapGroupDN follows go convention while tag is correct from API
	AutoPwd                  string                `json:"autoPwd,omitempty"`                  // AutoPwd is a required field when going from `Disabled=false` to `Disabled=true`
	AutoUser                 string                `json:"autoUser,omitempty"`                 // AutoUser is the MongoDB Automation Agent user, when x509 is enabled, it should be set to the subject of the AA's certificate
	DeploymentAuthMechanisms []string              `json:"deploymentAuthMechanisms,omitempty"` // DeploymentAuthMechanisms is a list of possible auth mechanisms that can be used within deployments
	Disabled                 bool                  `json:"disabled"`                           // Disabled indicates if auth is disabled
	Key                      string                `json:"key,omitempty"`                      // Key is the contents of the Keyfile, the automation agent will ensure this a Keyfile with these contents exists at the `Keyfile` path
	Keyfile                  string                `json:"keyfile,omitempty"`                  // Keyfile is the path to a keyfile with read & write permissions. It is a required field if `Disabled=false`
	KeyfileWindows           string                `json:"keyfileWindows,omitempty"`           // KeyfileWindows is required if `Disabled=false` even if the value is not used.
	NewAutoPwd               string                `json:"newAutoPwd,omitempty"`               // NewAutoPwd is a new password that the Automation uses when connecting to an instance.
	UsersDeleted             []*MongoDBDeletedUser `json:"usersDeleted"`                       // UsersDeleted are objects that define the authenticated users to be deleted from specified databases or from all databases
	UsersWanted              []*MongoDBUser        `json:"usersWanted"`                        // UsersWanted is a list which contains the desired users at the project level.
}

Auth authentication config.

See: https://docs.opsmanager.mongodb.com/current/reference/api/automation-config/automation-config-parameters/#authentication

type AuthenticationRestriction added in v0.22.0

type AuthenticationRestriction struct {
	ClientSource  []string `json:"clientSource"`
	ServerAddress []string `json:"serverAddress"`
}

AuthenticationRestriction of a database user.

type AutomationConfig

type AutomationConfig struct {
	AgentVersion              *map[string]interface{}   `json:"agentVersion,omitempty"`
	AtlasProxies              *[]interface{}            `json:"atlasProxies,omitempty"`
	AtlasUISes                []*map[string]interface{} `json:"atlasUISes,omitempty"` //nolint:tagliatelle // correct from API
	Filebeat                  *map[string]interface{}   `json:"filebeat,omitempty"`
	Auth                      Auth                      `json:"auth"`
	BackupVersions            []*ConfigVersion          `json:"backupVersions"`
	Balancer                  *map[string]interface{}   `json:"balancer"`
	ClusterWideConfigurations *map[string]interface{}   `json:"clusterWideConfigurations,omitempty"`
	CPSModules                []*map[string]interface{} `json:"cpsModules"`
	DBCheckModules            []*map[string]interface{} `json:"dbCheckModules,omitempty"`
	IndexConfigs              []*IndexConfig            `json:"indexConfigs"`
	Kerberos                  *map[string]interface{}   `json:"kerberos,omitempty"`
	LDAP                      *map[string]interface{}   `json:"ldap,omitempty"`
	MaintainedEnvoys          []*map[string]interface{} `json:"maintainedEnvoys,omitempty"`
	MongoDBToolsVersion       *map[string]interface{}   `json:"mongoDbToolsVersion,omitempty"`
	MongoDBVersions           []*map[string]interface{} `json:"mongoDbVersions,omitempty"`
	MongoSQLDs                []*map[string]interface{} `json:"mongosqlds"` //nolint:tagliatelle // correct from API
	MonitoringVersions        []*ConfigVersion          `json:"monitoringVersions,omitempty"`
	OnlineArchiveModules      []*map[string]interface{} `json:"onlineArchiveModules"`
	Mongots                   []*map[string]interface{} `json:"mongots"`
	Options                   *map[string]interface{}   `json:"options"`
	Processes                 []*Process                `json:"processes"`
	Prometheus                *Prometheus               `json:"prometheus,omitempty"`
	ReplicaSets               []*ReplicaSet             `json:"replicaSets"`
	Roles                     []*map[string]interface{} `json:"roles"`
	Sharding                  []*ShardingConfig         `json:"sharding"`
	SSL                       *SSL                      `json:"ssl,omitempty"` // Deprecated: prefer TLS
	TLS                       *SSL                      `json:"tls,omitempty"`
	UIBaseURL                 *string                   `json:"uiBaseUrl,omitempty"`
	Version                   int                       `json:"version,omitempty"`
}

AutomationConfig represents an Ops Manager project automation config.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/automation-config/automation-config-parameters/

type AutomationConfigAgent

type AutomationConfigAgent struct {
	AutomationAgentVersion string `json:"automationAgentVersion"`
	BiConnectorVersion     string `json:"biConnectorVersion"`
}

AutomationConfigAgent components versions.

type AutomationService added in v0.5.0

type AutomationService interface {
	GetConfig(context.Context, string) (*AutomationConfig, *Response, error)
	UpdateConfig(context.Context, string, *AutomationConfig) (*Response, error)
	UpdateAgentVersion(context.Context, string) (*AutomationConfigAgent, *Response, error)
	GetBackupAgentConfig(context.Context, string) (*AgentConfig, *Response, error)
	GetMonitoringAgentConfig(context.Context, string) (*AgentConfig, *Response, error)
	GetStatus(context.Context, string) (*AutomationStatus, *Response, error)
}

AutomationService provides access to the automation related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/nav/automation/

type AutomationServiceOp added in v0.5.0

type AutomationServiceOp service

AutomationServiceOp provides an implementation of the AutomationService interface.

func (*AutomationServiceOp) GetBackupAgentConfig added in v0.6.0

func (s *AutomationServiceOp) GetBackupAgentConfig(ctx context.Context, groupID string) (*AgentConfig, *Response, error)

GetBackupAgentConfig retrieves the current backup agent configuration for a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/automation-config/#get-backup-attributes

func (*AutomationServiceOp) GetConfig added in v0.5.0

func (s *AutomationServiceOp) GetConfig(ctx context.Context, groupID string) (*AutomationConfig, *Response, error)

GetConfig retrieves the current automation configuration for a project.

func (*AutomationServiceOp) GetMonitoringAgentConfig added in v0.6.0

func (s *AutomationServiceOp) GetMonitoringAgentConfig(ctx context.Context, groupID string) (*AgentConfig, *Response, error)

GetMonitoringAgentConfig retrieves the current monitoring agent configuration for a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/automation-config/#get-monitoring-attributes

func (*AutomationServiceOp) GetStatus added in v0.5.0

func (s *AutomationServiceOp) GetStatus(ctx context.Context, groupID string) (*AutomationStatus, *Response, error)

GetStatus lets you see whether each MongoDB process is up-to-date with the current automation configuration. The endpoint returns the goalVersion field to report the current version of the automation configuration and the lastGoalVersionAchieved fields to report the versions of the configuration running on each server.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/automation-status/

func (*AutomationServiceOp) UpdateAgentVersion added in v0.5.0

func (s *AutomationServiceOp) UpdateAgentVersion(ctx context.Context, groupID string) (*AutomationConfigAgent, *Response, error)

UpdateAgentVersion updates the MongoDB Agent and tools to the latest versions available at the time of the request.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/automation-config/#update-agend-versions-example

func (*AutomationServiceOp) UpdateConfig added in v0.5.0

func (s *AutomationServiceOp) UpdateConfig(ctx context.Context, groupID string, updateRequest *AutomationConfig) (*Response, error)

UpdateConfig updates a project’s automation configuration. When you submit updates, Ops Manager makes internal modifications to the data and then saves your new configuration version.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/automation-config/#update-the-automation-configuration

type AutomationStatus

type AutomationStatus struct {
	Processes   []ProcessStatus `json:"processes"`
	GoalVersion int             `json:"goalVersion"`
}

type BackupConfig added in v0.10.0

type BackupConfig struct {
	GroupID            string   `json:"groupId,omitempty"`
	ClusterID          string   `json:"clusterId,omitempty"`
	StatusName         string   `json:"statusName,omitempty"`
	StorageEngineName  string   `json:"storageEngineName,omitempty"`
	AuthMechanismName  string   `json:"authMechanismName,omitempty"`
	Password           string   `json:"password,omitempty"`
	SyncSource         string   `json:"syncSource,omitempty"`
	Username           string   `json:"username,omitempty"`
	ExcludedNamespaces []string `json:"excludedNamespaces,omitempty"`
	IncludedNamespaces []string `json:"includedNamespaces,omitempty"`
	Provisioned        *bool    `json:"provisioned,omitempty"`
	EncryptionEnabled  *bool    `json:"encryptionEnabled,omitempty"`
	SSLEnabled         *bool    `json:"sslEnabled,omitempty"`
}

BackupConfig represents a Backup configuration in the MongoDB Ops Manager API.

type BackupConfigs added in v0.10.0

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

BackupConfigs represents a paginated collection of BackupConfig.

type BackupConfigsService added in v0.10.0

BackupConfigsService is an interface for using the Backup Configurations endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/backup-configurations/

type BackupConfigsServiceOp added in v0.10.0

type BackupConfigsServiceOp service

BackupConfigsServiceOp provides an implementation of the BackupConfigsService interface.

func (*BackupConfigsServiceOp) Get added in v0.10.0

func (s *BackupConfigsServiceOp) Get(ctx context.Context, groupID, clusterID string) (*BackupConfig, *Response, error)

Get retrieves a single backup configuration by cluster ID.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/backup/get-one-backup-config-by-cluster-id/

func (*BackupConfigsServiceOp) List added in v0.10.0

List gets all backup configurations.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/backup/get-all-backup-configs-for-group/

func (*BackupConfigsServiceOp) Update added in v0.10.0

func (s *BackupConfigsServiceOp) Update(ctx context.Context, groupID, clusterID string, backupConfig *BackupConfig) (*BackupConfig, *Response, error)

Update updates a single backup configuration.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/backup/update-backup-config/

type BackupStore added in v0.10.0

type BackupStore struct {
	AdminBackupConfig
	LoadFactor    *int64 `json:"loadFactor,omitempty"`
	MaxCapacityGB *int64 `json:"maxCapacityGB,omitempty"` //nolint:tagliatelle // Bytes vs bits
	Provisioned   *bool  `json:"provisioned,omitempty"`
	SyncSource    string `json:"syncSource,omitempty"`
	Username      string `json:"username,omitempty"`
}

BackupStore represents a Blockstore, Oplog and Sync in the MongoDB Ops Manager API.

type BackupStores added in v0.10.0

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

BackupStores represents a paginated collection of BackupStore.

type BlockstoreConfigService added in v0.10.0

BlockstoreConfigService is an interface for using the Blockstore Configuration endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/blockstore-config/

type BlockstoreConfigServiceOp added in v0.10.0

type BlockstoreConfigServiceOp service

BlockstoreConfigServiceOp provides an implementation of the BlockstoreConfigService interface.

func (*BlockstoreConfigServiceOp) Create added in v0.10.0

Create creates a blockstore.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/mongoConfigs/create-one-blockstore-configuration/

func (*BlockstoreConfigServiceOp) Delete added in v0.10.0

func (s *BlockstoreConfigServiceOp) Delete(ctx context.Context, blockstoreID string) (*Response, error)

Delete removes a blockstore.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/mongoConfigs/delete-one-blockstore-configuration/

func (*BlockstoreConfigServiceOp) Get added in v0.10.0

func (s *BlockstoreConfigServiceOp) Get(ctx context.Context, blockstoreID string) (*BackupStore, *Response, error)

Get retrieves a blockstore.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/mongoConfigs/get-one-blockstore-configuration-by-id/

func (*BlockstoreConfigServiceOp) List added in v0.10.0

List retrieves all the blockstores.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/mongoConfigs/get-all-blockstore-configurations/

func (*BlockstoreConfigServiceOp) Update added in v0.10.0

func (s *BlockstoreConfigServiceOp) Update(ctx context.Context, blockstoreID string, blockstore *BackupStore) (*BackupStore, *Response, error)

Update updates a blockstore.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/mongoConfigs/update-one-blockstore-configuration/

type Build added in v0.10.0

type Build struct {
	Architecture       string    `json:"architecture,omitempty"`
	GitVersion         string    `json:"gitVersion,omitempty"`
	Platform           string    `json:"platform,omitempty"`
	URL                string    `json:"url,omitempty"`
	MaxOSVersion       string    `json:"maxOsVersion,omitempty"`
	MinOSVersion       string    `json:"minOsVersion,omitempty"`
	Win2008plus        bool      `json:"win2008plus,omitempty"`
	WinVCRedistDLL     string    `json:"winVCRedistDll,omitempty"`     //nolint:tagliatelle // correct from API
	WinVCRedistOptions []*string `json:"winVCRedistOptions,omitempty"` //nolint:tagliatelle // correct from API
	WinVCRedistURL     string    `json:"winVCRedistUrl,omitempty"`     //nolint:tagliatelle // correct from API
	WinVCRedistVersion string    `json:"winVCRedistVersion,omitempty"` //nolint:tagliatelle // correct from API
	Flavor             string    `json:"flavor,omitempty"`
	Modules            []*string `json:"modules,omitempty"`
}

type Checkpoint added in v0.55.2

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

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

Checkpoints represents all the backup checkpoints related to a cluster.

type CheckpointsService

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

CheckpointsService provides access to the backup related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/checkpoints/

type CheckpointsServiceOp

type CheckpointsServiceOp service

CheckpointsServiceOp provides an implementation of the CheckpointsService interface.

func (*CheckpointsServiceOp) Get

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

Get gets a checkpoint.

See https://docs.opsmanager.mongodb.com/current/reference/api/checkpoints/#get-one-checkpoint

func (*CheckpointsServiceOp) List

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

List lists checkpoints.

See https://docs.opsmanager.mongodb.com/current/reference/api/checkpoints/#get-all-checkpoints

type ChildJob

type ChildJob struct {
	AutomationAgentID          string `json:"automationAgentId,omitempty"`
	ErrorMessage               string `json:"errorMessage,omitempty"`
	FinishDate                 string `json:"finishDate"`
	HostName                   string `json:"hostName"`
	LogCollectionType          string `json:"logCollectionType"`
	Path                       string `json:"path"`
	StartDate                  string `json:"startDate"`
	Status                     string `json:"status"`
	UncompressedDiskSpaceBytes int64  `json:"uncompressedDiskSpaceBytes"`
}

ChildJob represents a ChildJob in the MongoDB Ops Manager API.

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string

	Organizations          OrganizationsService
	Projects               ProjectsService
	Users                  UsersService
	Teams                  TeamsService
	Automation             AutomationService
	UnauthUsers            UnauthUsersService
	AlertConfigurations    AlertConfigurationsService
	Alerts                 AlertsService
	ContinuousSnapshots    ContinuousSnapshotsService
	ContinuousRestoreJobs  ContinuousRestoreJobsService
	Events                 EventsService
	OrganizationAPIKeys    APIKeysService
	ProjectAPIKeys         ProjectAPIKeysService
	AccessListAPIKeys      AccessListAPIKeysService
	Agents                 AgentsService
	Checkpoints            CheckpointsService
	GlobalAlerts           GlobalAlertsService
	Deployments            DeploymentsService
	Measurements           MeasurementsService
	Clusters               ClustersService
	Logs                   LogsService
	LogCollections         LogCollectionService
	Diagnostics            DiagnosticsService
	GlobalAPIKeys          GlobalAPIKeysService
	GlobalAPIKeysWhitelist GlobalAPIKeyWhitelistsService
	MaintenanceWindows     MaintenanceWindowsService
	PerformanceAdvisor     PerformanceAdvisorService
	VersionManifest        VersionManifestService
	BackupConfigs          BackupConfigsService
	ProjectJobConfig       ProjectJobConfigService
	BlockstoreConfig       BlockstoreConfigService
	FileSystemStoreConfig  FileSystemStoreConfigService
	S3BlockstoreConfig     S3BlockstoreConfigService
	OplogStoreConfig       OplogStoreConfigService
	SyncStoreConfig        SyncStoreConfigService
	DaemonConfig           DaemonConfigService
	SnapshotSchedule       SnapshotScheduleService
	FeatureControlPolicies FeatureControlPoliciesService
	ServerUsage            ServerUsageService
	ServerUsageReport      ServerUsageReportService
	LiveMigration          LiveDataMigrationService
	ServiceVersion         ServiceVersionService
	// contains filtered or unexported fields
}

Client manages communication with Ops Manager API.

func New

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

New returns a new Ops Manager API client instance.

func NewClient

func NewClient(httpClient HTTPClient) *Client

NewClient returns a new Ops Manager API client. If a nil httpClient is provided, a http.DefaultClient will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the https://github.com/mongodb-forks/digest).

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. The provided ctx must be non-nil, if it is nil an error is returned. If it is canceled or times out, ctx.Err() will be returned.

func (*Client) NewGZipRequest

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

NewGZipRequest creates an API gzip request. A relative URL can be provided in urlStr, in which case it is resolved relative 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 as the request body.

func (*Client) NewPlainRequest added in v0.28.2

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

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

func (*Client) NewRequest

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

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative 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 as the request body.

func (*Client) OnRequestCompleted

func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)

OnRequestCompleted sets the DO API request completion callback.

func (*Client) OnResponseProcessed added in v0.39.0

func (c *Client) OnResponseProcessed(rc ResponseProcessedCallback)

OnResponseProcessed sets the DO API request completion callback.

type ClientOpt

type ClientOpt func(*Client) error

ClientOpt are options for New.

func Options

func Options(opts ...ClientOpt) ClientOpt

Options turns a list of ClientOpt instances into a ClientOpt.

func SetBaseURL

func SetBaseURL(bu string) ClientOpt

SetBaseURL is a client option for setting the base URL.

func SetUserAgent

func SetUserAgent(ua string) ClientOpt

SetUserAgent is a client option for setting the user agent.

func SetWithRaw added in v0.14.0

func SetWithRaw() ClientOpt

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

type Cluster

type Cluster struct {
	ClusterName    string  `json:"clusterName,omitempty"`
	GroupID        string  `json:"groupId,omitempty"`
	ID             string  `json:"id,omitempty"`
	LastHeartbeat  string  `json:"lastHeartbeat,omitempty"`
	Links          []*Link `json:"links,omitempty"`
	ReplicaSetName string  `json:"replicaSetName,omitempty"`
	ShardName      string  `json:"shardName,omitempty"`
	TypeName       string  `json:"typeName,omitempty"`
}

Cluster represents a cluster in Ops Manager.

type Clusters

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

Clusters is a list of clusters.

type ClustersService

type ClustersService interface {
	List(context.Context, string, *ListOptions) (*Clusters, *Response, error)
	Get(context.Context, string, string) (*Cluster, *Response, error)
	ListAll(ctx context.Context) (*AllClustersProjects, *Response, error)
}

ClustersService provides access to the cluster related functions in the Ops Manager API.

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

type ClustersServiceOp

type ClustersServiceOp service

ClustersServiceOp provides an implementation of the ClustersService interface.

func (*ClustersServiceOp) Get

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

Get get a single cluster by ID.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/clusters/#get-a-cluster

func (*ClustersServiceOp) List

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

List all clusters for a project

See more: https://docs.opsmanager.mongodb.com/current/reference/api/clusters/#get-all-clusters

func (*ClustersServiceOp) ListAll added in v0.5.0

ListAll list all clusters available to the user.

type CollationOptions added in v0.55.3

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

type Completer interface {
	OnRequestCompleted(RequestCompletionCallback)
}

Completer interface for clients with callback.

type ConfigVersion added in v0.10.0

type ConfigVersion struct {
	Name     string `json:"name"`
	Hostname string `json:"hostname"`
}

type ConnectionStatus added in v0.27.0

type ConnectionStatus struct {
	Status string `json:"status,omitempty"` // Status represents the state of the connection that exists between this organization and the target cluster in the MongoDB Ops Manager organization.
}

ConnectionStatus represents the response of LiveDataMigrationService.ConnectOrganizations and LiveDataMigrationService.ConnectionStatus.

type ContinuousJob added in v0.55.2

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"` //nolint:tagliatelle // used as in the API
	SnapshotID        string            `json:"snapshotId"`
	StatusName        string            `json:"statusName"`
	PointInTime       *bool             `json:"pointInTime,omitempty"`
	Timestamp         SnapshotTimestamp `json:"timestamp"`
}

type ContinuousJobRequest added in v0.55.2

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"` //nolint:tagliatelle // used as in the API
	SnapshotID           string   `json:"snapshotId,omitempty"`
}

type ContinuousJobs added in v0.55.2

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

type ContinuousRestoreJobsService added in v0.56.0

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

type ContinuousRestoreJobsServiceOp added in v0.23.0

type ContinuousRestoreJobsServiceOp service

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

func (*ContinuousRestoreJobsServiceOp) Create added in v0.23.0

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

Create creates a continuous backup job in Ops Manager.

func (*ContinuousRestoreJobsServiceOp) Get added in v0.23.0

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

Get gets a continuous backup job in Ops Manager.

func (*ContinuousRestoreJobsServiceOp) List added in v0.23.0

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

List lists all continuous backup jobs in Ops Manager.

type ContinuousSnapshot added in v0.48.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"`
}

ContinuousSnapshot represents a cloud provider snapshot.

type ContinuousSnapshots added in v0.48.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.
}

ContinuousSnapshots represents all cloud provider snapshots.

type ContinuousSnapshotsService added in v0.56.0

ContinuousSnapshotsService is an interface for interfacing with the Continuous Snapshots.

type ContinuousSnapshotsServiceOp added in v0.23.0

type ContinuousSnapshotsServiceOp service

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

func (*ContinuousSnapshotsServiceOp) ChangeExpiry added in v0.23.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.opsmanager.mongodb.com/current/reference/api/snapshots/change-expiry-for-one-snapshot/

func (*ContinuousSnapshotsServiceOp) Delete added in v0.23.0

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

Delete deletes the given continuous snapshot

See more: https://docs.opsmanager.mongodb.com/current/reference/api/snapshots/remove-one-snapshot-from-one-cluster/

func (*ContinuousSnapshotsServiceOp) Get added in v0.23.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/snapshots/get-one-snapshot-for-one-cluster/

func (*ContinuousSnapshotsServiceOp) List added in v0.23.0

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

List lists continuous snapshots for the given cluster

See more: https://docs.opsmanager.mongodb.com/current/reference/api/snapshots/get-all-snapshots-for-one-cluster/

type CreateOrganizationRequest added in v0.56.0

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

CreateOrganizationRequest struct for CreateOrganizationRequest.

type CreateOrganizationResponse added in v0.56.0

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

CreateOrganizationResponse struct for CreateOrganizationResponse.

type CreateProjectOptions added in v0.55.4

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

type CreateUserResponse

type CreateUserResponse struct {
	APIKey             string `json:"apiKey,omitempty"`
	ProgrammaticAPIKey APIKey `json:"programmaticApiKey,omitempty"`
	User               *User  `json:"user"`
}

CreateUserResponse API response for the CreateFirstUser() call.

type CurrentValue added in v0.55.6

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

type Daemon struct {
	AdminBackupConfig
	BackupJobsEnabled           bool     `json:"backupJobsEnabled"`
	Configured                  bool     `json:"configured"`
	GarbageCollectionEnabled    bool     `json:"garbageCollectionEnabled"`
	ResourceUsageEnabled        bool     `json:"resourceUsageEnabled"`
	RestoreQueryableJobsEnabled bool     `json:"restoreQueryableJobsEnabled"`
	HeadDiskType                string   `json:"headDiskType,omitempty"`
	NumWorkers                  int64    `json:"numWorkers,omitempty"`
	Machine                     *Machine `json:"machine,omitempty"`
}

Daemon represents a Backup Daemon Configuration in the MongoDB Ops Manager API.

type DaemonConfigService added in v0.10.0

type DaemonConfigService interface {
	List(context.Context, *ListOptions) (*Daemons, *Response, error)
	Get(context.Context, string) (*Daemon, *Response, error)
	Update(context.Context, string, *Daemon) (*Daemon, *Response, error)
	Delete(context.Context, string) (*Response, error)
}

DaemonConfigService is an interface for using the Backup Daemon endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/backup-daemon-config/

type DaemonConfigServiceOp added in v0.10.0

type DaemonConfigServiceOp service

DaemonConfigServiceOp provides an implementation of the DaemonConfigService interface.

func (*DaemonConfigServiceOp) Delete added in v0.10.0

func (s *DaemonConfigServiceOp) Delete(ctx context.Context, daemonID string) (*Response, error)

Delete removes a Daemon.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/daemonConfigs/delete-one-backup-daemon-configuration/

func (*DaemonConfigServiceOp) List added in v0.10.0

func (s *DaemonConfigServiceOp) List(ctx context.Context, options *ListOptions) (*Daemons, *Response, error)

List retrieves all the Daemons.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/daemonConfigs/get-all-backup-daemon-configurations/

func (*DaemonConfigServiceOp) Update added in v0.10.0

func (s *DaemonConfigServiceOp) Update(ctx context.Context, daemonID string, daemon *Daemon) (*Daemon, *Response, error)

Update updates a Daemon.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/daemonConfigs/update-one-backup-daemon-configuration/

type Daemons added in v0.10.0

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

Daemons represents a paginated collection of Daemon.

type DataPoints added in v0.56.0

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

DataPoints represents a MongoDB DataPoints.

type DefaultRWConcern added in v0.27.0

type DefaultRWConcern struct {
	DefaultReadConcern  *DefaultReadConcern  `json:"defaultReadConcern,omitempty"`
	DefaultWriteConcern *DefaultWriteConcern `json:"defaultWriteConcern,omitempty"`
}

type DefaultReadConcern added in v0.27.0

type DefaultReadConcern struct {
	Level string `json:"level"`
}

type DefaultWriteConcern added in v0.27.0

type DefaultWriteConcern struct {
	W        interface{} `json:"w,omitempty"` // W can be string or number
	J        *bool       `json:"j,omitempty"`
	Wtimeout int         `json:"wtimeout"`
}

type Delivery added in v0.56.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 DeploymentsService added in v0.5.0

DeploymentsService provides access to the deployment related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/nav/deployments/

type DeploymentsServiceOp added in v0.5.0

type DeploymentsServiceOp service

DeploymentsServiceOp provides an implementation of the DeploymentsService interface.

func (*DeploymentsServiceOp) GetDatabase added in v0.5.0

func (s *DeploymentsServiceOp) GetDatabase(ctx context.Context, groupID, hostID, name string) (*ProcessDatabase, *Response, error)

GetDatabase retrieve a single database by name.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/disk-get-one/

func (*DeploymentsServiceOp) GetHost added in v0.5.0

func (s *DeploymentsServiceOp) GetHost(ctx context.Context, groupID, hostID string) (*Host, *Response, error)

GetHost gets the MongoDB process with the specified host ID.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/hosts/get-one-host-by-id/

func (*DeploymentsServiceOp) GetHostByHostname added in v0.5.0

func (s *DeploymentsServiceOp) GetHostByHostname(ctx context.Context, groupID, hostname string, port int) (*Host, *Response, error)

GetHostByHostname gets a single MongoDB process by its hostname and port combination.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/hosts/get-one-host-by-hostname-port/

func (*DeploymentsServiceOp) GetPartition added in v0.5.0

func (s *DeploymentsServiceOp) GetPartition(ctx context.Context, groupID, hostID, name string) (*ProcessDisk, *Response, error)

GetPartition retrieves a disk partition.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/disk-get-one/

func (*DeploymentsServiceOp) ListDatabases added in v0.5.0

func (s *DeploymentsServiceOp) ListDatabases(ctx context.Context, groupID, hostID string, opts *ListOptions) (*ProcessDatabasesResponse, *Response, error)

ListDatabases retrieve all databases running on the specified host.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/databases-get-all-on-host/

func (*DeploymentsServiceOp) ListHosts added in v0.5.0

func (s *DeploymentsServiceOp) ListHosts(ctx context.Context, groupID string, opts *HostListOptions) (*Hosts, *Response, error)

ListHosts lists all MongoDB hosts in a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/hosts/get-all-hosts-in-group/

func (*DeploymentsServiceOp) ListPartitions added in v0.5.0

func (s *DeploymentsServiceOp) ListPartitions(ctx context.Context, groupID, hostID string, opts *ListOptions) (*ProcessDisksResponse, *Response, error)

ListPartitions retrieves all disk partitions on the specified host.

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

func (*DeploymentsServiceOp) StartMonitoring added in v0.5.0

func (s *DeploymentsServiceOp) StartMonitoring(ctx context.Context, groupID string, host *Host) (*Host, *Response, error)

StartMonitoring starts monitoring a new MongoDB process.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/hosts/create-one-host/

func (*DeploymentsServiceOp) StopMonitoring added in v0.5.0

func (s *DeploymentsServiceOp) StopMonitoring(ctx context.Context, groupID, hostID string) (*Response, error)

StopMonitoring stops the Monitoring from monitoring the MongoDB process on the hostname and port you specify.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/hosts/delete-one-host/

func (*DeploymentsServiceOp) UpdateMonitoring added in v0.5.0

func (s *DeploymentsServiceOp) UpdateMonitoring(ctx context.Context, groupID, hostID string, host *Host) (*Host, *Response, error)

UpdateMonitoring updates the configuration of a monitored MongoDB process.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/hosts/update-one-host/

type DiagnosticsListOpts added in v0.5.0

type DiagnosticsListOpts struct {
	Limit   int64 `json:"limit,omitempty"`
	Minutes int64 `json:"minutes,omitempty"`
}

DiagnosticsListOpts query options for getting the archive.

type DiagnosticsService added in v0.5.0

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

DiagnosticsService is an interface for interfacing with Diagnostic Archives in MongoDB Ops Manager APIs

https://docs.opsmanager.mongodb.com/current/reference/api/diagnostic-archives/

type DiagnosticsServiceOp added in v0.5.0

type DiagnosticsServiceOp struct {
	Client GZipRequestDoer
}

DiagnosticsServiceOp provides an implementation of the DiagnosticsService interface.

func (*DiagnosticsServiceOp) Get added in v0.5.0

func (s *DiagnosticsServiceOp) Get(ctx context.Context, groupID string, opts *DiagnosticsListOpts, out io.Writer) (*Response, error)

Get retrieves the project’s diagnostics archive file.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/diagnostics/get-project-diagnostic-archive/

type Doer added in v0.56.0

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

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

type ErrorResponse added in v0.55.1

type ErrorResponse struct {
	// Response that caused this error
	Response *http.Response
	// ErrorCode is the error code
	ErrorCode string `json:"errorCode"`
	// HTTPCode status code.
	HTTPCode int `json:"error"` //nolint:tagliatelle // used as in the API
	// Reason is short description of the error, which is simply the HTTP status phrase.
	Reason string `json:"reason"`
	// Detail is more detailed description of the error.
	Detail string `json:"detail,omitempty"`
}

ErrorResponse reports the error caused by an API request.

func (*ErrorResponse) Error added in v0.56.0

func (r *ErrorResponse) Error() string

func (*ErrorResponse) Is added in v0.56.0

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

type Event added in v0.48.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"` //nolint:tagliatelle // used as in the API
	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 Ops Manager API.

type EventListOptions added in v0.48.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.48.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.56.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.

type EventsServiceOp added in v0.23.0

type EventsServiceOp service

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

func (*EventsServiceOp) GetOrganizationEvent added in v0.23.0

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

GetOrganizationEvent gets the event 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.23.0

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

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

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

func (*EventsServiceOp) ListOrganizationEvents added in v0.23.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.opsmanager.mongodb.com/current/reference/api/events/get-all-events-for-org/

func (*EventsServiceOp) ListProjectEvents added in v0.23.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 ExternalManagementSystem added in v0.11.0

type ExternalManagementSystem struct {
	Name     string `json:"name"`
	SystemID string `json:"systemId,omitempty"`
	Version  string `json:"version,omitempty"`
}

ExternalManagementSystem contains parameters for the external system that manages this Ops Manager Project.

type FeatureControlPoliciesService added in v0.11.0

type FeatureControlPoliciesService interface {
	List(context.Context, string, *ListOptions) (*FeaturePolicy, *Response, error)
	Update(context.Context, string, *FeaturePolicy) (*FeaturePolicy, *Response, error)
	ListSupportedPolicies(context.Context, *ListOptions) (*FeaturePolicy, *Response, error)
}

FeatureControlPoliciesService provides access to the Feature Control Policies related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/feature-control-policies/

type FeatureControlPoliciesServiceOp added in v0.11.0

type FeatureControlPoliciesServiceOp service

FeatureControlPoliciesServiceOp provides an implementation of the FeatureControlPoliciesService interface.

func (*FeatureControlPoliciesServiceOp) List added in v0.11.0

List retrieves the policies that have been set on a project.

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

func (*FeatureControlPoliciesServiceOp) ListSupportedPolicies added in v0.11.0

func (s *FeatureControlPoliciesServiceOp) ListSupportedPolicies(ctx context.Context, opts *ListOptions) (*FeaturePolicy, *Response, error)

ListSupportedPolicies retrieves all supported policies by Ops Manager.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/controlled-features/get-all-feature-control-policies/

func (*FeatureControlPoliciesServiceOp) Update added in v0.11.0

Update updates the Feature Control Policies for one Project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/controlled-features/update-controlled-features-for-one-project/

type FeaturePolicy added in v0.11.0

type FeaturePolicy struct {
	Created                  string                    `json:"created,omitempty"`
	Updated                  string                    `json:"updated,omitempty"`
	ExternalManagementSystem *ExternalManagementSystem `json:"externalManagementSystem,omitempty"`
	Policies                 []*Policy                 `json:"policies"`
}

FeaturePolicy represents an Ops Manager feature policy.

type FileSystemStoreConfigService added in v0.10.0

FileSystemStoreConfigService is an interface for using the File System Store Configuration endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/file-system-store-config/

type FileSystemStoreConfigServiceOp added in v0.10.0

type FileSystemStoreConfigServiceOp service

FileSystemStoreConfigServiceOp provides an implementation of the FileSystemStoreConfigService interface.

func (*FileSystemStoreConfigServiceOp) Delete added in v0.10.0

func (s *FileSystemStoreConfigServiceOp) Delete(ctx context.Context, fileSystemID string) (*Response, error)

Delete deletes the configuration of one file system store.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/fileSystemConfigs/delete-one-file-system-store-configuration/

func (*FileSystemStoreConfigServiceOp) Get added in v0.10.0

Get retrieves a File System Store Configuration.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/fileSystemConfigs/get-one-file-system-store-configuration-by-id/

func (*FileSystemStoreConfigServiceOp) List added in v0.10.0

List retrieves the configurations of all file system stores.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/fileSystemConfigs/get-all-file-system-store-configurations/

func (*FileSystemStoreConfigServiceOp) Update added in v0.10.0

Update updates the configuration of one file system store.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/fileSystemConfigs/update-one-file-system-store-configuration/

type FileSystemStoreConfiguration added in v0.10.0

type FileSystemStoreConfiguration struct {
	BackupStore
	MMAPV1CompressionSetting string `json:"mmapv1CompressionSetting,omitempty"`
	StorePath                string `json:"storePath,omitempty"`
	WTCompressionSetting     string `json:"wtCompressionSetting,omitempty"`
}

FileSystemStoreConfiguration represents a File System Store Configuration in the MongoDB Ops Manager API.

type FileSystemStoreConfigurations added in v0.10.0

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

FileSystemStoreConfigurations represents a paginated collection of FileSystemStoreConfiguration.

type Force added in v0.32.0

type Force struct {
	CurrentVersion int `json:"currentVersion"`
}

type GZipRequestDoer added in v0.56.0

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

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

type GlobalAPIKeyWhitelistsService added in v0.9.0

GlobalAPIKeyWhitelistsService provides access to the global alerts related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/global-api-key-whitelists/

type GlobalAPIKeyWhitelistsServiceOp added in v0.9.0

type GlobalAPIKeyWhitelistsServiceOp service

GlobalAPIKeyWhitelistsServiceOp provides an implementation of the GlobalAPIKeyWhitelistsService interface.

func (*GlobalAPIKeyWhitelistsServiceOp) Create added in v0.9.0

Create one global whitelist entry.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/global/create-one-global-whitelist/

func (*GlobalAPIKeyWhitelistsServiceOp) Delete added in v0.9.0

Delete the global whitelist entry specified by id.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/global/delete-one-global-whitelist/

func (*GlobalAPIKeyWhitelistsServiceOp) Get added in v0.9.0

Get one global whitelist entry.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/global/get-one-global-whitelist/

func (*GlobalAPIKeyWhitelistsServiceOp) List added in v0.9.0

List all global whitelist entries.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/global/get-all-global-whitelist/

type GlobalAPIKeysService added in v0.9.0

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

GlobalAPIKeysService provides access to the global alerts related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/global-api-keys/

type GlobalAPIKeysServiceOp added in v0.9.0

type GlobalAPIKeysServiceOp service

GlobalAPIKeysServiceOp provides an implementation of the GlobalAPIKeysService interface.

func (*GlobalAPIKeysServiceOp) Create added in v0.9.0

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

Create an API Key.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/global/create-one-global-api-key/

func (*GlobalAPIKeysServiceOp) Delete added in v0.9.0

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

Delete the API Key with ID apiKeyID.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/global/delete-one-global-api-key/

func (*GlobalAPIKeysServiceOp) Get added in v0.9.0

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

Get gets one API Key with ID apiKeyID.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/global/get-one-global-api-key/

func (*GlobalAPIKeysServiceOp) List added in v0.9.0

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

List gets all Global API Keys.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/global/get-all-global-api-keys/

func (*GlobalAPIKeysServiceOp) Update added in v0.9.0

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

Update one API Key with ID apiKeyID.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/api-keys/global/update-one-global-api-key/

type GlobalAlert

type GlobalAlert struct {
	Alert
	SourceTypeName string   `json:"sourceTypeName,omitempty"`
	Tags           []string `json:"tags,omitempty"`
	Links          []*Link  `json:"links,omitempty"`
	HostID         string   `json:"hostId,omitempty"`
	ClusterID      string   `json:"clusterId,omitempty"`
}

GlobalAlert configuration struct.

type GlobalAlerts

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

GlobalAlerts collection of configurations.

type GlobalAlertsService

GlobalAlertsService provides access to the global alerts related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/global-alerts/

type GlobalAlertsServiceOp

type GlobalAlertsServiceOp service

GlobalAlertsServiceOp provides an implementation of the GlobalAlertsService interface.

func (*GlobalAlertsServiceOp) Acknowledge

func (s *GlobalAlertsServiceOp) Acknowledge(ctx context.Context, alertID string, body *AcknowledgeRequest) (*GlobalAlert, *Response, error)

Acknowledge acknowledges a global alert.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/global-alerts/

func (*GlobalAlertsServiceOp) Get

Get gets a global alert.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/global-alerts/

func (*GlobalAlertsServiceOp) List

List gets all global alerts.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/global-alerts/

type GlobalWhitelistAPIKey added in v0.9.0

type GlobalWhitelistAPIKey struct {
	ID          string `json:"id,omitempty"`
	CidrBlock   string `json:"cidrBlock,omitempty"`
	Created     string `json:"created,omitempty"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type,omitempty"`
	Updated     string `json:"updated,omitempty"`
}

GlobalWhitelistAPIKey represents a Whitelist API key.

type GlobalWhitelistAPIKeys added in v0.9.0

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

GlobalWhitelistAPIKeys represents all Whitelist API keys.

type HTTPClient added in v0.44.0

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Hash added in v0.56.0

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

type Host

type Host struct {
	Aliases            []string `json:"aliases,omitempty"`
	AuthMechanismName  string   `json:"authMechanismName,omitempty"`
	ClusterID          string   `json:"clusterId,omitempty"`
	Created            string   `json:"created,omitempty"`
	GroupID            string   `json:"groupId,omitempty"`
	Hostname           string   `json:"hostname"`
	ID                 string   `json:"id,omitempty"`
	IPAddress          string   `json:"ipAddress,omitempty"`
	LastPing           string   `json:"lastPing,omitempty"`
	LastRestart        string   `json:"lastRestart,omitempty"`
	ReplicaSetName     string   `json:"replicaSetName,omitempty"`
	ReplicaStateName   string   `json:"replicaStateName,omitempty"`
	ShardName          string   `json:"shardName,omitempty"`
	TypeName           string   `json:"typeName,omitempty"`
	Version            string   `json:"version,omitempty"`
	Username           string   `json:"username,omitempty"`
	Password           string   `json:"password,omitempty"`
	Deactivated        bool     `json:"deactivated,omitempty"`
	HasStartupWarnings bool     `json:"hasStartupWarnings,omitempty"`
	Hidden             bool     `json:"hidden,omitempty"`
	HiddenSecondary    bool     `json:"hiddenSecondary,omitempty"`
	HostEnabled        bool     `json:"hostEnabled,omitempty"`
	JournalingEnabled  bool     `json:"journalingEnabled,omitempty"`
	LowUlimit          bool     `json:"lowUlimit,omitempty"`
	LogsEnabled        *bool    `json:"logsEnabled,omitempty"`
	AlertsEnabled      *bool    `json:"alertsEnabled,omitempty"`
	ProfilerEnabled    *bool    `json:"profilerEnabled,omitempty"`
	SSLEnabled         *bool    `json:"sslEnabled,omitempty"`
	LastDataSizeBytes  float64  `json:"lastDataSizeBytes,omitempty"`
	LastIndexSizeBytes float64  `json:"lastIndexSizeBytes,omitempty"`
	Port               int32    `json:"port"`
	SlaveDelaySec      int64    `json:"slaveDelaySec,omitempty"`
	UptimeMsec         int64    `json:"uptimeMsec,omitempty"`
	Links              []*Link  `json:"links,omitempty"`
}

Host represents a MongoDB host process in Ops Manager.

type HostAssignment added in v0.11.0

type HostAssignment struct {
	GroupID      string                   `json:"groupId,omitempty"`
	Hostname     string                   `json:"hostname,omitempty"`
	Processes    []*HostAssignmentProcess `json:"processes,omitempty"`
	ServerType   *ServerType              `json:"serverType,omitempty"`
	MemSizeMB    int64                    `json:"memSizeMB,omitempty"` //nolint:tagliatelle // Bytes vs bits
	IsChargeable *bool                    `json:"isChargeable,omitempty"`
}

HostAssignment represents a HostAssignment in the MongoDB Ops Manager API.

type HostAssignmentProcess added in v0.11.0

type HostAssignmentProcess struct {
	Cluster                  string `json:"cluster,omitempty"`
	GroupName                string `json:"groupName,omitempty"`
	OrgName                  string `json:"orgName,omitempty"`
	GroupID                  string `json:"groupId,omitempty"`
	Name                     string `json:"name,omitempty"`
	HasConflictingServerType bool   `json:"hasConflictingServerType"`
	ProcessType              int64  `json:"processType"`
}

HostAssignmentProcess represents a HostAssignmentProcess in the MongoDB Ops Manager API.

type HostAssignments added in v0.11.0

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

HostAssignments represents a paginated collection of HostAssignment.

type HostCount

type HostCount struct {
	Arbiter   int `json:"arbiter"`
	Config    int `json:"config"`
	Master    int `json:"master"`
	Mongos    int `json:"mongos"`
	Primary   int `json:"primary"`
	Secondary int `json:"secondary"`
	Slave     int `json:"slave"`
}

HostCount number of processes per project.

type HostListOptions

type HostListOptions struct {
	ListOptions
	ClusterID string `url:"clusterId,omitempty"`
}

type Hosts

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

type IndexConfig

type IndexConfig struct {
	DBName         string            `json:"dbName"`              // DBName of the database that is indexed
	CollectionName string            `json:"collectionName"`      // CollectionName that is indexed
	RSName         string            `json:"rsName"`              // RSName that the index is built on
	Key            [][]string        `json:"key"`                 // Key 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
}

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

See: https://docs.opsmanager.mongodb.com/current/reference/api/automation-config/automation-config-parameters/#indexes

type IndexOptions added in v0.55.3

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"`  //nolint:tagliatelle // used as in the API
	LanguageOverride        string                  `json:"language_override,omitempty"` //nolint:tagliatelle // used as in the API
	TextIndexVersion        int                     `json:"textIndexVersion,omitempty"`
	TwodsphereIndexVersion  int                     `json:"2dsphereIndexVersion,omitempty"` //nolint:tagliatelle // used as in the API
	Bits                    int                     `json:"bits,omitempty"`
	Unique                  bool                    `json:"unique,omitempty"`
	Sparse                  bool                    `json:"sparse,omitempty"`
	GeoMin                  int                     `json:"min,omitempty"` //nolint:tagliatelle // used as in the API
	GeoMax                  int                     `json:"max,omitempty"` //nolint:tagliatelle // used as in the API
	BucketSize              int                     `json:"bucketSize,omitempty"`
	Name                    string                  `json:"name,omitempty"`
	ExpireAfterSeconds      int                     `json:"expireAfterSeconds,omitempty"`
}

IndexOptions represents mongodb index options.

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

type Invitation added in v0.55.4

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

Invitation represents the structure of an Invitation.

type InvitationOptions added in v0.55.5

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

InvitationOptions filtering options for invitations.

type LDAPGroupMapping added in v0.8.0

type LDAPGroupMapping struct {
	RoleName   string   `json:"roleName"`
	LDAPGroups []string `json:"ldapGroups"`
}

LDAPGroupMapping for LDAP-backed Ops Manager, the mappings of LDAP groups to Ops Manager project roles. Only present for LDAP-backed Ops Manager.

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

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

type LinkToken added in v0.55.3

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

type ListOptions added in v0.48.0

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

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

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

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

type LiveDataMigrationService added in v0.27.0

type LiveDataMigrationService interface {
	ConnectOrganizations(context.Context, string, *LinkToken) (*ConnectionStatus, *Response, error)
	DeleteConnection(context.Context, string) (*Response, error)
	ConnectionStatus(context.Context, string) (*ConnectionStatus, *Response, error)
}

LiveDataMigrationService is an interface for interfacing with the Live Migration endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/cloud-migration/

type LiveDataMigrationServiceOp added in v0.27.0

type LiveDataMigrationServiceOp service

LiveDataMigrationServiceOp provides an implementation of the LiveDataMigrationService interface.

func (*LiveDataMigrationServiceOp) ConnectOrganizations added in v0.27.0

func (s *LiveDataMigrationServiceOp) ConnectOrganizations(ctx context.Context, orgID string, linkToken *LinkToken) (*ConnectionStatus, *Response, error)

ConnectOrganizations connects the source Ops Manager organization with a target MongoDB Ops Manager organization.

func (*LiveDataMigrationServiceOp) ConnectionStatus added in v0.27.0

func (s *LiveDataMigrationServiceOp) ConnectionStatus(ctx context.Context, orgID string) (*ConnectionStatus, *Response, error)

ConnectionStatus returns the status of the connection between the specified source Ops Manager organization and the target MongoDB Ops Manager organization.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/cloud-migration/return-the-status-of-the-organization-link/

func (*LiveDataMigrationServiceOp) DeleteConnection added in v0.27.0

func (s *LiveDataMigrationServiceOp) DeleteConnection(ctx context.Context, orgID string) (*Response, error)

DeleteConnection removes the connection between the source Ops Manager organization and the target MongoDB Ops Manager organization.

type LogCollectionJob

type LogCollectionJob struct {
	ID                         string      `json:"id,omitempty"`
	GroupID                    string      `json:"groupId,omitempty"`
	UserID                     string      `json:"userId,omitempty"`
	CreationDate               string      `json:"creationDate,omitempty"`
	ExpirationDate             string      `json:"expirationDate,omitempty"`
	Status                     string      `json:"status,omitempty"`
	ResourceType               string      `json:"resourceType,omitempty"`
	ResourceName               string      `json:"resourceName,omitempty"`
	RootResourceName           string      `json:"rootResourceName,omitempty"`
	RootResourceType           string      `json:"rootResourceType,omitempty"`
	DownloadURL                string      `json:"downloadUrl,omitempty"`
	Redacted                   *bool       `json:"redacted,omitempty"`
	LogTypes                   []string    `json:"logTypes,omitempty"`
	SizeRequestedPerFileBytes  int64       `json:"sizeRequestedPerFileBytes,omitempty"`
	UncompressedSizeTotalBytes int64       `json:"uncompressedSizeTotalBytes,omitempty"`
	ChildJobs                  []*ChildJob `json:"childJobs,omitempty"` // ChildJobs included if verbose is true
}

LogCollectionJob represents a Log Collection Job in the MongoDB Ops Manager API.

type LogCollectionJobs

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

LogCollectionJobs represents a array of LogCollectionJobs.

type LogCollectionService

LogCollectionService is an interface for interfacing with the Log Collection Jobs endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/log-collection/

type LogCollectionServiceOp

type LogCollectionServiceOp service

LogCollectionServiceOp provides an implementation of the DiagnosticsService interface.

func (*LogCollectionServiceOp) Create

Create creates a log collection job.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/log-collections/log-collections-submit/

func (*LogCollectionServiceOp) Delete

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

Delete removes a log collection job.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/log-collections/log-collections-delete-one/

func (*LogCollectionServiceOp) Extend

func (s *LogCollectionServiceOp) Extend(ctx context.Context, groupID, jobID string, log *LogCollectionJob) (*Response, error)

Extend extends the expiration data of a log collection job.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/log-collections/log-collections-update-one/

func (*LogCollectionServiceOp) Get

func (s *LogCollectionServiceOp) Get(ctx context.Context, groupID, jobID string, opts *LogListOptions) (*LogCollectionJob, *Response, error)

Get gets a log collection job.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/log-collections/log-collections-get-one/

func (*LogCollectionServiceOp) List

List gets all collection log jobs.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/log-collections/log-collections-get-all/

func (*LogCollectionServiceOp) Retry

func (s *LogCollectionServiceOp) Retry(ctx context.Context, groupID, jobID string) (*Response, error)

Retry retries a single failed log collection job.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/log-collections/log-collections-retry/

type LogListOptions

type LogListOptions struct {
	ListOptions
	Verbose bool `url:"verbose,omitempty"`
}

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

type LogRotate

type LogRotate struct {
	MaxUncompressed    *int     `json:"maxUncompressed,omitempty"`
	NumTotal           *int     `json:"numTotal,omitempty"`
	NumUncompressed    *int     `json:"numUncompressed,omitempty"`
	PercentOfDiskspace *float64 `json:"percentOfDiskspace,omitempty"`
	SizeThresholdMB    float64  `json:"sizeThresholdMB,omitempty"` //nolint:tagliatelle // Bytes vs bits
	TimeThresholdHrs   int      `json:"timeThresholdHrs,omitempty"`
}

LogRotate part of the internal Process struct.

type LogsService

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

LogsService is an interface for interfacing with the Log Collection Jobs endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/log-collection/

type LogsServiceOp

type LogsServiceOp struct {
	Client GZipRequestDoer
}

LogsServiceOp handles communication with the Log Collection Jobs download method of the MongoDB Ops Manager API.

func (*LogsServiceOp) Download

func (s *LogsServiceOp) Download(ctx context.Context, groupID, jobID string, out io.Writer) (*Response, error)

Download allows to download a log from a collection job.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/log-collections/log-collections-download-job/

type Machine added in v0.10.0

type Machine struct {
	Machine           string `json:"machine,omitempty"`
	HeadRootDirectory string `json:"headRootDirectory,omitempty"`
}

type MaintenanceWindow added in v0.10.0

type MaintenanceWindow struct {
	ID             string   `json:"id,omitempty"`
	GroupID        string   `json:"groupId,omitempty"`
	Created        string   `json:"created,omitempty"`
	StartDate      string   `json:"startDate,omitempty"`
	EndDate        string   `json:"endDate,omitempty"`
	Updated        string   `json:"updated,omitempty"`
	AlertTypeNames []string `json:"alertTypeNames,omitempty"`
	Description    string   `json:"description,omitempty"`
}

MaintenanceWindow represents MongoDB Maintenance Windows.

type MaintenanceWindows added in v0.10.0

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

MaintenanceWindows is the response from the MaintenanceWindowsService.List.

type MaintenanceWindowsService added in v0.10.0

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

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

type MaintenanceWindowsServiceOp added in v0.10.0

type MaintenanceWindowsServiceOp service

MaintenanceWindowsServiceOp handles communication with the MaintenanceWindows related methods of the Ops Manager API.

func (*MaintenanceWindowsServiceOp) Create added in v0.10.0

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

Create creates one maintenance window.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/maintenance-windows-create-one/

func (*MaintenanceWindowsServiceOp) Delete added in v0.10.0

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

Delete removes one maintenance window with an end date in the future.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/maintenance-windows-delete-one/

func (*MaintenanceWindowsServiceOp) Get added in v0.10.0

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

Get gets a maintenance window.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/maintenance-windows-get-one/

func (*MaintenanceWindowsServiceOp) List added in v0.10.0

List gets all maintenance windows.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/maintenance-windows-get-all/

func (*MaintenanceWindowsServiceOp) Update added in v0.10.0

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

Update updates one maintenance window with an end date in the future.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/maintenance-windows-update-one/

type Matcher added in v0.55.6

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

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

Measurements represents a MongoDB Measurement.

type MeasurementsServiceOp added in v0.5.0

type MeasurementsServiceOp service

MeasurementsServiceOp provides an implementation of the MeasurementsService interface.

func (*MeasurementsServiceOp) Database added in v0.5.0

func (s *MeasurementsServiceOp) Database(ctx context.Context, groupID, hostID, databaseName string, opts *ProcessMeasurementListOptions) (*ProcessDatabaseMeasurements, *Response, error)

Database measurements provide statistics on database performance and storage. The Monitoring collects database measurements through the dbStats command.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/measures/get-database-measurements/

func (*MeasurementsServiceOp) Disk added in v0.5.0

Disk measurements provide data on IOPS, disk use, and disk latency on the disk partitions for hosts running MongoDB that the Automations collect. You must run Ops Manager Automation to retrieve disk measurements.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/measures/get-disk-measurements/

func (*MeasurementsServiceOp) Host added in v0.5.0

func (s *MeasurementsServiceOp) Host(ctx context.Context, projectID, hostID string, listOptions *ProcessMeasurementListOptions) (*ProcessMeasurements, *Response, error)

Host measurements provide data on the state of the MongoDB process. The Monitoring collects host measurements through the MongoDB serverStatus and dbStats commands.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/measures/get-host-process-system-measurements/

type Member

type Member struct {
	ID                 int                `json:"_id"` //nolint:tagliatelle // correct from API
	ArbiterOnly        bool               `json:"arbiterOnly"`
	BuildIndexes       bool               `json:"buildIndexes"`
	Hidden             bool               `json:"hidden"`
	Horizons           *map[string]string `json:"horizons,omitempty"` // Horizons are managed by Kubernetes Operator and should not be manually edited
	Host               string             `json:"host"`
	Priority           float64            `json:"priority"`
	SlaveDelay         *float64           `json:"slaveDelay,omitempty"`         // Deprecated: since 5.0+ use SecondaryDelaySecs instead
	SecondaryDelaySecs *float64           `json:"secondaryDelaySecs,omitempty"` // SecondaryDelaySecs replaces SlaveDelay since 5.0+
	Tags               *map[string]string `json:"tags,omitempty"`
	Votes              float64            `json:"votes"`
}

Member configs.

type MetricThreshold added in v0.55.6

type MetricThreshold struct {
	MetricName string  `json:"metricName,omitempty"` // Name of the metric to check.
	Operator   string  `json:"operator,omitempty"`   // Operator to apply when checking the current metric value against the threshold value.
	Threshold  float64 `json:"threshold"`            // Threshold value outside of which an alert will be triggered.
	Units      string  `json:"units,omitempty"`      // The units for the threshold value.
	Mode       string  `json:"mode,omitempty"`       // This must be set to AVERAGE. Ops Manager 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.56.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 MongoDBDeletedUser added in v0.57.0

type MongoDBDeletedUser struct {
	User string   `json:"user"`
	DBs  []string `json:"dbs"` //nolint:tagliatelle // use dbs as in the API
}

MongoDBDeletedUser user to delete from DBs list.

type MongoDBUser

type MongoDBUser struct {
	AuthenticationRestrictions []AuthenticationRestriction `json:"authenticationRestrictions"`
	CustomData                 interface{}                 `json:"customData,omitempty"`
	Database                   string                      `json:"db"`                //nolint:tagliatelle // Database is a better name
	InitPassword               string                      `json:"initPwd,omitempty"` // The cleartext password to be assigned to the user
	Mechanisms                 *[]string                   `json:"mechanisms,omitempty"`
	Password                   string                      `json:"pwd,omitempty"` //nolint:tagliatelle // Password is a better name than just pwd
	Roles                      []*Role                     `json:"roles"`
	ScramSha256Creds           *ScramShaCreds              `json:"scramSha256Creds,omitempty"`
	ScramSha1Creds             *ScramShaCreds              `json:"scramSha1Creds,omitempty"`
	Username                   string                      `json:"user"` //nolint:tagliatelle // Username is a better name than just user
}

MongoDBUser database user.

type Namespace added in v0.56.0

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

Namespace represents a Namespace.

type NamespaceFilter added in v0.56.0

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

type NamespaceOptions added in v0.55.4

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

NamespaceOptions contains the request query parameters for the API request.

type Namespaces added in v0.55.4

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

Namespaces represents a list of Namespace.

type Net

type Net struct {
	BindIP                 *string                 `json:"bindIp,omitempty"`
	BindIPAll              *bool                   `json:"bindIpAll,omitempty"`
	Compression            *map[string]interface{} `json:"compression,omitempty"`
	HTTP                   *map[string]interface{} `json:"http,omitempty"` // Deprecated: deprecated since 3.2 and removed in 3.6
	IPV6                   *bool                   `json:"ipv6,omitempty"`
	ListenBacklog          string                  `json:"listenBacklog,omitempty"`
	MaxIncomingConnections *int                    `json:"maxIncomingConnections,omitempty"`
	Port                   int                     `json:"port,omitempty"`
	ServiceExecutor        string                  `json:"serviceExecutor,omitempty"`
	SSL                    *TLS                    `json:"ssl,omitempty"` // Deprecated: deprecated since 4.4 use TLS instead
	TLS                    *TLS                    `json:"tls,omitempty"`
	TransportLayer         string                  `json:"transportLayer,omitempty"`
	UnixDomainSocket       *map[string]interface{} `json:"unixDomainSocket,omitempty"`
}

Net part of the internal Process struct.

type Notification added in v0.55.6

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, Ops Manager 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, Ops Manager 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, Ops Manager 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, Ops Manager sends an email to the project owner and eventually removes the key.
	SMSEnabled               *bool    `json:"smsEnabled,omitempty"`               // Flag indicating if text message notifications should be sent. Populated for ORG, GROUP, and USER notifications types.
	TeamID                   string   `json:"teamId,omitempty"`                   // Unique identifier of a team.
	TeamName                 string   `json:"teamName,omitempty"`                 // Label for the team that receives this notification.
	NotifierID               string   `json:"notifierId,omitempty"`               // The notifierId is a system-generated unique identifier assigned to each notification method.
	TypeName                 string   `json:"typeName,omitempty"`                 // Type of alert notification.
	Username                 string   `json:"username,omitempty"`                 // Name of the Ops Manager 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, Ops Manager 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, Ops Manager 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.
	MicrosoftTeamsWebhookURL string   `json:"microsoftTeamsWebhookUrl,omitempty"` // Microsoft Teams Wewbhook URL
	WebhookSecret            string   `json:"webhookSecret,omitempty"`            // Webhook Secret
	WebhookURL               string   `json:"webhookUrl,omitempty"`               // Webhook URL
}

Notification sends when an alert condition is detected.

type OMRole added in v0.56.0

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

OMRole represents a role name of API key.

type OMUserAssigned added in v0.56.0

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

OMUserAssigned represents the user assigned to the project.

type Operation added in v0.56.0

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

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

type OplogStoreConfigService added in v0.10.0

OplogStoreConfigService is an interface for using the Oplog endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/oplog-store-config/

type OplogStoreConfigServiceOp added in v0.10.0

type OplogStoreConfigServiceOp service

OplogStoreConfigServiceOp provides an implementation of the OplogStoreConfigService interface.

func (*OplogStoreConfigServiceOp) Delete added in v0.10.0

func (s *OplogStoreConfigServiceOp) Delete(ctx context.Context, oplogID string) (*Response, error)

Delete removes a Oplog.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/s3Configs/delete-one-s3-blockstore-configuration/

func (*OplogStoreConfigServiceOp) List added in v0.10.0

List retrieves all the Oplogs.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/oplog/mongoConfigs/get-all-oplog-configurations/

func (*OplogStoreConfigServiceOp) Update added in v0.10.0

func (s *OplogStoreConfigServiceOp) Update(ctx context.Context, oplogID string, oplog *BackupStore) (*BackupStore, *Response, error)

Update updates a Oplog.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/oplog/mongoConfigs/update-one-oplog-configuration/

type Organization

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

Organization represents the structure of an organization.

type Organizations

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

Organizations represents an array of organization.

type OrganizationsListOptions added in v0.48.0

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

OrganizationsListOptions filtering options for organizations.

type OrganizationsService

OrganizationsService provides access to the organization related functions in the Ops Manager API.

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

type OrganizationsServiceOp

type OrganizationsServiceOp service

OrganizationsServiceOp provides an implementation of the OrganizationsService interface.

func (*OrganizationsServiceOp) Create

func (s *OrganizationsServiceOp) Create(ctx context.Context, createRequest *Organization) (*Organization, *Response, error)

Create creates an organization.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/organizations/organization-create-one/

func (*OrganizationsServiceOp) Delete

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

Delete deletes an organization.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/organizations/organization-delete-one/

func (*OrganizationsServiceOp) DeleteInvitation added in v0.23.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/organizations/delete-one-invitation/

func (*OrganizationsServiceOp) Get added in v0.5.0

Get gets a single organization.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/organizations/organization-get-one/

func (*OrganizationsServiceOp) Invitation added in v0.23.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/organizations/get-one-invitation/

func (*OrganizationsServiceOp) Invitations added in v0.23.0

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

Invitations gets all unaccepted invitations to the specified Ops Manager organization.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/organizations/get-all-invitations/

func (*OrganizationsServiceOp) InviteUser added in v0.23.0

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

InviteUser invites one user to the Ops Manager organization that you specify.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/organizations/create-one-invitation/

func (*OrganizationsServiceOp) List added in v0.5.0

List gets all organizations.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/organizations/organization-get-all/

func (*OrganizationsServiceOp) ListUsers added in v0.9.3

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

ListUsers gets all users in an organization.

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

func (*OrganizationsServiceOp) Projects added in v0.7.0

Projects gets all projects for the given organization ID.

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

func (*OrganizationsServiceOp) UpdateInvitation added in v0.23.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/organizations/update-one-invitation/

func (*OrganizationsServiceOp) UpdateInvitationByID added in v0.23.0

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

UpdateInvitationByID updates one invitation to the Ops Manager organization.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/organizations/update-one-invitation-by-id/

type Part added in v0.55.2

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

type PerformanceAdvisorService added in v0.10.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/performance-advisor/index.html

type PerformanceAdvisorServiceOp added in v0.10.0

type PerformanceAdvisorServiceOp service

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

func (*PerformanceAdvisorServiceOp) GetNamespaces added in v0.10.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/performance-advisor/pa-namespaces-get-all/

func (*PerformanceAdvisorServiceOp) GetSlowQueries added in v0.10.0

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

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/performance-advisor/get-slow-queries/

func (*PerformanceAdvisorServiceOp) GetSuggestedIndexes added in v0.10.0

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

GetSuggestedIndexes gets suggested indexes as determined by the Performance Advisor.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/performance-advisor/get-suggested-indexes/

type PlainRequestDoer added in v0.56.0

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

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

type Policy added in v0.11.0

type Policy struct {
	Policy         string   `json:"policy,omitempty"`
	DisabledParams []string `json:"disabledParams,omitempty"`
}

Policy contains policies that the external system applies to this Ops Manager Project.

type Process

type Process struct {
	Alias                                      string             `json:"alias,omitempty"`
	Args26                                     Args26             `json:"args2_6"` //nolint:tagliatelle // correct from API
	AuditLogRotate                             *LogRotate         `json:"auditLogRotate,omitempty"`
	AuthSchemaVersion                          int                `json:"authSchemaVersion,omitempty"`
	BackupPITRestoreType                       string             `json:"backupPitRestoreType,omitempty"`
	BackupRestoreCertificateValidationHostname string             `json:"backupRestoreCertificateValidationHostname,omitempty"`
	BackupRestoreCheckpointTimestamp           interface{}        `json:"backupRestoreCheckpointTimestamp,omitempty"`
	BackupRestoreDesiredTime                   interface{}        `json:"backupRestoreDesiredTime,omitempty"`
	BackupRestoreFilterList                    interface{}        `json:"backupRestoreFilterList,omitempty"`
	BackupRestoreJobID                         string             `json:"backupRestoreJobId,omitempty"`
	BackupRestoreURL                           string             `json:"backupRestoreUrl,omitempty"`
	BackupRestoreIsSuccessiveUpgrade           *bool              `json:"backupRestoreIsSuccessiveUpgrade,omitempty"`
	BackupRestoreOplogBaseURL                  string             `json:"backupRestoreOplogBaseUrl,omitempty"`
	BackupRestoreOplog                         interface{}        `json:"backupRestoreOplog,omitempty"`
	BackupRestoreRsVersion                     *int               `json:"backupRestoreRsVersion,omitempty"`
	BackupRestoreSourceGroupID                 string             `json:"backupRestoreSourceGroupId,omitempty"`
	BackupRestoreSourceRsID                    string             `json:"backupRestoreSourceRsId,omitempty"`
	BackupRestoreSystemRolesUUID               string             `json:"backupRestoreSystemRolesUUID,omitempty"` //nolint:tagliatelle // correct from API
	BackupRestoreSystemUsersUUID               string             `json:"backupRestoreSystemUsersUUID,omitempty"` //nolint:tagliatelle // correct from API
	BackupRestoreVerificationKey               string             `json:"backupRestoreVerificationKey,omitempty"`
	CPUAffinity                                []int              `json:"cpuAffinity,omitempty"`
	Cluster                                    string             `json:"cluster,omitempty"`
	CredentialsVersion                         *int               `json:"credentialsVersion,omitempty"`
	DefaultRWConcern                           *DefaultRWConcern  `json:"defaultRWConcern,omitempty"` //nolint:tagliatelle // correct from API
	Disabled                                   bool               `json:"disabled"`
	FeatureCompatibilityVersion                string             `json:"featureCompatibilityVersion,omitempty"`
	FullVersion                                interface{}        `json:"fullVersion,omitempty"`
	Horizons                                   *map[string]string `json:"horizons,omitempty"`
	Hostname                                   string             `json:"hostname,omitempty"`
	KMIPProxyPort                              *int               `json:"kmipProxyPort,omitempty"`
	LastCompact                                string             `json:"lastCompact,omitempty"`
	LastResync                                 string             `json:"lastResync,omitempty"`
	LastRestart                                string             `json:"lastRestart,omitempty"`
	LastGoalVersionAchieved                    int                `json:"lastGoalVersionAchieved,omitempty"`
	LastKMIPMasterKeyRotation                  string             `json:"lastKmipMasterKeyRotation,omitempty"`
	LogLevel                                   *int               `json:"logLevel,omitempty"`
	LogRotate                                  *LogRotate         `json:"logRotate,omitempty"`
	ManualMode                                 bool               `json:"manualMode"`
	Name                                       string             `json:"name,omitempty"`
	NumCores                                   int                `json:"numCores,omitempty"`
	Plan                                       []string           `json:"plan,omitempty"`
	ProcessType                                string             `json:"processType,omitempty"`
	Version                                    string             `json:"version,omitempty"`
}

Process represents a single process in a deployment.

type ProcessDatabase added in v0.48.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.55.2

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

ProcessDatabaseMeasurements represents a MongoDB process database measurements.

type ProcessDatabasesResponse added in v0.48.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 ProcessDisk added in v0.48.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.55.2

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

ProcessDiskMeasurements represents a MongoDB Process Disk Measurements.

type ProcessDisksResponse added in v0.48.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 ProcessMeasurementListOptions added in v0.55.2

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

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 ProcessStatus

type ProcessStatus struct {
	ErrorCode               *int     `json:"errorCode,omitempty"`
	ErrorCodeDescription    *string  `json:"errorCodeDescription,omitempty"`
	ErrorCodeHumanReadable  *string  `json:"errorCodeHumanReadable,omitempty"`
	ErrorString             *string  `json:"errorString,omitempty"`
	Hostname                string   `json:"hostname"`
	LastGoalVersionAchieved int      `json:"lastGoalVersionAchieved"`
	Name                    string   `json:"name"`
	Plan                    []string `json:"plan"`
}

type Project

type Project struct {
	HostCounts                *HostCount          `json:"hostCounts,omitempty"`
	LDAPGroupMappings         []*LDAPGroupMapping `json:"ldapGroupMappings,omitempty"`
	Links                     []*Link             `json:"links,omitempty"`
	Name                      string              `json:"name,omitempty"`
	OrgID                     string              `json:"orgId,omitempty"`
	ID                        string              `json:"id,omitempty"`
	AgentAPIKey               string              `json:"agentApiKey,omitempty"`
	LastActiveAgent           string              `json:"lastActiveAgent,omitempty"`
	Tags                      []*string           `json:"tags,omitempty"`
	PublicAPIEnabled          bool                `json:"publicApiEnabled,omitempty"`
	WithDefaultAlertsSettings *bool               `json:"withDefaultAlertsSettings,omitempty"`
	ReplicaSetCount           int                 `json:"replicaSetCount,omitempty"`
	ShardCount                int                 `json:"shardCount,omitempty"`
	ActiveAgentCount          int                 `json:"activeAgentCount,omitempty"`
}

Project represents the structure of a project.

type ProjectAPIKeysOp added in v0.23.0

type ProjectAPIKeysOp service

ProjectAPIKeysOp handles communication with the APIKey related methods of the MongoDB Ops Manager API.

func (*ProjectAPIKeysOp) Assign added in v0.23.0

func (s *ProjectAPIKeysOp) Assign(ctx context.Context, groupID, 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.cloudmanager.mongodb.com/reference/api/api-keys/project/assign-one-org-apiKey-to-one-project/

func (*ProjectAPIKeysOp) Create added in v0.23.0

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.cloudmanager.mongodb.com/reference/api/api-keys/project/create-one-apiKey-in-one-project/

func (*ProjectAPIKeysOp) List added in v0.23.0

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.cloudmanager.mongodb.com/reference/api/api-keys/project/get-all-apiKeys-in-one-project/

func (*ProjectAPIKeysOp) Unassign added in v0.23.0

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

Unassign an API-KEY related to {GROUP-ID} to a the project with {API-KEY-ID}.

See more: https://docs.cloudmanager.mongodb.com/reference/api/api-keys/project/delete-one-apiKey-in-one-project/

type ProjectAPIKeysService added in v0.56.0

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.

type ProjectJob added in v0.10.0

type ProjectJob struct {
	AdminBackupConfig
	KMIPClientCertPassword string         `json:"kmipClientCertPassword,omitempty"`
	KMIPClientCertPath     string         `json:"kmipClientCertPath,omitempty"`
	LabelFilter            []string       `json:"labelFilter,omitempty"`
	SyncStoreFilter        []string       `json:"syncStoreFilter,omitempty"`
	DaemonFilter           []*Machine     `json:"daemonFilter,omitempty"`
	OplogStoreFilter       []*StoreFilter `json:"oplogStoreFilter,omitempty"`
	SnapshotStoreFilter    []*StoreFilter `json:"snapshotStoreFilter,omitempty"`
}

ProjectJob represents a Backup Project Configuration Job in the MongoDB Ops Manager API.

type ProjectJobConfigService added in v0.10.0

type ProjectJobConfigService interface {
	List(context.Context, *ListOptions) (*ProjectJobs, *Response, error)
	Get(context.Context, string) (*ProjectJob, *Response, error)
	Update(context.Context, string, *ProjectJob) (*ProjectJob, *Response, error)
}

ProjectJobConfigService is an interface for using the Project Job endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/backup-group-config/

type ProjectJobConfigServiceOp added in v0.10.0

type ProjectJobConfigServiceOp service

ProjectJobConfigServiceOp provides an implementation of the ProjectJobConfigService interface.

func (*ProjectJobConfigServiceOp) Get added in v0.10.0

func (s *ProjectJobConfigServiceOp) Get(ctx context.Context, projectJobID string) (*ProjectJob, *Response, error)

Get retrieves the configuration of one project’s backup jobs.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/groups/get-one-backup-group-configuration-by-id/

func (*ProjectJobConfigServiceOp) List added in v0.10.0

List retrieves the configurations of all project’s backup jobs.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/sync/mongoConfigs/get-all-sync-store-configurations/

func (*ProjectJobConfigServiceOp) Update added in v0.10.0

func (s *ProjectJobConfigServiceOp) Update(ctx context.Context, projectJobID string, projectJob *ProjectJob) (*ProjectJob, *Response, error)

Update updates the configuration of one project’s backup jobs.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/groups/update-one-backup-group-configuration/

type ProjectJobs added in v0.10.0

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

ProjectJobs represents a paginated collection of ProjectJob.

type ProjectTeam added in v0.55.4

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

ProjectTeam represents 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 ProjectsListOptions added in v0.48.0

type ProjectsListOptions struct {
	Name string `url:"name,omitempty"`
	ListOptions
}

ProjectsListOptions filtering options for projects.

type ProjectsService

ProjectsService provides access to the project related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/groups/

type ProjectsServiceOp

type ProjectsServiceOp service

ProjectsServiceOp provides an implementation of the ProjectsService interface.

func (*ProjectsServiceOp) AddTeamsToProject added in v0.10.0

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

AddTeamsToProject adds teams to a project

See more: https://docs.opsmanager.mongodb.com/current/reference/api/groups/project-add-team/

func (*ProjectsServiceOp) Create

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

Create creates a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/groups/create-one-group/

func (*ProjectsServiceOp) Delete

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

Delete deletes a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/groups/delete-one-group/

func (*ProjectsServiceOp) DeleteInvitation added in v0.23.0

func (s *ProjectsServiceOp) DeleteInvitation(ctx context.Context, groupID, invitationID string) (*Response, error)

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

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/projects/delete-one-invitation/

func (*ProjectsServiceOp) Get added in v0.5.0

func (s *ProjectsServiceOp) Get(ctx context.Context, groupID string) (*Project, *Response, error)

Get gets a single project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/groups/get-one-group-by-id/

func (*ProjectsServiceOp) GetByName added in v0.5.0

func (s *ProjectsServiceOp) GetByName(ctx context.Context, groupName string) (*Project, *Response, error)

GetByName gets a single project by its name.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/groups/get-one-group-by-name/

func (*ProjectsServiceOp) GetTeams added in v0.10.0

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

GetTeams gets all teams in a project

See more: https://docs.opsmanager.mongodb.com/current/reference/api/groups/project-get-teams/

func (*ProjectsServiceOp) Invitation added in v0.23.0

func (s *ProjectsServiceOp) Invitation(ctx context.Context, groupID, invitationID string) (*Invitation, *Response, error)

Invitation gets details for one unaccepted invitation to the specified Ops Manager project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/projects/get-one-invitation/

func (*ProjectsServiceOp) Invitations added in v0.23.0

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

Invitations gets all unaccepted invitations to the specified Ops Manager project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/projects/get-all-invitations/

func (*ProjectsServiceOp) InviteUser added in v0.23.0

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

InviteUser invites one user to the Ops Manager project that you specify.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/projects/create-one-invitation/

func (*ProjectsServiceOp) List added in v0.5.0

List gets all projects.

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

func (*ProjectsServiceOp) ListUsers added in v0.9.3

func (s *ProjectsServiceOp) ListUsers(ctx context.Context, projectID string, opts *ListOptions) ([]*User, *Response, error)

ListUsers gets all users in a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/groups/get-all-users-in-one-group/

func (*ProjectsServiceOp) RemoveUser added in v0.9.3

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

RemoveUser removes a user from a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/groups/remove-one-user-from-one-group/

func (*ProjectsServiceOp) UpdateInvitation added in v0.23.0

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

UpdateInvitation updates one pending invitation to the Ops Manager project that you specify.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/projects/update-one-invitation/

func (*ProjectsServiceOp) UpdateInvitationByID added in v0.23.0

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

UpdateInvitationByID updates one invitation to the Ops Manager project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/invitations/projects/update-one-invitation-by-id/

type Prometheus added in v0.58.0

type Prometheus struct {
	Enabled              bool   `json:"enabled"`
	Username             string `json:"username"`
	PasswordHash         string `json:"passwordHash,omitempty"`
	PasswordSalt         string `json:"passwordSalt,omitempty"`
	Scheme               string `json:"scheme"`
	TLSPemPath           string `json:"tlsPemPath"`
	TLSPemPassword       string `json:"tlsPemPassword"`
	Mode                 string `json:"mode"`
	ListenAddress        string `json:"listenAddress"`
	MetricsPath          string `json:"metricsPath"`
	TokenFillRateSeconds int    `json:"tokenFillRateSeconds"`
	BurstTokenCount      int    `json:"burstTokenCount"`
}

type ReplicaSet

type ReplicaSet struct {
	ID                                 string                  `json:"_id"` //nolint:tagliatelle // correct from API
	ProtocolVersion                    string                  `json:"protocolVersion,omitempty"`
	Members                            []Member                `json:"members"`
	Settings                           *map[string]interface{} `json:"settings,omitempty"`
	WriteConcernMajorityJournalDefault string                  `json:"writeConcernMajorityJournalDefault,omitempty"`
	Force                              *Force                  `json:"force,omitempty"`
}

ReplicaSet configuration.

type Replication

type Replication struct {
	EnableMajorityReadConcern *bool  `json:"enableMajorityReadConcern,omitempty"`
	OplogSizeMB               *int   `json:"oplogSizeMB,omitempty"` //nolint:tagliatelle // Bytes vs bits
	ReplSetName               string `json:"replSetName,omitempty"`
}

Replication is part of the internal Process struct.

type RequestCompletionCallback added in v0.23.0

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

RequestCompletionCallback defines the type of the request callback function.

type RequestDoer added in v0.56.0

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

RequestDoer minimum interface for any service of the client.

type Response added in v0.23.0

type Response struct {
	*http.Response

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

	// Raw data from server response
	Raw []byte `json:"-"`
}

Response is a MongoDB Ops Manager response. This wraps the standard http.Response returned from MongoDB Ops Manager API.

func (*Response) CheckResponse added in v0.56.0

func (resp *Response) CheckResponse(body io.ReadCloser) 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 (*Response) CurrentPage added in v0.56.0

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

CurrentPage gets the current page for list pagination request.

func (*Response) ServiceVersion added in v0.56.0

func (resp *Response) ServiceVersion() *ServiceVersion

ServiceVersion parses version information returned in the response.

type ResponseProcessedCallback added in v0.39.0

type ResponseProcessedCallback func(*Response)

ResponseProcessedCallback defines the type of the after request completion callback function.

type Result added in v0.56.0

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 {
	Role     string `json:"role"`
	Database string `json:"db"` //nolint:tagliatelle // Database is a better name than just db
}

Role of a database user.

type S3Blockstore added in v0.10.0

type S3Blockstore struct {
	BackupStore
	AWSAccessKey           string `json:"awsAccessKey,omitempty"`
	AWSSecretKey           string `json:"awsSecretKey,omitempty"`
	S3AuthMethod           string `json:"s3AuthMethod,omitempty"`
	S3BucketEndpoint       string `json:"s3BucketEndpoint,omitempty"`
	S3BucketName           string `json:"s3BucketName,omitempty"`
	S3MaxConnections       int64  `json:"s3MaxConnections,omitempty"`
	DisableProxyS3         *bool  `json:"disableProxyS3,omitempty"`
	AcceptedTos            *bool  `json:"acceptedTos"`
	SSEEnabled             *bool  `json:"sseEnabled"`
	PathStyleAccessEnabled *bool  `json:"pathStyleAccessEnabled"`
}

S3Blockstore represents a S3Blockstore in the MongoDB Ops Manager API.

type S3BlockstoreConfigService added in v0.10.0

S3BlockstoreConfigService is an interface for using the S3 Blockstore Service endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/s3-blockstore-config/

type S3BlockstoreConfigServiceOp added in v0.10.0

type S3BlockstoreConfigServiceOp service

S3BlockstoreConfigServiceOp provides an implementation of the S3BlockstoreConfigServiceinterface.

func (*S3BlockstoreConfigServiceOp) Create added in v0.10.0

Create create a S3Blockstore.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/s3Configs/create-one-s3-blockstore-configuration/

func (*S3BlockstoreConfigServiceOp) Delete added in v0.10.0

func (s *S3BlockstoreConfigServiceOp) Delete(ctx context.Context, s3BlockstoreID string) (*Response, error)

Delete removes a blockstore.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/s3Configs/delete-one-s3-blockstore-configuration/

func (*S3BlockstoreConfigServiceOp) List added in v0.10.0

List retrieves all the S3Blockstore.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/s3Configs/get-all-s3-blockstore-configurations/

func (*S3BlockstoreConfigServiceOp) Update added in v0.10.0

func (s *S3BlockstoreConfigServiceOp) Update(ctx context.Context, s3BlockstoreID string, blockstore *S3Blockstore) (*S3Blockstore, *Response, error)

Update updates a S3Blockstore.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/snapshot/s3Configs/update-one-s3-blockstore-configuration/

type S3Blockstores added in v0.10.0

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

S3Blockstores represents a paginated collection of S3Blockstore.

type SSL

type SSL struct {
	AutoPEMKeyFilePath    string `json:"autoPEMKeyFilePath,omitempty"` //nolint:tagliatelle // correct from API
	AutoPEMKeyFilePwd     string `json:"autoPEMKeyFilePwd,omitempty"`  //nolint:tagliatelle // correct from API
	CAFilePath            string `json:"CAFilePath,omitempty"`         //nolint:tagliatelle // correct from API
	ClientCertificateMode string `json:"clientCertificateMode,omitempty"`
}

SSL config properties.

See: https://docs.opsmanager.mongodb.com/current/reference/api/automation-config/automation-config-parameters/#tls

type ScramShaCreds

type ScramShaCreds struct {
	IterationCount int    `json:"iterationCount"`
	Salt           string `json:"salt"`
	ServerKey      string `json:"serverKey"`
	StoredKey      string `json:"storedKey"`
}

ScramShaCreds configuration.

type ServerType added in v0.11.0

type ServerType struct {
	Name  string `json:"name,omitempty"`
	Label string `json:"label,omitempty"`
}

ServerType represents a ServerType in the MongoDB Ops Manager API.

type ServerTypeOptions added in v0.11.0

type ServerTypeOptions struct {
	ListOptions
	StartDate  string `url:"startDate,omitempty"`
	EndDate    string `url:"endDate,omitempty"`
	FileFormat string `url:"fileFormat,omitempty"`
	Redact     *bool  `url:"redact,omitempty"`
}

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

type ServerTypeRequest added in v0.11.0

type ServerTypeRequest struct {
	ServerType *ServerType `json:"serverType,omitempty"`
}

ServerTypeRequest contains request body parameters for Server Usage Service.

type ServerUsageReportService added in v0.11.0

type ServerUsageReportService interface {
	Download(context.Context, *ServerTypeOptions, io.Writer) (*Response, error)
}

ServerUsageReportService interface is an interface for downloading the service usage report.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/create-one-report/

type ServerUsageReportServiceOp added in v0.11.0

type ServerUsageReportServiceOp struct {
	Client GZipRequestDoer
}

ServerUsageReportServiceOp handles communication with the Log Collection Jobs download method of the MongoDB Ops Manager API.

func (*ServerUsageReportServiceOp) Download added in v0.11.0

func (s *ServerUsageReportServiceOp) Download(ctx context.Context, options *ServerTypeOptions, out io.Writer) (*Response, error)

Download downloads a compressed report of server usage in a given timeframe.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/create-one-report/

type ServerUsageService added in v0.11.0

type ServerUsageService interface {
	GenerateDailyUsageSnapshot(context.Context) (*Response, error)
	ListAllHostAssignment(context.Context, *ServerTypeOptions) (*HostAssignments, *Response, error)
	ProjectHostAssignments(context.Context, string, *ServerTypeOptions) (*HostAssignments, *Response, error)
	OrganizationHostAssignments(context.Context, string, *ServerTypeOptions) (*HostAssignments, *Response, error)
	GetServerTypeProject(context.Context, string) (*ServerType, *Response, error)
	GetServerTypeOrganization(context.Context, string) (*ServerType, *Response, error)
	UpdateProjectServerType(context.Context, string, *ServerTypeRequest) (*Response, error)
	UpdateOrganizationServerType(context.Context, string, *ServerTypeRequest) (*Response, error)
}

ServerUsageService is an interface for using the Server Usage Service endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/

type ServerUsageServiceOp added in v0.11.0

type ServerUsageServiceOp service

ServerUsageServiceOp provides an implementation of the ServerUsageService.

func (*ServerUsageServiceOp) GenerateDailyUsageSnapshot added in v0.11.0

func (s *ServerUsageServiceOp) GenerateDailyUsageSnapshot(ctx context.Context) (*Response, error)

GenerateDailyUsageSnapshot generates snapshot of usage for the processes Ops Manager manages..

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/generate-daily-usage-snapshot/

func (*ServerUsageServiceOp) GetServerTypeOrganization added in v0.11.0

func (s *ServerUsageServiceOp) GetServerTypeOrganization(ctx context.Context, orgID string) (*ServerType, *Response, error)

GetServerTypeOrganization retrieves one default server type for one organization.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/get-default-server-type-for-one-organization/

func (*ServerUsageServiceOp) GetServerTypeProject added in v0.11.0

func (s *ServerUsageServiceOp) GetServerTypeProject(ctx context.Context, groupID string) (*ServerType, *Response, error)

GetServerTypeProject retrieves one default server type for one project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/get-default-server-type-for-one-project/

func (*ServerUsageServiceOp) ListAllHostAssignment added in v0.11.0

func (s *ServerUsageServiceOp) ListAllHostAssignment(ctx context.Context, options *ServerTypeOptions) (*HostAssignments, *Response, error)

ListAllHostAssignment retrieves all host assignments.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/list-all-host-assignments/

func (*ServerUsageServiceOp) OrganizationHostAssignments added in v0.11.0

func (s *ServerUsageServiceOp) OrganizationHostAssignments(ctx context.Context, orgID string, options *ServerTypeOptions) (*HostAssignments, *Response, error)

OrganizationHostAssignments retrieves all host assignments in a organization.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/list-all-host-assignments-in-one-organization/

func (*ServerUsageServiceOp) ProjectHostAssignments added in v0.11.0

func (s *ServerUsageServiceOp) ProjectHostAssignments(ctx context.Context, groupID string, options *ServerTypeOptions) (*HostAssignments, *Response, error)

ProjectHostAssignments retrieves all host assignments in a project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/list-all-host-assignments-in-one-project/

func (*ServerUsageServiceOp) UpdateOrganizationServerType added in v0.11.0

func (s *ServerUsageServiceOp) UpdateOrganizationServerType(ctx context.Context, groupID string, serverType *ServerTypeRequest) (*Response, error)

UpdateOrganizationServerType update the default server type for one organization.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/update-default-server-type-for-one-organization/

func (*ServerUsageServiceOp) UpdateProjectServerType added in v0.11.0

func (s *ServerUsageServiceOp) UpdateProjectServerType(ctx context.Context, groupID string, serverType *ServerTypeRequest) (*Response, error)

UpdateProjectServerType update the default server type for one project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/usage/update-default-server-type-for-one-project/

type ServiceVersion added in v0.28.2

type ServiceVersion struct {
	GitHash string
	Version string
}

ServiceVersion represents version information.

func (*ServiceVersion) String added in v0.56.0

func (v *ServiceVersion) String() string

String serializes VersionInfo into string.

type ServiceVersionService added in v0.56.0

type ServiceVersionService interface {
	Get(context.Context) (*ServiceVersion, *Response, error)
}

ServiceVersionService is an interface for the version private endpoint of the MongoDB Ops Manager API.

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

type ServiceVersionServiceOp added in v0.56.0

type ServiceVersionServiceOp struct {
	Client PlainRequestDoer
}

func (*ServiceVersionServiceOp) Get added in v0.56.0

Get gets the version information and parses it.

type Shape added in v0.56.0

type Shape struct {
	AvgMs             float64      `json:"avgMs,omitempty"`             // Average duration in milliseconds for the queries examined that match this shape.
	Count             int64        `json:"count,omitempty"`             // Number of queries examined that match this shape.
	ID                string       `json:"id,omitempty"`                // Unique id for this shape. Exists only for the duration of the API request.
	InefficiencyScore int64        `json:"inefficiencyScore,omitempty"` //  Average number of documents read for every document returned by the query.
	Namespace         string       `json:"namespace,omitempty"`         // The namespace in which the slow query ran.
	Operations        []*Operation `json:"operations,omitempty"`        // It represents documents with specific information and log lines for individual queries.
}

Shape represents a document with information about the query shapes that are served by the suggested indexes.

type Shard added in v0.7.0

type Shard struct {
	ID   string   `json:"_id"` //nolint:tagliatelle // correct from API
	RS   string   `json:"rs"`
	Tags []string `json:"tags"`
}

Shard details.

type Sharding

type Sharding struct {
	ArchiveMovedChunks *bool  `json:"archiveMovedChunks,omitempty"`
	AutoSplit          *bool  `json:"autoSplit,omitempty"`
	ChunkSize          *int   `json:"chunkSize,omitempty"`
	ClusterRole        string `json:"clusterRole,omitempty"`
}

Sharding is part of the internal Process struct.

type ShardingConfig added in v0.7.0

type ShardingConfig struct {
	Collections         []*map[string]interface{} `json:"collections"`
	ConfigServerReplica string                    `json:"configServerReplica"`
	Draining            []string                  `json:"draining"`
	ManagedSharding     bool                      `json:"managedSharding"`
	Name                string                    `json:"name"`
	Shards              []*Shard                  `json:"shards"`
	Tags                []*map[string]interface{} `json:"tags"`
}

ShardingConfig sharded clusters configuration.

type SlowQueries added in v0.55.5

type SlowQueries struct {
	SlowQuery []*SlowQuery `json:"slowQueries,omitempty"` //nolint:all // A list of documents with information about slow queries as detected by the Performance Advisor.
}

SlowQueries represents a list of SlowQuery.

type SlowQuery added in v0.56.0

type SlowQuery struct {
	Namespace string `json:"namespace,omitempty"` // The namespace in which the slow query ran.
	Line      string `json:"line,omitempty"`      // The raw log line pertaining to the slow query.
}

SlowQuery represents a slow query.

type SlowQueryOptions added in v0.55.5

type SlowQueryOptions struct {
	Namespaces string `url:"namespaces,omitempty"` // Namespaces from which to retrieve slow query logs. A namespace consists of the database and collection resource separated by a ., such as <database>.<collection>.
	NLogs      int64  `url:"nLogs,omitempty"`      // Maximum number of log lines to return. Defaults to 20000.
	NamespaceOptions
}

SlowQueryOptions contains the request query parameters for the API request.

type SnapshotPart added in v0.56.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"` //nolint:all
	MongodVersion      string `json:"mongodVersion"`
	StorageSizeBytes   int64  `json:"storageSizeBytes"`
}

type SnapshotSchedule added in v0.11.0

type SnapshotSchedule struct {
	ClusterID                      string  `json:"clusterId"`
	GroupID                        string  `json:"groupId"`
	ReferenceTimeZoneOffset        string  `json:"referenceTimeZoneOffset,omitempty"`
	DailySnapshotRetentionDays     *int    `json:"dailySnapshotRetentionDays,omitempty"`
	ClusterCheckpointIntervalMin   int     `json:"clusterCheckpointIntervalMin,omitempty"`
	Links                          []*Link `json:"links,omitempty"`
	MonthlySnapshotRetentionMonths *int    `json:"monthlySnapshotRetentionMonths,omitempty"`
	PointInTimeWindowHours         *int    `json:"pointInTimeWindowHours,omitempty"`
	ReferenceHourOfDay             *int    `json:"referenceHourOfDay,omitempty"`
	ReferenceMinuteOfHour          *int    `json:"referenceMinuteOfHour,omitempty"`
	SnapshotIntervalHours          int     `json:"snapshotIntervalHours,omitempty"`
	SnapshotRetentionDays          int     `json:"snapshotRetentionDays,omitempty"`
	WeeklySnapshotRetentionWeeks   *int    `json:"weeklySnapshotRetentionWeeks,omitempty"`
}

type SnapshotScheduleService added in v0.11.0

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

SnapshotScheduleService is an interface for using the Snapshot schedule endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/snapshot-schedule/

type SnapshotScheduleServiceOp added in v0.11.0

type SnapshotScheduleServiceOp service

SnapshotScheduleServiceOp provides an implementation of the SnapshotScheduleService interface.

func (*SnapshotScheduleServiceOp) Get added in v0.11.0

func (s *SnapshotScheduleServiceOp) Get(ctx context.Context, groupID, clusterID string) (*SnapshotSchedule, *Response, error)

Get gets the snapshot schedule for an instance.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/backup/get-snapshot-schedule/

func (*SnapshotScheduleServiceOp) Update added in v0.11.0

func (s *SnapshotScheduleServiceOp) Update(ctx context.Context, groupID, clusterID string, snapshot *SnapshotSchedule) (*SnapshotSchedule, *Response, error)

Update updates the parameters of snapshot creation and retention.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/backup/update-one-snapshot-schedule-by-cluster-id/

type SnapshotTimestamp added in v0.55.2

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

type SoftwareVersions added in v0.10.0

type SoftwareVersions struct {
	AutomationVersion         string  `json:"automationVersion"`
	AutomationMinimumVersion  string  `json:"automationMinimumVersion"`
	BiConnectorVersion        string  `json:"biConnectorVersion"`
	BiConnectorMinimumVersion string  `json:"biConnectorMinimumVersion"`
	Links                     []*Link `json:"links"`
	MongoDBToolsVersion       string  `json:"mongoDbToolsVersion"`
}

SoftwareVersions is a set of software components and their expected current and minimum versions.

type Stats added in v0.56.0

type Stats struct {
	MS        float64 `json:"ms,omitempty"`        // Duration in milliseconds of the query.
	NReturned int64   `json:"nReturned,omitempty"` // Number of results returned by the query.
	NScanned  int64   `json:"nScanned,omitempty"`  // Number of documents read by the query.
	TS        int64   `json:"ts,omitempty"`        // Query timestamp, in seconds since epoch.
}

Stats represents query statistics.

type Storage

type Storage struct {
	DBPath                 string                  `json:"dbPath,omitempty"`
	DirectoryPerDB         *bool                   `json:"directoryPerDB,omitempty"` //nolint:tagliatelle // DirectoryPerDB follows go convention while directoryPerDB is correct from API
	Engine                 string                  `json:"engine,omitempty"`
	IndexBuildRetry        *bool                   `json:"indexBuildRetry,omitempty"`
	InMemory               *map[string]interface{} `json:"inMemory,omitempty"`
	Journal                *map[string]interface{} `json:"journal,omitempty"`
	NSSize                 *int                    `json:"nsSize,omitempty"`
	OplogMinRetentionHours *float64                `json:"oplogMinRetentionHours,omitempty"`
	PreallocDataFiles      *bool                   `json:"preallocDataFiles,omitempty"`
	Quota                  *map[string]interface{} `json:"quota,omitempty"`
	RepairPath             string                  `json:"repairPath,omitempty"`
	SmallFiles             *bool                   `json:"smallFiles,omitempty"`
	SyncPeriodSecs         *float64                `json:"syncPeriodSecs,omitempty"`
	WiredTiger             *map[string]interface{} `json:"wiredTiger,omitempty"`
}

Storage part of the internal Process struct.

type StoreFilter added in v0.10.0

type StoreFilter struct {
	ID   string `json:"id,omitempty"`
	Type string `json:"type,omitempty"`
}

StoreFilter represents a StoreFilter in the MongoDB Ops Manager API.

type SuggestedIndex added in v0.56.0

type SuggestedIndex struct {
	ID        string           `json:"id,omitempty"`        // Unique id for this suggested index.
	Impact    []string         `json:"impact,omitempty"`    // List of unique identifiers which correspond the query shapes in this response which pertain to this suggested index.
	Namespace string           `json:"namespace,omitempty"` // 	Namespace of the suggested index.
	Weight    float64          `json:"weight,omitempty"`    // Estimated percentage performance improvement that the suggested index would provide.
	Index     []map[string]int `json:"index,omitempty"`     // Array of documents that specifies a key in the index and its sort order, ascending or descending.
}

SuggestedIndex represents a suggested index.

type SuggestedIndexOptions added in v0.55.5

type SuggestedIndexOptions struct {
	Namespaces string `url:"namespaces,omitempty"` // Namespaces from which to retrieve slow query logs. A namespace consists of the database and collection resource separated by a ., such as <database>.<collection>.
	NIndexes   int64  `url:"nIndexes,omitempty"`   // Maximum number of indexes to suggest. Defaults to unlimited.
	NExamples  int64  `url:"NExamples,omitempty"`  // Maximum number of examples queries to provide that will be improved by a suggested index. Defaults to 5.
	NamespaceOptions
}

SuggestedIndexOptions contains the request query parameters for the API request.

type SuggestedIndexes added in v0.55.5

type SuggestedIndexes struct {
	SuggestedIndexes []*SuggestedIndex `json:"suggestedIndexes,omitempty"` // Documents with information about the indexes suggested by the Performance Advisor.
	Shapes           []*Shape          `json:"shapes,omitempty"`           // Documents with information about the query shapes that are served by the suggested indexes.

}

SuggestedIndexes represents an array of suggested indexes.

type SyncStoreConfigService added in v0.10.0

SyncStoreConfigService is an interface for using the Sync endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/sync-store-config/

type SyncStoreConfigServiceOp added in v0.10.0

type SyncStoreConfigServiceOp service

SyncStoreConfigServiceOp provides an implementation of the SyncStoreConfigService interface.

func (*SyncStoreConfigServiceOp) Delete added in v0.10.0

func (s *SyncStoreConfigServiceOp) Delete(ctx context.Context, syncID string) (*Response, error)

Delete removes a Sync.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/sync/mongoConfigs/delete-one-sync-store-configuration/

func (*SyncStoreConfigServiceOp) List added in v0.10.0

List retrieves all the Syncs.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/admin/backup/sync/mongoConfigs/get-all-sync-store-configurations/

type SystemLog

type SystemLog struct {
	Destination     string `json:"destination,omitempty"`
	Path            string `json:"path,omitempty"`
	LogAppend       bool   `json:"logAppend,omitempty"`
	Verbosity       int    `json:"verbosity,omitempty"`
	Quiet           bool   `json:"quiet,omitempty"`
	SyslogFacility  string `json:"syslogFacility,omitempty"`
	LogRotate       string `json:"logRotate,omitempty"`
	TimeStampFormat string `json:"timeStampFormat,omitempty"`
}

SystemLog part of the internal Process struct.

type TLS added in v0.7.0

type TLS struct {
	CAFile                     string `json:"CAFile,omitempty"` //nolint:tagliatelle // correct from API
	CertificateKeyFile         string `json:"certificateKeyFile,omitempty"`
	CertificateKeyFilePassword string `json:"certificateKeyFilePassword,omitempty"`
	CertificateSelector        string `json:"certificateSelector,omitempty"`
	ClusterCertificateSelector string `json:"clusterCertificateSelector,omitempty"`
	ClusterFile                string `json:"clusterFile,omitempty"`
	ClusterPassword            string `json:"clusterPassword,omitempty"`
	CRLFile                    string `json:"CRLFile,omitempty"` //nolint:tagliatelle // correct from API
	DisabledProtocols          string `json:"disabledProtocols,omitempty"`
	FIPSMode                   *bool  `json:"FIPSMode,omitempty"` //nolint:tagliatelle // correct from API
	Mode                       string `json:"mode,omitempty"`
	PEMKeyFile                 string `json:"PEMKeyFile,omitempty"` //nolint:tagliatelle // correct from API
}

TLS defines TLS parameters for Net.

type Team added in v0.55.4

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

Team defines an Ops Manager team structure.

type TeamRoles added in v0.55.4

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

TeamRoles List of roles for a team.

type TeamUpdateRoles added in v0.55.4

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

TeamUpdateRoles update request body.

type TeamUpdateRolesResponse added in v0.56.0

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

TeamUpdateRolesResponse update roles response.

type TeamsAssigned added in v0.55.5

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

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

TeamsResponse represents a array of project.

type TeamsService added in v0.10.0

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) ([]*User, *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) ([]*User, *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 provides access to the team related functions in the Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/teams/

type TeamsServiceOp added in v0.10.0

type TeamsServiceOp service

TeamsServiceOp provides an implementation of the TeamsService interface.

func (*TeamsServiceOp) AddUsersToTeam added in v0.10.0

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

AddUsersToTeam adds a users from the organization associated with {ORG-ID} to the team with ID {TEAM-ID}.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/teams/teams-add-user/

func (*TeamsServiceOp) Create added in v0.10.0

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

Create creates a team.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/teams/teams-create-one/

func (*TeamsServiceOp) Get added in v0.10.0

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

Get gets a single team in the organization by team ID.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/teams/teams-get-one-by-id/

func (*TeamsServiceOp) GetOneTeamByName added in v0.10.0

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.opsmanager.mongodb.com/current/reference/api/teams/teams-get-one-by-name/

func (*TeamsServiceOp) GetTeamUsersAssigned added in v0.10.0

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

GetTeamUsersAssigned gets all the users assigned to a team.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/teams/teams-get-all-users/

func (*TeamsServiceOp) List added in v0.10.0

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

List gets all teams.

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

func (*TeamsServiceOp) RemoveTeamFromOrganization added in v0.10.0

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.opsmanager.mongodb.com/current/reference/api/teams/teams-delete-one/

func (*TeamsServiceOp) RemoveTeamFromProject added in v0.10.0

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.opsmanager.mongodb.com/current/reference/api/teams/teams-remove-from-project/

func (*TeamsServiceOp) RemoveUserToTeam added in v0.10.0

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.opsmanager.mongodb.com/current/reference/api/teams/teams-remove-user/

func (*TeamsServiceOp) Rename added in v0.10.0

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

Rename renames a team.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/teams/teams-rename-one/

func (*TeamsServiceOp) UpdateTeamRoles added in v0.10.0

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

UpdateTeamRoles Update the roles of a team in an Ops Manager project.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/teams/teams-update-roles/

type Threshold added in v0.56.0

type Threshold struct {
	Operator  string  `json:"operator,omitempty"`  // Operator to apply when checking the current metric value against the threshold value. it accepts the following values: GREATER_THAN, LESS_THAN
	Units     string  `json:"units,omitempty"`     // The units for the threshold value.
	Threshold float64 `json:"threshold,omitempty"` // Threshold value outside of which an alert will be triggered.
}

Threshold that triggers an alert. Don’t include if "eventTypeName" : "OUTSIDE_METRIC_THRESHOLD".

type UnauthUsersService

type UnauthUsersService interface {
	CreateFirstUser(context.Context, *User, *WhitelistOpts) (*CreateUserResponse, *Response, error)
}

UnauthUsersService is an interface for interfacing with unauthenticated APIs.

type UnauthUsersServiceOp

type UnauthUsersServiceOp service

UnauthUsersServiceOp handles communication with the unauthenticated API.

func (*UnauthUsersServiceOp) CreateFirstUser

func (s *UnauthUsersServiceOp) CreateFirstUser(ctx context.Context, user *User, opts *WhitelistOpts) (*CreateUserResponse, *Response, error)

CreateFirstUser creates the first user for a new installation.

See more: https://docs.opsmanager.mongodb.com/master/reference/api/user-create-first/

type User

type User struct {
	ID           string      `json:"id,omitempty"`
	EmailAddress string      `json:"emailAddress,omitempty"`
	FirstName    string      `json:"firstName,omitempty"`
	LastName     string      `json:"lastName,omitempty"`
	Links        []*Link     `json:"links,omitempty"`
	MobileNumber string      `json:"mobileNumber,omitempty"`
	Password     string      `json:"password,omitempty"`
	TeamIds      []string    `json:"teamIds,omitempty"` //nolint:all // used as in the API
	Roles        []*UserRole `json:"roles,omitempty"`
	Username     string      `json:"username"`
	Country      string      `json:"country,omitempty"`
}

User wrapper for a user response, augmented with a few extra fields.

type UserRole

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

UserRole denotes a single user role.

type UsersResponse added in v0.9.3

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

UsersResponse represents a array of users.

type UsersService added in v0.9.3

type UsersService interface {
	Get(context.Context, string) (*User, *Response, error)
	GetByName(context.Context, string) (*User, *Response, error)
	Create(context.Context, *User) (*User, *Response, error)
	Delete(context.Context, string) (*Response, error)
}

UsersService provides access to the user related functions in the Ops Manager API.

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

type UsersServiceOp added in v0.9.3

type UsersServiceOp service

UsersServiceOp provides an implementation of the UsersService interface.

func (*UsersServiceOp) Create added in v0.9.3

func (s *UsersServiceOp) Create(ctx context.Context, createRequest *User) (*User, *Response, error)

Create creates a new IAM user.

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

func (*UsersServiceOp) Delete added in v0.9.3

func (s *UsersServiceOp) Delete(ctx context.Context, userID string) (*Response, error)

Delete deletes a user.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/users/delete-one-user/

func (*UsersServiceOp) Get added in v0.9.3

func (s *UsersServiceOp) Get(ctx context.Context, userID string) (*User, *Response, error)

Get gets a single user by ID.

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

func (*UsersServiceOp) GetByName added in v0.9.3

func (s *UsersServiceOp) GetByName(ctx context.Context, username string) (*User, *Response, error)

GetByName gets a single user by name.

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

type Version

type Version struct {
	Name   string   `json:"name,omitempty"`
	Builds []*Build `json:"builds,omitempty"`
}

type VersionManifest added in v0.10.0

type VersionManifest struct {
	Updated  int64      `json:"updated,omitempty"`
	Versions []*Version `json:"versions,omitempty"`
}

type VersionManifestService added in v0.10.0

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

VersionManifestService is an interface for using the Version Manifest endpoints of the MongoDB Ops Manager API.

See more: https://docs.opsmanager.mongodb.com/current/reference/api/version-manifest/

type VersionManifestServiceOp added in v0.10.0

type VersionManifestServiceOp service

VersionManifestServiceOp provides an implementation of the VersionManifestService interface.

func (*VersionManifestServiceOp) Get added in v0.10.0

Get retrieves the version manifest

See more: https://docs.opsmanager.mongodb.com/current/reference/api/version-manifest/view-version-manifest/

func (*VersionManifestServiceOp) Update added in v0.10.0

func (s *VersionManifestServiceOp) Update(ctx context.Context, versionManifest *VersionManifest) (*VersionManifest, *Response, error)

Update updates the version manifest

See more: https://docs.opsmanager.mongodb.com/current/reference/api/version-manifest/update-version-manifest/

type WhitelistAPIKeysReq added in v0.9.0

type WhitelistAPIKeysReq struct {
	CidrBlock   string `json:"cidrBlock"`
	Description string `json:"description"`
}

WhitelistAPIKeysReq represents a source allowed to use global API keys.

type WhitelistOpts

type WhitelistOpts struct {
	Whitelist []string `url:"whitelist"`
}

WhitelistOpts allows access from given IPs.

Jump to

Keyboard shortcuts

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