mongodbatlas

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CaCentral1 represents the CA_CENTRAL_1 America region for AWS Configuration
	CaCentral1 = "CA_CENTRAL_1"
	// UsEast1 represents the US_EAST_1 America region for AWS Configuration
	UsEast1 = "US_EAST_1"
	// UsEast2 represents the US_EAST_2 America region for AWS Configuration
	UsEast2 = "US_EAST_2"
	// UsWest1 represents the US_WEST_1 America region for AWS Configuration
	UsWest1 = "US_WEST_1"
	// UsWest2 represents the US_WEST_2 America region for AWS Configuration
	UsWest2 = "US_WEST_2"
	// SaEast1 represents the SA_EAST_1 America region for AWS Configuration
	SaEast1 = "SA_EAST_1"

	// ApNortheast1 represents the AP_NORTHEAST_1 Asia region for AWS Configuration
	ApNortheast1 = "AP_NORTHEAST_1"
	// ApNortheast2 represents the AP_NORTHEAST_2 Asia region for AWS Configuration
	ApNortheast2 = "AP_NORTHEAST_2"
	// ApSouth1 represents the AP_SOUTH_1 Asia region for AWS Configuration
	ApSouth1 = "AP_SOUTH_1"
	// ApSoutheast1 represents the AP_SOUTHEAST_1 Asia region for AWS Configuration
	ApSoutheast1 = "AP_SOUTHEAST_1"
	// ApSoutheast2 represents the AP_SOUTHEAST_2 Asia region for AWS Configuration
	ApSoutheast2 = "AP_SOUTHEAST_2"

	// EuCentral1 represents the EU_CENTRAL_1 Europe region for AWS Configuration
	EuCentral1 = "EU_CENTRAL_1"
	// EuWest1 represents the EU_WEST_1 Europe region for AWS Configuration
	EuWest1 = "EU_WEST_1"
	// EuWest2 represents the EU_WEST_2 Europe region for AWS Configuration
	EuWest2 = "EU_WEST_2"
	// EuWest3 represents the EU_WEST_3 Europe region for AWS Configuration
	EuWest3 = "EU_WEST_3"

	// Azure represents `AZURE` where the Azure account credencials reside
	Azure = "AZURE"
	// AzureChina represents `AZURE_CHINA` AZURE where the Azure account credencials reside
	AzureChina = "AZURE_CHINA"
	// AzureGermany represents `AZURE_GERMANY` AZURE where the Azure account credencials reside
	AzureGermany = "AZURE_GERMANY"
)
View Source
const (

	// Sunday day of the week when you would like the maintenance window to start
	Sunday = 1
	// Monday day of the week when you would like the maintenance window to start
	Monday = 2
	// Tuesday day of the week when you would like the maintenance window to start
	Tuesday = 3
	// Wednesday day of the week when you would like the maintenance window to start
	Wednesday = 4
	// Thursday day of the week when you would like the maintenance window to start
	Thursday = 5
	// Friday day of the week when you would like the maintenance window to start
	Friday = 6
	// Saturday day of the week when you would like the maintenance window to start
	Saturday = 7
)
View Source
const (
	GROUP_OWNER                  = "GROUP_OWNER"                  //GROUP_OWNER - Project Owner
	GROUP_READ_ONLY              = "GROUP_READ_ONLY"              //GROUP_READ_ONLY - Project Read Only
	GROUP_DATA_ACCESS_ADMIN      = "GROUP_DATA_ACCESS_ADMIN"      //GROUP_DATA_ACCESS_ADMIN - Project Data Access Admin
	GROUP_DATA_ACCESS_READ_WRITE = "GROUP_DATA_ACCESS_READ_WRITE" //GROUP_DATA_ACCESS_READ_WRITE - Project Data Access Read/Write
	GROUP_DATA_ACCESS_READ_ONLY  = "GROUP_DATA_ACCESS_READ_ONLY"  //GROUP_DATA_ACCESS_READ_ONLY - Project Data Access Read Only

)

Variables

View Source
var DefaultDiskSizeGB map[string]map[string]float64 = map[string]map[string]float64{
	"TENANT": {
		"M2": 2,
		"M5": 5,
	},
	"AWS": {
		"M10":       10,
		"M20":       20,
		"M30":       40,
		"M40":       80,
		"R40":       80,
		"M40_NVME":  380,
		"M50":       160,
		"R50":       160,
		"M50_NVME":  760,
		"M60":       320,
		"R60":       320,
		"M60_NVME":  1600,
		"M80":       750,
		"R80":       750,
		"M80_NVME":  1600,
		"M140":      1000,
		"M200":      1500,
		"R200":      1500,
		"M200_NVME": 3100,
		"M300":      2000,
		"R300":      2000,
		"R400":      3000,
		"M400_NVME": 4000,
	},
	"GCP": {
		"M10":  10,
		"M20":  20,
		"M30":  40,
		"M40":  80,
		"M50":  160,
		"M60":  320,
		"M80":  750,
		"M200": 1500,
		"M300": 2200,
	},
	"AZURE": {
		"M10":  32,
		"M20":  32,
		"M30":  32,
		"M40":  128,
		"M50":  128,
		"M60":  128,
		"M80":  256,
		"M200": 256,
	},
}

DefaultDiskSizeGB represents the Tier and the default disk size for each one it can be use like: DefaultDiskSizeGB["AWS"]["M10"]

Functions

func CheckResponse

func CheckResponse(r *http.Response) 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 DoRequestWithClient

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

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

APIKey represents MongoDB API Key.

type APIKeyInput

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

APIKeyInput represents MongoDB API key input request for Create.

type APIKeysService

APIKeysService is an interface for interfacing with the APIKeys endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/apiKeys/

type APIKeysServiceOp

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

APIKeysServiceOp handles communication with the APIKey related methods of the MongoDB Atlas API

func (*APIKeysServiceOp) Create

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.atlas.mongodb.com/reference/api/apiKeys-orgs-create-one/

func (*APIKeysServiceOp) Delete

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

Delete the API Key specified to {API-KEY-ID} from the organization associated to {ORG-ID}. See more: https://docs.atlas.mongodb.com/reference/api/apiKey-delete-one-apiKey/

func (*APIKeysServiceOp) Get

