service

package
v0.0.0-...-96b04c8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 78 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CisTaskStatusCreating = "Creating"
	CisTaskStatusRunning  = "Running"
	CisTaskStatusSuccess  = "Success"
	CisTaskStatusFailed   = "Failed"
)
View Source
const (
	NfsStorage = "10-plugin-cluster-storage-nfs.yml"
)

Variables

View Source
var (
	CheckFailed            = "CHECK_FAILED"
	BackupAccountNameExist = "NAME_EXISTS"
)
View Source
var (
	CheckHostSSHConnection = "CHECK_HOST_SSH_CONNECTION"
	CheckK8sToken          = "CHECK_K8S_TOKEN"
	CheckK8sAPI            = "CHECK_K8S_API"
	CheckK8sNodeStatus     = "CHECK_K8S_NODE_STATUS"
	CheckKubeRouter        = "CHECK_KUBE_ROUTER"

	StatusSuccess        = "STATUS_SUCCESS"
	StatusWarning        = "STATUS_WARNING"
	StatusFailed         = "STATUS_FAILED"
	StatusError          = "STATUS_ERROR"
	StatusSolvedManually = "STATUS_SOLVED_MANUALLY"
	StatusRecoverd       = "STATUS_RECOVERD"

	RecoverNodeStatus   = "RECOVER_SYNC_NODE_STATUS"
	RecoverSyncRouterIP = "RECOVER_SYNC_ROUTER_IP"
	RecoverSyncToken    = "RECOVER_SYNC_TOKEN"
	RecoverConnConf     = "RECOVER_CONN_CONF"
	RecoverHostConn     = "RECOVER_HOST_CONN"
	RecoverAPIConn      = "RECOVER_API_CONN"
)
View Source
var (
	DeleteNtpServerError = "DELETE_REGION_FAILED_RESOURCE"
	NtpServerNameExist   = "NAME_EXISTS"
)
View Source
var (
	DeleteRegionError = "DELETE_REGION_FAILED_RESOURCE"
	RegionNameExist   = "NAME_EXISTS"
)
View Source
var (
	ConfigNameExist = "NAME_EXISTS"
	ConfigExist     = "VM_CONFIG_EXISTS"
)
View Source
var CredentialNameExist = "NAME_EXISTS"
View Source
var (
	PlanNameExist = "NAME_EXISTS"
)
View Source
var (
	ProjectNameExist = "NAME_EXISTS"
)
View Source
var (
	UpdateError = "BACKUP_FILES_NOT_NULL"
)

Functions

func CreateCredential

func CreateCredential(cluster string, backup dto.BackupAccount) (string, error)

func Do

func Do(client *kubernetes.Clientset, task *model.CisTask, port int)

func GetClusterStatusByAPI

func GetClusterStatusByAPI(addr string, cluster *model.Cluster) (bool, string)

func GetMsgContent

func GetMsgContent(msgType, sendType string, content map[string]string) (string, error)

func NewClusterImportService

func NewClusterImportService() *clusterImportService

func NewClusterResourceService

func NewClusterResourceService() *clusterResourceService

func NewDemoService

func NewDemoService() *demoService

Types

type BackupAccountService

type BackupAccountService interface {
	Get(name string) (*dto.BackupAccount, error)
	List(projectName string, conditions condition.Conditions) ([]dto.BackupAccount, error)
	Page(num, size int, conditions condition.Conditions) (*page.Page, error)
	Create(creation dto.BackupAccountRequest) (*dto.BackupAccount, error)
	Update(name string, creation dto.BackupAccountUpdate) (*dto.BackupAccount, error)
	Batch(op dto.BackupAccountOp) error
	GetBuckets(request dto.CloudStorageRequest) ([]interface{}, error)
	Delete(name string) error
	ListByClusterName(clusterName string) ([]dto.BackupAccount, error)
}

func NewBackupAccountService

func NewBackupAccountService() BackupAccountService

type CLusterBackupFileService

