opsmngr

package
Version: v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Version          = "0.1" // Version for client
	CloudURL         = "https://cloud.mongodb.com/"
	DefaultBaseURL   = CloudURL + APIPublicV1Path                                                             // DefaultBaseURL API default base URL for cloud manager
	APIPublicV1Path  = "api/public/v1.0/"                                                                     // DefaultAPIPath default root path for all API endpoints
	DefaultUserAgent = "go-client-ops-manager/" + Version + " (" + runtime.GOOS + "; " + runtime.GOARCH + ")" // DefaultUserAgent To be submitted by the client

)

Variables

This section is empty.

Functions

func OptionSkipVerify

func OptionSkipVerify(c *Client) error

OptionSkipVerify will set the Insecure Skip which means that TLS certs will not be verified for validity.

Types

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

type AgentAPIKey

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

type AgentAPIKeysRequest

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

type AgentAPIKeysServiceOp

type AgentAPIKeysServiceOp struct {
	Client atlas.RequestDoer
}

func (*AgentAPIKeysServiceOp) Delete

func (s *AgentAPIKeysServiceOp) Delete(ctx context.Context, groupID, agentAPIKey string) (*atlas.Response, error)

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

type Agents

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

type AgentsService

type AgentsService interface {
	List(context.Context, string, string) (*Agents, *atlas.Response, error)
	ListLinks(context.Context, string) (*Agents, *atlas.Response, error)
}

AgentsService is an interface for interfacing with the Agents endpoints of the MongoDB Cloud API. See more: https://docs.opsmanager.mongodb.com/current/reference/api/agents/

type AgentsServiceOp

type AgentsServiceOp struct {
	Client atlas.RequestDoer
}

AgentsServiceOp handles communication with the Agent related methods of the MongoDB Cloud API

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      []*atlas.Link         `json:"links"`
	Results    []*AllClustersProject `json:"results"`
	TotalCount int                   `json:"totalCount"`
}

type AllClustersService

type AllClustersService interface {
	List(context.Context) (*AllClustersProjects, *atlas.Response, error)
}

AllClustersService is an interface for interfacing with Clusters in MongoDB Ops Manager APIs

type AllClustersServiceOp

type AllClustersServiceOp struct {
	Client atlas.RequestDoer
}

func (*AllClustersServiceOp) List

List all clusters in the project.

type Args26

type Args26 struct {
	NET         Net          `json:"net"`                   // NET configuration for db connection (ports)
	Replication *Replication `json:"replication,omitempty"` // Replication configuration for ReplicaSets, omit this field if setting Sharding
	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
	SystemLog   SystemLog    `json:"systemLog"`             // SystemLog configuration for the dblog
}

Args26 part of the internal Process struct

type Auth

type Auth struct {
	Users                    []*MongoDBUser `json:"usersWanted,omitempty"` // Users is a list which contains the desired users at the project level.
	Disabled                 bool           `json:"disabled"`
	AuthoritativeSet         bool           `json:"authoritativeSet"`                   // AuthoritativeSet indicates if the MongoDBUsers should be synced with the current list of Users
	AutoAuthMechanisms       []string       `json:"autoAuthMechanisms,omitempty"`       // AutoAuthMechanisms is a list of auth mechanisms the Automation Agent is able to use
	AutoAuthMechanism        string         `json:"autoAuthMechanism"`                  // AutoAuthMechanism is the currently active agent authentication mechanism. This is a read only field
	DeploymentAuthMechanisms []string       `json:"deploymentAuthMechanisms,omitempty"` // DeploymentAuthMechanisms is a list of possible auth mechanisms that can be used within deployments
	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
	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
	AutoPwd                  string         `json:"autoPwd,omitempty"`                  // AutoPwd is a required field when going from `Disabled=false` to `Disabled=true`
}

Auth authentication config

type AutomationConfig