func (s *APIKeysServiceOp) Get(ctx context.Context, orgID string, 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.atlas.mongodb.com/reference/api/apiKeys-orgs-get-one/

func (*APIKeysServiceOp) List

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.atlas.mongodb.com/reference/api/apiKeys-orgs-get-all/

func (*APIKeysServiceOp) Update

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

Update a API Key in the organization associated to {ORG-ID} See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-orgs-update-one/

type Action added in v0.1.2

type Action struct {
	Action    string     `json:"action,omitempty"`
	Resources []Resource `json:"resources,omitempty"`
}

An Action describes the operation the role will include, for a specific set of Resources.

type ArgError

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

func NewArgError(arg, reason string) *ArgError

NewArgError creates an InputError.

func (*ArgError) Error

func (e *ArgError) Error() string

type AssignAPIKey added in v0.0.3

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

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

type AtlasRole added in v0.1.2

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

AtlasRole represents a role name of API key

type AtlasUser added in v0.1.2

type AtlasUser struct {
	EmailAddress string      `json:"emailAddress"`
	FirstName    string      `json:"firstName"`
	ID           string      `json:"id,omitempty"`
	LastName     string      `json:"lastName"`
	Roles        []AtlasRole `json:"roles"`
	TeamIds      []string    `json:"teamIds,omitempty"`
	Username     string      `json:"username"`
	MobileNumber string      `json:"mobileNumber"`
	Password     string      `json:"password"`
	Country      string      `json:"country"`
}

type AtlasUserAssigned added in v0.1.2

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

AtlasUserAssigned represents the user assigned to the project.

type AtlasUsersResponse added in v0.1.2

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

AtlasUsers represents a array of project

type AtlasUsersService added in v0.1.2

type AtlasUsersService interface {
	List(context.Context, string, *ListOptions) ([]AtlasUser, *Response, error)
	Get(context.Context, string) (*AtlasUser, *Response, error)
	GetByName(context.Context, string) (*AtlasUser, *Response, error)
	Create(context.Context, *AtlasUser) (*AtlasUser, *Response, error)
}

AtlasUsersService is an interface for interfacing with the AtlasUsers endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/users/

type AtlasUsersServiceOp added in v0.1.2

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

AtlasUsersServiceOp handles communication with the AtlasUsers related methos of the MongoDB Atlas API

func (*AtlasUsersServiceOp) Create added in v0.1.2

func (s *AtlasUsersServiceOp) Create(ctx context.Context, createRequest *AtlasUser) (*AtlasUser, *Response, error)

Create creates an Atlas User. See more: https://docs.atlas.mongodb.com/reference/api/user-create/

func (*AtlasUsersServiceOp) Get added in v0.1.2

func (s *AtlasUsersServiceOp) Get(ctx context.Context, userID string) (*AtlasUser, *Response, error)

Get gets a single atlas user. See more: https://docs.atlas.mongodb.com/reference/api/user-get-by-id/

func (*AtlasUsersServiceOp) GetByName added in v0.1.2

func (s *AtlasUsersServiceOp) GetByName(ctx context.Context, username string) (*AtlasUser, *Response, error)

GetByName gets a single atlas user by name. See more: https://docs.atlas.mongodb.com/reference/api/user-get-one-by-name/

func (*AtlasUsersServiceOp) List added in v0.1.2

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

List gets all users. See more: https://docs.atlas.mongodb.com/reference/api/user-get-all/

type Auditing added in v0.1.2

type Auditing struct {
	AuditAuthorizationSuccess *bool  `json:"auditAuthorizationSuccess,omitempty"` // Indicates whether the auditing system captures successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. For more information, see auditAuthorizationSuccess
	AuditFilter               string `json:"auditFilter,omitempty"`               // JSON-formatted audit filter used by the project
	ConfigurationType         string `json:"configurationType,omitempty"`         // Denotes the configuration method for the audit filter. Possible values are: NONE - auditing not configured for the project.m FILTER_BUILDER - auditing configured via Atlas UI filter builderm FILTER_JSON - auditing configured via Atlas custom filter or API
	Enabled                   *bool  `json:"enabled,omitempty"`                   // Denotes whether or not the project associated with the {GROUP-ID} has database auditing enabled.
}

Auditing represents MongoDB Maintenance Windows

type AuditingsService added in v0.1.2

type AuditingsService interface {
	Get(context.Context, string) (*Auditing, *Response, error)
	Configure(context.Context, string, *Auditing) (*Auditing, *Response, error)
}

AuditingsService is an interface for interfacing with the Auditing endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/auditing/

type AuditingsServiceOp added in v0.1.2

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

AuditingsServiceOp handles communication with the Auditings related methods of the MongoDB Atlas API

func (*AuditingsServiceOp) Configure added in v0.1.2

func (s *AuditingsServiceOp) Configure(ctx context.Context, groupID string, configRequest *Auditing) (*Auditing, *Response, error)

Configure the audit configuration for the project associated with {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/auditing-set-auditLog/

func (*AuditingsServiceOp) Get added in v0.1.2

func (s *AuditingsServiceOp) Get(ctx context.Context, groupID string) (*Auditing, *Response, error)

Get audit configuration for the project associated with {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/auditing-get-auditLog/

type AutoScaling

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

AutoScaling configures your cluster to automatically scale its storage

type AwsKms

type AwsKms struct {
	Enabled             *bool  `json:"enabled,omitempty"`             // Specifies whether Encryption at Rest is enabled for an Atlas project, To disable Encryption at Rest, pass only this parameter with a value of false, When you disable Encryption at Rest, Atlas also removes the configuration details.
	AccessKeyID         string `json:"accessKeyID,omitempty"`         // The IAM access key ID with permissions to access the customer master key specified by customerMasterKeyID.
	SecretAccessKey     string `json:"secretAccessKey,omitempty"`     // The IAM secret access key with permissions to access the customer master key specified by customerMasterKeyID.
	CustomerMasterKeyID string `json:"customerMasterKeyID,omitempty"` // The AWS customer master key used to encrypt and decrypt the MongoDB master keys.
	Region              string `json:"region,omitempty"`              // The AWS region in which the AWS customer master key exists: CA_CENTRAL_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, SA_EAST_1
}

AwsKms specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.

type AzureKeyVault

type AzureKeyVault struct {
	Enabled           *bool  `json:"enabled,omitempty"`           // Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
	ClientID          string `json:"clientID,omitempty"`          // The client ID, also known as the application ID, for an Azure application associated with the Azure AD tenant.
	AzureEnvironment  string `json:"azureEnvironment,omitempty"`  // The Azure environment where the Azure account credentials reside. Valid values are the following: AZURE, AZURE_CHINA, AZURE_GERMANY
	SubscriptionID    string `json:"subscriptionID,omitempty"`    // The unique identifier associated with an Azure subscription.
	ResourceGroupName string `json:"resourceGroupName,omitempty"` // The name of the Azure Resource group that contains an Azure Key Vault.
	KeyVaultName      string `json:"keyVaultName,omitempty"`      // The name of an Azure Key Vault containing your key.
	KeyIdentifier     string `json:"keyIdentifier,omitempty"`     // The unique identifier of a key in an Azure Key Vault.
	Secret            string `json:"secret,omitempty"`            // The secret associated with the Azure Key Vault specified by azureKeyVault.tenantID.
	TenantID          string `json:"tenantID,omitempty"`          // The unique identifier for an Azure AD tenant within an Azure subscription.
}

AzureKeyVault specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.

type BiConnector

type BiConnector struct {
	Enabled        *bool  `json:"enabled,omitempty"`
	ReadPreference string `json:"readPreference,omitempty"`
}

BiConnector specifies BI Connector for Atlas configuration on this cluster

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string

	//Services used for communicating with the API
	CustomDBRoles                    CustomDBRolesService
	DatabaseUsers                    DatabaseUsersService
	ProjectIPWhitelist               ProjectIPWhitelistService
	Projects                         ProjectsService
	Clusters                         ClustersService
	CloudProviderSnapshots           CloudProviderSnapshotsService
	APIKeys                          APIKeysService
	ProjectAPIKeys                   ProjectAPIKeysService
	CloudProviderSnapshotRestoreJobs CloudProviderSnapshotRestoreJobsService
	Peers                            PeersService
	Containers                       ContainersService
	EncryptionsAtRest                EncryptionsAtRestService
	WhitelistAPIKeys                 WhitelistAPIKeysService
	PrivateIPMode                    PrivateIpModeService
	MaintenanceWindows               MaintenanceWindowsService
	Teams                            TeamsService
	AtlasUsers                       AtlasUsersService
	GlobalClusters                   GlobalClustersService
	Auditing                         AuditingsService
	// contains filtered or unexported fields
}

Client manages communication with MongoDBAtlas v1.0 API

func New

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

New returns a new MongoDBAtlas API client instance.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new MongoDBAtlas API Client

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.

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 RequestCompletionCallback)

OnRequestCompleted sets the DO API request completion callback

type ClientOpt

type ClientOpt func(*Client) error

ClientOpt are options for New.

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 CloudProviderSnapshot

type CloudProviderSnapshot struct {
	ID               string  `json:"id,omitempty"`               // Unique identifier of the snapshot.
	RetentionInDays  int     `json:"retentionInDays,omitempty"`  // The number of days that Atlas should retain the on-demand snapshot. Must be at least 1 .
	CreatedAt        string  `json:"createdAt,omitempty"`        // UTC ISO 8601 formatted point in time when Atlas took the snapshot.
	ExpiresAt        string  `json:"expiresAt,omitempty"`        // UTC ISO 8601 formatted point in time when Atlas will delete the snapshot.
	Description      string  `json:"description,omitempty"`      // Description of the on-demand snapshot.
	Links            []*Link `json:"links,omitempty"`            // One or more links to sub-resources and/or related resources.
	MasterKeyUUID    string  `json:"masterKeyUUID,omitempty"`    // Unique ID of the AWS KMS Customer Master Key used to encrypt the snapshot. Only visible for clusters using Encryption at Rest via Customer KMS.
	MongodVersion    string  `json:"mongodVersion,omitempty"`    // Version of the MongoDB server.
	SnapshotType     string  `json:"snapshotType,omitempty"`     // Specified the type of snapshot. Valid values are onDemand and scheduled.
	Status           string  `json:"status,omitempty"`           // Current status of the snapshot. One of the following values: queued, inProgress, completed, failed
	StorageSizeBytes int     `json:"storageSizeBytes,omitempty"` // Specifies the size of the snapshot in bytes.
	Type             string  `json:"type,omitempty"`             // Specifies the type of cluster: replicaSet or shardedCluster.
}

CloudProviderSnapshot represents a cloud provider snapshot.

type CloudProviderSnapshotRestoreJob

type CloudProviderSnapshotRestoreJob struct {
	ID                string   `json:"id,omitempty"`                // The unique identifier of the restore job.
	SnapshotID        string   `json:"snapshotId,omitempty"`        // Unique identifier of the snapshot to restore.
	DeliveryType      string   `json:"deliveryType,omitempty"`      // Type of restore job to create. Possible values are: automated or download
	DeliveryURL       []string `json:"deliveryUrl,omitempty"`       // One or more URLs for the compressed snapshot files for manual download. Only visible if deliveryType is download.
	TargetClusterName string   `json:"targetClusterName,omitempty"` // Name of the target Atlas cluster to which the restore job restores the snapshot. Only required if deliveryType is automated.
	TargetGroupID     string   `json:"targetGroupId,omitempty"`     // Unique ID of the target Atlas project for the specified targetClusterName. Only required if deliveryType is automated.
	Cancelled         bool     `json:"cancelled,omitempty"`         // Indicates whether the restore job was canceled.
	CreatedAt         string   `json:"createdAt,omitempty"`         // UTC ISO 8601 formatted point in time when Atlas created the restore job.
	Expired           bool     `json:"expired,omitempty"`           // Indicates whether the restore job expired.
	ExpiresAt         string   `json:"expiresAt,omitempty"`         // UTC ISO 8601 formatted point in time when the restore job expires.
	FinishedAt        string   `json:"finishedAt,omitempty"`        // UTC ISO 8601 formatted point in time when the restore job completed.
	Links             []*Link  `json:"links,omitempty"`             // One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
	Timestamp         string   `json:"timestamp,omitempty"`         // Timestamp in ISO 8601 date and time format in UTC when the snapshot associated to snapshotId was taken.
}

CloudProviderSnapshotRestoreJob represents the structure of a cloudProviderSnapshotRestoreJob.

type CloudProviderSnapshotRestoreJobs

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

CloudProviderSnapshotRestoreJobs represents an array of cloudProviderSnapshotRestoreJob

type CloudProviderSnapshotRestoreJobsService

CloudProviderSnapshotRestoreJobsService is an interface for interfacing with the CloudProviderSnapshotRestoreJobs endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/cloudProviderSnapshotRestoreJobs/

type CloudProviderSnapshotRestoreJobsServiceOp

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

CloudProviderSnapshotRestoreJobsServiceOp handles communication with the CloudProviderSnapshotRestoreJobs related methos of the MongoDB Atlas API

func (*CloudProviderSnapshotRestoreJobsServiceOp) Create

Create creates a new restore job from a cloud provider snapshot associated to the specified cluster. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-create-one/

func (*CloudProviderSnapshotRestoreJobsServiceOp) Delete

Delete cancels the cloud provider snapshot manual download restore job associated to {JOB-ID}. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-delete-one/

func (*CloudProviderSnapshotRestoreJobsServiceOp) Get

Get gets one cloud provider snapshot restore jobs for the specified cluster. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-get-one/

func (*CloudProviderSnapshotRestoreJobsServiceOp) List

List gets all cloud provider snapshot restore jobs for the specified cluster. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-get-all/

type CloudProviderSnapshots

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

CloudProviderSnapshots represents all cloud provider snapshots.

type CloudProviderSnapshotsService

CloudProviderSnapshotsService is an interface for interfacing with the Cloud Provider Snapshots endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot/

type CloudProviderSnapshotsServiceOp

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

CloudProviderSnapshotsServiceOp handles communication with the DatabaseUsers related methos of the MongoDB Atlas API

func (*CloudProviderSnapshotsServiceOp) Create

Create takes one on-demand snapshot. Atlas takes on-demand snapshots immediately, unlike scheduled snapshots which occur at regular intervals. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-take-one-ondemand/

func (*CloudProviderSnapshotsServiceOp) Delete

Delete deletes the snapshot associated to {SNAPSHOT-ID}. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-delete-one/

func (*CloudProviderSnapshotsServiceOp) GetAllCloudProviderSnapshots

func (s *CloudProviderSnapshotsServiceOp) GetAllCloudProviderSnapshots(ctx context.Context, requestParameters *SnapshotReqPathParameters) (*CloudProviderSnapshots, *Response, error)

GetAllCloudProviderSnapshots gets all cloud provider snapshots for the specified cluster. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-get-all/

func (*CloudProviderSnapshotsServiceOp) GetOneCloudProviderSnapshot

func (s *CloudProviderSnapshotsServiceOp) GetOneCloudProviderSnapshot(ctx context.Context, requestParameters *SnapshotReqPathParameters) (*CloudProviderSnapshot, *Response, error)

GetOneCloudProviderSnapshot gets the snapshot associated to {SNAPSHOT-ID}. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-get-one/

type Cluster

type Cluster struct {
	AutoScaling              AutoScaling              `json:"autoScaling,omitempty"`
	BackupEnabled            *bool                    `json:"backupEnabled,omitempty"`
	BiConnector              BiConnector              `json:"biConnector,omitempty"`
	ClusterType              string                   `json:"clusterType,omitempty"`
	DiskSizeGB               *float64                 `json:"diskSizeGB,omitempty"`
	EncryptionAtRestProvider string                   `json:"encryptionAtRestProvider,omitempty"`
	ID                       string                   `json:"id,omitempty"`
	GroupID                  string                   `json:"groupId,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"`
	Name                     string                   `json:"name,omitempty"`
	NumShards                *int64                   `json:"numShards,omitempty"`
	Paused                   *bool                    `json:"paused,omitempty"`
	ProviderBackupEnabled    *bool                    `json:"providerBackupEnabled,omitempty"`
	ProviderSettings         *ProviderSettings        `json:"providerSettings,omitempty"`
	ReplicationFactor        *int64                   `json:"replicationFactor,omitempty"`
	ReplicationSpec          map[string]RegionsConfig `json:"replicationSpec,omitempty"`
	ReplicationSpecs         []ReplicationSpec        `json:"replicationSpecs,omitempty"`
	SrvAddress               string                   `json:"srvAddress,omitempty"`
	StateName                string                   `json:"stateName,omitempty"`
}

Cluster represents MongoDB cluster.

type ClustersService

ClustersService is an interface for interfacing with the Clusters endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/clusters/

type ClustersServiceOp

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

ClustersServiceOp handles communication with the Cluster related methods of the MongoDB Atlas API

func (*ClustersServiceOp) Create

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

Create adds a cluster to the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/clusters-create-one/

func (*ClustersServiceOp) Delete

func (s *ClustersServiceOp) Delete(ctx context.Context, groupID string, clusterName string) (*Response, error)

Delete the cluster specified to {CLUSTER-NAME} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/clusters-delete-one/

func (*ClustersServiceOp) Get

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

Get gets the cluster specified to {ClUSTER-NAME} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/clusters-get-one/

func (*ClustersServiceOp) GetProcessArgs added in v0.1.1

func (s *ClustersServiceOp) GetProcessArgs(ctx context.Context, groupID string, clusterName string) (*ProcessArgs, *Response, error)

GetProcessArgs gets the Advanced Configuration Options for One Cluster See more: https://docs.atlas.mongodb.com/reference/api/clusters-get-advanced-configuration-options/#get-advanced-configuration-options-for-one-cluster

func (*ClustersServiceOp) List

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

List all clusters in the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/clusters-get-all/

func (*ClustersServiceOp) Update

func (s *ClustersServiceOp) Update(ctx context.Context, groupID string, clusterName string, updateRequest *Cluster) (*Cluster, *Response, error)

Update a cluster in the project associated to {GROUP-ID} See more: https://docs.atlas.mongodb.com/reference/api/clusters-modify-one/

func (*ClustersServiceOp) UpdateProcessArgs added in v0.1.1

func (s *ClustersServiceOp) UpdateProcessArgs(ctx context.Context, groupID string, clusterName string, updateRequest *ProcessArgs) (*ProcessArgs, *Response, error)

UpdateProcessArgs Modifies Advanced Configuration Options for One Cluster See more: https://docs.atlas.mongodb.com/reference/api/clusters-modify-advanced-configuration-options/

type Container

type Container struct {
	AtlasCIDRBlock      string `json:"atlasCidrBlock,omitempty"`
	AzureSubscriptionID string `json:"azureSubscriptionId,omitempty"`
	GCPProjectID        string `json:"gcpProjectId,omitempty"`
	ID                  string `json:"id,omitempty"`
	NetworkName         string `json:"networkName,omitempty"`
	ProviderName        string `json:"providerName,omitempty"`
	Provisioned         *bool  `json:"provisioned,omitempty"`
	Region              string `json:"region,omitempty"`
	RegionName          string `json:"regionName,omitempty"`
	VNetName            string `json:"vnetName,omitempty"`
	VPCID               string `json:"vpcId,omitempty"`
}

Container represents MongoDB network peering containter.

type ContainersListOptions added in v0.1.2

type ContainersListOptions struct {
	ProviderName string `url:"providerName,omitempty"`
	ListOptions
}

type ContainersService

ContainersService is an interface for interfacing with the Network Peering Containers endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/vpc/

type ContainersServiceOp

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

ContainersServiceOp handles communication with the Network Peering Container related methods of the MongoDB Atlas API

func (*ContainersServiceOp) Create

func (s *ContainersServiceOp) Create(ctx context.Context, groupID string, createRequest *Container) (*Container, *Response, error)

Add a network peering container to the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/vpc-create-container/

func (*ContainersServiceOp) Delete

func (s *ContainersServiceOp) Delete(ctx context.Context, groupID string, containerID string) (*Response, error)

Delete the network peering container specified to {CONTAINER-ID} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/vpc-delete-one-container/

func (*ContainersServiceOp) Get

func (s *ContainersServiceOp) Get(ctx context.Context, groupID string, containerID string) (*Container, *Response, error)

Get gets the network peering container specified to {CONTAINER-ID} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/vpc-get-container/

func (*ContainersServiceOp) List

func (s *ContainersServiceOp) List(ctx context.Context, groupID string, listOptions *ContainersListOptions) ([]Container, *Response, error)

List all containers in the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/vpc-get-containers-list/

func (*ContainersServiceOp) Update

func (s *ContainersServiceOp) Update(ctx context.Context, groupID string, containerID string, updateRequest *Container) (*Container, *Response, error)

Update a network peering container in the project associated to {GROUP-ID} See more: https://docs.atlas.mongodb.com/reference/api/vpc-update-container/

type CustomDBRole added in v0.1.2

type CustomDBRole struct {
	Actions        []Action        `json:"actions,omitempty"`
	InheritedRoles []InheritedRole `json:"inheritedRoles,omitempty"`
	RoleName       string          `json:"roleName,omitempty"`
}

CustomDBRole represents a Custom MongoDB Role in your cluster.

type CustomDBRolesService added in v0.1.2

CustomDBRolesService is an interface for working wit the Custom MongoDB Roles endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/custom-roles/

type CustomDBRolesServiceOp added in v0.1.2

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

CustomDBRolesServiceOp handles communication with the CustomDBRoles related methods of the MongoDB Atlas API

func (*CustomDBRolesServiceOp) Create added in v0.1.2

func (s *CustomDBRolesServiceOp) Create(ctx context.Context, groupID string, createRequest *CustomDBRole) (*CustomDBRole, *Response, error)

Creates a new Custom MongoDB Role in the project. See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-create-a-role/

func (*CustomDBRolesServiceOp) Delete added in v0.1.2

func (s *CustomDBRolesServiceOp) Delete(ctx context.Context, groupID string, roleName string) (*Response, error)

Deletes a single Custom MongoDB Role. See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-delete-a-role/

func (*CustomDBRolesServiceOp) Get added in v0.1.2

func (s *CustomDBRolesServiceOp) Get(ctx context.Context, groupID string, roleName string) (*CustomDBRole, *Response, error)

Gets a single Custom MongoDB Role in the project. See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-get-single-role/

func (*CustomDBRolesServiceOp) List added in v0.1.2

func (s *CustomDBRolesServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) (*[]CustomDBRole, *Response, error)

List gets all custom db roles in the project. See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-get-all-roles/

func (*CustomDBRolesServiceOp) Update added in v0.1.2

func (s *CustomDBRolesServiceOp) Update(ctx context.Context, groupID string, roleName string, updateRequest *CustomDBRole) (*CustomDBRole, *Response, error)

Updates a single Custom MongoDB Role. See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-update-a-role/

type CustomZoneMapping added in v0.1.2

type CustomZoneMapping struct {
	Location string `json:"location"`
	Zone     string `json:"zone"`
}

CustomZoneMapping represents the custom zone mapping.

type CustomZoneMappingsRequest added in v0.1.2

type CustomZoneMappingsRequest struct {
	CustomZoneMappings []CustomZoneMapping `json:"customZoneMappings"`
}

CustomZoneMappingsRequest represents the request related to add custom zone mappings to a global cluster.

type DatabaseUser

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

DatabaseUser represents MongoDB users in your cluster.

type DatabaseUsersService

DatabaseUsersService is an interface for interfacing with the Database Users endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/database-users/index.html

type DatabaseUsersServiceOp

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

DatabaseUsersServiceOp handles communication with the DatabaseUsers related methos of the MongoDB Atlas API

func (*DatabaseUsersServiceOp) Create

func (s *DatabaseUsersServiceOp) Create(ctx context.Context, groupID string, createRequest *DatabaseUser) (*DatabaseUser, *Response, error)

Create creates a user for the project. See more: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/

func (*DatabaseUsersServiceOp) Delete

func (s *DatabaseUsersServiceOp) Delete(ctx context.Context, groupID string, username string) (*Response, error)

Delete deletes a user for the project. See more: https://docs.atlas.mongodb.com/reference/api/database-users-delete-a-user/

func (*DatabaseUsersServiceOp) Get

func (s *DatabaseUsersServiceOp) Get(ctx context.Context, groupID string, username string) (*DatabaseUser, *Response, error)

Get gets a single user in the project. See more: https://docs.atlas.mongodb.com/reference/api/database-users-get-single-user/

func (*DatabaseUsersServiceOp) List

func (s *DatabaseUsersServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) ([]DatabaseUser, *Response, error)

List gets all users in the project. See more: https://docs.atlas.mongodb.com/reference/api/database-users-get-all-users/

func (*DatabaseUsersServiceOp) Update

func (s *DatabaseUsersServiceOp) Update(ctx context.Context, groupID string, username string, updateRequest *DatabaseUser) (*DatabaseUser, *Response, error)

Update updates a user for the project. See more: https://docs.atlas.mongodb.com/reference/api/database-users-update-a-user/

type EncryptionAtRest

type EncryptionAtRest struct {
	GroupID        string                            `json:"groupId,omitempty"` // The unique identifier for the project.
	AwsKms         `json:"awsKms,omitempty"`         // AwsKms specifies AWS KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
	AzureKeyVault  `json:"azureKeyVault,omitempty"`  // AzureKeyVault specifies Azure Key Vault configuration details and whether Encryption at Rest is enabled for an Atlas project.
	GoogleCloudKms `json:"googleCloudKms,omitempty"` // Specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.
}

EncryptionAtRest represents a configuration Encryption at Rest for an Atlas project.

type EncryptionsAtRestService

type EncryptionsAtRestService interface {
	Create(context.Context, *EncryptionAtRest) (*EncryptionAtRest, *Response, error)
	Get(context.Context, string) (*EncryptionAtRest, *Response, error)
	Delete(context.Context, string) (*Response, error)
}

EncryptionsAtRestService is an interface for interfacing with the Encryption at Rest endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/encryption-at-rest/

type EncryptionsAtRestServiceOp

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

EncryptionsAtRestServiceOp handles communication with the DatabaseUsers related methos of the MongoDB Atlas API

func (*EncryptionsAtRestServiceOp) Create

Create takes one on-demand snapshot. Atlas takes on-demand snapshots immediately, unlike scheduled snapshots which occur at regular intervals. See more: https://docs.atlas.mongodb.com/reference/api/enable-configure-encryptionatrest/

func (*EncryptionsAtRestServiceOp) Delete

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

Delete disable the AWS, Azure and Google Encryption at Rest. See more: https://docs.atlas.mongodb.com/reference/api/enable-configure-encryptionatrest/

func (*EncryptionsAtRestServiceOp) Get

Get retrieves the current configuration for Encryption at Rest for an Atlas project. See more: https://docs.atlas.mongodb.com/reference/api/get-configuration-encryptionatrest/

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response
	//The error code, which is simply the HTTP status code.
	ErrorCode int `json:"Error"`

	//A short description of the error, which is simply the HTTP status phrase.
	Reason string `json:"reason"`

	//A more detailed description of the error.
	Detail string `json:"detail,omitempty"`
}

