scheduler

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 46 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StateInvalid = "Invalid"
	StateOk      = "OK"
)

Variables

View Source
var (
	ErrDeploymentNotFound = errors.New("deployment not found")
	ErrDomainAlreadyExist = errors.New("domain already exist")
	ErrInvalidDomain      = errors.New("invalid domain")
	ErrInvalidAnnotations = errors.New("invalid annotations")
)
View Source
var FreeUpDayInterval = 1

Interval for initiating free space release

Functions

This section is empty.

Types

type EdgeUpdateManager

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

EdgeUpdateManager manages information about edge node updates.

func NewEdgeUpdateManager

func NewEdgeUpdateManager(db *db.SQLDB) (*EdgeUpdateManager, error)

NewEdgeUpdateManager creates a new EdgeUpdateManager with the given SQL database connection.

func (*EdgeUpdateManager) DeleteEdgeUpdateConfig

func (eu *EdgeUpdateManager) DeleteEdgeUpdateConfig(ctx context.Context, nodeType int) error

DeleteEdgeUpdateConfig deletes the EdgeUpdateConfig for the given node type.

func (*EdgeUpdateManager) GetEdgeUpdateConfigs

func (eu *EdgeUpdateManager) GetEdgeUpdateConfigs(ctx context.Context) (map[int]*api.EdgeUpdateConfig, error)

GetEdgeUpdateConfigs returns the map of edge node update information.

func (*EdgeUpdateManager) SetEdgeUpdateConfig

func (eu *EdgeUpdateManager) SetEdgeUpdateConfig(ctx context.Context, info *api.EdgeUpdateConfig) error

SetEdgeUpdateConfig sets the EdgeUpdateConfig for the given node type.

type Scheduler

type Scheduler struct {
	fx.In

	region.Region
	*common.CommonAPI
	*EdgeUpdateManager
	dtypes.ServerID

	NodeManager            *node.Manager
	ValidationMgr          *validation.Manager
	AssetManager           *assets.Manager
	NatManager             *nat.Manager
	DataSync               *sSync.DataSync
	SchedulerCfg           *config.SchedulerCfg
	SetSchedulerConfigFunc dtypes.SetSchedulerConfigFunc
	GetSchedulerConfigFunc dtypes.GetSchedulerConfigFunc
	WorkloadManager        *workload.Manager
	ProjectManager         *projects.Manager
	ContainerManager       *container.Manager

	PrivateKey *rsa.PrivateKey
	Transport  *quic.Transport
}

Scheduler represents a scheduler node in a distributed system.

func (*Scheduler) AddAWSData added in v0.1.13

func (s *Scheduler) AddAWSData(ctx context.Context, list []types.AWSDataInfo) error

func (*Scheduler) AddDeploymentDomain added in v0.1.21

func (s *Scheduler) AddDeploymentDomain(ctx context.Context, id types.DeploymentID, cert *types.Certificate) error

func (*Scheduler) AssignTunserverURL added in v0.1.19

func (s *Scheduler) AssignTunserverURL(ctx context.Context) (*types.TunserverRsp, error)

AssignTunserverURL

func (*Scheduler) CalculateExitProfit added in v0.1.19

func (s *Scheduler) CalculateExitProfit(ctx context.Context, nodeID string) (types.ExitProfitRsp, error)

func (*Scheduler) CandidateCodeExist added in v0.1.19

func (s *Scheduler) CandidateCodeExist(ctx context.Context, code string) (bool, error)

func (*Scheduler) CandidateConnect

func (s *Scheduler) CandidateConnect(ctx context.Context, opts *types.ConnectOptions) error

CandidateConnect candidate node login to the scheduler

func (*Scheduler) CheckIpUsage added in v0.1.14

func (s *Scheduler) CheckIpUsage(ctx context.Context, ip string) (bool, error)

func (*Scheduler) CloseDeployment added in v0.1.21

func (s *Scheduler) CloseDeployment(ctx context.Context, deployment *types.Deployment, force bool) error

func (*Scheduler) CreateAsset added in v0.1.10