type AutomationConfig struct {
	AgentVersion       *map[string]interface{}   `json:"agentVersion,omitempty"`
	Auth               Auth                      `json:"auth"`
	BackupVersions     []*map[string]interface{} `json:"backupVersions,omitempty"`
	Balancer           *map[string]interface{}   `json:"balancer,omitempty"`
	CPSModules         []*map[string]interface{} `json:"cpsModules,omitempty"`
	IndexConfigs       []*IndexConfig            `json:"indexConfigs,omitempty"`
	Kerberos           *map[string]interface{}   `json:"kerberos,omitempty"`
	LDAP               *map[string]interface{}   `json:"ldap,omitempty"`
	MongoDBVersions    []*map[string]interface{} `json:"mongoDbVersions,omitempty"`
	MongoSQLDs         []*map[string]interface{} `json:"mongosqlds,omitempty"`
	MonitoringVersions []*map[string]interface{} `json:"monitoringVersions,omitempty"`
	MongoTs            []*map[string]interface{} `json:"mongots,omitempty"`
	Options            *Options                  `json:"options"`
	Processes          []*Process                `json:"processes,omitempty"`
	ReplicaSets        []*ReplicaSet             `json:"replicaSets,omitempty"`
	Roles              []*map[string]interface{} `json:"roles,omitempty"`
	Sharding           []*map[string]interface{} `json:"sharding,omitempty"`
	SSL                *SSL                      `json:"ssl,omitempty"`
	UIBaseURL          string                    `json:"uiBaseUrl,omitempty"`
	Version            int                       `json:"version,omitempty"`
}

type AutomationConfigAgent

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

type AutomationConfigService

type AutomationConfigService interface {
	Get(context.Context, string) (*AutomationConfig, *atlas.Response, error)
	Update(context.Context, string, *AutomationConfig) (*atlas.Response, error)
	UpdateAgent(context.Context, string) (*AutomationConfigAgent, *atlas.Response, error)
}

AutomationConfigService is an interface for interfacing with the Automation Config endpoints of the MongoDB CLoud API. See more: https://docs.cloudmanager.mongodb.com/reference/api/automation-config/

type AutomationConfigServiceOp

type AutomationConfigServiceOp struct {
	Client atlas.RequestDoer
}

AutomationConfigServiceOp handles communication with the Automation config related methods of the MongoDB Cloud API

type AutomationStatus

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

type AutomationStatusService

type AutomationStatusService interface {
	Get(context.Context, string) (*AutomationStatus, *atlas.Response, error)
}

AutomationStatusService is an interface for interfacing with the Automation Status endpoints of the MongoDB CLoud API. See more: https://docs.cloudmanager.mongodb.com/reference/api/automation-status/

type AutomationStatusServiceOp

type AutomationStatusServiceOp struct {
	Client atlas.RequestDoer
}

AutomationConfigServiceOp handles communication with the Automation config related methods of the MongoDB Cloud API

type CheckpointsService

CheckpointsService is an interface for interfacing with the Checkpoint endpoints of the MongoDB Ops Manager API. https://docs.opsmanager.mongodb.com/current/reference/api/checkpoints/

type CheckpointsServiceOp

type CheckpointsServiceOp struct {
	Client atlas.RequestDoer
}

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

func (*CheckpointsServiceOp) Get

func (s *CheckpointsServiceOp) Get(ctx context.Context, groupID, clusterID, checkpointID string) (*atlas.Checkpoint, *atlas.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 *atlas.ListOptions) (*atlas.Checkpoints, *atlas.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
	AutomationConfig         AutomationConfigService
	AutomationStatus         AutomationStatusService
	UnauthUsers              UnauthUsersService
	AlertConfigurations      atlas.AlertConfigurationsService
	Alerts                   atlas.AlertsService
	ContinuousSnapshots      atlas.ContinuousSnapshotsService
	ContinuousRestoreJobs    atlas.ContinuousRestoreJobsService
	Events                   atlas.EventsService
	AllClusters              AllClustersService
	Agents                   AgentsService
	AgentAPIKeys             AgentAPIKeysService
	Checkpoints              CheckpointsService
	GlobalAlerts             GlobalAlertsService
	Hosts                    HostsService
	HostDisks                HostDisksService
	HostDatabases            HostDatabasesService
	HostDatabaseMeasurements HostDatabaseMeasurementsService
	HostMeasurements         HostMeasurementsService
	HostDiskMeasurements     HostDiskMeasurementsService
	Clusters                 ClustersService
	Logs                     LogsService
	LogCollections           LogCollectionService
	// contains filtered or unexported fields
}

