mongodb

package
v0.0.0-...-4620523 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Detail    string `json:"detail"`
	Code      int    `json:"error"`
	ErrorCode string `json:"errorCode"`
	Reason    string `json:"reason"`
}

APIError represents a MongDB Atlas API Error response https://docs.atlas.mongodb.com/api/#errors

func (APIError) Error

func (e APIError) Error() string

type AutoScaling

type AutoScaling struct {
	DiskGBEnabled bool `json:"diskGBEnabled"`
}

AutoScaling has the information on whether disk auto-scaling is enabled.

type Client

type Client struct {
	Root          *RootService
	Clusters      *ClusterService
	Containers    *ContainerService
	Peers         *PeerService
	DatabaseUsers *DatabaseUserService
	// contains filtered or unexported fields
}

Client is a MongoDB Atlas client for making MongoDB API requests.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new Client.

type Cluster

type Cluster struct {
	ID                  string           `json:"id,omitempty"`
	GroupID             string           `json:"groupId,omitempty"`
	Name                string           `json:"name,omitempty"`
	MongoDBVersion      string           `json:"mongoDBVersion,omitempty"`
	MongoDBMajorVersion string           `json:"mongoDBMajorVersion,omitempty"`
	MongoURI            string           `json:"mongoURI,omitempty"`
	MongoURIUpdated     string           `json:"mongoURIUpdated,omitempty"`
	MongoURIWithOptions string           `json:"mongoURIWithOptions,omitempty"`
	DiskSizeGB          float64          `json:"diskSizeGB,omitempty"`
	BackupEnabled       bool             `json:"backupEnabled"`
	StateName           string           `json:"stateName,omitempty"`
	ReplicationFactor   int              `json:"replicationFactor,omitempty"`
	NumShards           int              `json:"numShards,omitempty"`
	Paused              bool             `json:"paused"`
	AutoScaling         AutoScaling      `json:"autoScaling,omitempty"`
	ProviderSettings    ProviderSettings `json:"providerSettings,omitempty"`
}

Cluster represents a Cluster configuration in MongoDB.

type ClusterService

type ClusterService struct {
	// contains filtered or unexported fields
}

ClusterService provides methods for accessing MongoDB Atlas Clusters API endpoints.

func (*ClusterService) Create

func (c *ClusterService) Create(gid string, clusterParams *Cluster) (*Cluster, *http.Response, error)

Create a cluster in the specified group. https://docs.atlas.mongodb.com/reference/api/clusters-create-one/

func (*ClusterService) Delete

func (c *ClusterService) Delete(gid string, name string) (*http.Response, error)

Delete a cluster in the specified group. https://docs.atlas.mongodb.com/reference/api/clusters-delete-one/

func (*ClusterService) Get

func (c *ClusterService) Get(gid string, name string) (*Cluster, *http.Response, error)

Get a cluster in the specified group. https://docs.atlas.mongodb.com/reference/api/clusters-get-one/

func (*ClusterService) List

func (c *ClusterService) List(gid string) ([]Cluster, *http.Response, error)

List all clusters for the specified group. https://docs.atlas.mongodb.com/reference/api/clusters-get-all/

func (*ClusterService) Update

func (c *ClusterService) Update(gid string, name string, clusterParams *Cluster) (*Cluster, *http.Response, error)

Update a cluster in the specified group. https://docs.atlas.mongodb.com/reference/api/clusters-modify-one/

type Container

type Container struct {
	ID             string `json:"id,omitempty"`
	ProviderName   string `json:"providerName,omitempty"`
	AtlasCidrBlock string `json:"atlasCidrBlock,omitempty"`
	RegionName     string `json:"regionName,omitempty"`
	VpcID          string `json:"vpcId,omitempty"`
	Provisioned    bool   `json:"provisioned,omitempty"`
}

Container represents a Cloud Services Containers in MongoDB.

type ContainerService

type ContainerService struct {
	// contains filtered or unexported fields
}

ContainerService provides methods for accessing MongoDB Atlas Containers API endpoints.

func (*ContainerService) Create

func (c *ContainerService) Create(gid string, containerParams *Container) (*Container, *http.Response, error)

Create a container in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-create-container/

func (*ContainerService) Delete

func (c *ContainerService) Delete(gid string, id string) (*http.Response, error)

Delete a container in the specified group.

func (*ContainerService) Get

func (c *ContainerService) Get(gid string, id string) (*Container, *http.Response, error)

Get a container in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-get-container/

func (*ContainerService) List