func (s *Scheduler) CreateAsset(ctx context.Context, req *types.CreateAssetReq) (*types.UploadInfo, error)

CreateAsset creates an asset with car CID, car name, and car size.

func (*Scheduler) CreateDeployment added in v0.1.21

func (s *Scheduler) CreateDeployment(ctx context.Context, deployment *types.Deployment) error

func (*Scheduler) CreateSyncAsset added in v0.1.21

func (s *Scheduler) CreateSyncAsset(ctx context.Context, req *types.CreateSyncAssetReq) error

CreateSyncAsset Synchronizing assets from other schedulers

func (*Scheduler) CreateTunnel added in v0.1.21

func (s *Scheduler) CreateTunnel(ctx context.Context, req *types.CreateTunnelReq) error

CreateTunnel create tunnel for workerd communication

func (*Scheduler) DeactivateNode added in v0.1.11

func (s *Scheduler) DeactivateNode(ctx context.Context, nodeID string, hours int) error

DeactivateNode is used to deactivate a node in the titan server. It stops the node from serving any requests and marks it as inactive. - nodeID: The ID of the node to deactivate. - hours: The deactivation countdown time in hours. It specifies the duration before the deactivation is executed. If the deactivation is canceled within this period, the node will remain active.

func (*Scheduler) DeleteDeploymentDomain added in v0.1.21

func (s *Scheduler) DeleteDeploymentDomain(ctx context.Context, id types.DeploymentID, domain string) error

func (*Scheduler) DeleteProject added in v0.1.19

func (s *Scheduler) DeleteProject(ctx context.Context, req *types.ProjectReq) error

func (*Scheduler) DeployProject added in v0.1.19

func (s *Scheduler) DeployProject(ctx context.Context, req *types.DeployProjectReq) error

func (*Scheduler) DownloadDataResult added in v0.1.13

func (s *Scheduler) DownloadDataResult(ctx context.Context, bucket, cid string, size int64) error

DownloadDataResult node download data result

func (*Scheduler) EdgeConnect

func (s *Scheduler) EdgeConnect(ctx context.Context, opts *types.ConnectOptions) error

EdgeConnect edge node login to the scheduler

func (*Scheduler) FreeUpDiskSpace added in v0.1.19

func (s *Scheduler) FreeUpDiskSpace(ctx context.Context, nodeID string, size int64) (*types.FreeUpDiskResp, error)

FreeUpDiskSpace Request to free up disk space, returns file hashes and next time

func (*Scheduler) GenerateCandidateCodes added in v0.1.21

func (s *Scheduler) GenerateCandidateCodes(ctx context.Context, count int, nodeType types.NodeType, isTest bool) ([]string, error)

func (*Scheduler) GenerateTokenForDownloadSource added in v0.1.21

func (s *Scheduler) GenerateTokenForDownloadSource(ctx context.Context, nodeID string, cid string) (*types.SourceDownloadInfo, error)

GenerateTokenForDownloadSource Generate Token For Download Source

func (*Scheduler) GetAssetCount added in v0.1.10

func (s *Scheduler) GetAssetCount(ctx context.Context) (int, error)

GetAssetCount retrieves a count of asset

func (*Scheduler) GetAssetListForBucket

func (s *Scheduler) GetAssetListForBucket(ctx context.Context, bucketID uint32) ([]string, error)

GetAssetListForBucket retrieves a list of asset hashes for the specified node's bucket.

func (*Scheduler) GetAssetRecord

func (s *Scheduler) GetAssetRecord(ctx context.Context, cid string) (*types.AssetRecord, error)

GetAssetRecord retrieves an asset record by its CID.

func (*Scheduler) GetAssetRecords

func (s *Scheduler) GetAssetRecords(ctx context.Context, limit, offset int, statuses []string, serverID dtypes.ServerID) ([]*types.AssetRecord, error)

GetAssetRecords lists asset records with optional filtering by status, limit, and offset.

func (*Scheduler) GetAssetSourceDownloadInfo added in v0.1.18