type CLusterBackupFileService interface {
	Page(num, size int, clusterName string) (*page.Page, error)
	Create(creation dto.ClusterBackupFileCreate) (*dto.ClusterBackupFile, error)
	Batch(op dto.ClusterBackupFileOp) error
	Backup(creation dto.ClusterBackupFileCreate) error
	Restore(restore dto.ClusterBackupFileRestore) error
	Delete(name string) error
	LocalRestore(clusterName string, file []byte) error
}

func NewClusterBackupFileService

func NewClusterBackupFileService() CLusterBackupFileService

type CLusterBackupStrategyService

type CLusterBackupStrategyService interface {
	Get(clusterName string) (*dto.ClusterBackupStrategy, error)
	Save(creation dto.ClusterBackupStrategyRequest) (*dto.ClusterBackupStrategy, error)
}

func NewCLusterBackupStrategyService

func NewCLusterBackupStrategyService() CLusterBackupStrategyService

type CisService

type CisService interface {
	Page(num, size int, clusterName string) (*page.Page, error)
	List(clusterName string) ([]dto.CisTask, error)
	Create(clusterName string, create *dto.CisTaskCreate) (*dto.CisTask, error)
	Delete(clusterName, id string) error
	Get(clusterName, id string) (*dto.CisTaskDetail, error)
}

func NewCisService

func NewCisService() CisService

type ClusterHealthService

type ClusterHealthService interface {
	HealthCheck(clusterName string) (*dto.ClusterHealth, error)
	Recover(clusterName string, ch dto.ClusterHealth) ([]dto.ClusterRecoverItem, error)
}

func NewClusterHealthService

func NewClusterHealthService() ClusterHealthService

type ClusterIaasService

type ClusterIaasService interface {
	LoadMetalNodes(creation *dto.ClusterCreate, cluster *model.Cluster, tx *gorm.DB) error
	LoadPlanNodes(cluster *model.Cluster) error
}

func NewClusterIaasService

func NewClusterIaasService() ClusterIaasService

type ClusterImportService

type ClusterImportService interface {
	Import(clusterImport dto.ClusterImport) error
	LoadClusterInfo(loadInfo *dto.ClusterLoad) (dto.ClusterLoadInfo, error)
}

type ClusterInitService

type ClusterInitService interface {
	Init(cluster model.Cluster, writer io.Writer)
	GatherKubernetesToken(cluster model.Cluster) error
}

func NewClusterInitService

func NewClusterInitService() ClusterInitService

type ClusterManifestService

type ClusterManifestService interface {
	List() ([]dto.ClusterManifest, error)
	ListActive() ([]dto.ClusterManifest, error)
	Update(update dto.ClusterManifestUpdate) (model.ClusterManifest, error)
	ListByLargeVersion() ([]dto.ClusterManifestGroup, error)
}

func NewClusterManifestService

func NewClusterManifestService() ClusterManifestService

type ClusterMemberService

type ClusterMemberService interface {
	Page(clusterName string, num, size int) (*page.Page, error)
	GetUsers(name string) (dto.UsersResponse, error)
	Create(clusterName string, request dto.ClusterMemberCreate) ([]dto.ClusterMember, error)
	Delete(name, clusterName string) error
	GetUsersByName(clusterName, name string) (dto.UsersAddResponse, error)
}

func NewClusterMemberService

func NewClusterMemberService() ClusterMemberService

type ClusterNodeService

type ClusterNodeService interface {
	Get(clusterName, name string) (*dto.Node, error)
	List(clusterName string) ([]dto.Node, error)
	Batch(clusterName string, batch dto.NodeBatch) error
	Recreate(clusterName string, batch dto.NodeBatch) error
	Page(num, size int, isPolling, clusterName string) (*dto.NodePage, error)
}

func NewClusterNodeService

func NewClusterNodeService() ClusterNodeService

type ClusterResourceService

