store

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertConfigurationLister

type AlertConfigurationLister interface {
	AlertConfigurations(*admin.ListAlertConfigurationsApiParams) (*admin.PaginatedAlertConfig, error)
}

type AllClustersLister

type AllClustersLister interface {
	ClusterLister
	ServerlessInstanceLister
}

type AtlasClusterConfigurationOptionsDescriber

type AtlasClusterConfigurationOptionsDescriber interface {
	AtlasClusterConfigurationOptions(string, string) (*atlasClustersPinned.ClusterDescriptionProcessArgs, error)
}

type AuditingDescriber

type AuditingDescriber interface {
	Auditing(string) (*atlasv2.AuditLog, error)
}

type AuthenticatedConfig

type AuthenticatedConfig interface {
	CredentialsGetter
	ServiceGetter
}

AuthenticatedConfig an interface of the methods needed to set up a Store.

type CloudProviderAccessRoleLister

type CloudProviderAccessRoleLister interface {
	CloudProviderAccessRoles(string) (*atlasv2.CloudProviderAccessRoles, error)
}

type ClusterDescriber

type ClusterDescriber interface {
	AtlasCluster(string, string) (*atlasClustersPinned.AdvancedClusterDescription, error)
	FlexCluster(string, string) (*atlasv2.FlexClusterDescription20241113, error)
}

type CompliancePolicyDescriber

type CompliancePolicyDescriber interface {
	DescribeCompliancePolicy(projectID string) (*atlasv2.DataProtectionSettings20231001, error)
}

type ConnectedOrgConfigsDescriber

type ConnectedOrgConfigsDescriber interface {
	GetConnectedOrgConfig(opts *atlasv2.GetConnectedOrgConfigApiParams) (*atlasv2.ConnectedOrgConfig, error)
}

type ContainersListOptions

type ContainersListOptions struct {
	ListOptions
	ProviderName string
}

type CredentialsGetter

type CredentialsGetter interface {
	PublicAPIKey() string
	PrivateAPIKey() string
	Token() (*atlasauth.Token, error)
	AuthType() config.AuthMechanism
}

CredentialsGetter interface for how to get credentials when Store must be authenticated.

type DataFederationDescriber

type DataFederationDescriber interface {
	DataFederation(string, string) (*admin.DataLakeTenant, error)
}

type DataFederationLister

type DataFederationLister interface {
	DataFederationList(string) ([]admin.DataLakeTenant, error)
}

type DataFederationStore

type DataFederationStore interface {
	DataFederationLister
	DataFederationDescriber
}

type DatabaseRoleLister

type DatabaseRoleLister interface {
	DatabaseRoles(string) ([]atlasv2.UserCustomDBRole, error)
}

type DatabaseUserLister

type DatabaseUserLister interface {
	DatabaseUsers(groupID string, opts *ListOptions) (*atlasv2.PaginatedApiAtlasDatabaseUser, error)
}

type EncryptionAtRestDescriber

type EncryptionAtRestDescriber interface {
	EncryptionAtRest(string) (*atlasv2.EncryptionAtRest, error)
}

type FederationSettingsDescriber

type FederationSettingsDescriber interface {
	FederationSetting(opts *atlasv2.GetFederationSettingsApiParams) (*atlasv2.OrgFederationSettings, error)
}

type GlobalClusterDescriber

type GlobalClusterDescriber interface {
	GlobalCluster(string, string) (*atlasClustersPinned.GeoSharding, error)
}

type IdentityProviderDescriber

type IdentityProviderDescriber interface {
	IdentityProvider(opts *atlasv2.GetIdentityProviderApiParams) (*atlasv2.FederationIdentityProvider, error)
}

type IdentityProviderLister

type IdentityProviderLister interface {
	IdentityProviders(opts *atlasv2.ListIdentityProvidersApiParams) (*atlasv2.PaginatedFederationIdentityProvider, error)
}

type IntegrationLister

type IntegrationLister interface {
	Integrations(string) (*atlasv2.PaginatedIntegration, error)
}

type InterfaceEndpointDescriber