func (s *Scheduler) GetAssetSourceDownloadInfo(ctx context.Context, cid string) (*types.AssetSourceDownloadInfoRsp, error)

func (*Scheduler) GetAssetView added in v0.1.14

func (s *Scheduler) GetAssetView(ctx context.Context, nodeID string, isFromNode bool) (*types.AssetView, error)

GetAssetView get the asset view of node

func (*Scheduler) GetAssetsForNode added in v0.1.10

func (s *Scheduler) GetAssetsForNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListNodeAssetRsp, error)

GetAssetsForNode retrieves a asset list of node

func (*Scheduler) GetAssetsInBucket added in v0.1.14

func (s *Scheduler) GetAssetsInBucket(ctx context.Context, nodeID string, bucketID int, isFromNode bool) ([]string, error)

GetAssetInBucket get the assets of the bucket

func (*Scheduler) GetCandidateCodeInfos added in v0.1.19

func (s *Scheduler) GetCandidateCodeInfos(ctx context.Context, nodeID, code string) ([]*types.CandidateCodeInfo, error)

func (*Scheduler) GetCandidateDownloadInfos

func (s *Scheduler) GetCandidateDownloadInfos(ctx context.Context, cid string) ([]*types.CandidateDownloadInfo, error)

GetCandidateDownloadInfos finds candidate download info for the given CID.

func (*Scheduler) GetCandidateIPs added in v0.1.11

func (s *Scheduler) GetCandidateIPs(ctx context.Context) ([]*types.NodeIPInfo, error)

func (*Scheduler) GetCandidateNodeIP added in v0.1.11

func (s *Scheduler) GetCandidateNodeIP(ctx context.Context, nodeID string) (string, error)

GetCandidateNodeIP get candidate ip for locator

func (*Scheduler) GetCandidateURLsForDetectNat

func (s *Scheduler) GetCandidateURLsForDetectNat(ctx context.Context) ([]string, error)

func (*Scheduler) GetCurrentRegionInfos added in v0.1.19

func (s *Scheduler) GetCurrentRegionInfos(ctx context.Context, areaID string) (map[string]int, error)

func (*Scheduler) GetDeploymentDomains added in v0.1.21

func (s *Scheduler) GetDeploymentDomains(ctx context.Context, id types.DeploymentID) ([]*types.DeploymentDomain, error)

func (*Scheduler) GetDeploymentList added in v0.1.21

func (s *Scheduler) GetDeploymentList(ctx context.Context, opt *types.GetDeploymentOption) (*types.GetDeploymentListResp, error)

func (*Scheduler) GetDeploymentProviderIP added in v0.1.21

func (s *Scheduler) GetDeploymentProviderIP(ctx context.Context, id types.DeploymentID) (string, error)

func (*Scheduler) GetDownloadInfos added in v0.1.21

func (s *Scheduler) GetDownloadInfos(cid string, needCandidate bool) (*types.AssetSourceDownloadInfoRsp, int64, error)

func (*Scheduler) GetEdgeDownloadInfos

func (s *Scheduler) GetEdgeDownloadInfos(ctx context.Context, cid string) (*types.EdgeDownloadInfoList, error)

GetEdgeDownloadInfos finds edge download information for a given CID

func (*Scheduler) GetEdgeExternalServiceAddress

func (s *Scheduler) GetEdgeExternalServiceAddress(ctx context.Context, nodeID, candidateURL string) (string, error)

GetEdgeExternalServiceAddress returns the external service address of an edge node

func (*Scheduler) GetEvents added in v0.1.21

func (s *Scheduler) GetEvents(ctx context.Context, deployment *types.Deployment) ([]*types.ServiceEvent, error)

func (*Scheduler) GetExternalAddress

func (s *Scheduler) GetExternalAddress(ctx context.Context) (string, error)

GetExternalAddress retrieves the external address of the caller.

func (*Scheduler) GetIngress added in v0.1.21

func (s *Scheduler) GetIngress(ctx context.Context, id types.DeploymentID) (*types.Ingress, error)