type ClusterResourceService interface {
	Page(num, size int, clusterName, resourceType string) (*page.Page, error)
	List(clusterName string, resourceType string) (interface{}, error)
	Create(clusterName string, request dto.ClusterResourceCreate) ([]dto.ClusterResource, error)
	GetResources(resourceType, projectName, clusterName string) (interface{}, error)
	Delete(name, resourceType, clusterName string) error
}

type ClusterService

type ClusterService interface {
	Get(name string) (dto.Cluster, error)
	GetClusterByProject(projectNames string) ([]dto.ClusterInfo, error)
	CheckExistence(name string) bool
	GetStatus(name string) (*dto.TaskLog, error)
	GetSecrets(name string) (dto.ClusterSecret, error)
	GetApiServerEndpoint(name string) (string, error)
	GetApiServerEndpoints(name string) ([]string, error)
	GetRouterEndpoint(name string) (dto.Endpoint, error)
	GetWebkubectlToken(name string) (dto.WebkubectlToken, error)
	GetKubeconfig(name string) (string, error)
	Create(creation dto.ClusterCreate) (*dto.Cluster, error)
	ReCreate(name string) error
	List() ([]dto.Cluster, error)
	Page(num, size int, isPolling string, user dto.SessionUser, conditions condition.Conditions) (*dto.ClusterPage, error)
	Delete(name string, force bool, uninstall bool) error
}

func NewClusterService

func NewClusterService() ClusterService

type ClusterStorageProvisionerService

type ClusterStorageProvisionerService interface {
	ListStorageProvisioner(clusterName string) ([]dto.ClusterStorageProvisioner, error)
	CreateStorageProvisioner(clusterName string, creation dto.ClusterStorageProvisionerCreation) error
	SyncStorageProvisioner(clusterName string, syncs []dto.ClusterStorageProvisionerSync) error
	DeleteStorageProvisioner(clusterName string, provisioner string) error
}

func NewClusterStorageProvisionerService

func NewClusterStorageProvisionerService() ClusterStorageProvisionerService

type ClusterToolService

type ClusterToolService interface {
	List(clusterName string) ([]dto.ClusterTool, error)
	GetNodePort(clusterName, toolName string) (string, error)
	SyncStatus(clusterName string) ([]dto.ClusterTool, error)
	Enable(clusterName string, tool dto.ClusterTool) (dto.ClusterTool, error)
	Upgrade(clusterName string, tool dto.ClusterTool) (dto.ClusterTool, error)
	Disable(clusterName string, tool dto.ClusterTool) (dto.ClusterTool, error)
	GetFlex(clusterName string) (string, error)
	EnableFlex(clusterName string) error
	DisableFlex(clusterName string) error
}

func NewClusterToolService

func NewClusterToolService() ClusterToolService

type ClusterUpgradeService

type ClusterUpgradeService interface {
	Upgrade(upgrade dto.ClusterUpgrade) error
}

func NewClusterUpgradeService

func NewClusterUpgradeService() ClusterUpgradeService

type ComponentService

type ComponentService interface {
	Get(clusterName string) ([]dto.Component, error)
	Create(component *dto.ComponentCreate) error
	Delete(clusterName, name string) error
	Sync(component *dto.ComponentSync) error
}

func NewComponentService

func NewComponentService() ComponentService

type ConnInfo

type ConnInfo struct {
	Name     string        `josn:"name"`
	Password string        `josn:"password"`
	Cluster  model.Cluster `json:"cluster"`
}

type ControllerStruct

type ControllerStruct struct {
	ExtraArgs extraArgsStruct `json:"extraArgs"`
}

type CredentialService

type CredentialService interface {
	Get(name string) (dto.Credential, error)
	List(conditions condition.Conditions) ([]dto.Credential, error)
	Page(num, size int, conditions condition.Conditions) (*page.Page, error)
	Create(creation dto.CredentialCreate) (*dto.Credential, error)
	Delete(name string) error
	Batch(op dto.CredentialBatchOp) error
	GetById(id string) (dto.Credential, error)
	Update(name string, update dto.CredentialUpdate) (*dto.Credential, error)
}