type InterfaceEndpointDescriber interface {
	InterfaceEndpoint(projectID, cloudProvider, privateEndpointID, endpointServiceID string) (*atlasv2.PrivateLinkEndpoint, error)
}

type ListOptions

type ListOptions struct {
	PageNum      int
	ItemsPerPage int
	IncludeCount bool
}

type MaintenanceWindowDescriber

type MaintenanceWindowDescriber interface {
	MaintenanceWindow(string) (*atlasv2.GroupMaintenanceWindow, error)
}

type OperatorDBUsersStore

type OperatorDBUsersStore interface {
	DatabaseUserLister
}

type OperatorOrgStore

type OperatorOrgStore interface {
	OrganizationAPIKeyCreator
	ProjectAPIKeyAssigner
}

type OperatorPrivateEndpointStore

type OperatorPrivateEndpointStore interface {
	InterfaceEndpointDescriber
	PrivateEndpointLister
}

type OperatorTeamsStore

type OperatorTeamsStore interface {
	TeamDescriber
	ProjectTeamLister
	TeamUserLister
}

type Option

type Option func(s *Store) error

Option is any configuration for Store. New will take a list of Option and process them sequentially. The store package provides a list of pointers and preset set of Option you can use but you can implement your own.

func AuthenticatedPreset

func AuthenticatedPreset(c AuthenticatedConfig) Option

AuthenticatedPreset is the default Option when connecting to the public API with authentication.

func Options

func Options(opts ...Option) Option

Options turns a list of Option instances into a single Option. This is a helper when combining multiple Option.

func Service

func Service(service string) Option

Service configures the Store service, valid options are cloud, cloud-manager, and ops-manager.

func WithAuthentication

func WithAuthentication(c CredentialsGetter) Option

WithAuthentication sets the store credentials.

func WithBaseURL

func WithBaseURL(configURL string) Option

WithBaseURL sets the base URL for the underling HTTP client. the url should not contain any path, to add the public API path use WithPublicPathBaseURL.

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets the store context.

type OrgProjectLister

type OrgProjectLister interface {
	ProjectLister
	GetOrgProjects(string, *ListOptions) (*atlasv2.PaginatedAtlasGroup, error)
}

type OrganizationAPIKeyCreator

type OrganizationAPIKeyCreator interface {
	CreateOrganizationAPIKey(string, *atlasv2.CreateAtlasOrganizationApiKey) (*atlasv2.ApiKeyUserDetails, error)
}

type PeeringConnectionLister

type PeeringConnectionLister interface {
	PeeringConnections(string, *ContainersListOptions) ([]atlasv2.BaseNetworkPeeringConnectionSettings, error)
}

type PrivateEndpointLister

type PrivateEndpointLister interface {
	PrivateEndpoints(string, string) ([]atlasv2.EndpointService, error)
}

type ProjectAPIKeyAssigner

type ProjectAPIKeyAssigner interface {
	AssignProjectAPIKey(string, string, *atlasv2.UpdateAtlasProjectApiKey) error
}

type ProjectAPIKeyCreator

type ProjectAPIKeyCreator interface {
	CreateProjectAPIKey(string, *atlasv2.CreateAtlasProjectApiKey) (*atlasv2.ApiKeyUserDetails, error)
}

type ProjectCreator

type ProjectCreator interface {
	CreateProject(*atlasv2.CreateProjectApiParams) (*atlasv2.Group, error)
}

type ProjectDescriber

type ProjectDescriber interface {
	Project(string) (*atlasv2.Group, error)
	ProjectByName(string) (*atlasv2.Group, error)
}

type ProjectIPAccessListLister

type ProjectIPAccessListLister interface {
	ProjectIPAccessLists(string, *ListOptions) (*atlasv2.PaginatedNetworkAccess, error)
}

type ProjectLister

type ProjectLister interface {
	Projects(*ListOptions) (*atlasv2.PaginatedAtlasGroup, error)
}

type ProjectSettingsDescriber

type ProjectSettingsDescriber interface {
	ProjectSettings(string) (*atlasv2.GroupSettings, error)
}

type ProjectTeamLister

type ProjectTeamLister interface {
	ProjectTeams(string, *ListOptions) (*atlasv2.PaginatedTeamRole, error)
}