func (*Scheduler) GetLeaseShellEndpoint added in v0.1.21

func (s *Scheduler) GetLeaseShellEndpoint(ctx context.Context, id types.DeploymentID) (*types.LeaseEndpoint, error)

func (*Scheduler) GetLogs added in v0.1.21

func (s *Scheduler) GetLogs(ctx context.Context, deployment *types.Deployment) ([]*types.ServiceLog, error)

func (*Scheduler) GetMinioConfigFromCandidate added in v0.1.11

func (s *Scheduler) GetMinioConfigFromCandidate(ctx context.Context, nodeID string) (*types.MinioConfig, error)

func (*Scheduler) GetNextFreeTime added in v0.1.19

func (s *Scheduler) GetNextFreeTime(ctx context.Context, nodeID string) (int64, error)

func (*Scheduler) GetNodeInfo

func (s *Scheduler) GetNodeInfo(ctx context.Context, nodeID string) (types.NodeInfo, error)

GetNodeInfo returns information about the specified node.

func (*Scheduler) GetNodeList

func (s *Scheduler) GetNodeList(ctx context.Context, offset int, limit int) (*types.ListNodesRsp, error)

GetNodeList retrieves a list of nodes with pagination.

func (*Scheduler) GetNodeOfIP added in v0.1.15

func (s *Scheduler) GetNodeOfIP(ctx context.Context, ip string) ([]string, error)

func (*Scheduler) GetNodeOnlineState added in v0.1.13

func (s *Scheduler) GetNodeOnlineState(ctx context.Context) (bool, error)

func (*Scheduler) GetNodePublicKey added in v0.1.11

func (s *Scheduler) GetNodePublicKey(ctx context.Context, nodeID string) (string, error)

GetNodePublicKey get node publicKey

func (*Scheduler) GetNodeToken added in v0.1.13

func (s *Scheduler) GetNodeToken(ctx context.Context, nodeID string) (string, error)

func (*Scheduler) GetNodeUploadInfo added in v0.1.19

func (s *Scheduler) GetNodeUploadInfo(ctx context.Context, userID string) (*types.UploadInfo, error)

func (*Scheduler) GetNodesFromRegion added in v0.1.19

func (s *Scheduler) GetNodesFromRegion(ctx context.Context, areaID string) ([]*types.NodeInfo, error)

func (*Scheduler) GetOnlineNodeCount

func (s *Scheduler) GetOnlineNodeCount(ctx context.Context, nodeType types.NodeType) (int, error)

GetOnlineNodeCount returns the count of online nodes for a given node type

func (*Scheduler) GetProfitDetailsForNode added in v0.1.18

func (s *Scheduler) GetProfitDetailsForNode(ctx context.Context, nodeID string, limit, offset int, ts []int) (*types.ListNodeProfitDetailsRsp, error)

GetReplicasForNode retrieves a asset list of node

func (*Scheduler) GetProjectInfo added in v0.1.19

func (s *Scheduler) GetProjectInfo(ctx context.Context, uuid string) (*types.ProjectInfo, error)

func (*Scheduler) GetProjectInfos added in v0.1.19

func (s *Scheduler) GetProjectInfos(ctx context.Context, userID string, limit, offset int) ([]*types.ProjectInfo, error)

func (*Scheduler) GetProjectsForNode added in v0.1.19

func (s *Scheduler) GetProjectsForNode(ctx context.Context, nodeID string) ([]*types.ProjectReplicas, error)

GetProjectsForNode

func (*Scheduler) GetProviderList added in v0.1.21

func (s *Scheduler) GetProviderList(ctx context.Context, opt *types.GetProviderOption) ([]*types.Provider, error)

func (*Scheduler) GetRemoteAddress added in v0.1.21

func (s *Scheduler) GetRemoteAddress(ctx context.Context) (string, error)

func (*Scheduler) GetReplicaEvents added in v0.1.11

func (s *Scheduler) GetReplicaEvents(ctx context.Context, start, end time.Time, limit, offset int) (*types.ListReplicaEventRsp, error)

GetReplicaEvents retrieves a replica event list