func NewCredentialService

func NewCredentialService() CredentialService

type DemoService

type DemoService interface {
	Save(demo dto.CreateDemo) error
	List() ([]dto.Demo, error)
	Get(name string) (dto.Demo, error)
}

type GradeService

type GradeService interface {
	GetGrade(clusterName string) (*dto.ClusterGrade, error)
}

func NewGradeService

func NewGradeService() GradeService

type HealthCheckFunc

type HealthCheckFunc func(c model.Cluster) dto.ClusterHealthHook

type HostService

type HostService interface {
	Get(name string) (*dto.Host, error)
	List(projectName string, conditions condition.Conditions) ([]dto.Host, error)
	Page(num, size int, projectName string, conditions condition.Conditions) (*page.Page, error)
	Create(creation dto.HostCreate) (*dto.Host, error)
	Update(host dto.HostUptate) (*dto.Host, error)
	Delete(name string) error
	SyncList(names []dto.HostSync) error
	Sync(name string) (dto.Host, error)
	Batch(op dto.HostOp) error
	DownloadTemplateFile() error
	RunGetHostConfig(host *model.Host)
	ImportHosts(file []byte) error
}

func NewHostService

func NewHostService() HostService

type IpPoolService

type IpPoolService interface {
	Get(name string) (dto.IpPool, error)
	Page(num, size int, conditions condition.Conditions) (*page.Page, error)
	Create(creation dto.IpPoolCreate) (dto.IpPool, error)
	Batch(op dto.IpPoolOp) error
	List(conditions condition.Conditions) ([]dto.IpPool, error)
	Delete(name string) error
}

func NewIpPoolService

func NewIpPoolService() IpPoolService

type IpService

type IpService interface {
	Get(ip string) (dto.Ip, error)
	Create(create dto.IpCreate, tx *gorm.DB) error
	Page(num, size int, ipPoolName string, conditions condition.Conditions) (*page.Page, error)
	Batch(op dto.IpOp) error
	Update(name string, update dto.IpUpdate) (*dto.Ip, error)
	Sync(ipPoolName string) error
	Delete(address string) error
	List(ipPoolName string, conditions condition.Conditions) ([]dto.Ip, error)
}

func NewIpService

func NewIpService() IpService

type KubepiService

type KubepiService interface {
	GetKubePiUser() (*kubepi.ListUser, error)
	BindKubePi(req dto.BindKubePI) error
	GetKubePiBind(req dto.SearchBind) (*dto.BindResponse, error)
	CheckConn(req dto.CheckConn) error
	LoadInfo(project, cluster string, isAdmin bool) (*ConnInfo, error)
}

func NewKubepiService

func NewKubepiService() KubepiService

type KubernetesService

type KubernetesService interface {
	Get(req dto.SourceSearch) (interface{}, error)
	GetMetric(cluster string) (interface{}, error)
	CreateSc(req dto.SourceScCreate) error
	CreateSecret(req dto.SourceSecretCreate) error
	CordonNode(req dto.Cordon) error
	EvictPod(req dto.Evict) error
	Delete(req dto.SourceDelete) error
}

func NewKubernetesService

func NewKubernetesService() KubernetesService

type LdapService

type LdapService interface {
	Create(creation dto.SystemSettingCreate) ([]dto.SystemSetting, error)
	TestConnect(creation dto.SystemSettingCreate) (int, error)
	TestLogin(username, password string) error
	LdapSync() ([]dto.LdapUser, error)
	ImpostUsers(users []dto.LdapUser) error
}

func NewLdapService

func NewLdapService() LdapService

type LicenseService

type LicenseService interface {
	Save(content string) (*dto.License, error)
	Get() (*dto.License, error)
}

func NewLicenseService

func NewLicenseService() LicenseService

type MsgAccountService

type MsgAccountService interface {
	GetByName(name string) (dto.MsgAccountDTO, error)
	CreateOrUpdate(msgDTO dto.MsgAccountDTO) (dto.MsgAccountDTO, error)
	Verify(msgDTO dto.MsgAccountDTO) error
}

