Documentation
¶
Index ¶
- Constants
- type ManageSite
- func (mst ManageSite) CheckHealthForSiteViaSiteAgent(ctx context.Context, siteID uuid.UUID) error
- func (mst ManageSite) CheckOTPExpirationAndRenewForAllSites(ctx context.Context) error
- func (mst ManageSite) DeleteOrphanedSiteTemporalNamespaces(ctx context.Context) error
- func (mst ManageSite) DeleteSiteComponentsFromDB(ctx context.Context, siteID uuid.UUID, infrastructureProviderID uuid.UUID, ...) error
- func (mst ManageSite) GetAllSiteIDs(ctx context.Context) ([]uuid.UUID, error)
- func (mst ManageSite) MonitorInventoryReceiptForAllSites(ctx context.Context) error
- func (mst ManageSite) OnCheckHealthForSiteViaSiteAgentError(ctx context.Context, siteID uuid.UUID, errMessage *string) error
- func (mst ManageSite) UpdateAgentCertExpiry(ctx context.Context, siteID uuid.UUID, certExpiry time.Time) error
Constants ¶
const ( // SiteInventoryReceiptThreshold is the period since last Site inventory receipt before error is logged SiteInventoryReceiptThreshold = 15 * 60 * time.Second // 10 minutes )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManageSite ¶
type ManageSite struct {
// contains filtered or unexported fields
}
ManageSite is an activity wrapper for managing Site lifecycle that allows injecting DB access
func NewManageSite ¶
func NewManageSite(dbSession *cdb.Session, siteClientPool *sc.ClientPool, tc client.Client, cfg *config.Config) ManageSite
NewManageSite returns a new ManageSite activity
func (ManageSite) CheckHealthForSiteViaSiteAgent ¶
CheckHealthForSiteViaSiteAgent checks the health of a Site via the Site Agent
func (ManageSite) CheckOTPExpirationAndRenewForAllSites ¶
func (mst ManageSite) CheckOTPExpirationAndRenewForAllSites(ctx context.Context) error
CheckOTPExpirationAndRenewForAllSites periodically checks all sites and rotates OTPs if necessary
func (ManageSite) DeleteOrphanedSiteTemporalNamespaces ¶
func (mst ManageSite) DeleteOrphanedSiteTemporalNamespaces(ctx context.Context) error
DeleteOrphanedSiteTemporalNamespaces finds and deletes orphaned Temporal namespaces for sites
func (ManageSite) DeleteSiteComponentsFromDB ¶
func (mst ManageSite) DeleteSiteComponentsFromDB(ctx context.Context, siteID uuid.UUID, infrastructureProviderID uuid.UUID, purgeMachines bool) error
DeleteSiteComponentsFromDB is a Temporal activity that initiate delete for instancetype/machine/operatingsystem/instance/subnet/vpc
func (ManageSite) GetAllSiteIDs ¶
GetAllSites returns all sites
func (ManageSite) MonitorInventoryReceiptForAllSites ¶
func (mst ManageSite) MonitorInventoryReceiptForAllSites(ctx context.Context) error
MonitorInventoryReceiptForAllSites loops through all Sites and checks when the last inventory was received
func (ManageSite) OnCheckHealthForSiteViaSiteAgentError ¶
func (mst ManageSite) OnCheckHealthForSiteViaSiteAgentError(ctx context.Context, siteID uuid.UUID, errMessage *string) error
OnCheckHealthForSiteViaSiteAgentError is a Temporal activity that is invoked when the activity CheckHealthForSiteViaSiteAgent has errored it sets the site status to error
func (ManageSite) UpdateAgentCertExpiry ¶
func (mst ManageSite) UpdateAgentCertExpiry(ctx context.Context, siteID uuid.UUID, certExpiry time.Time) error
UpdateAgentCertExpiry updates the AgentCertExpiry field for a site