func (*Scheduler) GetReplicaEventsForNode added in v0.1.10

func (s *Scheduler) GetReplicaEventsForNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListReplicaEventRsp, error)

GetReplicaEventsForNode retrieves a replica event list of node

func (*Scheduler) GetReplicas added in v0.1.11

func (s *Scheduler) GetReplicas(ctx context.Context, cid string, limit, offset int) (*types.ListReplicaRsp, error)

GetReplicas list asset replicas by CID.

func (*Scheduler) GetReplicasForNode added in v0.1.16

func (s *Scheduler) GetReplicasForNode(ctx context.Context, nodeID string, limit, offset int, statuses []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error)

GetReplicasForNode retrieves a asset list of node

func (*Scheduler) GetRetrieveEventRecords added in v0.1.11

func (s *Scheduler) GetRetrieveEventRecords(ctx context.Context, nodeID string, limit, offset int) (*types.ListRetrieveEventRsp, error)

GetRetrieveEventRecords retrieves a list of retrieve events

func (*Scheduler) GetSchedulerPublicKey

func (s *Scheduler) GetSchedulerPublicKey(ctx context.Context) (string, error)

GetSchedulerPublicKey get server publicKey

func (*Scheduler) GetStatistics added in v0.1.21

func (s *Scheduler) GetStatistics(ctx context.Context, id string) (*types.ResourcesStatistics, error)

func (*Scheduler) GetTunserverURLFromUser added in v0.1.21

func (s *Scheduler) GetTunserverURLFromUser(ctx context.Context, req *types.TunserverReq) (*types.TunserverRsp, error)

func (*Scheduler) GetValidationResults

func (s *Scheduler) GetValidationResults(ctx context.Context, nodeID string, limit, offset int) (*types.ListValidationResultRsp, error)

GetValidationResults retrieves a list of validation results.

func (*Scheduler) GetWorkloadRecord added in v0.1.10

func (s *Scheduler) GetWorkloadRecord(ctx context.Context, id string) (*types.WorkloadRecord, error)

GetWorkloadRecord retrieves a list of workload results.

func (*Scheduler) GetWorkloadRecords added in v0.1.10

func (s *Scheduler) GetWorkloadRecords(ctx context.Context, nodeID string, limit, offset int) (*types.ListWorkloadRecordRsp, error)

GetWorkloadRecords retrieves a list of workload results.

func (*Scheduler) L5Connect added in v0.1.21

func (s *Scheduler) L5Connect(ctx context.Context, opts *types.ConnectOptions) error

L5Connect l5 node login to the scheduler

func (*Scheduler) LoadAWSData added in v0.1.14

func (s *Scheduler) LoadAWSData(ctx context.Context, limit, offset int, isDistribute bool) ([]*types.AWSDataInfo, error)

func (*Scheduler) MinioUploadFileEvent added in v0.1.11

func (s *Scheduler) MinioUploadFileEvent(ctx context.Context, event *types.MinioUploadFileEvent) error

func (*Scheduler) NatPunch

func (s *Scheduler) NatPunch(ctx context.Context, target *types.NatPunchReq) error

NatPunch performs NAT traversal

func (*Scheduler) NodeExists

func (s *Scheduler) NodeExists(ctx context.Context, nodeID string) error

NodeExists checks if the node with the specified ID exists.

func (*Scheduler) NodeKeepalive

func (s *Scheduler) NodeKeepalive(ctx context.Context) (uuid.UUID, error)

NodeKeepalive candidate and edge keepalive

func (*Scheduler) NodeKeepaliveV2 added in v0.1.11

func (s *Scheduler) NodeKeepaliveV2(ctx context.Context) (uuid.UUID, error)

NodeKeepaliveV2 candidate and edge keepalive

func (*Scheduler) NodeLogin

func (s *Scheduler) NodeLogin(ctx context.Context, nodeID, sign string) (string, error)

NodeLogin creates a new JWT token for a node.

func (*Scheduler) NodeRemoveAssetResult