ErrorResponse reports the error caused by an API request.

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type GlobalCluster added in v0.1.2

type GlobalCluster struct {
	CustomZoneMapping map[string]string  `json:"customZoneMapping"`
	ManagedNamespaces []ManagedNamespace `json:"managedNamespaces"`
}

GlobalCluster represents MongoDB Global Cluster Configuration in your Global Cluster.

type GlobalClustersService added in v0.1.2

type GlobalClustersService interface {
	Get(context.Context, string, string) (*GlobalCluster, *Response, error)
	AddManagedNamespace(context.Context, string, string, *ManagedNamespace) (*GlobalCluster, *Response, error)
	DeleteManagedNamespace(context.Context, string, string, *ManagedNamespace) (*GlobalCluster, *Response, error)
	AddCustomZoneMappings(context.Context, string, string, *CustomZoneMappingsRequest) (*GlobalCluster, *Response, error)
	DeleteCustomZoneMappings(context.Context, string, string) (*GlobalCluster, *Response, error)
}

GlobalClustersService is an interface for interfacing with the Global Clusters endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/global-clusters/

type GlobalClustersServiceOp added in v0.1.2

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

GlobalClustersServiceOp handles communication with the GlobalClusters related methos of the MongoDB Atlas API

func (*GlobalClustersServiceOp) AddCustomZoneMappings added in v0.1.2