func NewMsgAccountService

func NewMsgAccountService() MsgAccountService

type MsgService

type MsgService interface {
	SendMsg(name, scope string, resource interface{}, success bool, content map[string]string) error
}

func NewMsgService

func NewMsgService() MsgService

type MsgSubscribeService

type MsgSubscribeService interface {
	Page(scope, resourceName string, num, size int, condition condition.Conditions) (page.Page, error)
	Update(updated dto.MsgSubscribeDTO) error
	UpdateSubscribeUser(msgSubscribeUserDTO dto.MsgSubscribeUserDTO) error
	AddSubscribeUser(msgSubscribeUserDTO dto.MsgSubscribeUserDTO) error
	DeleteSubscribeUser(msgSubscribeUserDTO dto.MsgSubscribeUserDTO) error
	List(scope, resourceName string, condition condition.Conditions) ([]dto.MsgSubscribeDTO, error)
	GetSubscribeUser(cluster, subscribeId, search string, user dto.SessionUser) (dto.AddSubscribeResponse, error)
	PageSubUsers(subscribeId string, num, size int, condition condition.Conditions) (page.Page, error)
}

func NewMsgSubscribeService

func NewMsgSubscribeService() MsgSubscribeService

type NtpServerService

type NtpServerService interface {
	Get(name string) (dto.NtpServer, error)
	List() ([]dto.NtpServer, error)
	Page(num, size int) (*page.Page, error)
	Delete(name string) error
	Create(creation dto.NtpServerCreate) (*dto.NtpServer, error)
	Update(name string, update dto.NtpServerUpdate) (*dto.NtpServer, error)
}

func NewNtpServerService

func NewNtpServerService() NtpServerService

type OverViewData

type OverViewData struct {
	Deployments int `json:"deployments"`
	Nodes       int `json:"nodes"`
	Namespaces  int `json:"namespaces"`
	Pods        int `json:"pods"`
	Containers  int `json:"containers"`
}

type PlanService

type PlanService interface {
	Get(name string) (*dto.Plan, error)
	List(projectName string) ([]dto.Plan, error)
	Page(num, size int, projectName string, conditions condition.Conditions) (*page.Page, error)
	Delete(name string) error
	Create(creation dto.PlanCreate) (*dto.Plan, error)
	Batch(op dto.PlanOp) error
	GetConfigs(regionName string) ([]dto.PlanVmConfig, error)
	PatchBy(name string, update dto.PlanUpdate) (*dto.Plan, error)
}

func NewPlanService

func NewPlanService() PlanService

type ProjectMemberService

type ProjectMemberService interface {
	Page(projectName string, num, size int) (*page.Page, error)
	Batch(op dto.ProjectMemberOP) error
	GetUsers(name string, projectName string) (*dto.AddMemberResponse, error)
	Create(projectName string, request dto.ProjectMemberCreate) ([]dto.ProjectMember, error)
	Get(name string, projectName string) (*dto.ProjectMember, error)
	Delete(name, projectName string) error
}

func NewProjectMemberService

func NewProjectMemberService() ProjectMemberService

type ProjectResourceService

type ProjectResourceService interface {
	Batch(op dto.ProjectResourceOp) error
	Page(num, size int, projectName string, resourceType string) (*page.Page, error)
	List(projectName string, resourceType string) (*page.Page, error)
	GetResources(resourceType, projectName string) (interface{}, error)
	Create(projectName string, request dto.ProjectResourceCreate) ([]dto.ProjectResource, error)
	Delete(name, resourceType, projectName string) error
}

func NewProjectResourceService

func NewProjectResourceService() ProjectResourceService

type ProjectService

