Documentation ¶
Index ¶
- type AddonManagement
- type AddonNode
- type AddonNodeList
- type ClusterDaily
- type DBClient
- func (c *DBClient) AddonManageReader() *addonManageReader
- func (c *DBClient) AddonManageWriter() *addonManageWriter
- func (c *DBClient) AddonNodeReader() *addonNodeReader
- func (c *DBClient) AddonNodeWriter() *addonNodeWriter
- func (c *DBClient) CreateDeployment(deployment *Deployments) error
- func (c *DBClient) CreateJob(Job *Jobs) error
- func (c *DBClient) DeleteDeployment(orgID string, taskID uint64) error
- func (c *DBClient) DeleteJob(orgID string, taskID uint64) error
- func (c *DBClient) GetDeployment(orgID string, taskID uint64) []Deployments
- func (c *DBClient) GetJob(orgID string, taskID uint64) []Jobs
- func (c *DBClient) ListDeploymentsByOrgID(param *apistructs.OrgRunningTasksListRequest, orgID uint64) (int64, *[]Deployments, error)
- func (c *DBClient) ListExpiredDeployments(startTime string) []Deployments
- func (c *DBClient) ListExpiredJobs(startTime string) []Jobs
- func (c *DBClient) ListJobsByOrgID(param *apistructs.OrgRunningTasksListRequest, orgID uint64) (int64, *[]Jobs, error)
- func (c *DBClient) ListRunningDeployments() []Deployments
- func (c *DBClient) ListRunningJobs() []Jobs
- func (c *DBClient) OrgAKReader() *orgakReader
- func (c *DBClient) OrgAKWriter() *orgakWriter
- func (c *DBClient) RecordsReader() *recordsReader
- func (c *DBClient) RecordsWriter() *recordsWriter
- func (c *DBClient) ResourceRoutingReader() *resourceRoutingReader
- func (c *DBClient) ResourceRoutingWriter() *resourceRoutingWriter
- func (c *DBClient) UpdateDeploymentStatus(deployment *Deployments) error
- func (c *DBClient) UpdateJobStatus(Job *Jobs) error
- type Deployments
- type ExtraDeployment
- type ExtraJob
- type Jobs
- type OrgAK
- type ProjectDaily
- type Record
- type RecordType
- type ResourceRouting
- type ResourceType
- type RoutingStatus
- type StatusType
- type VendorType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddonManagement ¶
type AddonManagement struct { ID uint64 `gorm:"primary_key"` AddonID string `gorm:"type:varchar(64)"` // Primary key 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 AddonNode ¶
type AddonNode struct { ID string `gorm:"type:varchar(64)"` InstanceID string `gorm:"type:varchar(64)"` // AddonInstance primary key Namespace string `gorm:"type:text"` NodeName string CPU float64 Mem uint64 Deleted string `gorm:"column:is_deleted"` // Y: deleted N: not delete CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
AddonNode Addon node info
type AddonNodeList ¶
type AddonNodeList []AddonNode
func (AddonNodeList) Len ¶
func (r AddonNodeList) Len() int
func (AddonNodeList) Less ¶
func (r AddonNodeList) Less(i, j int) bool
func (AddonNodeList) Swap ¶
func (r AddonNodeList) Swap(i, j int)
type ClusterDaily ¶
type ClusterDaily struct { ID int `gorm:"type:BIGINT(20)"` ClusterName string `gorm:"type:cluster_name"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` // contains filtered or unexported fields }
ProjectDaily
type DBClient ¶
func (*DBClient) AddonManageReader ¶
func (c *DBClient) AddonManageReader() *addonManageReader
read condition
func (*DBClient) AddonManageWriter ¶
func (c *DBClient) AddonManageWriter() *addonManageWriter
write
func (*DBClient) AddonNodeReader ¶
func (c *DBClient) AddonNodeReader() *addonNodeReader
func (*DBClient) AddonNodeWriter ¶
func (c *DBClient) AddonNodeWriter() *addonNodeWriter
func (*DBClient) CreateDeployment ¶
func (c *DBClient) CreateDeployment(deployment *Deployments) error
CreateDeployment create running deployment
func (*DBClient) DeleteDeployment ¶
DeleteDeployment 删除 deployment 信息
func (*DBClient) GetDeployment ¶
func (c *DBClient) GetDeployment(orgID string, taskID uint64) []Deployments
GetDeployment get deployment info
func (*DBClient) ListDeploymentsByOrgID ¶
func (c *DBClient) ListDeploymentsByOrgID(param *apistructs.OrgRunningTasksListRequest, orgID uint64) (int64, *[]Deployments, error)
ListDeploymentsByOrgID list deployment by org id
func (*DBClient) ListExpiredDeployments ¶
func (c *DBClient) ListExpiredDeployments(startTime string) []Deployments
ListExpiredDeployments list expire deployment from specific time
func (*DBClient) ListExpiredJobs ¶
ListExpiredJobs 列出过期的job
func (*DBClient) ListJobsByOrgID ¶
func (c *DBClient) ListJobsByOrgID(param *apistructs.OrgRunningTasksListRequest, orgID uint64) (int64, *[]Jobs, error)
ListJobsByOrgID 获取指定企业的job列表
func (*DBClient) ListRunningDeployments ¶
func (c *DBClient) ListRunningDeployments() []Deployments
ListRunningDeployments list running deployments
func (*DBClient) ListRunningJobs ¶
ListRunningJobs list running job
func (*DBClient) OrgAKReader ¶
func (c *DBClient) OrgAKReader() *orgakReader
func (*DBClient) OrgAKWriter ¶
func (c *DBClient) OrgAKWriter() *orgakWriter
func (*DBClient) RecordsReader ¶
func (c *DBClient) RecordsReader() *recordsReader
func (*DBClient) RecordsWriter ¶
func (c *DBClient) RecordsWriter() *recordsWriter
func (*DBClient) ResourceRoutingReader ¶
func (c *DBClient) ResourceRoutingReader() *resourceRoutingReader
func (*DBClient) ResourceRoutingWriter ¶
func (c *DBClient) ResourceRoutingWriter() *resourceRoutingWriter
func (*DBClient) UpdateDeploymentStatus ¶
func (c *DBClient) UpdateDeploymentStatus(deployment *Deployments) error
UpdateDeploymentStatus update deployment status
func (*DBClient) UpdateJobStatus ¶
UpdateJobStatus 更新Job状态
type Deployments ¶
type Deployments struct { ID int64 `json:"id" gorm:"primary_key"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` OrgID uint64 `gorm:"index:org_id"` ProjectID uint64 ApplicationID uint64 PipelineID uint64 TaskID uint64 QueueTimeSec int64 // queue time CostTimeSec int64 // job const time ProjectName string ApplicationName string TaskName string Status string Env string ClusterName string UserID string RuntimeID string ReleaseID string Extra ExtraDeployment `json:"extra"` }
Deployments deployment service
func (Deployments) TableName ¶
func (Deployments) TableName() string
type ExtraDeployment ¶
type ExtraDeployment struct{}
type Jobs ¶
type Jobs struct { ID int64 `json:"id" gorm:"primary_key"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` OrgID uint64 `gorm:"index:org_id"` ProjectID uint64 ApplicationID uint64 PipelineID uint64 TaskID uint64 QueueTimeSec int64 CostTimeSec int64 ProjectName string ApplicationName string TaskName string Status string Env string ClusterName string TaskType string UserID string Extra ExtraJob `json:"extra"` }
type OrgAK ¶
type ProjectDaily ¶
type ProjectDaily struct { ID int `gorm:"type:BIGINT(20)"` ProjectName string `gorm:"type:project_name"` ProjectID string `gorm:"column:project_id"` CpuQuota float64 `gorm:"column:cpu_quota"` CpuRequest float64 `gorm:"column:cpu_request"` MemQuota float64 `gorm:"column:mem_quota"` MemRequest float64 `gorm:"column:mem_request"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` }
ProjectDaily
type Record ¶
type Record struct { dbengine.BaseModel RecordType RecordType `gorm:"type:varchar(64)"` UserID string `gorm:"type:varchar(64)"` OrgID string `gorm:"type:varchar(64);index"` ClusterName string `gorm:"type:varchar(64);index"` Status StatusType `gorm:"type:varchar(64)"` Detail string `gorm:"type:text"` PipelineID uint64 }
type RecordType ¶
type RecordType string
const ( RecordTypeAddNodes RecordType = "addNodes" RecordTypeAddEssNodes RecordType = "addEssNodes" RecordTypeAddAliNodes RecordType = "addAliNodes" RecordTypeRmNodes RecordType = "rmNodes" RecordTypeDeleteNodes RecordType = "deleteNodes" RecordTypeDeleteEssNodes RecordType = "deleteEssNodes" RecordTypeDeleteEssNodesCronJob RecordType = "deleteEssNodesCronJob" RecordTypeSetLabels RecordType = "setLabels" RecordTypeAddAliECSECluster RecordType = "addAliECSEdgeCluster" RecordTypeAddAliACKECluster RecordType = "addAliACKEdgeCluster" // TODO remove RecordTypeAddAliCSECluster RecordType = "addAliCSEdgeCluster" RecordTypeAddAliCSManagedCluster RecordType = "addAliCSManagedEdgeCluster" RecordTypeImportKubernetesCluster RecordType = "importKubernetesCluster" RecordTypeCreateClusterCredential RecordType = "createClusterCredential" RecordTypeResetClusterCredential RecordType = "resetClusterCredential" RecordTypeUpgradeEdgeCluster RecordType = "upgradeEdgeCluster" RecordTypeOfflineEdgeCluster RecordType = "offlineEdgeCluster" RecordTypeCreateAliCloudMysql RecordType = "createAliCloudMysql" RecordTypeCreateAliCloudMysqlDB RecordType = "createAliCloudMysqlDB" RecordTypeCreateAliCloudRedis RecordType = "createAliCloudRedis" RecordTypeCreateAliCloudOss RecordType = "createAliCloudOss" RecordTypeCreateAliCloudOns RecordType = "createAliCloudOns" RecordTypeCreateAliCloudOnsTopic RecordType = "createAliCloudOnsTopic" RecordTypeCreateAliCloudGateway RecordType = "createAliCloudGateway" )
func (RecordType) String ¶
func (r RecordType) String() string
type ResourceRouting ¶
type ResourceRouting struct { dbengine.BaseModel ResourceID string `gorm:"type:varchar(128); index"` // e.g mysql instance/db name ResourceName string `gorm:"type:varchar(64)"` // e.g mysql/mysql db ResourceType ResourceType `gorm:"type:varchar(32)"` Vendor string `gorm:"type:varchar(32)"` OrgID string `gorm:"type:varchar(64)"` ClusterName string `gorm:"type:varchar(64)"` ProjectID string `gorm:"type:varchar(64); index"` AddonID string `gorm:"type:varchar(64)"` Status RoutingStatus `gorm:"type:varchar(32)"` RecordID uint64 Detail string `gorm:"type:text"` }
func (ResourceRouting) TableName ¶
func (ResourceRouting) TableName() string
type ResourceType ¶
type ResourceType string
const ( ResourceTypeMysql ResourceType = "MYSQL" ResourceTypeMysqlDB ResourceType = "MYSQL_DB" ResourceTypeGateway ResourceType = "GATEWAY" ResourceTypeGatewayVpcGrant ResourceType = "GATEWAY_VPC_GRANT" ResourceTypeOns ResourceType = "ONS" ResourceTypeOnsTopic ResourceType = "ONS_TOPIC" ResourceTypeRedis ResourceType = "REDIS" ResourceTypeOss ResourceType = "OSS" )
func (ResourceType) String ¶
func (r ResourceType) String() string
type RoutingStatus ¶
type RoutingStatus string
const ( ResourceStatusCreated RoutingStatus = "CREATED" ResourceStatusDeleted RoutingStatus = "DELETED" ResourceStatusAttached RoutingStatus = "ATTACHED" ResourceStatusDetached RoutingStatus = "DETACHED" )
func (RoutingStatus) String ¶
func (r RoutingStatus) String() string
type StatusType ¶
type StatusType string
const ( StatusTypeSuccess StatusType = "success" StatusTypeSuccessed StatusType = "successed" StatusTypeFailed StatusType = "failed" StatusTypeProcessing StatusType = "processing" StatusTypeUnknown StatusType = "unknown" )
func (StatusType) String ¶
func (s StatusType) String() string
Click to show internal directories.
Click to hide internal directories.