Documentation ¶
Overview ¶
Package dbclient 定义数据库操作的方法, orm 等。
Index ¶
- Constants
- func ConvertRuntimeDTO(runtime *Runtime, app *apistructs.ApplicationDTO) *apistructs.RuntimeDTO
- func InitMysqlMock() (*gorm.DB, sqlmock.Sqlmock, error)
- func NotDeleted(db *gorm.DB) *gorm.DB
- type AddonAttachment
- type AddonAudit
- type AddonDeploy
- type AddonExtra
- type AddonInstance
- type AddonInstanceExtra
- type AddonInstanceInfoExtra
- type AddonInstanceRelation
- type AddonInstanceRouting
- type AddonInstanceTenant
- type AddonManagement
- type AddonMicroAttach
- type AddonNode
- type AddonPrebuild
- type ConfigItem
- type ConfigNamespace
- type ConfigNamespaceRelation
- type DBClient
- func (db *DBClient) ClearRuntimeServiceErrors(serviceId uint64) error
- func (db *DBClient) CountAddonReferenceByClusterAndOrg(clusterName, orgID string) (int, error)
- func (db *DBClient) CountServiceReferenceByClusterAndOrg(clusterName, orgID string) (int, error)
- func (db *DBClient) CreateAddonAudit(addonAudit AddonAudit) error
- func (db *DBClient) CreateAddonDeploy(addonDeploy *AddonDeploy) error
- func (db *DBClient) CreateAddonExtra(addonExtra *AddonExtra) error
- func (db *DBClient) CreateAddonInstance(instance *AddonInstance) error
- func (db *DBClient) CreateAddonInstanceExtra(addonInstanceExtra *AddonInstanceExtra) error
- func (db *DBClient) CreateAddonInstanceRelation(addonInstanceRelation *AddonInstanceRelation) error
- func (db *DBClient) CreateAddonInstanceRouting(addonRouting *AddonInstanceRouting) error
- func (db *DBClient) CreateAddonInstanceTenant(tenant *AddonInstanceTenant) error
- func (db *DBClient) CreateAddonNode(addonNode *AddonNode) error
- func (db *DBClient) CreateAttachment(addonAttachment *AddonAttachment) error
- func (db *DBClient) CreateDeployment(deployment *Deployment) error
- func (db *DBClient) CreateHPAEventInfo(hpaEvent *HPAEventInfo) error
- func (db *DBClient) CreateMicroAttach(addonMicroAttach *AddonMicroAttach) error
- func (db *DBClient) CreateMigrationLog(migrationLog *MigrationLog) error
- func (db *DBClient) CreateMySQLAccount(account *MySQLAccount) error
- func (db *DBClient) CreateOrUpdateRuntimeService(service *RuntimeService, overrideStatus bool) error
- func (db *DBClient) CreatePrebuild(addonPrebuild *AddonPrebuild) error
- func (db *DBClient) CreateRuntime(runtime *Runtime) error
- func (db *DBClient) CreateRuntimeHPA(runtimeHPA *RuntimeHPA) error
- func (db *DBClient) CreateRuntimeVPA(runtimeVPA *RuntimeVPA) error
- func (db *DBClient) DeleteAddonInstance(instanceID string) error
- func (db *DBClient) DeleteAddonInstanceTenant(tenantID string) error
- func (db *DBClient) DeleteAttachmentByIDs(id ...uint64) error
- func (db *DBClient) DeleteAttachmentByRuntimeAndInstanceID(runtimeID, instanceID string) error
- func (db *DBClient) DeleteAttachmentByRuntimeAndRoutingInstanceID(runtimeID, routingInstanceID string) error
- func (db *DBClient) DeleteAttachmentsByRoutingInstanceID(routingInstanceID string) error
- func (db *DBClient) DeleteDomain(domainValue string) error
- func (db *DBClient) DeleteDomainsByRuntimeId(runtimeId uint64) error
- func (db *DBClient) DeleteRuntime(runtimeId uint64) error
- func (db *DBClient) DeleteRuntimeHPAByRuleId(ruleId string) error
- func (db *DBClient) DeleteRuntimeHPAEventsByRuleId(ruleId string) error
- func (db *DBClient) DeleteRuntimeVPAByRuleId(ruleId string) error
- func (db *DBClient) DeleteRuntimeVPARecommendationsByRuntimeId(runtimeId uint64) error
- func (db *DBClient) DestroyById(id uint64) error
- func (db *DBClient) DestroyByInstanceId(instanceID string) error
- func (db *DBClient) DestroyByIntsanceID(instanceID string) error
- func (db *DBClient) DestroyByProjectAndEnvAndRoutingId(instanceID string) error
- func (db *DBClient) DestroyByRoutingID(routingInstanceID string) error
- func (db *DBClient) DestroyPrebuildByRuntimeID(runtimeID string) error
- func (db *DBClient) ExistRoost(projectID uint64, clusterName, workspace string) (bool, error)
- func (db *DBClient) ExistZK(projectID uint64, clusterName, workspace string) (bool, error)
- func (db *DBClient) FindAllDeployments(runtimeId uint64, filter DeploymentFilter) ([]Deployment, error)
- func (db *DBClient) FindDeletingRuntimes() ([]Runtime, error)
- func (db *DBClient) FindDeployments(runtimeId uint64, filter DeploymentFilter, offset int, limit int) ([]Deployment, int, error)
- func (db *DBClient) FindDeploymentsByIDs(ids []uint64) (map[uint64]Deployment, error)
- func (db *DBClient) FindDomains(domainValues []string) ([]RuntimeDomain, error)
- func (db *DBClient) FindDomainsByRuntimeId(runtimeId uint64) ([]RuntimeDomain, error)
- func (db *DBClient) FindDomainsByRuntimeIdAndServiceName(runtimeId uint64, serviceName string) ([]RuntimeDomain, error)
- func (db *DBClient) FindLastDeployment(runtimeId uint64) (*Deployment, error)
- func (db *DBClient) FindLastDeploymentIDsByRutimeIDs(runtimeIDs []uint64) ([]uint64, error)
- func (db *DBClient) FindLastSuccessDeployment(runtimeId uint64) (*Deployment, error)
- func (db *DBClient) FindMultiRuntimesDeployments(runtimeids []uint64, filter DeploymentFilter, offset int, limit int) ([]Deployment, int, error)
- func (db *DBClient) FindNotOutdatedOlderThan(runtimeId uint64, maxId uint64) ([]Deployment, error)
- func (db *DBClient) FindPreDeployment(uniqueId spec.RuntimeUniqueId) (*PreDeployment, error)
- func (db *DBClient) FindPreDeploymentOrCreate(uniqueId spec.RuntimeUniqueId, dice *diceyml.DiceYaml) (*PreDeployment, error)
- func (db *DBClient) FindRuntime(uniqueId spec.RuntimeUniqueId) (*Runtime, error)
- func (db *DBClient) FindRuntimeOrCreate(uniqueId spec.RuntimeUniqueId, operator string, ...) (*Runtime, bool, error)
- func (db *DBClient) FindRuntimeServices(runtimeId uint64) ([]RuntimeService, error)
- func (db *DBClient) FindRuntimesByAppId(appId uint64) ([]Runtime, error)
- func (db *DBClient) FindRuntimesByAppIdAndWorkspace(appId uint64, workspace string) ([]Runtime, error)
- func (db *DBClient) FindRuntimesByIds(ids []uint64) ([]Runtime, error)
- func (db *DBClient) FindRuntimesInApps(appIDs []uint64, env string) (map[uint64][]*Runtime, []uint64, error)
- func (db *DBClient) FindRuntimesNewerThan(minId uint64, limit int) ([]Runtime, error)
- func (db *DBClient) FindSuccessfulDeployments(runtimeId uint64, limit int) ([]Deployment, error)
- func (db *DBClient) FindTmcInstanceByNameAndCLuster(name, cluster string) ([]TmcInstance, error)
- func (db *DBClient) FindTopDeployments(runtimeId uint64, limit int) ([]Deployment, error)
- func (db *DBClient) FindUnfinishedDeploymentOrders() ([]DeploymentOrder, error)
- func (db *DBClient) FindUnfinishedDeployments() ([]Deployment, error)
- func (db *DBClient) GetAddonInstance(id string) (*AddonInstance, error)
- func (db *DBClient) GetAddonInstanceByNameAndCluster(addonName, cluster string) (*AddonInstance, error)
- func (db *DBClient) GetAddonInstanceRoutingByOrgAndAddonName(OrgID, clusterName, addonName, workspace, shareScope string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetAddonInstanceRoutingByProjectAndAddonName(projectID, clusterName, addonName, workspace string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetAddonInstanceTenant(id string) (*AddonInstanceTenant, error)
- func (db *DBClient) GetAddonNodesByInstanceID(instanceID string) (*[]AddonNode, error)
- func (db *DBClient) GetAddonNodesByInstanceIDs(instanceIDs []string) (*[]AddonNode, error)
- func (db *DBClient) GetAliveByAddonIDs(addonIDs []string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetAliveClusterAddon(addonName, clusterName string, status []apistructs.AddonStatus) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetAliveDiceAddon(addonName string, status []apistructs.AddonStatus) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetAliveProjectAddons(projectID, clusterName, workspace string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetAppRuntimeNumberByWorkspace(projectId uint64, env string) (uint64, error)
- func (db *DBClient) GetApplicationReleaseByVersion(version, appName string) (*Release, error)
- func (db *DBClient) GetAttachMentsByRuntimeID(runtimeID uint64) (*[]AddonAttachment, error)
- func (db *DBClient) GetAttachmentByID(id uint64) (*AddonAttachment, error)
- func (db *DBClient) GetAttachmentCountByInstanceID(instanceID string) (int64, error)
- func (db *DBClient) GetAttachmentCountByRoutingInstanceID(routingInstanceID string) (int64, error)
- func (db *DBClient) GetAttachmentsByInstanceID(instanceID string) (*[]AddonAttachment, error)
- func (db *DBClient) GetAttachmentsByRoutingInstanceID(routingInstanceID string) (*[]AddonAttachment, error)
- func (db *DBClient) GetAttachmentsByTenantInstanceID(tenantInstanceID string) (*[]AddonAttachment, error)
- func (db *DBClient) GetByAddonNameAndField(addonName, field string) (*AddonExtra, error)
- func (db *DBClient) GetByAppIdAndBranchAndEnv(applicationID, gitBranch, env string) (*[]AddonPrebuild, error)
- func (db *DBClient) GetByAppIdAndBranchAndEnvAndInstanceName(applicationID, gitBranch, env, instanceName string) (*[]AddonPrebuild, error)
- func (db *DBClient) GetById(id int64) (*AddonPrebuild, error)
- func (db *DBClient) GetByInSideInstanceID(instanceID string) (*AddonInstanceRelation, error)
- func (db *DBClient) GetByInstanceIDAndField(instanceID, field string) (*AddonInstanceExtra, error)
- func (db *DBClient) GetByOutSideInstanceID(instanceID string) (*[]AddonInstanceRelation, error)
- func (db *DBClient) GetByRealInstance(realInstanceID string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetByRoutingIDs(routingInstanceIDs []string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetByRuntimeIDAndInstanceID(runtimeID, instanceID string) (*[]AddonAttachment, error)
- func (db *DBClient) GetByRuntimeIDAndRoutingInstanceID(runtimeID, routingInstanceID string) (*[]AddonAttachment, error)
- func (db *DBClient) GetClusterAddon(addonName string, clusterName []string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetDefaultDomainOrCreate(runtimeId uint64, serviceName string, domain string) (string, error)
- func (db *DBClient) GetDeployByAddonName(addonName string) (*[]AddonDeploy, error)
- func (db *DBClient) GetDeployById(id int64) (*AddonDeploy, error)
- func (db *DBClient) GetDeployment(id uint64) (*Deployment, error)
- func (db *DBClient) GetDeploymentOrder(id string) (*DeploymentOrder, error)
- func (db *DBClient) GetDistinctProjectInfo() (*[]string, error)
- func (db *DBClient) GetEnvConfigsByNamespaceID(namespaceID int64) ([]ConfigItem, error)
- func (db *DBClient) GetExtraByAddonName(addonName string) (*[]AddonExtra, error)
- func (db *DBClient) GetInstanceExtraByAddonName(addonName string) (*[]AddonExtra, error)
- func (db *DBClient) GetInstanceRouting(id string) (*AddonInstanceRouting, error)
- func (db *DBClient) GetInstanceRoutingByRealInstance(realIns string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetInstanceRoutingsByIDs(ids []string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetInstanceRoutingsByProjectIDs(platformServiceType int, projectIDs []string, az, env string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetInstancesByIDs(ids []string) (*[]AddonInstance, error)
- func (db *DBClient) GetMicroAttachByAddonName(addonName string) (*[]AddonMicroAttach, error)
- func (db *DBClient) GetMicroAttachByOrgId(orgID string) (*[]AddonMicroAttach, error)
- func (db *DBClient) GetMicroAttachByProjectAndEnv(projectID, env string) (*[]AddonMicroAttach, error)
- func (db *DBClient) GetMicroAttachByProjects(projectIDs []string) (*[]AddonMicroAttach, error)
- func (db *DBClient) GetMicroAttachesByAddonName(addonName, orgID string, projectIDs []string) (*[]AddonMicroAttach, error)
- func (db *DBClient) GetMicroAttachesByAddonNameAndProjectIDs(addonName string, projectIDs []string, env string) (*[]AddonMicroAttach, error)
- func (db *DBClient) GetMigrationLogByDeploymentID(deploymentID uint64) (*MigrationLog, error)
- func (db *DBClient) GetMigrationLogExpiredThreeDays() (*[]MigrationLog, error)
- func (db *DBClient) GetMySQLAccountByID(id string) (*MySQLAccount, error)
- func (db *DBClient) GetMySQLAccountListByRoutingInstanceID(routingInstanceID string) ([]MySQLAccount, error)
- func (db *DBClient) GetNamespaceByName(name string) (*ConfigNamespace, error)
- func (db *DBClient) GetNamespaceRelationByName(name string) (*ConfigNamespaceRelation, error)
- func (db *DBClient) GetOrgRoutingInstances(orgID, workspace, cluster string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetPreBuildsByRuntimeID(runtimeID uint64) (*[]AddonPrebuild, error)
- func (db *DBClient) GetProjectAddon(addonName, orgID, env string, projectIds []string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetProjectReleaseByVersion(version string, projectId uint64) (*Release, error)
- func (db *DBClient) GetProjectRoutingInstances(orgID, projectID, workspace, cluster string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetProjectRuntimeNumberByWorkspace(projectId uint64, env string) (uint64, error)
- func (db *DBClient) GetReleases(releaseId string) (*Release, error)
- func (db *DBClient) GetRoutingInstanceByProjectAndName(projectID uint64, workspace, addonName, name, clusterName string) (*AddonInstanceRouting, error)
- func (db *DBClient) GetRoutingInstancesByAddonName(orgID uint64, addonName string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetRoutingInstancesByCategory(orgID uint64, category string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetRoutingInstancesByOrg(orgID uint64) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetRoutingInstancesByProject(orgID, projectID uint64, category string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetRoutingInstancesBySimilar(addonNames []string, params *apistructs.AddonHandlerCreateItem) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetRoutingInstancesByWorkbench(orgID uint64, projectIDs []string, category string) (*[]AddonInstanceRouting, error)
- func (db *DBClient) GetRuntime(id uint64) (*Runtime, error)
- func (db *DBClient) GetRuntimeAllowNil(id uint64) (*Runtime, error)
- func (db *DBClient) GetRuntimeByAppName(env string, projectId uint64, appName string) (*Runtime, error)
- func (db *DBClient) GetRuntimeByDeployOrderId(projectId uint64, orderId string) (*[]Runtime, error)
- func (db *DBClient) GetRuntimeByProjectIDs(projectIDs []uint64) (*[]Runtime, error)
- func (db *DBClient) GetRuntimeByScheduleName(scheduleName string) (*Runtime, error)
- func (db *DBClient) GetRuntimeHPAByServices(id spec.RuntimeUniqueId, services []string) ([]RuntimeHPA, error)
- func (db *DBClient) GetRuntimeHPAEventsByServices(runtimeId uint64, services []string) ([]HPAEventInfo, error)
- func (db *DBClient) GetRuntimeHPARuleByRuleId(ruleId string) (*RuntimeHPA, error)
- func (db *DBClient) GetRuntimeHPARulesByRuntimeId(runtimeId uint64) ([]RuntimeHPA, error)
- func (db *DBClient) GetRuntimeVPAByServices(id spec.RuntimeUniqueId, services []string) ([]RuntimeVPA, error)
- func (db *DBClient) GetRuntimeVPARecommendationsByServices(runtimeId uint64, services []string) ([]RuntimeVPAContainerRecommendation, error)
- func (db *DBClient) GetRuntimeVPARuleByRuleId(ruleId string) (*RuntimeVPA, error)
- func (db *DBClient) GetRuntimeVPARulesByRuntimeId(runtimeId uint64) ([]RuntimeVPA, error)
- func (db *DBClient) GetUnDeletableAttachMentsByRuntimeID(orgID, runtimeID uint64) (*[]AddonAttachment, error)
- func (db *DBClient) ListAddonInstanceByAddonName(projectID, workspace, addonName string) (*[]AddonInstance, error)
- func (db *DBClient) ListAddonInstanceByOrg(orgID uint64) (*[]AddonInstance, error)
- func (db *DBClient) ListAddonInstanceTenant() ([]AddonInstanceTenant, error)
- func (db *DBClient) ListAddonInstanceTenantByAddonInstanceID(addoninstanceId string) ([]AddonInstanceTenant, error)
- func (db *DBClient) ListAddonInstanceTenantByAddonInstanceRoutingID(addoninstanceroutingId string) ([]AddonInstanceTenant, error)
- func (db *DBClient) ListAddonInstanceTenantByProjectIDs(projectIDs []uint64, workspace ...string) ([]AddonInstanceTenant, error)
- func (db *DBClient) ListAddonInstancesByParams(orgID uint64, params *apistructs.MiddlewareListRequest) (int, []AddonInstanceInfoExtra, error)
- func (db *DBClient) ListAddonInstancesByParamsWithoutPage(orgID uint64, params *apistructs.MiddlewareListRequest) ([]AddonInstanceInfoExtra, error)
- func (db *DBClient) ListAddonInstancesByProjectIDs(projectIDs []uint64, exclude ...string) (*[]AddonInstance, error)
- func (db *DBClient) ListAddonInstancesForClean() ([]AddonInstance, error)
- func (db *DBClient) ListAttachedAddonInstance() ([]AddonInstance, error)
- func (db *DBClient) ListAttachedRoutingInstance() ([]AddonInstanceRouting, error)
- func (db *DBClient) ListAttachingAddonInstance() (*[]AddonInstance, error)
- func (db *DBClient) ListAttachmentIDRuntimeIDNotExist() ([]AddonAttachment, error)
- func (db *DBClient) ListCustomInstancesByProjectAndEnv(projectId uint64, workspace string) ([]AddonInstance, error)
- func (db *DBClient) ListDeploymentOrder(conditions *apistructs.DeploymentOrderListConditions, ...) (int, []DeploymentOrder, error)
- func (db *DBClient) ListNoAttachAddon() (*[]RemoveAddonID, error)
- func (db *DBClient) ListReleases(releasesId []string) ([]*Release, error)
- func (db *DBClient) ListReleasesMap(releasesId []string) (map[string]*Release, error)
- func (db *DBClient) ListRoutingInstanceByCluster(clusterName string) ([]AddonInstanceRouting, error)
- func (db *DBClient) ListRoutingInstanceByOrgCluster(clusterName string, orgID uint64) ([]AddonInstanceRouting, error)
- func (db *DBClient) ListRuntimeByCluster(clusterName string) ([]Runtime, error)
- func (db *DBClient) ListRuntimeByOrgCluster(clusterName string, orgID uint64) ([]Runtime, error)
- func (db *DBClient) ListRuntimesByAppsName(env string, projectId uint64, appsName []string) (*[]Runtime, error)
- func (db *DBClient) ResetPreDice(uniqueId spec.RuntimeUniqueId) error
- func (db *DBClient) SaveDomain(domain *RuntimeDomain) error
- func (db *DBClient) SetRuntimeServiceErrors(serviceId uint64, errs []apistructs.ErrorResponse) error
- func (db *DBClient) UpdateAddonDeploy(addonDeploy *AddonDeploy) error
- func (db *DBClient) UpdateAddonExtra(addonExtra *AddonExtra) error
- func (db *DBClient) UpdateAddonInstance(instance *AddonInstance) error
- func (db *DBClient) UpdateAddonInstanceExtra(addonInstanceExtra *AddonInstanceExtra) error
- func (db *DBClient) UpdateAddonInstanceRelation(addonInstanceRelation *AddonInstanceRelation) error
- func (db *DBClient) UpdateAddonInstanceResource(ID string, cpurequest, cpulimit float64, memrequest, memlimit int) error
- func (db *DBClient) UpdateAddonInstanceRoutingStatus(ID, status string) error
- func (db *DBClient) UpdateAddonInstanceStatus(ID, status string) error
- func (db *DBClient) UpdateAddonInstanceTenant(tenant *AddonInstanceTenant) error
- func (db *DBClient) UpdateAttachment(addonAttachment *AddonAttachment) error
- func (db *DBClient) UpdateCount(id uint64, diff int) error
- func (db *DBClient) UpdateDeleteStatus(id int64, deleteStatus int8) error
- func (db *DBClient) UpdateDeployment(deployment *Deployment) error
- func (db *DBClient) UpdateDeploymentOrder(deploymentOrder *DeploymentOrder) error
- func (db *DBClient) UpdateDeploymentOrderAppStatus(id string, appName string, appStatus apistructs.DeploymentOrderStatusItem) error
- func (db *DBClient) UpdateDeploymentOrderStatusDetail(orderId string, newOrderStatusMap apistructs.DeploymentOrderStatusMap) error
- func (db *DBClient) UpdateInstanceId(id int64, instanceId, routingInstanceId string) error
- func (db *DBClient) UpdateInstanceRouting(routing *AddonInstanceRouting) error
- func (db *DBClient) UpdateMigrationLog(migrationLog *MigrationLog) error
- func (db *DBClient) UpdateMySQLAccount(account *MySQLAccount) error
- func (db *DBClient) UpdatePreDeployment(pre *PreDeployment) error
- func (db *DBClient) UpdatePrebuild(addonPrebuild *AddonPrebuild) error
- func (db *DBClient) UpdateRuntime(runtime *Runtime) error
- func (db *DBClient) UpdateRuntimeDeploymentInfo(runtimeId, curDeploymentId uint64, status apistructs.DeploymentStatus) error
- func (db *DBClient) UpdateRuntimeHPA(runtimeHPA *RuntimeHPA) error
- func (db *DBClient) UpdateRuntimeId(applicationID, gitBranch, env, runtimeId string) error
- func (db *DBClient) UpdateRuntimeVPA(runtimeVPA *RuntimeVPA) error
- type Deployment
- type DeploymentExtra
- type DeploymentFilter
- type DeploymentOrder
- type EventDetail
- type HPAEventInfo
- type MigrationLog
- type MySQLAccount
- type PreDeployment
- type Release
- type RemoveAddonID
- type Runtime
- type RuntimeDomain
- type RuntimeHPA
- type RuntimeService
- type RuntimeVPA
- type RuntimeVPAContainerRecommendation
- type ScheduleName
- type TmcInstance
Constants ¶
const ( TMCInstanceRunningStatus = "RUNNING" TMCInstanceErrorStatus = "ERROR" TMCInstanceInitStatus = "INIT" )
const (
LegacyStatusDeleting = "DELETING"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertRuntimeDTO ¶
func ConvertRuntimeDTO(runtime *Runtime, app *apistructs.ApplicationDTO) *apistructs.RuntimeDTO
TODO: we no need app, just redundant fields into runtime table
func InitMysqlMock ¶
Types ¶
type AddonAttachment ¶
type AddonAttachment struct { ID uint64 `gorm:"primary_key"` InstanceID string `gorm:"type:varchar(64)"` // AddonInstance 主键 RoutingInstanceID string `gorm:"type:varchar(64)"` // AddonInstanceRouting 主键 TenantInstanceID string `gorm:"type:varchar(64)"` MySQLAccountID string `gorm:"column:mysql_account_id"` PreviousMySQLAccountID string `gorm:"column:previous_mysql_account_id"` // MySQLAccountState CUR, PRE MySQLAccountState string `gorm:"column:mysql_account_state"` Options string `gorm:"type:text"` OrgID string ProjectID string ApplicationID string RuntimeID string `gorm:"column:app_id"` InsideAddon string `gorm:"type:varchar(1)"` // N or Y RuntimeName string Deleted string `gorm:"column:is_deleted"` // Y: 已删除 N: 未删除 CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonAttachment addon & runtime 关联关系
type AddonAudit ¶
type AddonAudit struct { ID int64 `gorm:"primary_key"` // 唯一Id OrgID string `gorm:"type:varchar(16)"` // 企业ID ProjectID string `gorm:"type:varchar(16)"` // 项目ID Workspace string `gorm:"type:varchar(16)"` // 环境 Operator string `gorm:"type:varchar(255)"` // 操作人 OpName string `gorm:"type:varchar(64)"` // 操作类型 AddonName string `gorm:"type:varchar(128)"` // 属性值 InsID string `gorm:"type:varchar(64)"` // 属性值 InsName string `gorm:"type:varchar(128)"` // 属性值 Params string `gorm:"type:varchar(4096)"` // 属性值 Deleted string `gorm:"column:is_deleted"` CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonAudit 第三方addon操作审计信息
type AddonDeploy ¶
type AddonDeploy struct { ID uint64 `gorm:"primary_key"` // 唯一Id AddonName string `gorm:"type:varchar(64)"` // addon名称 Version string `gorm:"type:varchar(32)"` // 版本 DeployStatus string `gorm:"type:varchar(32)"` // 发布状态 DeployMode string `gorm:"type:varchar(32)"` // 发布方式,upgrade或rollback Deleted string `gorm:"column:is_deleted"` CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonDeploy 平台组件发布信息
type AddonExtra ¶
type AddonExtra struct { ID string `gorm:"type:varchar(64)"` // 唯一Id AddonName string `gorm:"type:varchar(64)"` // addon名称 Field string `gorm:"type:varchar(64)"` // 属性名称 Value string `gorm:"type:text"` // 属性值 Deleted string `gorm:"column:is_deleted"` CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonExtra 存储addon额外信息
type AddonInstance ¶
type AddonInstance struct { ID string `gorm:"type:varchar(64);primary_key"` // 主键 Name string `gorm:"type:varchar(64)"` // 用户 dice.yml 指定 AddonID string `gorm:"type:varchar(64)"` // addonID // TODO deprecated AddonName string `gorm:"type:varchar(64)"` // 应用市场 addon 名称 Category string Namespace string ScheduleName string Plan string Version string Options string `gorm:"type:text"` Config string `gorm:"type:text"` Label string Status string OrgID string Cluster string `gorm:"column:az"` // 集群名称 ProjectID string ApplicationID string AppID string `gorm:"column:app_id"` Workspace string `gorm:"column:env;type:varchar(20)"` // DEV/TEST/STAGING/PROD Deleted string `gorm:"column:is_deleted"` // Y: 已删除 N: 未删除 PlatformServiceType int `gorm:"type:int(1)"` // 服务类型,0:基础addon,1:微服务,2:通用能力 KmsKey string `gorm:"column:kms_key"` CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` CpuRequest float64 CpuLimit float64 MemRequest int MemLimit int }
AddonInstance addon 实例
type AddonInstanceExtra ¶
type AddonInstanceExtra struct { ID string `gorm:"type:varchar(64)"` // 唯一Id InstanceID string `gorm:"type:varchar(64)"` // addon名称 Field string `gorm:"type:varchar(32)"` // 属性名称 Value string `gorm:"type:text"` // 属性值 Deleted string `gorm:"column:is_deleted"` CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonInstanceExtra 存储addon实例额外信息
type AddonInstanceInfoExtra ¶
type AddonInstanceInfoExtra struct { AddonInstance CPU float64 Mem uint64 NodeCount int AttCount int }
type AddonInstanceRelation ¶
type AddonInstanceRelation struct { ID string `gorm:"type:varchar(64)"` // 唯一Id OutsideInstanceID string `gorm:"type:varchar(64)"` // addon实例Id InsideInstanceID string `gorm:"type:varchar(32)"` // addon实例依赖Id Deleted string `gorm:"column:is_deleted"` CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonInstanceRelation 存储addon实例依赖关系
func (AddonInstanceRelation) TableName ¶
func (AddonInstanceRelation) TableName() string
TableName 数据库表名
type AddonInstanceRouting ¶
type AddonInstanceRouting struct { ID string `gorm:"type:varchar(64);primary_key"` // 主键 RealInstance string `gorm:"type:varchar(64)"` // AddonInstance 主键 Name string `gorm:"type:varchar(64)"` // 用户 dice.yml 指定 AddonID string `gorm:"type:varchar(64)"` // addonID AddonName string `gorm:"type:varchar(64)"` // 应用市场 addon 名称 Category string Plan string Version string Options string `gorm:"type:text"` Status string OrgID string Cluster string `gorm:"column:az"` // 集群名称 ProjectID string ApplicationID string AppID string `gorm:"column:app_id"` Workspace string `gorm:"column:env;type:varchar(20)"` // DEV/TEST/STAGING/PROD InsideAddon string `gorm:"type:varchar(1)"` // N or Y Tag string `gorm:"type:varchar(64)"` // 实例标签 Reference int `gorm:"column:attach_count"` // addon 实例引用数 Deleted string `gorm:"column:is_deleted"` // Y: 已删除 N: 未删除 IsPlatform bool // 是否为平台Addon实例 PlatformServiceType int `gorm:"type:int(1)"` // 服务类型,0:基础addon,1:微服务,2:通用能力 CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonInstanceRouting addon 真实实例
func (AddonInstanceRouting) TableName ¶
func (AddonInstanceRouting) TableName() string
TableName 数据库表名
type AddonInstanceTenant ¶
type AddonInstanceTenant struct { ID string `gorm:"type:varchar(64);primary_key"` // 主键 Name string `gorm:"type:varchar(64)"` // project 级唯一 AddonInstanceID string `gorm:"type:varchar(64)"` // addon 实例 ID AddonInstanceRoutingID string `gorm:"type:varchar(64)"` // addon 实例 ID Config string `gorm:"type:text"` OrgID string ProjectID string AppID string `gorm:"column:app_id"` Workspace string `gorm:"type:varchar(20)"` // DEV/TEST/STAGING/PROD Deleted string `gorm:"column:is_deleted"` // Y: 已删除 N: 未删除 KmsKey string `gorm:"column:kms_key"` Reference int CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonInstance addon 租户
func (AddonInstanceTenant) TableName ¶
func (AddonInstanceTenant) TableName() string
type AddonManagement ¶
type AddonManagement struct { ID uint64 `gorm:"primary_key"` AddonID string `gorm:"type:varchar(64)"` // 主键 Name string `gorm:"type:varchar(64)"` ProjectID string OrgID string AddonConfig string `gorm:"type:text"` CPU float64 Mem uint64 Nodes int CreateTime time.Time `gorm:"column:create_time"` UpdateTime time.Time `gorm:"column:update_time"` }
addon management
func (AddonManagement) TableName ¶
func (AddonManagement) TableName() string
type AddonMicroAttach ¶
type AddonMicroAttach struct { ID uint64 `gorm:"primary_key"` AddonName string `gorm:"type:varchar(64)"` RoutingInstanceID string `gorm:"type:varchar(64)"` InstanceID string `gorm:"type:varchar(64)"` ProjectID string `gorm:"type:varchar(64)"` OrgID string `gorm:"type:varchar(64)"` Env string `gorm:"type:varchar(16)"` Count uint32 `gorm:"type:int(11)"` Deleted string `gorm:"column:is_deleted"` CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
Microservices and project associations
func (AddonMicroAttach) TableName ¶
func (AddonMicroAttach) TableName() string
type AddonNode ¶
type AddonNode struct { ID string `gorm:"type:varchar(64)"` InstanceID string `gorm:"type:varchar(64)"` // AddonInstance 主键 Namespace string `gorm:"type:text"` NodeName string CPU float64 Mem uint64 Deleted string `gorm:"column:is_deleted"` // Y: 已删除 N: 未删除 CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonNode addon node信息
type AddonPrebuild ¶
type AddonPrebuild struct { ID uint64 `gorm:"primary_key"` ApplicationID string `gorm:"type:varchar(32)"` GitBranch string `gorm:"type:varchar(128)"` Env string `gorm:"type:varchar(10)"` RuntimeID string `gorm:"type:varchar(32)"` RoutingInstanceID string `gorm:"type:varchar(64)"` InstanceID string `gorm:"type:varchar(64)"` InstanceName string `gorm:"type:varchar(128)"` AddonName string `gorm:"type:varchar(128)"` Plan string `gorm:"column:addon_class;type:varchar(64)"` Options string `gorm:"type:varchar(1024)"` Config string `gorm:"type:varchar(1024)"` BuildFrom int `gorm:"type:int(1);default:0"` // 0: dice.yml 来源 1: 重新分析 DeleteStatus int `gorm:"type:int(1),column:delete_status"` // 0: 未删除,1: diceyml删除,2: 重新分析删除 Deleted string `gorm:"column:is_deleted"` CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
Addon prebuild信息
func (AddonPrebuild) TableName ¶
func (AddonPrebuild) TableName() string
type ConfigItem ¶
type ConfigItem struct { ID int64 `json:"id" gorm:"primary_key"` CreatedAt time.Time `json:"createdAt" gorm:"column:create_time"` UpdatedAt time.Time `json:"updatedAt" gorm:"column:update_time"` IsSync bool // deprecated Dynamic bool // deprecated Encrypt bool // deprecated DeleteRemote bool // deprecated IsDeleted string NamespaceID uint64 `gorm:"index:namespace_id"` ItemKey string ItemValue string ItemComment string ItemType string // FILE, ENV Source string Status string // deprecated }
ConfigItem 配置信息
type ConfigNamespace ¶
type ConfigNamespace struct { ID int64 `json:"id" gorm:"primary_key"` CreatedAt time.Time `json:"createdAt" gorm:"column:create_time"` UpdatedAt time.Time `json:"updatedAt" gorm:"column:update_time"` Dynamic bool IsDefault bool IsDeleted string Name string Env string `gorm:"index:env"` ProjectID string `gorm:"index:project_id"` ApplicationID string `gorm:"index:application_id"` RuntimeID string `gorm:"index:runtime_id"` }
ConfigNamespace 配置信息
type ConfigNamespaceRelation ¶
type ConfigNamespaceRelation struct { ID int64 `json:"id" gorm:"primary_key"` CreatedAt time.Time `json:"createdAt" gorm:"column:create_time"` UpdatedAt time.Time `json:"updatedAt" gorm:"column:update_time"` IsDeleted string Namespace string `gorm:"index:namespace"` DefaultNamespace string `gorm:"index:default_namespace"` }
ConfigNamespaceRelation 配置信息
func (ConfigNamespaceRelation) TableName ¶
func (ConfigNamespaceRelation) TableName() string
TableName 设置模型对应数据库表名称
type DBClient ¶
func (*DBClient) ClearRuntimeServiceErrors ¶
func (*DBClient) CountAddonReferenceByClusterAndOrg ¶
CountAddonReferenceByClusterAndOrg 统计集群中addon数量
func (*DBClient) CountServiceReferenceByClusterAndOrg ¶
CountServiceReferenceByClusterAndOrg 统计集群中service数量
func (*DBClient) CreateAddonAudit ¶
func (db *DBClient) CreateAddonAudit(addonAudit AddonAudit) error
CreateAddonAudit insert AddonAudit
func (*DBClient) CreateAddonDeploy ¶
func (db *DBClient) CreateAddonDeploy(addonDeploy *AddonDeploy) error
CreateAddonDeploy insert AddonDeploy
func (*DBClient) CreateAddonExtra ¶
func (db *DBClient) CreateAddonExtra(addonExtra *AddonExtra) error
CreateAddonExtra insert AddonExtra
func (*DBClient) CreateAddonInstance ¶
func (db *DBClient) CreateAddonInstance(instance *AddonInstance) error
CreateAddonInstance 创建 addon instance
func (*DBClient) CreateAddonInstanceExtra ¶
func (db *DBClient) CreateAddonInstanceExtra(addonInstanceExtra *AddonInstanceExtra) error
CreateAddonInstanceExtra insert AddonExtra
func (*DBClient) CreateAddonInstanceRelation ¶
func (db *DBClient) CreateAddonInstanceRelation(addonInstanceRelation *AddonInstanceRelation) error
CreateAddonInstanceRelation insert AddonInstanceRelation
func (*DBClient) CreateAddonInstanceRouting ¶
func (db *DBClient) CreateAddonInstanceRouting(addonRouting *AddonInstanceRouting) error
CreateAddonInstanceRouting insert addon routing info
func (*DBClient) CreateAddonInstanceTenant ¶
func (db *DBClient) CreateAddonInstanceTenant(tenant *AddonInstanceTenant) error
func (*DBClient) CreateAddonNode ¶
CreateAddonNode insert addonNode
func (*DBClient) CreateAttachment ¶
func (db *DBClient) CreateAttachment(addonAttachment *AddonAttachment) error
CreateAttachment insert addonAttachment
func (*DBClient) CreateDeployment ¶
func (db *DBClient) CreateDeployment(deployment *Deployment) error
func (*DBClient) CreateHPAEventInfo ¶
func (db *DBClient) CreateHPAEventInfo(hpaEvent *HPAEventInfo) error
func (*DBClient) CreateMicroAttach ¶
func (db *DBClient) CreateMicroAttach(addonMicroAttach *AddonMicroAttach) error
CreateMicroAttach insert microservice attachment
func (*DBClient) CreateMigrationLog ¶
func (db *DBClient) CreateMigrationLog(migrationLog *MigrationLog) error
CreateMigrationLog insert migrationLog
func (*DBClient) CreateMySQLAccount ¶
func (db *DBClient) CreateMySQLAccount(account *MySQLAccount) error
CreateMySQLAccount creates a new MySQLAccount
func (*DBClient) CreateOrUpdateRuntimeService ¶
func (db *DBClient) CreateOrUpdateRuntimeService(service *RuntimeService, overrideStatus bool) error
func (*DBClient) CreatePrebuild ¶
func (db *DBClient) CreatePrebuild(addonPrebuild *AddonPrebuild) error
CreatePrebuild insert addon prebuild info
func (*DBClient) CreateRuntime ¶
func (*DBClient) CreateRuntimeHPA ¶
func (db *DBClient) CreateRuntimeHPA(runtimeHPA *RuntimeHPA) error
func (*DBClient) CreateRuntimeVPA ¶
func (db *DBClient) CreateRuntimeVPA(runtimeVPA *RuntimeVPA) error
func (*DBClient) DeleteAddonInstance ¶
DeleteAddonInstance 删除 addon instance
func (*DBClient) DeleteAddonInstanceTenant ¶
func (*DBClient) DeleteAttachmentByIDs ¶
DeleteAttachmentByIDs Delete attachments by ids
func (*DBClient) DeleteAttachmentByRuntimeAndInstanceID ¶
DeleteAttachmentByRuntimeAndInstanceID 根据 runtimeID & InstanceID 删除 attachment
func (*DBClient) DeleteAttachmentByRuntimeAndRoutingInstanceID ¶
func (db *DBClient) DeleteAttachmentByRuntimeAndRoutingInstanceID(runtimeID, routingInstanceID string) error
DeleteAttachmentByRuntimeAndRoutingInstanceID 根据 runtimeID & routingInstanceID 删除 attachment
func (*DBClient) DeleteAttachmentsByRoutingInstanceID ¶
DeleteAttachmentsByRoutingInstanceID 根据 routingInstanceID 删除 attachment
func (*DBClient) DeleteDomain ¶
func (*DBClient) DeleteDomainsByRuntimeId ¶
func (*DBClient) DeleteRuntime ¶
func (*DBClient) DeleteRuntimeHPAByRuleId ¶
func (*DBClient) DeleteRuntimeHPAEventsByRuleId ¶
func (*DBClient) DeleteRuntimeVPAByRuleId ¶
func (*DBClient) DeleteRuntimeVPARecommendationsByRuntimeId ¶
func (*DBClient) DestroyById ¶
DestroyById 根据Id删除引用
func (*DBClient) DestroyByInstanceId ¶
DestroyByInstanceId 根据addon实例Id,删除引用
func (*DBClient) DestroyByIntsanceID ¶
DestroyByIntsanceID 根据instanceID逻辑删除attach信息
func (*DBClient) DestroyByProjectAndEnvAndRoutingId ¶
DestroyByProjectAndEnvAndRoutingId 根据项目Id、环境、addon路由Id,删除引用
func (*DBClient) DestroyByRoutingID ¶
DestroyByRoutingID 根据routingId删除信息
func (*DBClient) DestroyPrebuildByRuntimeID ¶
DestroyPrebuildByRuntimeID 根据runtimeId删除信息
func (*DBClient) ExistRoost ¶
ExistRoost 给定 projectID+workspace下是否有roost
func (*DBClient) FindAllDeployments ¶
func (db *DBClient) FindAllDeployments(runtimeId uint64, filter DeploymentFilter) ([]Deployment, error)
func (*DBClient) FindDeletingRuntimes ¶
func (*DBClient) FindDeployments ¶
func (db *DBClient) FindDeployments(runtimeId uint64, filter DeploymentFilter, offset int, limit int) ([]Deployment, int, error)
func (*DBClient) FindDeploymentsByIDs ¶
func (db *DBClient) FindDeploymentsByIDs(ids []uint64) (map[uint64]Deployment, error)
func (*DBClient) FindDomains ¶
func (db *DBClient) FindDomains(domainValues []string) ([]RuntimeDomain, error)
func (*DBClient) FindDomainsByRuntimeId ¶
func (db *DBClient) FindDomainsByRuntimeId(runtimeId uint64) ([]RuntimeDomain, error)
func (*DBClient) FindDomainsByRuntimeIdAndServiceName ¶
func (db *DBClient) FindDomainsByRuntimeIdAndServiceName(runtimeId uint64, serviceName string) ([]RuntimeDomain, error)
func (*DBClient) FindLastDeployment ¶
func (db *DBClient) FindLastDeployment(runtimeId uint64) (*Deployment, error)
FindLastDeployment first deployment has no previous, nothing found does not matter
func (*DBClient) FindLastDeploymentIDsByRutimeIDs ¶
FindLastDeploymentIDsByRutimeIDs
func (*DBClient) FindLastSuccessDeployment ¶
func (db *DBClient) FindLastSuccessDeployment(runtimeId uint64) (*Deployment, error)
FindLastSuccessDeployment find last successful deployment
func (*DBClient) FindMultiRuntimesDeployments ¶
func (db *DBClient) FindMultiRuntimesDeployments(runtimeids []uint64, filter DeploymentFilter, offset int, limit int) ([]Deployment, int, error)
func (*DBClient) FindNotOutdatedOlderThan ¶
func (db *DBClient) FindNotOutdatedOlderThan(runtimeId uint64, maxId uint64) ([]Deployment, error)
find not-outdated deployments older than maxId (id < maxId)
func (*DBClient) FindPreDeployment ¶
func (db *DBClient) FindPreDeployment(uniqueId spec.RuntimeUniqueId) (*PreDeployment, error)
func (*DBClient) FindPreDeploymentOrCreate ¶
func (db *DBClient) FindPreDeploymentOrCreate(uniqueId spec.RuntimeUniqueId, dice *diceyml.DiceYaml) (*PreDeployment, error)
func (*DBClient) FindRuntime ¶
func (db *DBClient) FindRuntime(uniqueId spec.RuntimeUniqueId) (*Runtime, error)
if not found, return (nil, nil)
func (*DBClient) FindRuntimeOrCreate ¶
func (db *DBClient) FindRuntimeOrCreate(uniqueId spec.RuntimeUniqueId, operator string, source apistructs.RuntimeSource, clusterName string, clusterId uint64, gitRepoAbbrev string, projectID, orgID uint64, deploymentOrderId, releaseVersion, extraParams string) (*Runtime, bool, error)
func (*DBClient) FindRuntimeServices ¶
func (db *DBClient) FindRuntimeServices(runtimeId uint64) ([]RuntimeService, error)
func (*DBClient) FindRuntimesByAppId ¶
func (*DBClient) FindRuntimesByAppIdAndWorkspace ¶
func (*DBClient) FindRuntimesByIds ¶
func (*DBClient) FindRuntimesInApps ¶
func (db *DBClient) FindRuntimesInApps(appIDs []uint64, env string) (map[uint64][]*Runtime, []uint64, error)
FindRuntimesInApps finds all runtimes for the given appIDs. The key in the returned map is appID.
func (*DBClient) FindRuntimesNewerThan ¶
find runtimes newer than minId (id > minId)
func (*DBClient) FindSuccessfulDeployments ¶
func (db *DBClient) FindSuccessfulDeployments(runtimeId uint64, limit int) ([]Deployment, error)
func (*DBClient) FindTmcInstanceByNameAndCLuster ¶
func (db *DBClient) FindTmcInstanceByNameAndCLuster(name, cluster string) ([]TmcInstance, error)
func (*DBClient) FindTopDeployments ¶
func (db *DBClient) FindTopDeployments(runtimeId uint64, limit int) ([]Deployment, error)
func (*DBClient) FindUnfinishedDeploymentOrders ¶
func (db *DBClient) FindUnfinishedDeploymentOrders() ([]DeploymentOrder, error)
func (*DBClient) FindUnfinishedDeployments ¶
func (db *DBClient) FindUnfinishedDeployments() ([]Deployment, error)
func (*DBClient) GetAddonInstance ¶
func (db *DBClient) GetAddonInstance(id string) (*AddonInstance, error)
GetAddonInstance 获取 addon instance
func (*DBClient) GetAddonInstanceByNameAndCluster ¶
func (db *DBClient) GetAddonInstanceByNameAndCluster(addonName, cluster string) (*AddonInstance, error)
func (*DBClient) GetAddonInstanceRoutingByOrgAndAddonName ¶
func (db *DBClient) GetAddonInstanceRoutingByOrgAndAddonName(OrgID, clusterName, addonName, workspace, shareScope string) ( *[]AddonInstanceRouting, error)
GetAddonInstanceRoutingByOrgAndAddonName 根据 OrgID & addonName & clusterName & workspace 获取
func (*DBClient) GetAddonInstanceRoutingByProjectAndAddonName ¶
func (db *DBClient) GetAddonInstanceRoutingByProjectAndAddonName(projectID, clusterName, addonName, workspace string) ( *[]AddonInstanceRouting, error)
GetAddonInstanceRoutingByProjectAndAddonName 根据 projectID & addonName & clusterName & workspace 获取
func (*DBClient) GetAddonInstanceTenant ¶
func (db *DBClient) GetAddonInstanceTenant(id string) (*AddonInstanceTenant, error)
func (*DBClient) GetAddonNodesByInstanceID ¶
GetAddonNodesByInstanceID 根据instanceID获取addonNode信息
func (*DBClient) GetAddonNodesByInstanceIDs ¶
GetAddonNodesByInstanceIDs 根据instanceID列表获取addonNode信息
func (*DBClient) GetAliveByAddonIDs ¶
func (db *DBClient) GetAliveByAddonIDs(addonIDs []string) (*[]AddonInstanceRouting, error)
GetAliveByAddonIDs 根据addonId列表获取信息
func (*DBClient) GetAliveClusterAddon ¶
func (db *DBClient) GetAliveClusterAddon(addonName, clusterName string, status []apistructs.AddonStatus) (*[]AddonInstanceRouting, error)
GetAliveClusterAddon 获取cluster级别微服务addon信息
func (*DBClient) GetAliveDiceAddon ¶
func (db *DBClient) GetAliveDiceAddon(addonName string, status []apistructs.AddonStatus) (*[]AddonInstanceRouting, error)
GetAliveDiceAddon 获取dice级别addon信息
func (*DBClient) GetAliveProjectAddons ¶
func (db *DBClient) GetAliveProjectAddons(projectID, clusterName, workspace string) (*[]AddonInstanceRouting, error)
GetAliveProjectAddon 获取project级别微服务addon信息
func (*DBClient) GetAppRuntimeNumberByWorkspace ¶
func (*DBClient) GetApplicationReleaseByVersion ¶
func (*DBClient) GetAttachMentsByRuntimeID ¶
func (db *DBClient) GetAttachMentsByRuntimeID(runtimeID uint64) (*[]AddonAttachment, error)
GetAttachMentsByRuntimeID 根据runtimeID获取attachment信息
func (*DBClient) GetAttachmentByID ¶
func (db *DBClient) GetAttachmentByID(id uint64) (*AddonAttachment, error)
func (*DBClient) GetAttachmentCountByInstanceID ¶
GetAttachmentCountByInstanceID count数据量
func (*DBClient) GetAttachmentCountByRoutingInstanceID ¶
GetAttachmentCountByRoutingInstanceID count数据量
func (*DBClient) GetAttachmentsByInstanceID ¶
func (db *DBClient) GetAttachmentsByInstanceID(instanceID string) (*[]AddonAttachment, error)
GetAttachmentsByInstanceID 根据instanceId获取attachment信息
func (*DBClient) GetAttachmentsByRoutingInstanceID ¶
func (db *DBClient) GetAttachmentsByRoutingInstanceID(routingInstanceID string) (*[]AddonAttachment, error)
GetAttachmentsByRoutingInstanceID 根据routingInstanceID获取attachment信息
func (*DBClient) GetAttachmentsByTenantInstanceID ¶
func (db *DBClient) GetAttachmentsByTenantInstanceID(tenantInstanceID string) (*[]AddonAttachment, error)
GetAttachmentsByTenantInstanceID 根据 tenantInstanceID 获取 attachment 信息
func (*DBClient) GetByAddonNameAndField ¶
func (db *DBClient) GetByAddonNameAndField(addonName, field string) (*AddonExtra, error)
GetByAddonNameAndField 根据addonName、field获取AddonExtra信息
func (*DBClient) GetByAppIdAndBranchAndEnv ¶
func (db *DBClient) GetByAppIdAndBranchAndEnv(applicationID, gitBranch, env string) (*[]AddonPrebuild, error)
GetByAppIdAndBranchAndEnv 通过applicationID、branch、env获取prebuild信息
func (*DBClient) GetByAppIdAndBranchAndEnvAndInstanceName ¶
func (db *DBClient) GetByAppIdAndBranchAndEnvAndInstanceName(applicationID, gitBranch, env, instanceName string) (*[]AddonPrebuild, error)
GetByAppIdAndBranchAndEnvAndInstanceName 获取prebuild信息
func (*DBClient) GetById ¶
func (db *DBClient) GetById(id int64) (*AddonPrebuild, error)
GetById 通过id获取prebuild信息
func (*DBClient) GetByInSideInstanceID ¶
func (db *DBClient) GetByInSideInstanceID(instanceID string) (*AddonInstanceRelation, error)
GetByInSideInstanceID 根据addonName、field获取AddonExtra信息
func (*DBClient) GetByInstanceIDAndField ¶
func (db *DBClient) GetByInstanceIDAndField(instanceID, field string) (*AddonInstanceExtra, error)
GetByInstanceIDAndField 根据addonName、field获取AddonExtra信息
func (*DBClient) GetByOutSideInstanceID ¶
func (db *DBClient) GetByOutSideInstanceID(instanceID string) (*[]AddonInstanceRelation, error)
GetByInstanceIDAndField 根据addonName、field获取AddonExtra信息
func (*DBClient) GetByRealInstance ¶
func (db *DBClient) GetByRealInstance(realInstanceID string) (*[]AddonInstanceRouting, error)
GetByRealInstance 获取 realInstanceID 的数据信息
func (*DBClient) GetByRoutingIDs ¶
func (db *DBClient) GetByRoutingIDs(routingInstanceIDs []string) (*[]AddonInstanceRouting, error)
GetByRoutingIDs 根据Id列表获取routingInstance信息
func (*DBClient) GetByRuntimeIDAndInstanceID ¶
func (db *DBClient) GetByRuntimeIDAndInstanceID(runtimeID, instanceID string) (*[]AddonAttachment, error)
GetByRuntimeIDAndInstanceID 根据runtimeID、instanceId获取attachment信息
func (*DBClient) GetByRuntimeIDAndRoutingInstanceID ¶
func (db *DBClient) GetByRuntimeIDAndRoutingInstanceID(runtimeID, routingInstanceID string) (*[]AddonAttachment, error)
GetByRuntimeIDAndRoutingInstanceID 根据runtimeID、routingInstanceID获取attachment信息
func (*DBClient) GetClusterAddon ¶
func (db *DBClient) GetClusterAddon(addonName string, clusterName []string) (*[]AddonInstanceRouting, error)
GetClusterAddon 获取cluster级别addon信息
func (*DBClient) GetDefaultDomainOrCreate ¶
func (*DBClient) GetDeployByAddonName ¶
func (db *DBClient) GetDeployByAddonName(addonName string) (*[]AddonDeploy, error)
GetDeployByAddonName 根据addonName获取AddonDeploy信息
func (*DBClient) GetDeployById ¶
func (db *DBClient) GetDeployById(id int64) (*AddonDeploy, error)
GetDeployById 根据id获取addonDeploy信息
func (*DBClient) GetDeployment ¶
func (db *DBClient) GetDeployment(id uint64) (*Deployment, error)
func (*DBClient) GetDeploymentOrder ¶
func (db *DBClient) GetDeploymentOrder(id string) (*DeploymentOrder, error)
func (*DBClient) GetDistinctProjectInfo ¶
GetDistinctProjectInfo 获取所有project信息
func (*DBClient) GetEnvConfigsByNamespaceID ¶
func (db *DBClient) GetEnvConfigsByNamespaceID(namespaceID int64) ([]ConfigItem, error)
GetEnvConfigsByNamespaceID 根据 namespaceID 获取所有配置信息
func (*DBClient) GetExtraByAddonName ¶
func (db *DBClient) GetExtraByAddonName(addonName string) (*[]AddonExtra, error)
GetByAddonName 根据addonName获取AddonExtra信息
func (*DBClient) GetInstanceExtraByAddonName ¶
func (db *DBClient) GetInstanceExtraByAddonName(addonName string) (*[]AddonExtra, error)
GetByAddonName 根据addonName获取AddonExtra信息
func (*DBClient) GetInstanceRouting ¶
func (db *DBClient) GetInstanceRouting(id string) (*AddonInstanceRouting, error)
GetInstanceRouting 获取 instanceRouting 实例
func (*DBClient) GetInstanceRoutingByRealInstance ¶
func (db *DBClient) GetInstanceRoutingByRealInstance(realIns string) (*[]AddonInstanceRouting, error)
GetInstanceRoutingByRealInstance 通过真实例Id查找routing信息
func (*DBClient) GetInstanceRoutingsByIDs ¶
func (db *DBClient) GetInstanceRoutingsByIDs(ids []string) (*[]AddonInstanceRouting, error)
GetInstanceRoutingsByIDs 根据 ID 查询实例路由
func (*DBClient) GetInstanceRoutingsByProjectIDs ¶
func (db *DBClient) GetInstanceRoutingsByProjectIDs(platformServiceType int, projectIDs []string, az, env string) (*[]AddonInstanceRouting, error)
GetInstanceRoutingsByProjectIDs 获取project级别的实例路由
func (*DBClient) GetInstancesByIDs ¶
func (db *DBClient) GetInstancesByIDs(ids []string) (*[]AddonInstance, error)
GetInstancesByIDs 根据 ID 查询实例
func (*DBClient) GetMicroAttachByAddonName ¶
func (db *DBClient) GetMicroAttachByAddonName(addonName string) (*[]AddonMicroAttach, error)
GetMicroAttachByAddonName 通过addonName来获取microservice attach信息
func (*DBClient) GetMicroAttachByOrgId ¶
func (db *DBClient) GetMicroAttachByOrgId(orgID string) (*[]AddonMicroAttach, error)
GetMicroAttachByOrgId 通过orgID来获取microservice attach信息
func (*DBClient) GetMicroAttachByProjectAndEnv ¶
func (db *DBClient) GetMicroAttachByProjectAndEnv(projectID, env string) (*[]AddonMicroAttach, error)
GetMicroAttachByProjectAndEnv 通过projectID和env来获取microservice attach信息
func (*DBClient) GetMicroAttachByProjects ¶
func (db *DBClient) GetMicroAttachByProjects(projectIDs []string) (*[]AddonMicroAttach, error)
GetMicroAttachByProjects 通过projectID列表获取microservice attach信息
func (*DBClient) GetMicroAttachesByAddonName ¶
func (db *DBClient) GetMicroAttachesByAddonName(addonName, orgID string, projectIDs []string) (*[]AddonMicroAttach, error)
GetAttachmentsByProjectIDs 根据项目 ID 和环境获取微服务引用
func (*DBClient) GetMicroAttachesByAddonNameAndProjectIDs ¶
func (db *DBClient) GetMicroAttachesByAddonNameAndProjectIDs(addonName string, projectIDs []string, env string) (*[]AddonMicroAttach, error)
GetAttachmentsByProjectIDs 根据项目 ID 和环境获取微服务引用
func (*DBClient) GetMigrationLogByDeploymentID ¶
func (db *DBClient) GetMigrationLogByDeploymentID(deploymentID uint64) (*MigrationLog, error)
GetMigrationLogByDeploymentID 根据 deployID 查询migration信息
func (*DBClient) GetMigrationLogExpiredThreeDays ¶
func (db *DBClient) GetMigrationLogExpiredThreeDays() (*[]MigrationLog, error)
GetMigrationLogExpired 获取已经过期的migration操作记录
func (*DBClient) GetMySQLAccountByID ¶
func (db *DBClient) GetMySQLAccountByID(id string) (*MySQLAccount, error)
GetMySQLAccountByID returns a MySQLAccount by ID
func (*DBClient) GetMySQLAccountListByRoutingInstanceID ¶
func (db *DBClient) GetMySQLAccountListByRoutingInstanceID(routingInstanceID string) ([]MySQLAccount, error)
GetMySQLAccountListByRoutingInstanceID returns a list of MySQLAccount for a given routing instance
func (*DBClient) GetNamespaceByName ¶
func (db *DBClient) GetNamespaceByName(name string) (*ConfigNamespace, error)
GetNamespaceByName 根据 name 获取 namespac
func (*DBClient) GetNamespaceRelationByName ¶
func (db *DBClient) GetNamespaceRelationByName(name string) (*ConfigNamespaceRelation, error)
GetNamespaceRelationByName 根据 name 获取 namespace 关联关系
func (*DBClient) GetOrgRoutingInstances ¶
func (db *DBClient) GetOrgRoutingInstances(orgID, workspace, cluster string) (*[]AddonInstanceRouting, error)
GetOrgRoutingInstances 获取企业下可用的企业级共享 addon 实例列表
func (*DBClient) GetPreBuildsByRuntimeID ¶
func (db *DBClient) GetPreBuildsByRuntimeID(runtimeID uint64) (*[]AddonPrebuild, error)
GetPreBuildsByRuntimeID 通过 runtimeID 获取 prebuild 信息
func (*DBClient) GetProjectAddon ¶
func (db *DBClient) GetProjectAddon(addonName, orgID, env string, projectIds []string) (*[]AddonInstanceRouting, error)
GetProjectAddon 获取project级别addon信息
func (*DBClient) GetProjectReleaseByVersion ¶
func (*DBClient) GetProjectRoutingInstances ¶
func (db *DBClient) GetProjectRoutingInstances(orgID, projectID, workspace, cluster string) (*[]AddonInstanceRouting, error)
GetProjectRoutingInstances 获取项目下可用的项目级共享 addon 实例列表
func (*DBClient) GetProjectRuntimeNumberByWorkspace ¶
func (*DBClient) GetRoutingInstanceByProjectAndName ¶
func (db *DBClient) GetRoutingInstanceByProjectAndName(projectID uint64, workspace, addonName, name, clusterName string) (*AddonInstanceRouting, error)
GetRoutingInstanceByProjectAndName 根据 projectID 等信息获取 addon
func (*DBClient) GetRoutingInstancesByAddonName ¶
func (db *DBClient) GetRoutingInstancesByAddonName(orgID uint64, addonName string) (*[]AddonInstanceRouting, error)
GetRoutingInstancesByAddonName 根据 addonName 获取指定企业下的 addon 实例列表
func (*DBClient) GetRoutingInstancesByCategory ¶
func (db *DBClient) GetRoutingInstancesByCategory(orgID uint64, category string) (*[]AddonInstanceRouting, error)
GetRoutingInstancesByCategory 根据 category 获取指定企业下的 addon 实例列表
func (*DBClient) GetRoutingInstancesByOrg ¶
func (db *DBClient) GetRoutingInstancesByOrg(orgID uint64) (*[]AddonInstanceRouting, error)
GetRoutingInstancesByOrg 根据 orgID 获取 addon 实例列表
func (*DBClient) GetRoutingInstancesByProject ¶
func (db *DBClient) GetRoutingInstancesByProject(orgID, projectID uint64, category string) (*[]AddonInstanceRouting, error)
GetRoutingInstancesByProject 根据 projectID 获取 addon 实例列表
func (*DBClient) GetRoutingInstancesBySimilar ¶
func (db *DBClient) GetRoutingInstancesBySimilar(addonNames []string, params *apistructs.AddonHandlerCreateItem) (*[]AddonInstanceRouting, error)
GetRoutingInstancesBySimilar 根据similar查询对应的addon信息
func (*DBClient) GetRoutingInstancesByWorkbench ¶
func (db *DBClient) GetRoutingInstancesByWorkbench(orgID uint64, projectIDs []string, category string) (*[]AddonInstanceRouting, error)
GetRoutingInstancesByWorkbench 获取用户有权限访问的 addon 实例列表
func (*DBClient) GetRuntime ¶
if not found, return (nil, error)
func (*DBClient) GetRuntimeAllowNil ¶
func (*DBClient) GetRuntimeByAppName ¶
func (*DBClient) GetRuntimeByDeployOrderId ¶
func (*DBClient) GetRuntimeByProjectIDs ¶
GetRuntimeByProjectIDs 通过projectIDs获取对应runtime
func (*DBClient) GetRuntimeByScheduleName ¶
if not found, return (nil, error)
func (*DBClient) GetRuntimeHPAByServices ¶
func (db *DBClient) GetRuntimeHPAByServices(id spec.RuntimeUniqueId, services []string) ([]RuntimeHPA, error)
if not found, return (nil, error)
func (*DBClient) GetRuntimeHPAEventsByServices ¶
func (db *DBClient) GetRuntimeHPAEventsByServices(runtimeId uint64, services []string) ([]HPAEventInfo, error)
if not found, return (nil, error)
func (*DBClient) GetRuntimeHPARuleByRuleId ¶
func (db *DBClient) GetRuntimeHPARuleByRuleId(ruleId string) (*RuntimeHPA, error)
func (*DBClient) GetRuntimeHPARulesByRuntimeId ¶
func (db *DBClient) GetRuntimeHPARulesByRuntimeId(runtimeId uint64) ([]RuntimeHPA, error)
func (*DBClient) GetRuntimeVPAByServices ¶
func (db *DBClient) GetRuntimeVPAByServices(id spec.RuntimeUniqueId, services []string) ([]RuntimeVPA, error)
if not found, return (nil, error)
func (*DBClient) GetRuntimeVPARecommendationsByServices ¶
func (db *DBClient) GetRuntimeVPARecommendationsByServices(runtimeId uint64, services []string) ([]RuntimeVPAContainerRecommendation, error)
if not found, return (nil, error)
func (*DBClient) GetRuntimeVPARuleByRuleId ¶
func (db *DBClient) GetRuntimeVPARuleByRuleId(ruleId string) (*RuntimeVPA, error)
func (*DBClient) GetRuntimeVPARulesByRuntimeId ¶
func (db *DBClient) GetRuntimeVPARulesByRuntimeId(runtimeId uint64) ([]RuntimeVPA, error)
func (*DBClient) GetUnDeletableAttachMentsByRuntimeID ¶
func (db *DBClient) GetUnDeletableAttachMentsByRuntimeID(orgID, runtimeID uint64) (*[]AddonAttachment, error)
GetUnDeletableAttachMentsByRuntimeID 根据runtimeID获取不可删除的attachment信息
func (*DBClient) ListAddonInstanceByAddonName ¶
func (db *DBClient) ListAddonInstanceByAddonName(projectID, workspace, addonName string) (*[]AddonInstance, error)
ListAddonInstanceByAddonName 根据 addonName 获取实例列表
func (*DBClient) ListAddonInstanceByOrg ¶
func (db *DBClient) ListAddonInstanceByOrg(orgID uint64) (*[]AddonInstance, error)
ListAddonInstanceByOrg 根据 orgID 获取实例列表
func (*DBClient) ListAddonInstanceTenant ¶
func (db *DBClient) ListAddonInstanceTenant() ([]AddonInstanceTenant, error)
func (*DBClient) ListAddonInstanceTenantByAddonInstanceID ¶
func (db *DBClient) ListAddonInstanceTenantByAddonInstanceID(addoninstanceId string) ([]AddonInstanceTenant, error)
func (*DBClient) ListAddonInstanceTenantByAddonInstanceRoutingID ¶
func (db *DBClient) ListAddonInstanceTenantByAddonInstanceRoutingID(addoninstanceroutingId string) ([]AddonInstanceTenant, error)
func (*DBClient) ListAddonInstanceTenantByProjectIDs ¶
func (db *DBClient) ListAddonInstanceTenantByProjectIDs(projectIDs []uint64, workspace ...string) ([]AddonInstanceTenant, error)
func (*DBClient) ListAddonInstancesByParams ¶
func (db *DBClient) ListAddonInstancesByParams(orgID uint64, params *apistructs.MiddlewareListRequest) (int, []AddonInstanceInfoExtra, error)
ListAddonInstancesByParams 根据参数获取 addon 列表
func (*DBClient) ListAddonInstancesByParamsWithoutPage ¶
func (db *DBClient) ListAddonInstancesByParamsWithoutPage(orgID uint64, params *apistructs.MiddlewareListRequest) ([]AddonInstanceInfoExtra, error)
ListAddonInstancesByParamsWithoutPage 根据参数获取 addon 列表
func (*DBClient) ListAddonInstancesByProjectIDs ¶
func (db *DBClient) ListAddonInstancesByProjectIDs(projectIDs []uint64, exclude ...string) (*[]AddonInstance, error)
ListAddonInstancesByProjectIDs 根据projectIDS列表来返回对应数据
func (*DBClient) ListAddonInstancesForClean ¶
func (db *DBClient) ListAddonInstancesForClean() ([]AddonInstance, error)
ListAddonInstancesForClean .
func (*DBClient) ListAttachedAddonInstance ¶
func (db *DBClient) ListAttachedAddonInstance() ([]AddonInstance, error)
func (*DBClient) ListAttachedRoutingInstance ¶
func (db *DBClient) ListAttachedRoutingInstance() ([]AddonInstanceRouting, error)
func (*DBClient) ListAttachingAddonInstance ¶
func (db *DBClient) ListAttachingAddonInstance() (*[]AddonInstance, error)
ListAttachingAddonInstance 查询出所有attaching的addon信息
func (*DBClient) ListAttachmentIDRuntimeIDNotExist ¶
func (db *DBClient) ListAttachmentIDRuntimeIDNotExist() ([]AddonAttachment, error)
ListAttachmentIDRuntimeIDNotExist Find attachments whose runtime does not exist
func (*DBClient) ListCustomInstancesByProjectAndEnv ¶
func (db *DBClient) ListCustomInstancesByProjectAndEnv(projectId uint64, workspace string) ([]AddonInstance, error)
func (*DBClient) ListDeploymentOrder ¶
func (db *DBClient) ListDeploymentOrder(conditions *apistructs.DeploymentOrderListConditions, pageInfo *apistructs.PageInfo) (int, []DeploymentOrder, error)
func (*DBClient) ListNoAttachAddon ¶
func (db *DBClient) ListNoAttachAddon() (*[]RemoveAddonID, error)
ListNoAttachAddon 查询出所有没有引用关系的addon
func (*DBClient) ListReleases ¶
func (*DBClient) ListReleasesMap ¶
func (*DBClient) ListRoutingInstanceByCluster ¶
func (db *DBClient) ListRoutingInstanceByCluster(clusterName string) ([]AddonInstanceRouting, error)
ListRoutingInstanceByCluster 根据 clusterName 查找 addon 列表
func (*DBClient) ListRoutingInstanceByOrgCluster ¶
func (db *DBClient) ListRoutingInstanceByOrgCluster(clusterName string, orgID uint64) ([]AddonInstanceRouting, error)
ListRoutingInstanceByOrgCluster 根据 clusterName 查找 addon 列表
func (*DBClient) ListRuntimeByCluster ¶
ListRuntimeByCluster 根据 clusterName 查找 runtime 列表
func (*DBClient) ListRuntimeByOrgCluster ¶
ListRuntimeByOrgCluster 根据 clusterName 和 orgID 查找 runtime 列表
func (*DBClient) ListRuntimesByAppsName ¶
func (*DBClient) ResetPreDice ¶
func (db *DBClient) ResetPreDice(uniqueId spec.RuntimeUniqueId) error
func (*DBClient) SaveDomain ¶
func (db *DBClient) SaveDomain(domain *RuntimeDomain) error
func (*DBClient) SetRuntimeServiceErrors ¶
func (db *DBClient) SetRuntimeServiceErrors(serviceId uint64, errs []apistructs.ErrorResponse) error
func (*DBClient) UpdateAddonDeploy ¶
func (db *DBClient) UpdateAddonDeploy(addonDeploy *AddonDeploy) error
UpdateAddonDeploy update AddonDeploy
func (*DBClient) UpdateAddonExtra ¶
func (db *DBClient) UpdateAddonExtra(addonExtra *AddonExtra) error
UpdateAddonExtra update AddonExtra
func (*DBClient) UpdateAddonInstance ¶
func (db *DBClient) UpdateAddonInstance(instance *AddonInstance) error
UpdateAddonInstance 更新 addon instance
func (*DBClient) UpdateAddonInstanceExtra ¶
func (db *DBClient) UpdateAddonInstanceExtra(addonInstanceExtra *AddonInstanceExtra) error
UpdateAddonInstanceExtra update AddonInstanceExtra
func (*DBClient) UpdateAddonInstanceRelation ¶
func (db *DBClient) UpdateAddonInstanceRelation(addonInstanceRelation *AddonInstanceRelation) error
UpdateAddonInstanceRelation update AddonInstanceRelation
func (*DBClient) UpdateAddonInstanceResource ¶
func (db *DBClient) UpdateAddonInstanceResource(ID string, cpurequest, cpulimit float64, memrequest, memlimit int) error
UpdateAddonInstanceResource 根据 Id 更新 resource 信息
func (*DBClient) UpdateAddonInstanceRoutingStatus ¶
UpdateAddonInstanceRoutingStatus 根据Id更新信息
func (*DBClient) UpdateAddonInstanceStatus ¶
UpdateAddonInstanceStatus 根据Id更新信息
func (*DBClient) UpdateAddonInstanceTenant ¶
func (db *DBClient) UpdateAddonInstanceTenant(tenant *AddonInstanceTenant) error
func (*DBClient) UpdateAttachment ¶
func (db *DBClient) UpdateAttachment(addonAttachment *AddonAttachment) error
UpdateAttachment update addonAttachment
func (*DBClient) UpdateCount ¶
UpdateCount 更新引用数量信息
func (*DBClient) UpdateDeleteStatus ¶
UpdateDeleteSTatus 更新prebuild中删除状态
func (*DBClient) UpdateDeployment ¶
func (db *DBClient) UpdateDeployment(deployment *Deployment) error
func (*DBClient) UpdateDeploymentOrder ¶
func (db *DBClient) UpdateDeploymentOrder(deploymentOrder *DeploymentOrder) error
func (*DBClient) UpdateDeploymentOrderAppStatus ¶
func (db *DBClient) UpdateDeploymentOrderAppStatus(id string, appName string, appStatus apistructs.DeploymentOrderStatusItem) error
func (*DBClient) UpdateDeploymentOrderStatusDetail ¶
func (db *DBClient) UpdateDeploymentOrderStatusDetail(orderId string, newOrderStatusMap apistructs.DeploymentOrderStatusMap) error
func (*DBClient) UpdateInstanceId ¶
UpdateInstanceId 更新prebuild中addon实例Id信息
func (*DBClient) UpdateInstanceRouting ¶
func (db *DBClient) UpdateInstanceRouting(routing *AddonInstanceRouting) error
UpdateInstanceRouting 更新 instanceRouting 信息
func (*DBClient) UpdateMigrationLog ¶
func (db *DBClient) UpdateMigrationLog(migrationLog *MigrationLog) error
UpdateMigrationLog update migrationLog
func (*DBClient) UpdateMySQLAccount ¶
func (db *DBClient) UpdateMySQLAccount(account *MySQLAccount) error
UpdateMySQLAccount updates an existing MySQLAccount
func (*DBClient) UpdatePreDeployment ¶
func (db *DBClient) UpdatePreDeployment(pre *PreDeployment) error
func (*DBClient) UpdatePrebuild ¶
func (db *DBClient) UpdatePrebuild(addonPrebuild *AddonPrebuild) error
UpdatePrebuild 更新prebuild信息
func (*DBClient) UpdateRuntime ¶
func (*DBClient) UpdateRuntimeDeploymentInfo ¶
func (db *DBClient) UpdateRuntimeDeploymentInfo(runtimeId, curDeploymentId uint64, status apistructs.DeploymentStatus) error
func (*DBClient) UpdateRuntimeHPA ¶
func (db *DBClient) UpdateRuntimeHPA(runtimeHPA *RuntimeHPA) error
func (*DBClient) UpdateRuntimeId ¶
UpdateRuntimeId 更新prebuild中runtime信息
func (*DBClient) UpdateRuntimeVPA ¶
func (db *DBClient) UpdateRuntimeVPA(runtimeVPA *RuntimeVPA) error
type Deployment ¶
type Deployment struct { dbengine.BaseModel RuntimeId uint64 `gorm:"not null;index:idx_runtime_id"` ReleaseId string Outdated bool // Deprecated: use ReleaseID instead, or only use for redundancy Dice string `gorm:"type:text"` // Deprecated BuiltDockerImages string `gorm:"type:text"` Operator string `gorm:"not null;index:idx_operator"` Status apistructs.DeploymentStatus `gorm:"not null;index:idx_status"` Phase apistructs.DeploymentPhase `gorm:"column:step"` FailCause string `gorm:"type:text"` Extra DeploymentExtra `gorm:"type:text"` // 需要审批 NeedApproval bool // userid ApprovedByUser string ApprovedAt *time.Time ApprovalStatus string ApprovalReason string FinishedAt *time.Time BuildId uint64 Type string DiceType uint64 SkipPushByOrch bool Param string `gorm:"type:text"` DeploymentOrderId string }
func (*Deployment) Convert ¶
func (d *Deployment) Convert() *apistructs.Deployment
TODO: refactor the convert logic
func (Deployment) TableName ¶
func (Deployment) TableName() string
type DeploymentExtra ¶
type DeploymentExtra struct { FakeHealthyCount uint64 `json:"fakeHealthyCount,omitempty"` AddonPhaseStartAt *time.Time `json:"addonPhaseStartAt,omitempty"` AddonPhaseEndAt *time.Time `json:"addonPhaseEndAt,omitempty"` ServicePhaseStartAt *time.Time `json:"servicePhaseStartAt,omitempty"` ServicePhaseEndAt *time.Time `json:"servicePhaseEndAt,omitempty"` CancelStartAt *time.Time `json:"cancelStartAt,omitempty"` CancelEndAt *time.Time `json:"cancelEndAt,omitempty"` ForceCanceled bool `json:"forceCanceled,omitempty"` AutoTimeout bool `json:"autoTimeout,omitempty"` }
func (*DeploymentExtra) Scan ¶
func (ex *DeploymentExtra) Scan(value interface{}) error
type DeploymentFilter ¶
type DeploymentOrder ¶
type DeploymentOrder struct { ID string `gorm:"size:36"` Type string Description string ReleaseId string Operator user.ID ProjectId uint64 ProjectName string ApplicationId int64 ApplicationName string Workspace string StatusDetail string // application status Status string // deployment order status Params string IsOutdated uint16 CurrentBatch uint64 BatchSize uint64 DeployList string Modes string // release deploy modes, used to make modes env, separated by "," CreatedAt time.Time UpdatedAt time.Time StartedAt time.Time `gorm:"default:'1970-01-01 00:00:00'"` }
func (DeploymentOrder) TableName ¶
func (DeploymentOrder) TableName() string
type EventDetail ¶
type HPAEventInfo ¶
type HPAEventInfo struct { ID string `json:"id" gorm:"size:36"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at"gorm:"column:updated_at"` RuntimeID uint64 `json:"runtime_id" gorm:"not null"` OrgID uint64 `json:"org_id" gorm:"not null"` OrgName string `json:"org_name"` ServiceName string `json:"service_name"` Event string `json:"event" gorm:"type:text"` SoftDeletedAt uint64 `json:"soft_deleted_at" gorm:"column:soft_deleted_at"` }
func (HPAEventInfo) TableName ¶
func (HPAEventInfo) TableName() string
type MigrationLog ¶
type MigrationLog struct { dbengine.BaseModel ProjectID uint64 ApplicationID uint64 RuntimeID uint64 DeploymentID uint64 OperatorID uint64 Status string AddonInstanceID string AddonInstanceConfig string }
MigrationLog migration执行记录表
type MySQLAccount ¶
type MySQLAccount struct { ID string `gorm:"primary_key"` CreatedAt time.Time UpdatedAt time.Time Username string Password string KMSKey string InstanceID string RoutingInstanceID string Creator string IsDeleted bool }
func (MySQLAccount) TableName ¶
func (MySQLAccount) TableName() string
type PreDeployment ¶
type PreDeployment struct { dbengine.BaseModel ApplicationId uint64 `gorm:"column:project_id;unique_index:idx_unique_project_env_branch"` Workspace string `gorm:"column:env;unique_index:idx_unique_project_env_branch"` RuntimeName string `gorm:"column:git_branch;unique_index:idx_unique_project_env_branch"` Dice string `gorm:"type:text"` DiceOverlay string `gorm:"type:text"` DiceType uint64 }
Deprecated
func (PreDeployment) TableName ¶
func (PreDeployment) TableName() string
type Release ¶
type Release struct { ReleaseId string `json:"releaseId" gorm:"type:varchar(64);primary_key"` ReleaseName string `json:"releaseName" gorm:"index:idx_release_name;not null"` Desc string `json:"desc" gorm:"type:text"` DiceYaml string `json:"dice" gorm:"type:text"` // dice.yml Addon string `json:"addon" gorm:"type:text"` Changelog string `json:"changelog" gorm:"type:text"` IsStable bool `json:"isStable" gorm:"type:tinyint(1)"` IsFormal bool `json:"isFormal" gorm:"type:tinyint(1)"` IsProjectRelease bool `json:"IsProjectRelease" gorm:"type:tinyint(1)"` Modes string `json:"modes" gorm:"type:text"` Labels string `json:"labels" gorm:"type:varchar(1000)"` GitBranch string `json:"gitBranch" gorm:"type:varchar(255)"` Tags string `json:"tags" gorm:"type:varchar(100)"` Version string `json:"version" gorm:"type:varchar(100)"` OrgID int64 `json:"orgId" gorm:"index:idx_org_id"` ProjectID int64 `json:"projectId"` ApplicationId uint64 `json:"applicationId"` ProjectName string `json:"projectName" gorm:"type:varchar(80)"` ApplicationName string `json:"applicationName" gorm:"type:varchar(80)"` UserId string `json:"userId" gorm:"type:varchar(50)"` ClusterName string `json:"clusterName" gorm:"type:varchar(80)"` // 所属集群 Resources string `json:"resources,omitempty" gorm:"type:text"` Reference int64 `json:"reference"` CrossCluster bool `json:"crossCluster"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` IsLatest bool `json:"isLatest"` }
type RemoveAddonID ¶
type RemoveAddonID struct {
ID string `gorm:"column:id"`
}
type Runtime ¶
type Runtime struct { dbengine.BaseModel Name string `gorm:"not null;unique_index:idx_unique_app_id_name"` ApplicationID uint64 `gorm:"not null;unique_index:idx_unique_app_id_name"` Workspace string `gorm:"not null;unique_index:idx_unique_app_id_name"` GitBranch string // Deprecated ProjectID uint64 `gorm:"not null"` // TODO: currently equal to applicationID, fix later Env string // Deprecated ClusterName string ClusterId uint64 // Deprecated: use clusterName Creator string `gorm:"not null"` ScheduleName ScheduleName Status string `gorm:"column:runtime_status"` DeploymentStatus apistructs.DeploymentStatus CurrentDeploymentID uint64 DeploymentOrderId string ReleaseVersion string LegacyStatus string `gorm:"column:status"` FileToken string Deployed bool Deleting bool `gorm:"-"` // TODO: after legacyStatus removed, we use deleting instead Version string Source apistructs.RuntimeSource DiceVersion string CPU float64 Mem float64 // 单位: MB ConfigUpdatedDate *time.Time // Deprecated ReadableUniqueId string // Deprecated GitRepoAbbrev string OrgID uint64 `gorm:"not null"` ExtraParams string }
ServiceGroup is the common resource based on which deployments are created projectId, git branch and working dev determine a runtime
func (*Runtime) InitScheduleName ¶
type RuntimeDomain ¶
type RuntimeDomain struct { dbengine.BaseModel RuntimeId uint64 `gorm:"not null"` Domain string `gorm:"unique_index:unique_domain_key"` DomainType string EndpointName string UseHttps bool }
RuntimeDomain indicated default and custom domain for endpoints
func (RuntimeDomain) TableName ¶
func (RuntimeDomain) TableName() string
type RuntimeHPA ¶
type RuntimeHPA struct { ID string `json:"id" gorm:"size:36"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at"gorm:"column:updated_at"` RuleName string `json:"rule_name"` RuleNameSpace string `json:"rule_namespace" gorm:"column:rule_namespace"` OrgID uint64 `json:"org_id" gorm:"not null"` OrgName string `json:"org_name"` OrgDisPlayName string `json:"org_display_name" gorm:"column:org_display_name"` ProjectID uint64 `json:"project_id" gorm:"not null"` ProjectName string `json:"project_name"` ProjectDisplayName string `json:"proj_display_name" gorm:"column:proj_display_name"` ApplicationID uint64 `json:"application_id" gorm:"not null"` ApplicationName string `json:"application_name"` ApplicationDisPlayName string `json:"app_display_name" gorm:"column:app_display_name"` RuntimeID uint64 `json:"runtime_id" gorm:"not null"` RuntimeName string `json:"runtime_name"` ClusterName string `json:"cluster_name"` // target k8s cluster name Workspace string `json:"workspace" gorm:"column:workspace"` UserID string `json:"user_id"` // user ID UserName string `json:"user_name"` // user name NickName string `json:"nick_name"` // user nick name ServiceName string `json:"service_name"` Rules string `json:"rules" gorm:"type:text"` IsApplied string `json:"is_applied" gorm:"column:applied"` // ‘Y’ means hpa rule have applied,‘N’ means hpa rule have canceled SoftDeletedAt uint64 `json:"soft_deleted_at" gorm:"column:soft_deleted_at"` }
RuntimeHPA define KEDA ScaledObjects for runtime's service
func (RuntimeHPA) TableName ¶
func (RuntimeHPA) TableName() string
type RuntimeService ¶
type RuntimeService struct { dbengine.BaseModel RuntimeId uint64 `gorm:"not null;unique_index:idx_runtime_id_service_name"` ServiceName string `gorm:"not null;unique_index:idx_runtime_id_service_name"` Cpu string Mem int Environment string `gorm:"type:text"` Ports string Replica int Status string Errors string `gorm:"type:text"` }
func (RuntimeService) TableName ¶
func (RuntimeService) TableName() string
TableName runtime service 表名
type RuntimeVPA ¶
type RuntimeVPA struct { ID string `json:"id" gorm:"size:36"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at"gorm:"column:updated_at"` RuleName string `json:"rule_name"` RuleNameSpace string `json:"rule_namespace" gorm:"column:rule_namespace"` OrgID uint64 `json:"org_id" gorm:"not null"` OrgName string `json:"org_name"` OrgDisPlayName string `json:"org_display_name" gorm:"column:org_display_name"` ProjectID uint64 `json:"project_id" gorm:"not null"` ProjectName string `json:"project_name"` ProjectDisplayName string `json:"proj_display_name" gorm:"column:proj_display_name"` ApplicationID uint64 `json:"application_id" gorm:"not null"` ApplicationName string `json:"application_name"` ApplicationDisPlayName string `json:"app_display_name" gorm:"column:app_display_name"` RuntimeID uint64 `json:"runtime_id" gorm:"not null"` RuntimeName string `json:"runtime_name"` ClusterName string `json:"cluster_name"` // target k8s cluster name Workspace string `json:"workspace" gorm:"column:workspace"` UserID string `json:"user_id"` // user ID UserName string `json:"user_name"` // user name NickName string `json:"nick_name"` // user nick name ServiceName string `json:"service_name"` Rules string `json:"rules" gorm:"type:text"` IsApplied string `json:"is_applied" gorm:"column:applied"` // ‘Y’ means vpa rule have applied,‘N’ means vpa rule have canceled SoftDeletedAt uint64 `json:"soft_deleted_at" gorm:"column:soft_deleted_at"` }
RuntimeVPA define K8s VPA object for runtime's service
func (RuntimeVPA) TableName ¶
func (RuntimeVPA) TableName() string
type RuntimeVPAContainerRecommendation ¶
type RuntimeVPAContainerRecommendation struct { ID string `json:"id" gorm:"size:36"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at"gorm:"column:updated_at"` RuleName string `json:"rule_name"` RuleID string `json:"rule_id"` RuleNameSpace string `json:"rule_namespace" gorm:"column:rule_namespace"` OrgID uint64 `json:"org_id" gorm:"not null"` OrgName string `json:"org_name"` ProjectID uint64 `json:"project_id" gorm:"not null"` ProjectName string `json:"project_name"` ApplicationID uint64 `json:"application_id" gorm:"not null"` ApplicationName string `json:"application_name"` RuntimeID uint64 `json:"runtime_id" gorm:"not null"` RuntimeName string `json:"runtime_name"` Workspace string `json:"workspace" gorm:"column:workspace"` ClusterName string `json:"cluster_name"` // target k8s cluster name ServiceName string `json:"service_name"` ContainerName string `json:"container_name"` LowerCPURequest float64 `json:"lower_bound_cpu_request" gorm:"lower_cpu_request"` LowerMemoryRequest float64 `json:"lower_bound_memory_request" gorm:"lower_memory_request"` UpperCPURequest float64 `json:"upper_bound_cpu_request" gorm:"upper_cpu_request"` UpperMemoryRequest float64 `json:"upper_bound_memory_request" gorm:"upper_memory_request"` TargetCPURequest float64 `json:"target_cpu_request" gorm:"target_cpu_request"` // real cpu value apply to pod TargetMemoryRequest float64 `json:"target_memory_request" gorm:"target_memory_request"` // real memory value apply to pod UncappedCPURequest float64 `json:"uncapped_target_cpu_request" gorm:"uncapped_cpu_request"` // no limits target cpu value UncappedMemoryRequest float64 `json:"uncapped_target_memory_request" gorm:"uncapped_memory_request"` // no limits target memory value SoftDeletedAt uint64 `json:"soft_deleted_at" gorm:"column:soft_deleted_at"` }
RuntimeVPAContainerRecommendation define VPA objects for runtime's service
func (RuntimeVPAContainerRecommendation) TableName ¶
func (RuntimeVPAContainerRecommendation) TableName() string
type ScheduleName ¶
func (ScheduleName) Args ¶
func (s ScheduleName) Args() (string, string)
func (*ScheduleName) Scan ¶
func (s *ScheduleName) Scan(value interface{}) error
type TmcInstance ¶
type TmcInstance struct { ID string `gorm:"column:id;primary_key"` Engine string `gorm:"column:engine"` Version string `gorm:"column:version"` ReleaseID string `gorm:"column:release_id"` Status string `gorm:"column:status"` Az string `gorm:"column:az"` Config string `gorm:"column:config"` Options string `gorm:"column:options"` IsCustom string `gorm:"column:is_custom;default:'N'"` IsDeleted string `gorm:"column:is_deleted;default:'N'"` CreateTime time.Time `gorm:"column:create_time;default:CURRENT_TIMESTAMP"` UpdateTime time.Time `gorm:"column:update_time;default:CURRENT_TIMESTAMP"` }
TmcInstance .
Source Files ¶
- addon_attachment.go
- addon_audit.go
- addon_deploy_info.go
- addon_extra.go
- addon_instance.go
- addon_instance_extra.go
- addon_instance_relation.go
- addon_instance_routing.go
- addon_instance_tenant.go
- addon_management.go
- addon_micro_attach.go
- addon_mysql_account.go
- addon_node.go
- addon_prebuild.go
- configItem.go
- config_namespace.go
- config_namespace_relation.go
- dbclient.go
- dbmock.go
- deployment.go
- deployment_order.go
- domain.go
- env_config.go
- hpa.go
- migration_log.go
- runtime.go
- tmc_instance.go
- vpa.go