func (s *Scheduler) NodeRemoveAssetResult(ctx context.Context, resultInfo types.RemoveAssetResult) error

NodeRemoveAssetResult updates a node's disk usage and block count based on the resultInfo.

func (*Scheduler) NodeValidationResult

func (s *Scheduler) NodeValidationResult(ctx context.Context, r io.Reader, sign string) error

NodeValidationResult processes the validation result for a node

func (*Scheduler) PerformSyncData added in v0.1.18

func (s *Scheduler) PerformSyncData(ctx context.Context, nodeID string) error

func (*Scheduler) PullAsset

func (s *Scheduler) PullAsset(ctx context.Context, info *types.PullAssetReq) error

PullAsset pull an asset based on the provided PullAssetReq structure.

func (*Scheduler) ReDetermineNodeNATType added in v0.1.19

func (s *Scheduler) ReDetermineNodeNATType(ctx context.Context, nodeID string) error

func (*Scheduler) RePullFailedAssets

func (s *Scheduler) RePullFailedAssets(ctx context.Context, hashes []types.AssetHash) error

RePullFailedAssets retries the pull process for a list of failed assets

func (*Scheduler) RedeployFailedProjects added in v0.1.19

func (s *Scheduler) RedeployFailedProjects(ctx context.Context, ids []string) error

RedeployFailedProjects retries the deploy process for a list of failed projects

func (*Scheduler) RegisterCandidateNode added in v0.1.19

func (s *Scheduler) RegisterCandidateNode(ctx context.Context, nodeID, publicKey, code string) (*types.ActivationDetail, error)

RegisterCandidateNode register node

func (*Scheduler) RegisterEdgeNode added in v0.1.11

func (s *Scheduler) RegisterEdgeNode(ctx context.Context, nodeID, publicKey string) (*types.ActivationDetail, error)

RegisterEdgeNode register edge node, return key

func (*Scheduler) RegisterNode

func (s *Scheduler) RegisterNode(ctx context.Context, nodeID, publicKey string, nodeType types.NodeType) (*types.ActivationDetail, error)

RegisterNode register node

func (*Scheduler) ReimburseNodeProfit added in v0.1.21

func (s *Scheduler) ReimburseNodeProfit(ctx context.Context, nodeID, note string, profit float64) error

func (*Scheduler) RemoveAssetRecord

func (s *Scheduler) RemoveAssetRecord(ctx context.Context, cid string) error

RemoveAssetRecord removes an asset record from the system by its CID.

func (*Scheduler) RemoveAssetReplica

func (s *Scheduler) RemoveAssetReplica(ctx context.Context, cid, nodeID string) error

RemoveAssetReplica removes an asset replica from the system by its CID and nodeID.

func (*Scheduler) RemoveCandidateCode added in v0.1.21

func (s *Scheduler) RemoveCandidateCode(ctx context.Context, code string) error

func (*Scheduler) RemoveNodeFailedReplica added in v0.1.16

func (s *Scheduler) RemoveNodeFailedReplica(ctx context.Context) error

func (*Scheduler) RequestActivationCodes added in v0.1.10

func (s *Scheduler) RequestActivationCodes(ctx context.Context, nodeType types.NodeType, count int) ([]*types.NodeActivation, error)

RequestActivationCodes request node activation codes

func (*Scheduler) ResetCandidateCode added in v0.1.21

func (s *Scheduler) ResetCandidateCode(ctx context.Context, nodeID, code string) error

func (*Scheduler) SetProperties added in v0.1.21

func (s *Scheduler) SetProperties(ctx context.Context, properties *types.Properties) error

func (*Scheduler) SetTunserverURL added in v0.1.21

func (s *Scheduler) SetTunserverURL(ctx context.Context, nodeID, wsNodeID string) error

func (*Scheduler) ShareAssets added in v0.1.10

func (s *Scheduler) ShareAssets(ctx context.Context, userID string, assetCIDs []string) (map[string][]string, error)

ShareAssets shares the assets of the user.

func (*Scheduler) StartProject added in v0.1.19

