Documentation ¶
Index ¶
- Constants
- func RenderOutputObject(outPutStr, templateName string, clusterValueFiles ...gitrepo.ClusterValueFile) (interface{}, error)
- type Application
- type Base
- type BatchResponse
- type BuildDeployRequest
- type BuildDeployRequestGit
- type BuildDeployResponse
- type BuildTemplateInfo
- type CodeInfo
- type Controller
- type CreateClusterParamsV2
- type CreateClusterRequest
- type CreateClusterRequestV2
- type CreateClusterResponseV2
- type CreatePipelineRunRequest
- type DeployRequest
- type ExecRequest
- type ExecResponse
- type ExecResult
- type ExecuteActionRequest
- type GetClusterByNameResponse
- type GetClusterPodResponse
- type GetClusterResponse
- type GetClusterResponseV2
- type GetClusterStatusResponse
- type GetDiffResponse
- type GetGrafanaDashboardsResponse
- type GetResourceTreeResponse
- type GetStepResponse
- type GitResponse
- type InternalDeployRequest
- type InternalDeployRequestV2
- type InternalDeployResponse
- type InternalDeployResponseV2
- type LatestPipelinerun
- type ListClusterResponse
- type ListClusterWithExpiryResponse
- type ListClusterWithFullResponse
- type OperationResult
- type PipelinerunIDResponse
- type PipelinerunStatusResponse
- type ResourceNode
- type Revision
- type RollbackRequest
- type RunningTask
- type Scope
- type StatusResponseV2
- type Step
- type Template
- type TemplateInput
- type UpdateClusterRequest
- type UpdateClusterRequestV2
- type User
- type WhetherLike
Constants ¶
View Source
const ServerlessTemplateName = "serverless"
Variables ¶
This section is empty.
Functions ¶
func RenderOutputObject ¶
func RenderOutputObject(outPutStr, templateName string, clusterValueFiles ...gitrepo.ClusterValueFile) (interface{}, error)
Types ¶
type Application ¶
type Base ¶
type Base struct { Description string `json:"description"` Git *codemodels.Git `json:"git"` Template *Template `json:"template"` TemplateInput *TemplateInput `json:"templateInput"` Tags []*tagmodels.TagBasic `json:"tags"` }
type BatchResponse ¶
type BatchResponse map[string]OperationResult
type BuildDeployRequest ¶
type BuildDeployRequest struct { Title string `json:"title"` Description string `json:"description"` Git *BuildDeployRequestGit `json:"git"` }
type BuildDeployRequestGit ¶
type BuildDeployResponse ¶
type BuildDeployResponse struct {
PipelinerunID uint `json:"pipelinerunID"`
}
type BuildTemplateInfo ¶
type BuildTemplateInfo struct { BuildConfig map[string]interface{} TemplateInfo *codemodels.TemplateInfo TemplateConfig map[string]interface{} }
type Controller ¶
type Controller interface { CreateCluster(ctx context.Context, applicationID uint, environment, region string, request *CreateClusterRequest, mergePatch bool) (*GetClusterResponse, error) UpdateCluster(ctx context.Context, clusterID uint, request *UpdateClusterRequest, mergePatch bool) (*GetClusterResponse, error) DeleteCluster(ctx context.Context, clusterID uint, hard bool) error GetCluster(ctx context.Context, clusterID uint) (*GetClusterResponse, error) GetClusterByName(ctx context.Context, clusterName string) (*GetClusterByNameResponse, error) GetClusterOutput(ctx context.Context, clusterID uint) (interface{}, error) List(ctx context.Context, query *q.Query) ([]*ListClusterWithFullResponse, int, error) ListByApplication(ctx context.Context, query *q.Query) (int, []*ListClusterWithFullResponse, error) ListClusterWithExpiry(ctx context.Context, query *q.Query) ([]*ListClusterWithExpiryResponse, error) BuildDeploy(ctx context.Context, clusterID uint, request *BuildDeployRequest) (*BuildDeployResponse, error) Restart(ctx context.Context, clusterID uint) (*PipelinerunIDResponse, error) Deploy(ctx context.Context, clusterID uint, request *DeployRequest) (*PipelinerunIDResponse, error) Rollback(ctx context.Context, clusterID uint, request *RollbackRequest) (*PipelinerunIDResponse, error) FreeCluster(ctx context.Context, clusterID uint) error // InternalDeploy todo(zx): remove after InternalDeployV2 is stabilized InternalDeploy(ctx context.Context, clusterID uint, r *InternalDeployRequest) (_ *InternalDeployResponse, err error) ExecuteAction(ctx context.Context, clusterID uint, action string, gvk schema.GroupVersionResource) error // Deprecated: GetClusterStatus GetClusterStatus(ctx context.Context, clusterID uint) (_ *GetClusterStatusResponse, err error) // Deprecated Online(ctx context.Context, clusterID uint, r *ExecRequest) (ExecResponse, error) // Deprecated Offline(ctx context.Context, clusterID uint, r *ExecRequest) (ExecResponse, error) Exec(ctx context.Context, clusterID uint, r *ExecRequest) (_ ExecResponse, err error) GetDiff(ctx context.Context, clusterID uint, refType, ref string) (*GetDiffResponse, error) GetContainerLog(ctx context.Context, clusterID uint, podName, containerName string, tailLines int64) ( <-chan string, error) DeleteClusterPods(ctx context.Context, clusterID uint, podName []string) (BatchResponse, error) GetClusterPod(ctx context.Context, clusterID uint, podName string) ( *GetClusterPodResponse, error) GetPodEvents(ctx context.Context, clusterID uint, podName string) (interface{}, error) GetContainers(ctx context.Context, clusterID uint, podName string) (interface{}, error) GetGrafanaDashBoard(c context.Context, clusterID uint) (*GetGrafanaDashboardsResponse, error) CreateClusterV2(ctx context.Context, params *CreateClusterParamsV2) (*CreateClusterResponseV2, error) GetClusterV2(ctx context.Context, clusterID uint) (*GetClusterResponseV2, error) UpdateClusterV2(ctx context.Context, clusterID uint, r *UpdateClusterRequestV2, mergePatch bool) error // InternalDeployV2 deploy only used by internal system InternalDeployV2(ctx context.Context, clusterID uint, r *InternalDeployRequestV2) (_ *InternalDeployResponseV2, err error) InternalGetClusterStatus(ctx context.Context, clusterID uint) (_ *GetClusterStatusResponse, err error) GetClusterStatusV2(ctx context.Context, clusterID uint) (_ *StatusResponseV2, err error) GetClusterPipelinerunStatus(ctx context.Context, clusterID uint) (*PipelinerunStatusResponse, error) GetResourceTree(ctx context.Context, clusterID uint) (*GetResourceTreeResponse, error) GetStep(ctx context.Context, clusterID uint) (resp *GetStepResponse, err error) // Deprecated: for internal usage, v1 to v2 Upgrade(ctx context.Context, clusterID uint) error ToggleLikeStatus(ctx context.Context, clusterID uint, like *WhetherLike) (err error) CreatePipelineRun(ctx context.Context, clusterID uint, r *CreatePipelineRunRequest) (*prmodels.PipelineBasic, error) }
func NewController ¶
func NewController(config *config.Config, param *param.Param) Controller
type CreateClusterParamsV2 ¶
type CreateClusterParamsV2 struct { *CreateClusterRequestV2 ApplicationID uint Environment string Region string // whether to merge json schema form data MergePatch bool }
type CreateClusterRequest ¶
type CreateClusterRequestV2 ¶
type CreateClusterRequestV2 struct { Name string `json:"name"` Description string `json:"description"` Priority string `json:"priority"` ExpireTime string `json:"expireTime"` Git *codemodels.Git `json:"git"` Image *string `json:"image"` Tags tagmodels.TagsBasic `json:"tags"` BuildConfig map[string]interface{} `json:"buildConfig"` TemplateInfo *codemodels.TemplateInfo `json:"templateInfo"` TemplateConfig map[string]interface{} `json:"templateConfig"` // TODO(tom): just for internal usage ExtraMembers map[string]string `json:"extraMembers"` }
type CreateClusterResponseV2 ¶
type CreateClusterResponseV2 struct { ID uint `json:"id"` Name string `json:"name"` FullPath string `json:"fullPath"` ApplicationID uint `json:"applicationID"` Scope *Scope `json:"scope"` Application *Application `json:"application"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type CreatePipelineRunRequest ¶
type CreatePipelineRunRequest struct { Title string `json:"title"` Description string `json:"description"` Action string `json:"action"` // for build deploy Git *BuildDeployRequestGit `json:"git,omitempty"` ImageTag string `json:"imageTag,omitempty"` // for rollback PipelinerunID uint `json:"pipelinerunID,omitempty"` }
type DeployRequest ¶
type ExecRequest ¶
type ExecResponse ¶
type ExecResponse map[string]ExecResult
type ExecResult ¶
type ExecResult struct { OperationResult Stdout string `json:"stdout,omitempty"` Stderr string `json:"stderr,omitempty"` }
type ExecuteActionRequest ¶
type GetClusterByNameResponse ¶
type GetClusterByNameResponse struct { ID uint `json:"id"` Name string `json:"name"` Description string `json:"description"` Template *Template `json:"template"` Git *codemodels.Git `json:"git"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` FullPath string `json:"fullPath"` }
type GetClusterPodResponse ¶
type GetClusterResponse ¶
type GetClusterResponse struct { *CreateClusterRequest ID uint `json:"id"` FullPath string `json:"fullPath"` Application *Application `json:"application"` Priority string `json:"priority"` Template *Template `json:"template"` Scope *Scope `json:"scope"` LatestDeployedCommit string `json:"latestDeployedCommit,omitempty"` Status string `json:"status,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` TTLInSeconds *uint `json:"ttlInSeconds"` CreatedBy *User `json:"createdBy,omitempty"` UpdatedBy *User `json:"updatedBy,omitempty"` }
type GetClusterResponseV2 ¶
type GetClusterResponseV2 struct { // basic infos ID uint `json:"id"` Name string `json:"name"` Description string `json:"description"` Priority string `json:"priority"` ExpireTime string `json:"expireTime"` Scope *Scope `json:"scope"` FullPath string `json:"fullPath"` ApplicationName string `json:"applicationName"` ApplicationID uint `json:"applicationID"` Tags tagmodels.TagsBasic `json:"tags"` // source info Git *codemodels.Git `json:"git"` Image string `json:"image"` // git config info BuildConfig map[string]interface{} `json:"buildConfig"` TemplateInfo *codemodels.TemplateInfo `json:"templateInfo"` TemplateConfig map[string]interface{} `json:"templateConfig"` Manifest map[string]interface{} `json:"manifest"` // status and update info Status string `json:"status"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` CreatedBy *User `json:"createdBy,omitempty"` UpdatedBy *User `json:"updatedBy,omitempty"` TTLInSeconds *uint `json:"ttlInSeconds,omitempty"` }
type GetClusterStatusResponse ¶
type GetClusterStatusResponse struct { RunningTask *RunningTask `json:"runningTask" yaml:"runningTask"` LatestPipelinerun *LatestPipelinerun `json:"latestPipelinerun,omitempty"` ClusterStatus interface{} `json:"clusterStatus,omitempty" yaml:"clusterStatus,omitempty"` TTLSeconds *uint `json:"ttlSeconds,omitempty" yaml:"ttlSeconds,omitempty"` }
type GetDiffResponse ¶
type GetResourceTreeResponse ¶
type GetResourceTreeResponse struct {
Nodes map[string]*ResourceNode `json:"nodes"`
}
type GetStepResponse ¶
type GitResponse ¶
type InternalDeployRequest ¶
type InternalDeployRequest struct {
PipelinerunID uint `json:"pipelinerunID"`
}
type InternalDeployRequestV2 ¶
type InternalDeployResponse ¶
type LatestPipelinerun ¶
LatestPipelinerun latest pipelinerun
type ListClusterResponse ¶
type ListClusterResponse struct { ID uint `json:"id"` Name string `json:"name"` Type *string `json:"type,omitempty"` Description string `json:"description"` Scope *Scope `json:"scope"` Template *Template `json:"template"` Git *GitResponse `json:"git"` IsFavorite *bool `json:"isFavorite"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Tags []*tagmodels.TagBasic `json:"tags,omitempty"` }
type ListClusterWithFullResponse ¶
type ListClusterWithFullResponse struct { *ListClusterResponse IsFavorite *bool `json:"isFavorite,omitempty"` FullName string `json:"fullName,omitempty"` FullPath string `json:"fullPath,omitempty"` }
type OperationResult ¶
type PipelinerunIDResponse ¶
type PipelinerunIDResponse struct {
PipelinerunID uint `json:"pipelinerunID"`
}
type PipelinerunStatusResponse ¶
type PipelinerunStatusResponse struct { LatestPipelinerun *LatestPipelinerun `json:"latestPipelinerun,omitempty"` RunningTask *RunningTask `json:"runningTask,omitempty"` }
type ResourceNode ¶
type ResourceNode struct { v1alpha1.ResourceNode PodDetail interface{} `json:"podDetail,omitempty"` }
type RollbackRequest ¶
type RollbackRequest struct {
PipelinerunID uint `json:"pipelinerunID"`
}
type RunningTask ¶
type RunningTask struct { Task string `json:"task" yaml:"task"` // the latest buildDeploy pipelinerun ID PipelinerunID uint `json:"pipelinerunID,omitempty"` TaskStatus string `json:"taskStatus,omitempty" yaml:"taskStatus,omitempty"` }
RunningTask the most recent task in progress
type StatusResponseV2 ¶
type StatusResponseV2 struct {
Status string `json:"status"`
}
type TemplateInput ¶
type UpdateClusterRequest ¶
type UpdateClusterRequestV2 ¶
type UpdateClusterRequestV2 struct { // basic infos Description string `json:"description"` Priority string `json:"priority"` ExpireTime string `json:"expireTime"` // env and region info (can only be modified after cluster freed) Environment *string `json:"environment"` Region *string `json:"region"` Tags tagmodels.TagsBasic `json:"tags"` // source info Git *codemodels.Git `json:"git"` Image *string `json:"image"` // git config info BuildConfig map[string]interface{} `json:"buildConfig"` TemplateInfo *codemodels.TemplateInfo `json:"templateInfo"` TemplateConfig map[string]interface{} `json:"templateConfig"` }
type WhetherLike ¶
type WhetherLike struct {
IsFavorite bool `json:"isFavorite"`
}
Source Files ¶
- controller.go
- controller_basic.go
- controller_basic_v2.go
- controller_build_deploy.go
- controller_internal.go
- controller_internal_v2.go
- controller_operation.go
- controller_status.go
- models_basic.go
- models_basic_v2.go
- models_build_deploy.go
- models_internal.go
- models_internal_v2.go
- models_operation.go
- models_status.go
Click to show internal directories.
Click to hide internal directories.