Client manages communication with v1.0 API

func New

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

New returns a new Ops Manager API client instance.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new Ops Manager API Client

func (*Client) Do

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

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

func (*Client) NewGZipRequest

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

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

func (*Client) NewRequest

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

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

func (*Client) OnRequestCompleted

func (c *Client) OnRequestCompleted(rc atlas.RequestCompletionCallback)

OnRequestCompleted sets the DO API request completion callback

type ClientOpt

type ClientOpt func(*Client) error

ClientOpt are options for New.

func OptionCAValidate

func OptionCAValidate(ca string) ClientOpt

OptionCAValidate will use the CA certificate, passed as a string, to validate the certificates presented by Ops Manager.

func SetBaseURL

func SetBaseURL(bu string) ClientOpt

SetBaseURL is a client option for setting the base URL.

func SetUserAgent

func SetUserAgent(ua string) ClientOpt

SetUserAgent is a client option for setting the user agent.

type 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          []*atlas.Link `json:"links,omitempty"`
	ReplicaSetName string        `json:"replicaSetName,omitempty"`
	ShardName      string        `json:"shardName,omitempty"`
	TypeName       string        `json:"typeName,omitempty"`
}

Cluster a cluster details

type Clusters

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

Clusters is a list of clusters

type ClustersService

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

ClustersService is an interface for interfacing with Clusters in MongoDB Ops Manager APIs https://docs.opsmanager.mongodb.com/current/reference/api/clusters/

type ClustersServiceOp

type ClustersServiceOp struct {
	Client atlas.RequestDoer
}

func (*ClustersServiceOp) Get

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

func (*ClustersServiceOp) List

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

List all clusters for a project

type CreateUserResponse

type CreateUserResponse struct {
	APIKey string `json:"apiKey"`
	User   *User  `json:"user"`
}

CreateUserResponse API response for the CreateFirstUser() call

type GlobalAlert

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

type GlobalAlerts

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

type GlobalAlertsService

GlobalAlertsService is an interface for interfacing with Clusters in MongoDB Ops Manager APIs

type GlobalAlertsServiceOp

type GlobalAlertsServiceOp struct {
	Client atlas.RequestDoer
}

func (*GlobalAlertsServiceOp) Acknowledge

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 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"`
	MuninEnabled       bool          `json:"muninEnabled,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"`
	MuninPort          *int32        `json:"muninPort,omitempty"`
	Port               int32         `json:"port"`
	SlaveDelaySec      int64         `json:"slaveDelaySec,omitempty"`
	UptimeMsec         int64         `json:"uptimeMsec,omitempty"`
	Links              []*atlas.Link `json:"links,omitempty"`
}

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 HostDatabaseMeasurementsService

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

HostDatabaseMeasurementsService is an interface for interfacing with the host database measurements endpoints of the MongoDB API. See more: hhttps://docs.opsmanager.mongodb.com/current/reference/api/measures/get-database-measurements/

type HostDatabaseMeasurementsServiceOp

type HostDatabaseMeasurementsServiceOp struct {
	Client atlas.RequestDoer
}

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

func (*HostDatabaseMeasurementsServiceOp) List

List gets measurements for a specific host MongoDB disk. See more: https://docs.opsmanager.mongodb.com/current/reference/api/measures/get-disk-measurements/

type HostDatabasesService