func (c *ContainerService) List(gid string) ([]Container, *http.Response, error)

List all containers for the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-get-containers-list/

func (*ContainerService) Update

func (c *ContainerService) Update(gid string, id string, containerParams *Container) (*Container, *http.Response, error)

Update a container in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-update-container/

type DatabaseUser

type DatabaseUser struct {
	GroupID      string `json:"groupId,omitempty"`
	Username     string `json:"username,omitempty"`
	Password     string `json:"password,omitempty"`
	DatabaseName string `json:"databaseName,omitempty"`
	Roles        []Role `json:"roles,omitempty"`
}

DatabaseUser represents MongoDB users in your cluster.

type DatabaseUserService

type DatabaseUserService struct {
	// contains filtered or unexported fields
}

DatabaseUserService provides methods for accessing MongoDB Atlas DatabaseUsers API endpoints.

func (*DatabaseUserService) Create

func (c *DatabaseUserService) Create(gid string, databaseUserParams *DatabaseUser) (*DatabaseUser, *http.Response, error)

Create a databaseUser in the specified group. https://docs.atlas.mongodb.com/reference/api/databaseUsers-create-one/

func (*DatabaseUserService) Delete

func (c *DatabaseUserService) Delete(gid string, username string) (*http.Response, error)

Delete a databaseUser in the specified group. https://docs.atlas.mongodb.com/reference/api/databaseUsers-delete-one/

func (*DatabaseUserService) Get

func (c *DatabaseUserService) Get(gid string, username string) (*DatabaseUser, *http.Response, error)

Get a databaseUser in the specified group. https://docs.atlas.mongodb.com/reference/api/database-users-get-single-user/

func (*DatabaseUserService) List

List all databaseUsers for the specified group. https://docs.atlas.mongodb.com/reference/api/database-users-get-all-users/

func (*DatabaseUserService) Update

func (c *DatabaseUserService) Update(gid string, username string, databaseUserParams *DatabaseUser) (*DatabaseUser, *http.Response, error)

Update a databaseUser in the specified group. https://docs.atlas.mongodb.com/reference/api/databaseUsers-modify-one/

type Peer

type Peer struct {
	ID                  string `json:"id,omitempty"`
	ProviderName        string `json:"providerName,omitempty"`
	RouteTableCidrBlock string `json:"routeTableCidrBlock,omitempty"`
	VpcID               string `json:"vpcId,omitempty"`
	AwsAccountID        string `json:"awsAccountId,omitempty"`
	ConnectionID        string `json:"connectionId,omitempty"`
	StatusName          string `json:"statusName,omitempty"`
	ErrorStateName      string `json:"errorStateName,omitempty"`
	ContainerID         string `json:"containerId,omitempty"`
}

Peer represents a peering connection information in MongoDB.

type PeerService

type PeerService struct {
	// contains filtered or unexported fields
}

PeerService provides methods for accessing MongoDB Atlas Peers API endpoints.

func (*PeerService) Create

func (c *PeerService) Create(gid string, peerParams *Peer) (*Peer, *http.Response, error)

Create a peer in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/

func (*PeerService) Delete

func (c *PeerService) Delete(gid string, id string) (*http.Response, error)

Delete a peer in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-delete-peering-connection/

func (*PeerService) Get

func (c *PeerService) Get(gid string, id string) (*Peer, *http.Response, error)

Get a peer in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-get-connection/

func (*PeerService) List

func (c *PeerService) List(gid string) ([]Peer, *http.Response, error)

List all peers for the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-get-connections-list/

func (*PeerService) Update

func (c *PeerService) Update(gid string, id string, peerParams *Peer) (*Peer, *http.Response, error)

Update a peer in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-update-peering-connection/

type ProviderSettings

type ProviderSettings struct {
	ProviderName        string `json:"providerName,omitempty"`
	BackingProviderName string `json:"backingProviderName,omitempty"`
	RegionName          string `json:"regionName,omitempty"`
	InstanceSizeName    string `json:"instanceSizeName,omitempty"`
}

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

type Role

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

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

type Root

type Root struct {
	AppName string `json:"appName"`
	Build   string `json:"build"`
}

Root is the response from the RootService.List.

type RootService

type RootService struct {
	// contains filtered or unexported fields
}

RootService checks connectivity to MongoDB Atlas API.

func (*RootService) Get

func (c *RootService) Get() (*Root, *http.Response, error)

Get the root resource which is the starting point for the Atlas API. https://docs.atlas.mongodb.com/reference/api/root/

Jump to

Keyboard shortcuts

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