runtime

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package runtime 应用实例相关操作

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeployContext

type DeployContext struct {
	Runtime        *dbclient.Runtime
	App            *apistructs.ApplicationDTO
	LastDeployment *dbclient.Deployment
	// ReleaseId to deploy
	ReleaseID  string
	Operator   string
	DeployType string

	// Extras:
	// used for pipeline
	BuildID uint64
	// used for ability
	AddonActions map[string]interface{}
	// used for runtime-addon
	InstanceID string
	// used for
	Scale0 bool

	// 不由 orchestrator 来推进部署
	SkipPushByOrch bool
}

DeployContext 部署上下文

type Option

type Option func(*Runtime)

Option 应用实例对象配置选项

func WithAddon

func WithAddon(a *addon.Addon) Option

WithAddon 配置 addon service

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithDBClient

func WithDBClient(db *dbclient.DBClient) Option

WithDBClient 配置 db client

func WithEventManager

func WithEventManager(evMgr *events.EventManager) Option

WithEventManager 配置 EventManager

type Runtime

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

Runtime 应用实例对象封装

func New

func New(options ...Option) *Runtime

New 新建应用实例 service

func (*Runtime) Create

Create 创建应用实例

func (*Runtime) CreateByReleaseID

func (r *Runtime) CreateByReleaseID(operator user.ID, releaseReq *apistructs.RuntimeReleaseCreateRequest) (*apistructs.DeploymentCreateResponseDTO, error)

Create 创建应用实例

func (*Runtime) CreateByReleaseIDPipeline

func (r *Runtime) CreateByReleaseIDPipeline(orgid uint64, operator user.ID, releaseReq *apistructs.RuntimeReleaseCreateRequest) (*apistructs.RuntimeDeployDTO, error)

func (*Runtime) Delete

func (r *Runtime) Delete(operator user.ID, orgID uint64, runtimeID uint64) (*apistructs.RuntimeDTO, error)

Delete 标记应用实例删除

func (*Runtime) Destroy

func (r *Runtime) Destroy(runtimeID uint64) error

Destroy 摧毁应用实例

func (*Runtime) FullGC

func (r *Runtime) FullGC()

FullGC 定时全量 GC 过期的部署单

func (*Runtime) Get

func (r *Runtime) Get(userID user.ID, orgID uint64, idOrName string, appID string, workspace string) (*apistructs.RuntimeInspectDTO, error)

Get 查询应用实例

func (*Runtime) GetSpec

func (r *Runtime) GetSpec(userID user.ID, orgID uint64, runtimeID uint64) (*apistructs.ServiceGroup, error)

GetSpec 查询应用实例规格

func (*Runtime) KillPod

func (r *Runtime) KillPod(runtimeID uint64, podname string) error

func (*Runtime) List

func (r *Runtime) List(userID user.ID, orgID uint64, appID uint64, workspace, name string) ([]apistructs.RuntimeSummaryDTO, error)

List 查询应用实例列表

func (*Runtime) MarkOutdatedForDelete

func (r *Runtime) MarkOutdatedForDelete(runtimeID uint64)

MarkOutdatedForDelete 将删除的应用实例,他们的所有部署单,标记为废弃

func (*Runtime) OrgJobLogs

func (r *Runtime) OrgJobLogs(userID user.ID, orgID uint64, jobID, clusterName string, paramValues url.Values) (*apistructs.DashboardSpotLogData, error)

OrgJobLogs 数据中心--->任务列表 日志接口

func (*Runtime) Redeploy

func (r *Runtime) Redeploy(operator user.ID, orgID uint64, runtimeID uint64) (*apistructs.DeploymentCreateResponseDTO, error)

Redeploy 重新部署

func (*Runtime) RedeployPipeline

func (r *Runtime) RedeployPipeline(operator user.ID, orgID uint64, runtimeID uint64) (*apistructs.RuntimeDeployDTO, error)

func (*Runtime) ReferCluster

func (r *Runtime) ReferCluster(clusterName string) bool

ReferCluster 查看 runtime & addon 是否有使用集群

func (*Runtime) Rollback

func (r *Runtime) Rollback(operator user.ID, orgID uint64, runtimeID uint64, deploymentID uint64) (
	*apistructs.DeploymentCreateResponseDTO, error)

func (*Runtime) RollbackPipeline

func (r *Runtime) RollbackPipeline(operator user.ID, orgID uint64, runtimeID uint64, deploymentID uint64) (
	*apistructs.RuntimeDeployDTO, error)

func (*Runtime) RuntimeDeployLogs

func (r *Runtime) RuntimeDeployLogs(userID user.ID, orgID uint64, deploymentID uint64, paramValues url.Values) (*apistructs.DashboardSpotLogData, error)

RuntimeDeployLogs deploy发布日志接口

func (*Runtime) StopRuntime

func (r *Runtime) StopRuntime(operator user.ID, orgID uint64, runtimeID uint64) (*apistructs.DeploymentCreateResponseDTO, error)

StopRuntime scale 0 服务

Jump to

Keyboard shortcuts

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