HostDatabasesService is an interface for interfacing with databases in MongoDB Ops Manager APIs https://docs.opsmanager.mongodb.com/current/reference/api/databases/

type HostDatabasesServiceOp

type HostDatabasesServiceOp struct {
	Client atlas.RequestDoer
}

func (*HostDatabasesServiceOp) Get

func (s *HostDatabasesServiceOp) Get(ctx context.Context, groupID, hostID, partitionName string) (*atlas.ProcessDatabase, *atlas.Response, error)

Get gets the MongoDB databases with the specified host ID and database name. See more: https://docs.opsmanager.mongodb.com/current/reference/api/disk-get-one/

func (*HostDatabasesServiceOp) List

List lists all MongoDB databases in a host. See more: https://docs.opsmanager.mongodb.com/current/reference/api/databases-get-all-on-host/

type HostDiskMeasurementsService

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

HostDiskMeasurementsService is an interface for interfacing with the host disk measurements endpoints of the MongoDB API. See more: https://docs.opsmanager.mongodb.com/current/reference/api/measures/get-disk-measurements/

type HostDiskMeasurementsServiceOp

type HostDiskMeasurementsServiceOp struct {
	Client atlas.RequestDoer
}

HostDiskMeasurementsServiceOp handles communication with the host disk measurements related methods of the MongoDB API

func (*HostDiskMeasurementsServiceOp) List

List gets measurements for a specific host MongoDB disk. See more: https://docs.opsmanager.mongodb.com/current/reference/api/measures/get-disk-measurements/

type HostDisksService

HostDisksService is an interface for interfacing with Hosts in MongoDB Ops Manager APIs https://docs.opsmanager.mongodb.com/current/reference/api/disks/

type HostDisksServiceOp

type HostDisksServiceOp struct {
	Client atlas.RequestDoer
}

func (*HostDisksServiceOp) Get

func (s *HostDisksServiceOp) Get(ctx context.Context, groupID, hostID, partitionName string) (*atlas.ProcessDisk, *atlas.Response, error)

Get gets the MongoDB disks with the specified host ID and partition name. See more: https://docs.opsmanager.mongodb.com/current/reference/api/disk-get-one/

func (*HostDisksServiceOp) List

List lists all MongoDB partitions in a host. See more: https://docs.opsmanager.mongodb.com/current/reference/api/disks-get-all/

type HostListOptions

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

type HostMeasurementsService

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

HostMeasurementsService is an interface for interfacing with the System Measurements endpoints of the MongoDB Ops Manager API.

type HostMeasurementsServiceOp

type HostMeasurementsServiceOp struct {
	Client atlas.RequestDoer
}

HostMeasurementsServiceOp handles communication with the system measurements related methods of the MongoDB Ops Manager API

func (*HostMeasurementsServiceOp) List

List lists system and process measurements on the CPU usage of the hosts that run MongoDB. See more: https://docs.opsmanager.mongodb.com/current/reference/api/measures/get-host-process-system-measurements/

type Hosts

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

type HostsService

type HostsService interface {
	Get(context.Context, string, string) (*Host, *atlas.Response, error)
	GetByHostname(context.Context, string, string, int) (*Host, *atlas.Response, error)
	List(context.Context, string, *HostListOptions) (*Hosts, *atlas.Response, error)
	Monitoring(context.Context, string, *Host) (*Host, *atlas.Response, error)
	UpdateMonitoring(context.Context, string, string, *Host) (*Host, *atlas.Response, error)
	StopMonitoring(context.Context, string, string) (*atlas.Response, error)
}

HostsService is an interface for interfacing with Hosts in MongoDB Ops Manager APIs https://docs.opsmanager.mongodb.com/current/reference/api/hosts/

type HostsServiceOp

type HostsServiceOp struct {
	Client atlas.RequestDoer
}

func (*HostsServiceOp) Get

func (s *HostsServiceOp) Get(ctx context.Context, groupID, hostID string) (*Host, *atlas.Response, error)

Get 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 (*HostsServiceOp) GetByHostname