type ScheduleDescriber

type ScheduleDescriber interface {
	DescribeSchedule(string, string) (*atlasClustersPinned.DiskBackupSnapshotSchedule, error)
}

type ServerlessInstanceDescriber

type ServerlessInstanceDescriber interface {
	GetServerlessInstance(string, string) (*atlasClustersPinned.ServerlessInstanceDescription, error)
}

type ServerlessInstanceLister

type ServerlessInstanceLister interface {
	ServerlessInstances(string, *ListOptions) (*atlasClustersPinned.PaginatedServerlessInstanceDescription, error)
}

type ServerlessPrivateEndpointsLister

type ServerlessPrivateEndpointsLister interface {
	ServerlessPrivateEndpoints(string, string) ([]atlasClustersPinned.ServerlessTenantEndpoint, error)
}

type ServiceGetter

type ServiceGetter interface {
	Service() string
	OpsManagerURL() string
}

ServiceGetter is a basic interface for service and base url settings.

type Store

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

func New

func New(opts ...Option) (*Store, error)

New returns a new Store based on the given list of Option.

Usage:

// get a new Store for Atlas
store := store.New(Service("cloud"))

// get a new Store for the public API based on a Config interface
store := store.New(AuthenticatedPreset(config))

// get a new Store for the private API based on a Config interface
store := store.New(PrivateAuthenticatedPreset(config))

func (*Store) AlertConfigurations

func (s *Store) AlertConfigurations(params *admin.ListAlertConfigurationsApiParams) (*admin.PaginatedAlertConfig, error)

AlertConfigurations encapsulate the logic to manage different cloud providers.

func (*Store) AssignProjectAPIKey

func (s *Store) AssignProjectAPIKey(projectID, apiKeyID string, input *atlasv2.UpdateAtlasProjectApiKey) error

AssignProjectAPIKey encapsulates the logic to manage different cloud providers.

func (*Store) AtlasCluster

func (s *Store) AtlasCluster(projectID, name string) (*atlasClustersPinned.AdvancedClusterDescription, error)

AtlasCluster encapsulates the logic to manage different cloud providers.

func (*Store) AtlasClusterConfigurationOptions

func (s *Store) AtlasClusterConfigurationOptions(projectID, name string) (*atlasClustersPinned.ClusterDescriptionProcessArgs, error)

AtlasClusterConfigurationOptions encapsulates the logic to manage different cloud providers.

func (*Store) Auditing

func (s *Store) Auditing(projectID string) (*atlasv2.AuditLog, error)

func (*Store) CloudProviderAccessRoles

func (s *Store) CloudProviderAccessRoles(groupID string) (*atlasv2.CloudProviderAccessRoles, error)

CloudProviderAccessRoles encapsulates the logic to manage different cloud providers.

func (*Store) CreateFlexCluster added in v1.0.0

func (s *Store) CreateFlexCluster(groupID string, flexClusterDescriptionCreate20241113 *atlasv2.FlexClusterDescriptionCreate20241113) (*atlasv2.FlexClusterDescription20241113, error)

CreateFlexCluster encapsulate the logic to manage different cloud providers.

func (*Store) CreateOrganizationAPIKey

func (s *Store) CreateOrganizationAPIKey(orgID string, input *atlasv2.CreateAtlasOrganizationApiKey) (*atlasv2.ApiKeyUserDetails, error)

CreateOrganizationAPIKey encapsulates the logic to manage different cloud providers.

func (*Store) CreateProject

func (s *Store) CreateProject(params *atlasv2.CreateProjectApiParams) (*atlasv2.Group, error)

CreateProject encapsulates the logic to manage different cloud providers.

func (*Store) CreateProjectAPIKey

func (s *Store) CreateProjectAPIKey(projectID string, apiKeyInput *atlasv2.CreateAtlasProjectApiKey) (*atlasv2.ApiKeyUserDetails, error)

CreateProjectAPIKey creates an API Keys for a project.

func (*Store) DataFederation

func (s *Store) DataFederation(projectID, id string) (*admin.DataLakeTenant, error)