func (s *GlobalClustersServiceOp) AddCustomZoneMappings(ctx context.Context, groupID string, clusterName string, createRequest *CustomZoneMappingsRequest) (*GlobalCluster, *Response, error)

AddCustomZoneMappings adds an entry to the list of custom zone mappings for the specified Global Cluster. See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-add-customzonemapping/

func (*GlobalClustersServiceOp) AddManagedNamespace added in v0.1.2

func (s *GlobalClustersServiceOp) AddManagedNamespace(ctx context.Context, groupID string, clusterName string, createRequest *ManagedNamespace) (*GlobalCluster, *Response, error)

AddManagedNamespace adds a managed namespace to the specified Global Cluster. See more: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/

func (*GlobalClustersServiceOp) DeleteCustomZoneMappings added in v0.1.2

func (s *GlobalClustersServiceOp) DeleteCustomZoneMappings(ctx context.Context, groupID string, clusterName string) (*GlobalCluster, *Response, error)

DeleteCustomZoneMappings removes all custom zone mappings from the specified Global Cluster. See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-delete-namespace/

func (*GlobalClustersServiceOp) DeleteManagedNamespace added in v0.1.2

func (s *GlobalClustersServiceOp) DeleteManagedNamespace(ctx context.Context, groupID string, clusterName string, deleteRequest *ManagedNamespace) (*GlobalCluster, *Response, error)