func (s *HostsServiceOp) GetByHostname(ctx context.Context, groupID, hostname string, port int) (*Host, *atlas.Response, error)

GetByHostname 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-id/

func (*HostsServiceOp) List

func (s *HostsServiceOp) List(ctx context.Context, groupID string, opts *HostListOptions) (*Hosts, *atlas.Response, error)

List lists all MongoDB hosts in a project. See more: https://docs.opsmanager.mongodb.com/current/reference/api/hosts/get-all-hosts-in-group/

func (*HostsServiceOp) Monitoring

func (s *HostsServiceOp) Monitoring(ctx context.Context, groupID string, host *Host) (*Host, *atlas.Response, error)

Monitoring starts monitoring a new MongoDB process. See more: https://docs.opsmanager.mongodb.com/current/reference/api/hosts/create-one-host/

func (*HostsServiceOp) StopMonitoring

func (s *HostsServiceOp) StopMonitoring(ctx context.Context, groupID, hostID string) (*atlas.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 (*HostsServiceOp) UpdateMonitoring

func (s *HostsServiceOp) UpdateMonitoring(ctx context.Context, groupID, hostID string, host *Host) (*Host, *atlas.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 IndexConfig

type IndexConfig struct {
	DBName         string                  `json:"dbName"`              // Database that is indexed
	CollectionName string                  `json:"collectionName"`      // Collection that is indexed
	RSName         string                  `json:"rsName"`              // The replica set that the index is built on
	Key            [][]string              `json:"key"`                 // Keys array of keys to index and their type, sorting of keys is important for an index
	Options        *atlas.IndexOptions     `json:"options,omitempty"`   // Options MongoDB index options
	Collation      *atlas.CollationOptions `json:"collation,omitempty"` // Collation Mongo collation index options
}

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

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"`
	URL                        string      `json:"downloadUrl,omitempty"`
	Redacted                   *bool       `json:"redacted,omitempty"`
	LogTypes                   []string    `json:"logTypes,omitempty"`
	SizeRequestedPerFileBytes  int64       `json:"sizeRequestedPerFileBytes,omitempty"`
	UncompressedDiskSpaceBytes int64       `json:"uncompressedSizeTotalBytes,omitempty"`
	ChildJobs                  []*ChildJob `json:"childJobs,omitempty"` //included if verbose is true
}

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

type LogCollectionJobs

type LogCollectionJobs struct {
	Links      []*atlas.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 struct {
	Client atlas.RequestDoer
}

LogCollectionServiceOp handles communication with the Log Collection Jobs related methods of the MongoDB Ops Manager API

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) (*atlas.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) (*atlas.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

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) (*atlas.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 {
	atlas.ListOptions
	Verbose bool `url:"verbose,omitempty"`
}

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

type LogRotate

type LogRotate struct {
	SizeThresholdMB  float64 `json:"sizeThresholdMB,omitempty"`
	TimeThresholdHrs int     `json:"timeThresholdHrs,omitempty"`
}

LogRotate part of the internal Process struct

type LogsService

type LogsService interface {
	Download(context.Context, string, string, io.Writer) (*atlas.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 atlas.GZipRequestDoer
}

LogCollectionServiceOp 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) (*atlas.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 Member

type Member struct {
	ID           int     `json:"_id"`
	ArbiterOnly  bool    `json:"arbiterOnly"`
	BuildIndexes bool    `json:"buildIndexes"`
	Hidden       bool    `json:"hidden"`
	Host         string  `json:"host"`
	Priority     float64 `json:"priority"`
	SlaveDelay   float64 `json:"slaveDelay"`
	Votes        float64 `json:"votes"`
}

Member configs

type MongoDBUser

type MongoDBUser struct {
	Mechanisms                 []string       `json:"mechanisms"`
	Roles                      []*Role        `json:"roles"`
	Username                   string         `json:"user"`
	Database                   string         `json:"db"`
	AuthenticationRestrictions []string       `json:"authenticationRestrictions,omitempty"`
	InitPassword               string         `json:"initPwd,omitempty"` // The cleartext password to be assigned to the user
	ScramSha256Creds           *ScramShaCreds `json:"scramSha256Creds,omitempty"`
	ScramSha1Creds             *ScramShaCreds `json:"scramSha1Creds,omitempty"`
}

type Net

type Net struct {
	Port int     `json:"port,omitempty"`
	SSL  *NetSSL `json:"ssl,omitempty"`
}

Net part of the internal Process struct

type NetSSL

type NetSSL struct {
	Mode       string `json:"mode"`
	PEMKeyFile string `json:"PEMKeyFile"`
}

NetSSL defines SSL parameters for Net

type Options

type Options struct {
	DownloadBase string `json:"downloadBase"`
}

Options configs

type Organization

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

Organization represents the structure of an organization.

type Organizations

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

Organizations represents a array of organization

type OrganizationsService

type OrganizationsService interface {
	GetAllOrganizations(context.Context) (*Organizations, *atlas.Response, error)
	GetOneOrganization(context.Context, string) (*Organization, *atlas.Response, error)
	GetProjects(context.Context, string) (*Projects, *atlas.Response, error)
	Create(context.Context, *Organization) (*Organization, *atlas.Response, error)
	Delete(context.Context, string) (*atlas.Response, error)
}

OrganizationsService is an interface for interfacing with the Organizations endpoints of the MongoDB Atlas API. See more: https://docs.cloudmanager.mongodb.com/reference/api/organizations/

type OrganizationsServiceOp

type OrganizationsServiceOp struct {
	Client atlas.RequestDoer
}

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

func (*OrganizationsServiceOp) Create

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

Create creates an organization. See more: https://docs.cloudmanager.mongodb.com/reference/api/organizations/organization-create-one/

func (*OrganizationsServiceOp) Delete

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

Delete deletes an organization. See more: https://docs.cloudmanager.mongodb.com/reference/api/organizations/organization-delete-one/

func (*OrganizationsServiceOp) GetAllOrganizations

func (s *OrganizationsServiceOp) GetAllOrganizations(ctx context.Context) (*Organizations, *atlas.Response, error)

GetAllOrganizations gets all organizations. See more: https://docs.cloudmanager.mongodb.com/reference/api/organizations/organization-get-all/

func (*OrganizationsServiceOp) GetOneOrganization

func (s *OrganizationsServiceOp) GetOneOrganization(ctx context.Context, orgID string) (*Organization, *atlas.Response, error)

GetOneOrganization gets a single organization. See more: https://docs.cloudmanager.mongodb.com/reference/api/organizations/organization-get-one/

func (*OrganizationsServiceOp) GetProjects

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

GetProjects gets all projects for the given organization ID See more: https://docs.cloudmanager.mongodb.com/reference/api/organizations/organization-get-all-projects/

type Process

type Process struct {
	Args26                      Args26     `json:"args2_6"`
	AuthSchemaVersion           int        `json:"authSchemaVersion,omitempty"`
	LastGoalVersionAchieved     int        `json:"lastGoalVersionAchieved,omitempty"`
	Name                        string     `json:"name,omitempty"`
	Cluster                     string     `json:"cluster,omitempty"`
	FeatureCompatibilityVersion string     `json:"featureCompatibilityVersion,omitempty"`
	Hostname                    string     `json:"hostname,omitempty"`
	LogRotate                   *LogRotate `json:"logRotate,omitempty"`
	Plan                        []string   `json:"plan,omitempty"`
	ProcessType                 string     `json:"processType,omitempty"`
	Version                     string     `json:"version,omitempty"`
	Disabled                    bool       `json:"disabled,omitempty"`
	ManualMode                  bool       `json:"manualMode,omitempty"`
}

Process represents a single process in a deployment

type ProcessStatus

type ProcessStatus struct {
	Plan                    []string `json:"plan"`
	LastGoalVersionAchieved int      `json:"lastGoalVersionAchieved"`
	Name                    string   `json:"name"`
	Hostname                string   `json:"hostname"`
}

type Project

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

Project represents the structure of a project.

type Projects

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

Projects represents a array of project

type ProjectsService

type ProjectsService interface {
	GetAllProjects(context.Context) (*Projects, *atlas.Response, error)
	GetOneProject(context.Context, string) (*Project, *atlas.Response, error)
	GetOneProjectByName(context.Context, string) (*Project, *atlas.Response, error)
	Create(context.Context, *Project) (*Project, *atlas.Response, error)
	Delete(context.Context, string) (*atlas.Response, error)
}

ProjectsService is an interface for interfacing with the Projects endpoints of the MongoDB Cloud/Ops Manager API. See more: https://docs.cloudmanager.mongodb.com/reference/api/groups/

type ProjectsServiceOp

type ProjectsServiceOp struct {
	Client atlas.RequestDoer
}

ProjectsServiceOp handles communication with the Projects related methods of the MongoDB Cloud/Ops Manager API

func (*ProjectsServiceOp) Create

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

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

func (*ProjectsServiceOp) Delete

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

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

func (*ProjectsServiceOp) GetAllProjects

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

GetAllProjects gets all projects. See more: https://docs.cloudmanager.mongodb.com/reference/api/groups/get-all-groups-for-current-user/

func (*ProjectsServiceOp) GetOneProject

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

GetOneProject gets a single project. See more: https://docs.cloudmanager.mongodb.com/reference/api/groups/get-one-group-by-id/

func (*ProjectsServiceOp) GetOneProjectByName

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

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

type ReplicaSet

type ReplicaSet struct {
	ID              string   `json:"_id"`
	ProtocolVersion string   `json:"protocolVersion,omitempty"`
	Members         []Member `json:"members"`
}

ReplicaSet configs

type Replication

type Replication struct {
	ReplSetName string `json:"replSetName,omitempty"`
}

Replication is part of the internal Process struct

type Role

type Role struct {
	Role     string `json:"role"`
	Database string `json:"db"`
}

type SSL

type SSL struct {
	AutoPEMKeyFilePath    string `json:"autoPEMKeyFilePath,omitempty"`
	CAFilePath            string `json:"CAFilePath,omitempty"`
	ClientCertificateMode string `json:"clientCertificateMode,omitempty"`
}

SSL config properties

type ScramShaCreds

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

type Sharding

type Sharding struct {
	ClusterRole string `json:"clusterRole"`
}

Sharding is part of the internal Process struct

type Storage

type Storage struct {
	DBPath string `json:"dbPath,omitempty"`
}

Storage part of the internal Process struct

type SystemLog

type SystemLog struct {
	Destination string `json:"destination,omitempty"`
	Path        string `json:"path,omitempty"`
}

SystemLog part of the internal Process struct

type UnauthUsersService

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

UnauthUsersService is an interface for interfacing with unauthenticated APIs

type UnauthUsersServiceOp

type UnauthUsersServiceOp struct {
	Client atlas.RequestDoer
}

UnauthUsersServiceOp handles communication with the unauthenticated API

func (*UnauthUsersServiceOp) CreateFirstUser

func (s *UnauthUsersServiceOp) CreateFirstUser(ctx context.Context, user *User, opts *WhitelistOpts) (*CreateUserResponse, *atlas.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 {
	Username     string        `json:"username"`
	Password     string        `json:"password,omitempty"`
	FirstName    string        `json:"firstName,omitempty"`
	LastName     string        `json:"lastName,omitempty"`
	EmailAddress string        `json:"emailAddress,omitempty"`
	ID           string        `json:"id,omitempty"`
	Links        []*atlas.Link `json:"links,omitempty"`
	Roles        []*UserRole   `json:"roles,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 WhitelistOpts

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

Jump to

Keyboard shortcuts

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