type ProjectService interface {
	Get(name string) (*dto.Project, error)
	List(user dto.SessionUser, conditions condition.Conditions) ([]dto.Project, error)
	Page(num, size int, user dto.SessionUser, conditions condition.Conditions) (*page.Page, error)
	Delete(name string) error
	Create(creation dto.ProjectCreate) (*dto.Project, error)
	Batch(op dto.ProjectOp) error
	Update(name string, update dto.ProjectUpdate) (*dto.Project, error)
	GetResourceTree(user dto.SessionUser) ([]dto.ProjectResourceTree, error)
	GetProjectsHasClusters(user dto.SessionUser) ([]dto.Project, error)
}

func NewProjectService

func NewProjectService() ProjectService

type RegionService

type RegionService interface {
	Get(name string) (dto.Region, error)
	List(conditions condition.Conditions) ([]dto.Region, error)
	Page(num, size int, conditions condition.Conditions) (*page.Page, error)
	Delete(name string) error
	Create(creation dto.RegionCreate) (*dto.Region, error)
	Batch(op dto.RegionOp) error
	ListDatacenter(creation dto.RegionDatacenterRequest) ([]string, string, error)
	Update(name string, update dto.RegionUpdate) (*dto.Region, error)
}

func NewRegionService

func NewRegionService() RegionService

type SystemLogService

type SystemLogService interface {
	Create(creation dto.SystemLogCreate) error
	Page(num, size int, conditions condition.Conditions) (*page.Page, error)
}

func NewSystemLogService

func NewSystemLogService() SystemLogService

type SystemSettingService

type SystemSettingService interface {
	Get(name string) (dto.SystemSetting, error)
	GetLocalIPs() ([]model.SystemRegistry, error)
	List() (dto.SystemSettingResult, error)
	Create(creation dto.SystemSettingCreate) ([]dto.SystemSetting, error)
	ListByTab(tabName string) (dto.SystemSettingResult, error)
	CheckSettingByType(tabName string, creation dto.SystemSettingCreate) error
	ListRegistry(conditions condition.Conditions) ([]dto.SystemRegistry, error)
	PageRegistry(num, size int, conditions condition.Conditions) (*page.Page, error)
	GetRegistryByID(id string) (dto.SystemRegistry, error)
	GetRegistryByArch(arch string) (dto.SystemRegistry, error)
	CreateRegistry(creation dto.SystemRegistryCreate) (*dto.SystemRegistry, error)
	UpdateRegistry(arch string, creation dto.SystemRegistryUpdate) (*dto.SystemRegistry, error)
	BatchRegistry(op dto.SystemRegistryBatchOp) error
	DeleteRegistry(id string) error
	ChangePassword(repo dto.RepoChangePassword) error
}

func NewSystemSettingService

func NewSystemSettingService() SystemSettingService

type TaskLogService

type TaskLogService interface {
	Page(num, size int, clusterName string, logtype string) (*page.Page, error)
	GetByID(id string) (model.TaskLog, error)
	GetTaskDetailByID(id string) (*dto.TaskLog, error)
	GetTaskLogByID(clusterId, logId string) (*dto.Logs, error)
	GetTaskLogByName(clusterName, logId string) (*dto.Logs, error)
	GetBackupLogs(num, size int, clusterName string) (*page.Page, error)
	Save(taskLog *model.TaskLog) error
	Start(log *model.TaskLog) error
	End(log *model.TaskLog, success bool, message string) error
	NewTerminalTask(clusterID string, logtype string) (*model.TaskLog, error)

	IsTaskOn(clusterName string) bool

	StartDetail(detail *model.TaskLogDetail) error
	EndDetail(detail *model.TaskLogDetail, name, taskType, statu, message string) error
	SaveDetail(detail *model.TaskLogDetail) error

	RestartTask(cluster *model.Cluster, operation string) error
}

func NewTaskLogService

func NewTaskLogService() TaskLogService

type TemplateConfigService

type TemplateConfigService interface {
	List() ([]dto.TemplateConfig, error)
	Page(num, size int, conditions condition.Conditions) (*page.Page, error)
	Create(creation dto.TemplateConfigCreate) (*dto.TemplateConfig, error)
	Get(name string) (*dto.TemplateConfig, error)
	Delete(name string) error
	Update(name string, update dto.TemplateConfig) (*dto.TemplateConfig, error)
}