DeleteManagedNamespace deletes the managed namespace configuration of the global cluster given. See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-delete-namespace/

func (*GlobalClustersServiceOp) Get added in v0.1.2

func (s *GlobalClustersServiceOp) Get(ctx context.Context, groupID string, clusterName string) (*GlobalCluster, *Response, error)

Get retrieves all managed namespaces and custom zone mappings associated with the specified Global Cluster. See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-retrieve-namespaces/

type GoogleCloudKms

type GoogleCloudKms struct {
	Enabled              *bool  `json:"enabled,omitempty"`              // Specifies whether Encryption at Rest is enabled for an Atlas project. To disable Encryption at Rest, pass only this parameter with a value of false. When you disable Encryption at Rest, Atlas also removes the configuration details.
	ServiceAccountKey    string `json:"serviceAccountKey,omitempty"`    // String-formatted JSON object containing GCP KMS credentials from your GCP account.
	KeyVersionResourceID string `json:"keyVersionResourceID,omitempty"` // 	The Key Version Resource ID from your GCP account.
}

GoogleCloudKms specifies GCP KMS configuration details and whether Encryption at Rest is enabled for an Atlas project.

type InheritedRole added in v0.1.2

type InheritedRole struct {
	Db   string `json:"db,omitempty"`
	Role string `json:"role,omitempty"`
}

