Documentation ¶
Index ¶
- func GetClusterInstallationsForMigration(c *Context, request model.MigrateClusterInstallationRequest) ([]*model.ClusterInstallation, int)
- func Register(rootRouter *mux.Router, context *Context)
- type AwsClient
- type Context
- type DBProvider
- type EventProducer
- type InstallationDNSProvider
- type Metrics
- type Provisioner
- type ResponseWriterWrapper
- type Store
- type Supervisor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClusterInstallationsForMigration ¶ added in v0.48.0
func GetClusterInstallationsForMigration(c *Context, request model.MigrateClusterInstallationRequest) ([]*model.ClusterInstallation, int)
GetClusterInstallationsForMigration compare , filter already migrated installations & returns actual set of CIs for migration
Types ¶
type AwsClient ¶ added in v0.46.1
type AwsClient interface { EnsureVPCExists(vpcID string) error SwitchClusterTags(clusterID string, targetClusterID string, logger log.FieldLogger) error SecretsManagerValidateExternalClusterSecret(name string) error SecretsManagerValidateExternalDatabaseSecret(name string) error RDSDBCLusterExists(awsID string) (bool, error) DeletePGBouncerLogicalDatabase(multitenantDatabase *model.MultitenantDatabase, logicalDatabaseName string, logger log.FieldLogger) error }
AwsClient describes the interface required to communicate with the AWS
type Context ¶
type Context struct { Store Store Supervisor Supervisor Provisioner Provisioner DBProvider DBProvider EventProducer EventProducer AwsClient AwsClient DNSProvider InstallationDNSProvider Metrics Metrics Logger log.FieldLogger InstallationDeletionExpiryDefault time.Duration RequestID string Environment string }
Context provides the API with all necessary data and interfaces for responding to requests.
It is cloned before each request, allowing per-request changes such as logger annotations.
type DBProvider ¶ added in v0.46.1
DBProvider describes the interface required to get database for specific installation and specified type.
type EventProducer ¶ added in v0.50.0
type EventProducer interface { ProduceInstallationStateChangeEvent(installation *model.Installation, oldState string, extraDataFields ...events.DataField) error ProduceClusterStateChangeEvent(cluster *model.Cluster, oldState string, extraDataFields ...events.DataField) error }
EventProducer produces Provisioners' state change events.
type InstallationDNSProvider ¶ added in v0.79.0
type InstallationDNSProvider interface {
DeleteDNSRecords(customerDNSName []string, logger log.FieldLogger) error
}
InstallationDNSProvider allows for domain name management of installations.
type Metrics ¶ added in v0.60.0
type Metrics interface { IncrementAPIRequest() ObserveAPIEndpointDuration(handler, method string, statusCode int, elapsed float64) }
Metrics exposes metrics from API usage.
type Provisioner ¶ added in v0.2.0
type Provisioner interface { ExecClusterInstallationCLI(cluster *model.Cluster, clusterInstallation *model.ClusterInstallation, args ...string) ([]byte, error, error) ExecMMCTL(cluster *model.Cluster, clusterInstallation *model.ClusterInstallation, args ...string) ([]byte, error) ExecMattermostCLI(cluster *model.Cluster, clusterInstallation *model.ClusterInstallation, args ...string) ([]byte, error) ExecClusterInstallationPPROF(cluster *model.Cluster, clusterInstallation *model.ClusterInstallation) (model.ClusterInstallationDebugData, error, error) GetClusterInstallationStatus(cluster *model.Cluster, clusterInstallation *model.ClusterInstallation) (*model.ClusterInstallationStatus, error) }
Provisioner describes the interface required to communicate with the Kubernetes cluster.
type ResponseWriterWrapper ¶ added in v0.60.0
type ResponseWriterWrapper struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriterWrapper is a wrapper for writing http responses with custom status code logic.
func NewWrappedWriter ¶ added in v0.60.0
func NewWrappedWriter(original http.ResponseWriter) *ResponseWriterWrapper
NewWrappedWriter returns a new ResponseWriterWrapper.
func (*ResponseWriterWrapper) Flush ¶ added in v0.60.0
func (rw *ResponseWriterWrapper) Flush()
Flush flushes the response writer.
func (*ResponseWriterWrapper) Hijack ¶ added in v0.60.0
func (rw *ResponseWriterWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack calls the underlying writer's Hijack output.
func (*ResponseWriterWrapper) StatusCode ¶ added in v0.60.0
func (rw *ResponseWriterWrapper) StatusCode() int
StatusCode returns the last written status code.
func (*ResponseWriterWrapper) Write ¶ added in v0.60.0
func (rw *ResponseWriterWrapper) Write(data []byte) (int, error)
Write writes the provided data.
func (*ResponseWriterWrapper) WriteHeader ¶ added in v0.60.0
func (rw *ResponseWriterWrapper) WriteHeader(statusCode int)
WriteHeader stores the provided status code and writes it.
type Store ¶
type Store interface { model.InstallationDatabaseStoreInterface DeleteMultitenantDatabase(multitenantDatabaseID string) error DeleteLogicalDatabase(logicalDatabaseID string) error CreateCluster(cluster *model.Cluster, annotations []*model.Annotation) error GetCluster(clusterID string) (*model.Cluster, error) GetClusterDTO(clusterID string) (*model.ClusterDTO, error) GetClusters(filter *model.ClusterFilter) ([]*model.Cluster, error) GetClusterDTOs(filter *model.ClusterFilter) ([]*model.ClusterDTO, error) UpdateCluster(cluster *model.Cluster) error LockCluster(clusterID, lockerID string) (bool, error) UnlockCluster(clusterID, lockerID string, force bool) (bool, error) LockClusterScheduling(clusterID, lockerID string) (bool, error) UnlockClusterScheduling(clusterID, lockerID string, force bool) (bool, error) LockClusterAPI(clusterID string) error UnlockClusterAPI(clusterID string) error DeleteCluster(clusterID string) error CreateInstallation(installation *model.Installation, annotations []*model.Annotation, dnsRecords []*model.InstallationDNS) error GetInstallation(installationID string, includeGroupConfig, includeGroupConfigOverrides bool) (*model.Installation, error) GetInstallationDTO(installationID string, includeGroupConfig, includeGroupConfigOverrides bool) (*model.InstallationDTO, error) GetInstallations(filter *model.InstallationFilter, includeGroupConfig, includeGroupConfigOverrides bool) ([]*model.Installation, error) GetInstallationDTOs(filter *model.InstallationFilter, includeGroupConfig, includeGroupConfigOverrides bool) ([]*model.InstallationDTO, error) GetInstallationsCount(filter *model.InstallationFilter) (int64, error) GetInstallationsStatus() (*model.InstallationsStatus, error) UpdateInstallation(installation *model.Installation) error UpdateInstallationState(installation *model.Installation) error LockInstallation(installationID, lockerID string) (bool, error) UnlockInstallation(installationID, lockerID string, force bool) (bool, error) LockInstallationAPI(installationID string) error UnlockInstallationAPI(installationID string) error DeleteInstallation(installationID string) error DeletionLockInstallation(installationID string) error DeletionUnlockInstallation(installationID string) error GetClusterInstallation(clusterInstallationID string) (*model.ClusterInstallation, error) GetClusterInstallations(filter *model.ClusterInstallationFilter) ([]*model.ClusterInstallation, error) LockClusterInstallationAPI(clusterInstallationID string) error UnlockClusterInstallationAPI(clusterInstallationID string) error CreateGroup(group *model.Group, annotations []*model.Annotation) error GetGroup(groupID string) (*model.Group, error) GetGroupDTO(groupID string) (*model.GroupDTO, error) GetGroups(filter *model.GroupFilter) ([]*model.Group, error) GetGroupDTOs(filter *model.GroupFilter) ([]*model.GroupDTO, error) UpdateGroup(group *model.Group, forceSequenceUpdate bool) error LockGroup(groupID, lockerID string) (bool, error) UnlockGroup(groupID, lockerID string, force bool) (bool, error) LockGroupAPI(groupID string) error UnlockGroupAPI(groupID string) error DeleteGroup(groupID string) error GetGroupStatus(groupID string) (*model.GroupStatus, error) CreateGroupAnnotations(groupID string, annotations []*model.Annotation) ([]*model.Annotation, error) DeleteGroupAnnotation(groupID string, annotationName string) error CreateWebhook(webhook *model.Webhook) error GetWebhook(webhookID string) (*model.Webhook, error) GetWebhooks(filter *model.WebhookFilter) ([]*model.Webhook, error) DeleteWebhook(webhookID string) error GetOrCreateAnnotations(annotations []*model.Annotation) ([]*model.Annotation, error) GetAnnotationsByName(names []string) ([]*model.Annotation, error) CreateClusterAnnotations(clusterID string, annotations []*model.Annotation) ([]*model.Annotation, error) DeleteClusterAnnotation(clusterID string, annotationName string) error CreateInstallationAnnotations(installationID string, annotations []*model.Annotation) ([]*model.Annotation, error) DeleteInstallationAnnotation(installationID string, annotationName string) error IsInstallationBackupRunning(installationID string) (bool, error) IsInstallationBackupBeingUsed(backupID string) (bool, error) CreateInstallationBackup(backupMeta *model.InstallationBackup) error UpdateInstallationBackupState(backupMeta *model.InstallationBackup) error GetInstallationBackup(id string) (*model.InstallationBackup, error) GetInstallationBackups(filter *model.InstallationBackupFilter) ([]*model.InstallationBackup, error) LockInstallationBackup(backupMetadataID, lockerID string) (bool, error) UnlockInstallationBackup(backupMetadataID, lockerID string, force bool) (bool, error) LockInstallationBackupAPI(backupID string) error UnlockInstallationBackupAPI(backupID string) error TriggerInstallationRestoration(installation *model.Installation, backup *model.InstallationBackup) (*model.InstallationDBRestorationOperation, error) GetInstallationDBRestorationOperation(id string) (*model.InstallationDBRestorationOperation, error) GetInstallationDBRestorationOperations(filter *model.InstallationDBRestorationFilter) ([]*model.InstallationDBRestorationOperation, error) MigrateClusterInstallations(clusterInstallations []*model.ClusterInstallation, targetCluster string) error SwitchDNS(oldCIsIDs, newCIsIDs, installationIDs []string, hibernatingInstallationIDs []string) error DeleteClusterInstallation(id string) error DeleteInActiveClusterInstallationByClusterID(clusterID string) (int64, error) LockInstallations(installationIDs []string, lockerID string) (bool, error) UnlockInstallations(installationIDs []string, lockerID string, force bool) (bool, error) UpdateClusterInstallation(clusterInstallation *model.ClusterInstallation) error TriggerInstallationDBMigration(dbMigrationOp *model.InstallationDBMigrationOperation, installation *model.Installation) (*model.InstallationDBMigrationOperation, error) TriggerInstallationDBMigrationRollback(dbMigrationOp *model.InstallationDBMigrationOperation, installation *model.Installation) error GetInstallationDBMigrationOperations(filter *model.InstallationDBMigrationFilter) ([]*model.InstallationDBMigrationOperation, error) GetInstallationDBMigrationOperation(id string) (*model.InstallationDBMigrationOperation, error) UpdateInstallationDBMigrationOperationState(dbMigration *model.InstallationDBMigrationOperation) error LockInstallationDBMigrationOperation(id, lockerID string) (bool, error) UnlockInstallationDBMigrationOperation(id, lockerID string, force bool) (bool, error) CreateSubscription(sub *model.Subscription) error GetSubscriptions(filter *model.SubscriptionsFilter) ([]*model.Subscription, error) GetSubscription(subID string) (*model.Subscription, error) DeleteSubscription(subID string) error GetStateChangeEvents(filter *model.StateChangeEventFilter) ([]*model.StateChangeEventData, error) AddInstallationDomain(installation *model.Installation, dnsRecord *model.InstallationDNS) error GetInstallationDNS(id string) (*model.InstallationDNS, error) SwitchPrimaryInstallationDomain(installationID string, installationDNSID string) error GetDNSRecordsForInstallation(installationID string) ([]*model.InstallationDNS, error) DeleteInstallationDNS(installationID, dnsName string) error }
Store describes the interface required to persist changes made via API requests.
type Supervisor ¶
type Supervisor interface {
Do() error
}
Supervisor describes the interface to notify the background jobs of an actionable change.
Source Files ¶
- api.go
- cluster.go
- cluster_installation.go
- common.go
- context.go
- databases.go
- db_database_schema.go
- db_logical_database.go
- db_multitenant_database.go
- events.go
- events_subscription.go
- group.go
- handler.go
- helpers.go
- installation.go
- installation_backup.go
- installation_db_migration.go
- installation_db_restoration_operation.go
- installation_dns.go
- lock.go
- response_writer_wrapper.go
- security.go
- webhook.go