func NewTemplateConfigService

func NewTemplateConfigService() TemplateConfigService

type ThemeService

type ThemeService interface {
	GetConsumerTheme() (*dto.Theme, error)
}

func NewThemeService

func NewThemeService() ThemeService

type UserMsgService

type UserMsgService interface {
	UpdateLocalMsg(msgID string, user dto.SessionUser) error
	PageLocalMsg(num, size int, user dto.SessionUser, conditions condition.Conditions) (dto.UserMsgResponse, error)
	MarkAllRead(user dto.SessionUser) error
}

func NewUserMsgService

func NewUserMsgService() UserMsgService

type UserService

type UserService interface {
	Get(name string) (*dto.User, error)
	List(user dto.SessionUser, conditions condition.Conditions) ([]dto.User, error)
	Create(isSuper bool, creation dto.UserCreate) (*dto.User, error)
	Page(num, size int, user dto.SessionUser, conditions condition.Conditions) (*page.Page, error)
	Delete(name string) error
	Update(name string, isSuper bool, update dto.UserUpdate) (*dto.User, error)
	Batch(op dto.UserOp) error
	ChangePassword(isSuper bool, ch dto.UserChangePassword) error
	UserAuth(name string, password string) (user *model.User, err error)
	ResetPassword(fp dto.UserForgotPassword) error
}

func NewUserService

func NewUserService() UserService

type UserSettingService

type UserSettingService interface {
	Update(settingDTO dto.UserSettingDTO) (dto.UserSettingDTO, error)
	GetByUsername(username string) (dto.UserSettingDTO, error)
}

func NewUserSettingService

func NewUserSettingService() UserSettingService

type VeleroBackupService

type VeleroBackupService interface {
	Create(operate string, backup dto.VeleroBackup) (string, error)
	GetBackups(cluster string) (*dto.VeleroBackupList, error)
	GetLogs(cluster, name, operate string) (string, error)
	GetDescribe(cluster, name, operate string) (string, error)
	Delete(cluster, name, operate string) (string, error)
	Install(cluster string, veleroInstall dto.VeleroInstall) (string, error)
	GetConfig(cluster string) (dto.VeleroInstall, error)
	UnInstall(cluster string) error
}

func NewVeleroBackupService

func NewVeleroBackupService() VeleroBackupService

type VmConfigService

type VmConfigService interface {
	Page(num, size int, conditions condition.Conditions) (*page.Page, error)
	List(conditions condition.Conditions) ([]dto.VmConfig, error)
	Batch(op dto.VmConfigOp) error
	Create(creation dto.VmConfigCreate) (*dto.VmConfig, error)
	Update(name string, creation dto.VmConfigUpdate) (*dto.VmConfig, error)
	Get(name string) (*dto.VmConfig, error)
	Delete(name string) error
}

func NewVmConfigService

func NewVmConfigService() VmConfigService

type ZoneService

type ZoneService interface {
	Get(name string) (*dto.Zone, error)
	List(conditions condition.Conditions) ([]dto.Zone, error)
	Page(num, size int, conditions condition.Conditions) (*page.Page, error)
	Delete(name string) error
	Create(creation dto.ZoneCreate) (*dto.Zone, error)
	Update(name string, creation dto.ZoneUpdate) (*dto.Zone, error)
	Batch(op dto.ZoneOp) error
	ListClusters(creation dto.CloudZoneRequest) ([]interface{}, error)
	ListTemplates(creation dto.CloudZoneRequest) ([]interface{}, error)
	ListByRegionName(regionName string) ([]dto.Zone, error)
	ListDatastores(creation dto.CloudZoneRequest) ([]dto.CloudDatastore, error)
	UploadImage(zoneName string) error
	ListFolders(creation dto.CloudZoneRequest) ([]string, error)
}

func NewZoneService

func NewZoneService() ZoneService

Jump to

Keyboard shortcuts

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