An InheritedRole describes the role that this Role inherits from.

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 ListOptions

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

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

type MaintenanceWindow added in v0.1.2

type MaintenanceWindow struct {
	DayOfWeek         int   `json:"dayOfWeek,omitempty"`         // Day of the week when you would like the maintenance window to start as a 1-based integer.Sunday 	1, Monday 	2, Tuesday 	3, Wednesday 	4, Thursday 5, Friday 6, Saturday 7
	HourOfDay         *int  `json:"hourOfDay,omitempty"`         // Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12.
	StartASAP         *bool `json:"startASAP,omitempty"`         // Flag indicating whether project maintenance has been directed to start immediately.
	NumberOfDeferrals int   `json:"numberOfDeferrals,omitempty"` // Number of times the current maintenance event for this project has been deferred.
}

MaintenanceWindow represents MongoDB Maintenance Windows

type MaintenanceWindowsService added in v0.1.2

type MaintenanceWindowsService interface {
	Get(context.Context, string) (*MaintenanceWindow, *Response, error)
	Update(context.Context, string, *MaintenanceWindow) (*Response, error)
	Defer(context.Context, string) (*Response, error)
	Reset(context.Context, string) (*Response, error)
}

MaintenanceWindowsService is an interface for interfacing with the Maintenance Windows endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/maintenance-windows/

type MaintenanceWindowsServiceOp added in v0.1.2

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

MaintenanceWindowsServiceOp handles communication with the MaintenanceWindows related methods of the MongoDB Atlas API

func (*MaintenanceWindowsServiceOp) Defer added in v0.1.2

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

Defer maintenance for the given project for one week. See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-defer/

func (*MaintenanceWindowsServiceOp) Get added in v0.1.2

Get gets the current user-defined maintenance window for the given project. See more: https://docs.atlas.mongodb.com/reference/api/maintenance-windows-view-in-one-project/

func (*MaintenanceWindowsServiceOp) Reset added in v0.1.2

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

Reset clears the current maintenance window for the given project. See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-clear/

func (*MaintenanceWindowsServiceOp) Update added in v0.1.2

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

Update the current maintenance window for the given project. See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-update/

type ManagedNamespace added in v0.1.2

type ManagedNamespace struct {
	Db             string `json:"db"`
	Collection     string `json:"collection"`
	CustomShardKey string `json:"customShardKey,omitempty"`
}

ManagedNamespace represents the information about managed namespace configuration.

type Peer

type Peer struct {
	AccepterRegionName  string `json:"accepterRegionName,omitempty"`
	AWSAccountId        string `json:"awsAccountId,omitempty"`
	ConnectionID        string `json:"connectionId,omitempty"`
	ContainerID         string `json:"containerId,omitempty"`
	ErrorStateName      string `json:"errorStateName,omitempty"`
	ID                  string `json:"id,omitempty"`
	ProviderName        string `json:"providerName,omitempty"`
	RouteTableCIDRBlock string `json:"routeTableCidrBlock,omitempty"`
	StatusName          string `json:"statusName,omitempty"`
	VpcID               string `json:"vpcId,omitempty"`
	AtlasCIDRBlock      string `json:"atlasCidrBlock,omitempty"`
	AzureDirectoryID    string `json:"azureDirectoryId,omitempty"`
	AzureSubscriptionId string `json:"azureSubscriptionId,omitempty"`
	ResourceGroupName   string `json:"resourceGroupName,omitempty"`
	VNetName            string `json:"vnetName,omitempty"`
	ErrorState          string `json:"errorState,omitempty"`
	Status              string `json:"status,omitempty"`
	GCPProjectID        string `json:"gcpProjectId,omitempty"`
	NetworkName         string `json:"networkName,omitempty"`
	ErrorMessage        string `json:"errorMessage,omitempty"`
}

Peer represents MongoDB peer connection.

type PeersService

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

PeersService is an interface for interfacing with the Peers endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/peers/

type PeersServiceOp

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

PeersServiceOp handles communication with the Network Peering Connection related methods of the MongoDB Atlas API

func (*PeersServiceOp) Create

func (s *PeersServiceOp) Create(ctx context.Context, groupID string, createRequest *Peer) (*Peer, *Response, error)

Add a peer connection to the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/

func (*PeersServiceOp) Delete

func (s *PeersServiceOp) Delete(ctx context.Context, groupID string, peerID string) (*Response, error)

Delete the peer connection specified to {PEER-ID} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/vpc-delete-peering-connection/

func (*PeersServiceOp) Get

func (s *PeersServiceOp) Get(ctx context.Context, groupID string, peerID string) (*Peer, *Response, error)

Get gets the netwprk peering connection specified to {PEER-ID} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/vpc-get-connection/

func (*PeersServiceOp) List

func (s *PeersServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) ([]Peer, *Response, error)

List all peers in the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/vpc-get-connections-list/

func (*PeersServiceOp) Update

func (s *PeersServiceOp) Update(ctx context.Context, groupID string, peerID string, updateRequest *Peer) (*Peer, *Response, error)

Update a peer connection in the project associated to {GROUP-ID} See more: https://docs.atlas.mongodb.com/reference/api/vpc-update-peering-connection/

type PrivateIPMode added in v0.1.0

type PrivateIPMode struct {
	Enabled *bool `json:"enabled,omitempty"`
}

PrivateIPMode represents MongoDB Private IP Mode Configutation.

type PrivateIpModeService added in v0.1.0

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