DataFederation encapsulates the logic to manage different cloud providers.

func (*Store) DataFederationList

func (s *Store) DataFederationList(projectID string) ([]admin.DataLakeTenant, error)

DataFederationList encapsulates the logic to manage different cloud providers.

func (*Store) DatabaseRoles

func (s *Store) DatabaseRoles(projectID string) ([]atlasv2.UserCustomDBRole, error)

DatabaseRoles encapsulate the logic to manage different cloud providers.

func (*Store) DatabaseUsers

func (s *Store) DatabaseUsers(projectID string, opts *ListOptions) (*atlasv2.PaginatedApiAtlasDatabaseUser, error)

func (*Store) DeleteFlexCluster added in v1.0.0

func (s *Store) DeleteFlexCluster(groupID, name string) error

DeleteFlexCluster encapsulate the logic to manage different cloud providers.

func (*Store) DescribeCompliancePolicy

func (s *Store) DescribeCompliancePolicy(projectID string) (*atlasv2.DataProtectionSettings20231001, error)

func (*Store) DescribeSchedule

func (s *Store) DescribeSchedule(projectID, clusterName string) (*atlasClustersPinned.DiskBackupSnapshotSchedule, error)

DescribeSchedule encapsulates the logic to manage different cloud providers.

func (*Store) EncryptionAtRest

func (s *Store) EncryptionAtRest(projectID string) (*atlasv2.EncryptionAtRest, error)

func (*Store) FederationSetting

FederationSetting encapsulate the logic to manage different cloud providers.

func (*Store) FlexCluster added in v1.0.0

func (s *Store) FlexCluster(groupID, name string) (*atlasv2.FlexClusterDescription20241113, error)

FlexCluster encapsulate the logic to manage different cloud providers.

func (*Store) GetConnectedOrgConfig

func (s *Store) GetConnectedOrgConfig(opts *atlasv2.GetConnectedOrgConfigApiParams) (*atlasv2.ConnectedOrgConfig, error)

GetConnectedOrgConfig encapsulate the logic to manage different cloud providers.

func (*Store) GetOrgProjects

func (s *Store) GetOrgProjects(orgID string, opts *ListOptions) (*atlasv2.PaginatedAtlasGroup, error)

GetOrgProjects encapsulates the logic to manage different cloud providers.

func (*Store) GetServerlessInstance

func (s *Store) GetServerlessInstance(projectID, clusterName string) (*atlasClustersPinned.ServerlessInstanceDescription, error)

GetServerlessInstance encapsulates the logic to manage different cloud providers.

func (*Store) GlobalCluster

func (s *Store) GlobalCluster(projectID, instanceName string) (*atlasClustersPinned.GeoSharding, error)

func (*Store) IdentityProvider

IdentityProvider encapsulate the logic to manage different cloud providers.

func (*Store) IdentityProviders

IdentityProviders encapsulate the logic to manage different cloud providers.

func (*Store) Integrations

func (s *Store) Integrations(projectID string) (*atlasv2.PaginatedIntegration, error)

Integrations encapsulates the logic to manage different cloud providers.

func (*Store) InterfaceEndpoint

func (s *Store) InterfaceEndpoint(projectID, cloudProvider, privateEndpointID, endpointServiceID string) (*atlasv2.PrivateLinkEndpoint, error)

InterfaceEndpoint encapsulates the logic to manage different cloud providers.

func (*Store) ListFlexClusters added in v1.0.0

ListFlexClusters encapsulate the logic to manage different cloud providers.

func (*Store) MaintenanceWindow

func (s *Store) MaintenanceWindow(projectID string) (*atlasv2.GroupMaintenanceWindow, error)

MaintenanceWindow encapsulates the logic to manage different cloud providers.

func (*Store) PeeringConnections

func (s *Store) PeeringConnections(projectID string, opts *ContainersListOptions) ([]atlasv2.BaseNetworkPeeringConnectionSettings, error)

PeeringConnections encapsulates the logic to manage different cloud providers.

func (*Store) PrivateEndpoints

func (s *Store) PrivateEndpoints(projectID, provider string) ([]atlasv2.EndpointService, error)

