Version: v0.3.0 Latest Latest

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0


MongoDB Ops Manager Go Client

Build Status

An HTTP client for Ops Manager and Cloud Manager Public API endpoints.

You can view the Official API docs at:


To get the latest version run this command:

go get go.mongodb.org/ops-manager


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


The Ops Manager API uses HTTP Digest Authentication. Provide your PUBLIC_KEY as the username and PRIVATE_KEY as the password as part of the HTTP request. See how to set up public API access for more information.

We use the following library to get HTTP Digest Auth:

Example Usage

package main

import (


func newClient(publicKey, privateKey string) (*mongodbatlas.Client, error) {

	// Setup a transport to handle digest
	transport := digest.NewTransport(publicKey, privateKey)

	// Initialize the client
	client, err := transport.Client()
	if err != nil {
		return nil, err

	//Initialize the MongoDB API Client.
	return opsmngr.NewClient(client), nil

func main() {
	publicKey := os.Getenv("MONGODB_PUBLIC_KEY")
	privateKey := os.Getenv("MONGODB_PRIVATE_KEY")
	projectID := os.Getenv("MONGODB_PROJECT_ID")

	if publicKey == "" || privateKey == "" || projectID == "" {
		log.Fatalln("MONGODB_PUBLIC_KEY, MONGODB_PRIVATE_KEY and MONGODB_PROJECT_ID must be set to run this example")

	client, err := newClient(publicKey, privateKey)
	if err != nil {

	atmStatus, _, err := client.AutomationStatus.Get(context.Background(), projectID)

	if err != nil {

	fmt.Printf("%+v \n", atmStatus)



This library is being initially developed for mongocli, so API methods will likely be implemented in the order that they are needed by that application.


See our CONTRIBUTING.md Guide.


MongoDB Ops Manager Go Client is released under the Apache 2.0 license. See LICENSE


Path Synopsis

Jump to

Keyboard shortcuts

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