PrivateIpModeService is an interface for interfacing with the PrivateIpMode endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/get-private-ip-mode-for-project/

type PrivateIpModeServiceOp added in v0.1.0

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

PrivateIpModeServiceOp handles communication with the Private IP Mode related methods of the MongoDB Atlas API

func (*PrivateIpModeServiceOp) Get added in v0.1.0

Get Verify Connect via Peering Only Mode from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/get-private-ip-mode-for-project/

func (*PrivateIpModeServiceOp) Update added in v0.1.0

func (s *PrivateIpModeServiceOp) Update(ctx context.Context, groupID string, updateRequest *PrivateIPMode) (*PrivateIPMode, *Response, error)

Update connection via Peering Only Mode in the project associated to {GROUP-ID} See more: https://docs.atlas.mongodb.com/reference/api/set-private-ip-mode-for-project/

type ProcessArgs added in v0.1.1

type ProcessArgs struct {
	FailIndexKeyTooLong              *bool  `json:"failIndexKeyTooLong,omitempty"`
	JavascriptEnabled                *bool  `json:"javascriptEnabled,omitempty"`
	MinimumEnabledTLSProtocol        string `json:"minimumEnabledTlsProtocol,omitempty"`
	NoTableScan                      *bool  `json:"noTableScan,omitempty"`
	OplogSizeMB                      *int64 `json:"oplogSizeMB,omitempty"`
	SampleSizeBIConnector            *int64 `json:"sampleSizeBIConnector,omitempty"`
	SampleRefreshIntervalBIConnector *int64 `json:"sampleRefreshIntervalBIConnector,omitempty"`
}

ProcessArgs represents the advanced configuration options for the cluster

type Project

type Project struct {
	ID           string  `json:"id,omitempty"`
	OrgID        string  `json:"orgId,omitempty"`
	Name         string  `json:"name,omitempty"`
	ClusterCount int     `json:"clusterCount,omitempty"`
	Created      string  `json:"created,omitempty"`
	Links        []*Link `json:"links,omitempty"`
}

Project represents the structure of a project.

type ProjectAPIKeysOp

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

ProjectAPIKeysOp handles communication with the APIKey related methods of the MongoDB Atlas API

func (*ProjectAPIKeysOp) Assign

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

func (*ProjectAPIKeysOp) Create

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

func (*ProjectAPIKeysOp) List

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

func (*ProjectAPIKeysOp) Unassign

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

Unassign an API-KEY related to {GROUP-ID} to a the project with {API-KEY-ID}. See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/delete-one-apiKey-in-one-project/

type ProjectAPIKeysService

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 endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/apiKeys/#organization-api-keys-on-projects-endpoints

type ProjectIPWhitelist

type ProjectIPWhitelist struct {
	Comment         string `json:"comment,omitempty"`
	GroupID         string `json:"groupId,omitempty"`
	CIDRBlock       string `json:"cidrBlock,omitempty"`
	IPAddress       string `json:"ipAddress,omitempty"`
	DeleteAfterDate string `json:"deleteAfterDate,omitempty"`
}

ProjectIPWhitelist represents MongoDB project's IP whitelist.

type ProjectIPWhitelistService

ProjectIPWhitelistService is an interface for interfacing with the Project IP Whitelist endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/whitelist/

type ProjectIPWhitelistServiceOp

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

ProjectIPWhitelistServiceOp handles communication with the ProjectIPWhitelist related methods of the MongoDB Atlas API

func (*ProjectIPWhitelistServiceOp) Create

func (s *ProjectIPWhitelistServiceOp) Create(ctx context.Context, groupID string, createRequest []*ProjectIPWhitelist) ([]ProjectIPWhitelist, *Response, error)

Add one or more whitelist entries to the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/

func (*ProjectIPWhitelistServiceOp) Delete

func (s *ProjectIPWhitelistServiceOp) Delete(ctx context.Context, groupID string, whitelistEntry string) (*Response, error)

Delete the whitelist entry specified to {WHITELIST-ENTRY} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/whitelist-delete-one/

func (*ProjectIPWhitelistServiceOp) Get

func (s *ProjectIPWhitelistServiceOp) Get(ctx context.Context, groupID string, whiteListEntry string) (*ProjectIPWhitelist, *Response, error)

Get gets the whitelist entry specified to {WHITELIST-ENTRY} from the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/whitelist-get-one-entry/

func (*ProjectIPWhitelistServiceOp) List

List all whitelist entries in the project associated to {GROUP-ID}. See more: https://docs.atlas.mongodb.com/reference/api/whitelist-get-all/

func (*ProjectIPWhitelistServiceOp) Update

func (s *ProjectIPWhitelistServiceOp) Update(ctx context.Context, groupID string, whitelistEntry string, updateRequest []*ProjectIPWhitelist) ([]ProjectIPWhitelist, *Response, error)

Update one or more whitelist entries in the project associated to {GROUP-ID} See more: https://docs.atlas.mongodb.com/reference/api/whitelist-update-one/

type ProjectTeam added in v0.1.2

type ProjectTeam struct {
	TeamID string      `json:"teamId"`
	Roles  []*RoleName `json:"roles"`
}

ProjectTeam reperesents 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 ProjectsService

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

ProjectsService is an interface for interfacing with the Projects endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/projects/

type ProjectsServiceOp

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

ProjectsServiceOp handles communication with the Projects related methos of the MongoDB Atlas API

func (*ProjectsServiceOp) AddTeamsToProject

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

AddTeamsToProject adds teams to a project See more: https://docs.atlas.mongodb.com/reference/api/project-add-team/

func (*ProjectsServiceOp) Create

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

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

func (*ProjectsServiceOp) Delete

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

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

func (*ProjectsServiceOp) GetAllProjects

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

GetAllProjects gets all project. See more: https://docs.atlas.mongodb.com/reference/api/project-get-all/

func (*ProjectsServiceOp) GetOneProject

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

GetOneProject gets a single project. See more: https://docs.atlas.mongodb.com/reference/api/project-get-one/

func (*ProjectsServiceOp) GetOneProjectByName

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

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

func (*ProjectsServiceOp) GetProjectTeamsAssigned

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

GetProjectTeamsAssigned gets all the teams assigned to a project. See more: https://docs.atlas.mongodb.com/reference/api/project-get-teams/

type ProviderSettings

type ProviderSettings struct {
	BackingProviderName string `json:"backingProviderName,omitempty"`
	DiskIOPS            *int64 `json:"diskIOPS,omitempty"`
	DiskTypeName        string `json:"diskTypeName,omitempty"`
	EncryptEBSVolume    *bool  `json:"encryptEBSVolume,omitempty"`
	InstanceSizeName    string `json:"instanceSizeName,omitempty"`
	ProviderName        string `json:"providerName,omitempty"`
	RegionName          string `json:"regionName,omitempty"`
	VolumeType          string `json:"volumeType,omitempty"`
}

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

type RegionsConfig

type RegionsConfig struct {
	AnalyticsNodes *int64 `json:"analyticsNodes,omitempty"`
	ElectableNodes *int64 `json:"electableNodes,omitempty"`
	Priority       *int64 `json:"priority,omitempty"`
	ReadOnlyNodes  *int64 `json:"readOnlyNodes,omitempty"`
}

