Documentation ¶
Index ¶
- type APIError
- type AutoScaling
- type Client
- type Cluster
- type ClusterService
- func (c *ClusterService) Create(gid string, clusterParams *Cluster) (*Cluster, *http.Response, error)
- func (c *ClusterService) Delete(gid string, name string) (*http.Response, error)
- func (c *ClusterService) Get(gid string, name string) (*Cluster, *http.Response, error)
- func (c *ClusterService) List(gid string) ([]Cluster, *http.Response, error)
- func (c *ClusterService) Update(gid string, name string, clusterParams *Cluster) (*Cluster, *http.Response, error)
- type Container
- type ContainerService
- func (c *ContainerService) Create(gid string, containerParams *Container) (*Container, *http.Response, error)
- func (c *ContainerService) Delete(gid string, id string) (*http.Response, error)
- func (c *ContainerService) Get(gid string, id string) (*Container, *http.Response, error)
- func (c *ContainerService) List(gid string) ([]Container, *http.Response, error)
- func (c *ContainerService) Update(gid string, id string, containerParams *Container) (*Container, *http.Response, error)
- type DatabaseUser
- type DatabaseUserService
- func (c *DatabaseUserService) Create(gid string, databaseUserParams *DatabaseUser) (*DatabaseUser, *http.Response, error)
- func (c *DatabaseUserService) Delete(gid string, username string) (*http.Response, error)
- func (c *DatabaseUserService) Get(gid string, username string) (*DatabaseUser, *http.Response, error)
- func (c *DatabaseUserService) List(gid string) ([]DatabaseUser, *http.Response, error)
- func (c *DatabaseUserService) Update(gid string, username string, databaseUserParams *DatabaseUser) (*DatabaseUser, *http.Response, error)
- type Peer
- type PeerService
- func (c *PeerService) Create(gid string, peerParams *Peer) (*Peer, *http.Response, error)
- func (c *PeerService) Delete(gid string, id string) (*http.Response, error)
- func (c *PeerService) Get(gid string, id string) (*Peer, *http.Response, error)
- func (c *PeerService) List(gid string) ([]Peer, *http.Response, error)
- func (c *PeerService) Update(gid string, id string, peerParams *Peer) (*Peer, *http.Response, error)
- type ProviderSettings
- type Role
- type Root
- type RootService
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
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.
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 ¶
Delete a cluster in the specified group. https://docs.atlas.mongodb.com/reference/api/clusters-delete-one/
func (*ClusterService) Get ¶
Get a cluster in the specified group. https://docs.atlas.mongodb.com/reference/api/clusters-get-one/
func (*ClusterService) List ¶
List all clusters for the specified group. https://docs.atlas.mongodb.com/reference/api/clusters-get-all/
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) Get ¶
Get a container in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-get-container/
func (*ContainerService) List ¶
List all containers for the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-get-containers-list/
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 ¶
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 ¶
func (c *DatabaseUserService) List(gid string) ([]DatabaseUser, *http.Response, error)
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 ¶
Create a peer in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/
func (*PeerService) Delete ¶
Delete a peer in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-delete-peering-connection/
func (*PeerService) Get ¶
Get a peer in the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-get-connection/
func (*PeerService) List ¶
List all peers for the specified group. https://docs.atlas.mongodb.com/reference/api/vpc-get-connections-list/
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 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/