func (s *Scheduler) StartProject(ctx context.Context, req *types.ProjectReq) error

func (*Scheduler) StopAssetRecord added in v0.1.14

func (s *Scheduler) StopAssetRecord(ctx context.Context, cids []string) error

StopAssetRecord stop an asset record from the system by its CID.

func (*Scheduler) SubmitProjectReport added in v0.1.21

func (s *Scheduler) SubmitProjectReport(ctx context.Context, req *types.ProjectRecordReq) error

func (*Scheduler) SubmitWorkloadReport added in v0.1.18

func (s *Scheduler) SubmitWorkloadReport(ctx context.Context, workload *types.WorkloadRecordReq) error

SubmitWorkloadReport

func (*Scheduler) SubmitWorkloadReportV2 added in v0.1.18

func (s *Scheduler) SubmitWorkloadReportV2(ctx context.Context, workload *types.WorkloadRecordReq) error

func (*Scheduler) SwitchFillDiskTimer added in v0.1.13

func (s *Scheduler) SwitchFillDiskTimer(ctx context.Context, open bool) error

func (*Scheduler) TriggerElection

func (s *Scheduler) TriggerElection(ctx context.Context) error

TriggerElection triggers a single election for validators.

func (*Scheduler) UndoNodeDeactivation added in v0.1.11

func (s *Scheduler) UndoNodeDeactivation(ctx context.Context, nodeID string) error

UndoNodeDeactivation is used to undo the deactivation of a node in the titan server. It allows the previously deactivated node to start serving requests again.

func (*Scheduler) UpdateAssetExpiration

func (s *Scheduler) UpdateAssetExpiration(ctx context.Context, cid string, t time.Time) error

UpdateAssetExpiration resets the expiration time of an asset record based on the provided CID and new expiration time.

func (*Scheduler) UpdateBandwidths added in v0.1.11

func (s *Scheduler) UpdateBandwidths(ctx context.Context, bandwidthDown, bandwidthUp int64) error

UpdateBandwidths update bandwidths

func (*Scheduler) UpdateDeployment added in v0.1.21

func (s *Scheduler) UpdateDeployment(ctx context.Context, deployment *types.Deployment) error

func (*Scheduler) UpdateIngress added in v0.1.21

func (s *Scheduler) UpdateIngress(ctx context.Context, id types.DeploymentID, annotations map[string]string) error

func (*Scheduler) UpdateNetFlows added in v0.1.19

func (s *Scheduler) UpdateNetFlows(ctx context.Context, total, up, down int64) error

UpdateNetFlows update node net flow total,up,down usage

func (*Scheduler) UpdateNodeDynamicInfo added in v0.1.19

func (s *Scheduler) UpdateNodeDynamicInfo(ctx context.Context, info *types.NodeDynamicInfo) error

func (*Scheduler) UpdateNodePort

func (s *Scheduler) UpdateNodePort(ctx context.Context, nodeID, port string) error

UpdateNodePort sets the port for the specified node.

func (*Scheduler) UpdateProject added in v0.1.19

func (s *Scheduler) UpdateProject(ctx context.Context, req *types.ProjectReq) error

func (*Scheduler) UpdateProjectStatus added in v0.1.19

func (s *Scheduler) UpdateProjectStatus(ctx context.Context, list []*types.Project) error

func (*Scheduler) UpdateTunserverURL added in v0.1.19

func (s *Scheduler) UpdateTunserverURL(ctx context.Context, nodeID string) error

func (*Scheduler) UserAssetDownloadResult added in v0.1.11

func (s *Scheduler) UserAssetDownloadResult(ctx context.Context, userID, cid string, totalTraffic, peakBandwidth int64) error

UserAssetDownloadResult download result

func (*Scheduler) VerifyTokenWithLimitCount added in v0.1.11

func (s *Scheduler) VerifyTokenWithLimitCount(ctx context.Context, token string) (*types.JWTPayload, error)

VerifyTokenWithLimitCount verify token in limit count

Directories

Path Synopsis
gen command
gen command

Jump to

Keyboard shortcuts

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