RegionsConfig describes the region’s priority in elections and the number and type of MongoDB nodes Atlas deploys to the region.

type ReplicationSpec

type ReplicationSpec struct {
	ID            string                   `json:"id,omitempty"`
	NumShards     *int64                   `json:"numShards,omitempty"`
	ZoneName      string                   `json:"zoneName,omitempty"`
	RegionsConfig map[string]RegionsConfig `json:"regionsConfig,omitempty"`
}

ReplicationSpec represents a configuration for cluster regions

type RequestCompletionCallback

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

RequestCompletionCallback defines the type of the request callback function

type Resource added in v0.1.2

type Resource struct {
	Collection string `json:"collection,omitempty"`
	Db         string `json:"db,omitempty"`
	Cluster    bool   `json:"cluster,omitempty"`
}

A Resource describes a specific resource the Role will allow operating on.

type Response

type Response struct {
	*http.Response

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

Response is a MongoDBAtlas response. This wraps the standard http.Response returned from MongoDBAtlas API.

func (*Response) CurrentPage

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

CurrentPage gets the current page for list pagination request.

func (*Response) IsLastPage

func (resp *Response) IsLastPage() bool

IsLastPage returns true if the current page is the last page

type Result

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 {
	RoleName       string `json:"roleName,omitempty"`
	DatabaseName   string `json:"databaseName,omitempty"`
	CollectionName string `json:"collectionName,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 RoleName

type RoleName struct {
	RoleName string `json:"rolesNames"`
}

RoleName represents the kind of user role in your project

type SnapshotReqPathParameters

type SnapshotReqPathParameters struct {
	GroupID     string `json:"groupId,omitempty"`     // The unique identifier of the project for the Atlas cluster.
	SnapshotID  string `json:"snapshotId,omitempty"`  // The unique identifier of the snapshot you want to retrieve.
	ClusterName string `json:"clusterName,omitempty"` // The name of the Atlas cluster that contains the snapshots you want to retrieve.
	JobID       string `json:"jobId,omitempty"`       //The unique identifier of the restore job to retrieve.
}

SnapshotReqPathParameters represents all the pissible parameters to make the request

type Team

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

type TeamRoles added in v0.1.2

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

type TeamUpdateRoles added in v0.1.2

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

type TeamUpdateRolesResponse added in v0.1.2

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

type TeamsAssigned

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

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

Teams represents a array of project

type TeamsService added in v0.1.2

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) ([]AtlasUser, *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)
	AddUserToTeam(context.Context, string, string, string) ([]AtlasUser, *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 is an interface for interfacing with the Teams endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/teams/

type TeamsServiceOp added in v0.1.2

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

TeamsServiceOp handles communication with the Teams related methos of the MongoDB Atlas API

func (*TeamsServiceOp) AddUserToTeam added in v0.1.2

func (s *TeamsServiceOp) AddUserToTeam(ctx context.Context, orgID, teamID, userID string) ([]AtlasUser, *Response, error)

AddUserToTeam adds a user from the organization associated with {ORG-ID} to the team with ID {TEAM-ID}. See more: https://docs.atlas.mongodb.com/reference/api/teams-add-user/

func (*TeamsServiceOp) Create added in v0.1.2

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

Create creates a team. See more: https://docs.atlas.mongodb.com/reference/api/teams-create-one/

func (*TeamsServiceOp) Get added in v0.1.2

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

Get gets a single team in the organization by team ID. See more: https://docs.atlas.mongodb.com/reference/api/teams-get-one-by-id/

func (*TeamsServiceOp) GetOneTeamByName added in v0.1.2

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.atlas.mongodb.com/reference/api/project-get-one-by-name/

func (*TeamsServiceOp) GetTeamUsersAssigned added in v0.1.2

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

GetTeamUsersAssigned gets all the users assigned to a team. See more: https://docs.atlas.mongodb.com/reference/api/teams-get-all-users/

func (*TeamsServiceOp) List added in v0.1.2

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

GetAllTeams gets all teams. See more: https://docs.atlas.mongodb.com/reference/api/project-get-all/

func (*TeamsServiceOp) RemoveTeamFromOrganization added in v0.1.2

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

func (*TeamsServiceOp) RemoveTeamFromProject added in v0.1.2

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

func (*TeamsServiceOp) RemoveUserToTeam added in v0.1.2

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

func (*TeamsServiceOp) Rename added in v0.1.2

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

RenameTeam renames a team See more: https://docs.atlas.mongodb.com/reference/api/teams-rename-one/

func (*TeamsServiceOp) UpdateTeamRoles added in v0.1.2

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

UpdateTeamRoles Update the roles of a team in an Atlas project. See more: https://docs.atlas.mongodb.com/reference/api/teams-update-roles/

type WhitelistAPIKey added in v0.0.2

type WhitelistAPIKey struct {
	CidrBlock       string  `json:"cidrBlock,omitempty"`       // CIDR-notated range of whitelisted 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 whitelist.
	IPAddress       string  `json:"ipAddress,omitempty"`       // Whitelisted IP address.
	LastUsed        string  `json:"lastUsed,omitempty"`        // Date of the most recent request that originated from this IP address. This field only appears if at least one request has originated from this IP address, and is only updated when a whitelisted 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.}
}

WhitelistAPIKey represents a Whitelist API key.

type WhitelistAPIKeys added in v0.0.2

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

WhitelistAPIKeys represents all Whitelist API keys.

type WhitelistAPIKeysReq added in v0.0.2

type WhitelistAPIKeysReq struct {
	IPAddress string `json:"ipAddress,omitempty"` // IP address to be added to the whitelist for the API key.
	CidrBlock string `json:"cidrBlock,omitempty"` // Whitelist entry in CIDR notation to be added for the API key.
}

WhitelistAPIKeysReq represents the request to the mehtod create

type WhitelistAPIKeysService added in v0.0.2

WhitelistAPIKeysService is an interface for interfacing with the Whitelist API Keys endpoints of the MongoDB Atlas API. See more: https://docs.atlas.mongodb.com/reference/api/apiKeys/#organization-api-key-endpoints

type WhitelistAPIKeysServiceOp added in v0.0.2

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

WhitelistAPIKeysServiceOp handles communication with the Whitelist API keys related methods of the MongoDB Atlas API

func (*WhitelistAPIKeysServiceOp) Create added in v0.0.2

func (s *WhitelistAPIKeysServiceOp) Create(ctx context.Context, orgID string, apiKeyID string, createRequest []*WhitelistAPIKeysReq) (*WhitelistAPIKeys, *Response, error)

Create a submit a POST request containing ipAddress or cidrBlock values which are not already present in the whitelist, Atlas adds those entries to the list of existing entries in the whitelist. See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-org-whitelist-create/

func (*WhitelistAPIKeysServiceOp) Delete added in v0.0.2

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

Delete deletes the Whitelist API keys. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-delete-one/

func (*WhitelistAPIKeysServiceOp) Get added in v0.0.2

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

Get gets the Whitelist API keys. See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-get-one/

func (*WhitelistAPIKeysServiceOp) List added in v0.0.2

List gets all Whitelist API keys. See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-org-whitelist-get-all/

Jump to

Keyboard shortcuts

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