PrivateEndpoints encapsulates the logic to manage different cloud providers.

func (*Store) Project

func (s *Store) Project(id string) (*atlasv2.Group, error)

Project encapsulates the logic to manage different cloud providers.

func (*Store) ProjectByName

func (s *Store) ProjectByName(name string) (*atlasv2.Group, error)

func (*Store) ProjectClusters

func (s *Store) ProjectClusters(projectID string, opts *ListOptions) (*atlasClustersPinned.PaginatedAdvancedClusterDescription, error)

ProjectClusters encapsulate the logic to manage different cloud providers.

func (*Store) ProjectIPAccessLists

func (s *Store) ProjectIPAccessLists(projectID string, opts *ListOptions) (*atlasv2.PaginatedNetworkAccess, error)

ProjectIPAccessLists encapsulate the logic to manage different cloud providers.

func (*Store) ProjectSettings

func (s *Store) ProjectSettings(projectID string) (*atlasv2.GroupSettings, error)

ProjectSettings encapsulates the logic of getting settings of a particular project.

func (*Store) ProjectTeams

func (s *Store) ProjectTeams(projectID string, opts *ListOptions) (*atlasv2.PaginatedTeamRole, error)

ProjectTeams encapsulates the logic to manage different cloud providers.

func (*Store) Projects

func (s *Store) Projects(opts *ListOptions) (*atlasv2.PaginatedAtlasGroup, error)

Projects encapsulates the logic to manage different cloud providers.

func (*Store) ServerlessInstances

func (s *Store) ServerlessInstances(projectID string, listOps *ListOptions) (*atlasClustersPinned.PaginatedServerlessInstanceDescription, error)

ServerlessInstances encapsulates the logic to manage different cloud providers.

func (*Store) ServerlessPrivateEndpoints

func (s *Store) ServerlessPrivateEndpoints(projectID, instanceName string) ([]atlasClustersPinned.ServerlessTenantEndpoint, error)

func (*Store) StreamsConnections

func (s *Store) StreamsConnections(projectID, tenantName string) (*atlasv2.PaginatedApiStreamsConnection, error)

StreamsConnections encapsulates the logic to manage different cloud providers.

func (*Store) TeamByID

func (s *Store) TeamByID(orgID, teamID string) (*atlasv2.TeamResponse, error)

TeamByID encapsulates the logic to manage different cloud providers.

func (*Store) TeamUsers

func (s *Store) TeamUsers(orgID, teamID string) (*atlasv2.PaginatedAppUser, error)

TeamUsers encapsulates the logic to manage different cloud providers.

func (*Store) UpdateFlexCluster added in v1.0.0

func (s *Store) UpdateFlexCluster(groupID, name string, flexClusterDescriptionUpdate20241113 *atlasv2.FlexClusterDescriptionUpdate20241113) (*atlasv2.FlexClusterDescription20241113, error)

UpdateFlexCluster encapsulate the logic to manage different cloud providers.

func (*Store) UpgradeFlexCluster added in v1.0.0

func (s *Store) UpgradeFlexCluster(groupID string, flexClusterDescriptionUpdate20241113 *atlasv2.AtlasTenantClusterUpgradeRequest20240805) (*atlasv2.FlexClusterDescription20241113, error)

UpgradeFlexCluster encapsulate the logic to manage different cloud providers.

type StreamProcessingStore

type StreamProcessingStore interface {
	StreamsLister
	StreamsConnectionLister
}

type StreamsConnectionLister

type StreamsConnectionLister interface {
	StreamsConnections(string, string) (*atlasv2.PaginatedApiStreamsConnection, error)
}

type StreamsLister

type StreamsLister interface {
	ProjectStreams(*atlasv2.ListStreamInstancesApiParams) (*atlasv2.PaginatedApiStreamsTenant, error)
}

type TeamDescriber

type TeamDescriber interface {
	TeamByID(string, string) (*atlasv2.TeamResponse, error)
}

type TeamUserLister

type TeamUserLister interface {
	TeamUsers(string, string) (*atlasv2.PaginatedAppUser, error)
}

Jump to

Keyboard shortcuts

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