service

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProductTemplate

func CreateProductTemplate(args *template.Product, log *zap.SugaredLogger) (err error)

CreateProductTemplate 创建产品模板

func CreateProjectOpenAPI added in v1.9.9

func CreateProjectOpenAPI(userID, username string, args *OpenAPICreateProductReq, logger *zap.SugaredLogger) error

func CreateVariableSet added in v1.9.9

func CreateVariableSet(args *CreateVariableSetRequest) error

func DeleteCollabrationMode added in v1.9.9

func DeleteCollabrationMode(productName string, userName string, log *zap.SugaredLogger) error

func DeleteLabels added in v1.9.9

func DeleteLabels(productName string, log *zap.SugaredLogger) error

func DeletePolicy added in v1.10.0

func DeletePolicy(productName string, log *zap.SugaredLogger) error

func DeleteProductTemplate

func DeleteProductTemplate(userName, productName, requestID string, isDelete bool, log *zap.SugaredLogger) (err error)

DeleteProductTemplate 删除产品模板

func DeleteProductsAsync

func DeleteProductsAsync(userName, productName, requestID string, isDelete bool, log *zap.SugaredLogger) error

func DeleteProjectOpenAPI added in v1.9.9

func DeleteProjectOpenAPI(userName, requestID, projectName string, isDelete bool, logger *zap.SugaredLogger) error

func DeleteTestModules

func DeleteTestModules(productName, requestID string, log *zap.SugaredLogger) error

func DeleteVariableSet added in v1.9.9

func DeleteVariableSet(id, projectName string, log *zap.SugaredLogger) error

func GetGlobalVariables added in v1.9.9

func GetGlobalVariables(productName string, production bool, log *zap.SugaredLogger) ([]*commontypes.ServiceVariableKV, error)

func GetProductTemplateServices

func GetProductTemplateServices(productName string, envType types.EnvType, isBaseEnv bool, baseEnvName string, log *zap.SugaredLogger) (*template.Product, error)

func GetVariableSet added in v1.9.9

func GetVariableSet(idStr string, log *zap.SugaredLogger) (*commonmodels.VariableSet, error)

func InitializeYAMLProject added in v1.9.9

func InitializeYAMLProject(userID, username, requestID string, args *OpenAPIInitializeProjectReq, logger *zap.SugaredLogger) error

func ListOpenSourceProduct

func ListOpenSourceProduct(log *zap.SugaredLogger) ([]*template.Product, error)

Deprecated

func ListProjects added in v1.5.0

func ListProjects(opts *ProjectListOptions, logger *zap.SugaredLogger) (interface{}, error)

func OpenAPIGetGlobalVariables added in v1.9.9

func OpenAPIGetGlobalVariables(projectName string, logger *zap.SugaredLogger) (*commontypes.GlobalVariables, error)

func OpenAPIInitializeHelmProject added in v1.9.9

func OpenAPIInitializeHelmProject(userID, username, requestID string, args *OpenAPIInitializeProjectReq, logger *zap.SugaredLogger) error

func TransferHostProject added in v1.9.9

func TransferHostProject(user, projectName string, log *zap.SugaredLogger) (err error)

func UpdateCustomMatchRules added in v1.5.0

func UpdateCustomMatchRules(productName, userName, requestID string, matchRules []*ImageParseData) error

func UpdateGlobalVariables added in v1.9.9

func UpdateGlobalVariables(productName, userName string, globalVariables []*commontypes.ServiceVariableKV, production bool) error

func UpdateProductTemplate

func UpdateProductTemplate(name string, args *template.Product, log *zap.SugaredLogger) (err error)

UpdateProductTemplate 更新产品模板

func UpdateProductTmplStatus

func UpdateProductTmplStatus(productName, onboardingStatus string, log *zap.SugaredLogger) (err error)

UpdateProductTmplStatus 更新项目onboarding状态

func UpdateProductionServiceOrchestration added in v1.9.9

func UpdateProductionServiceOrchestration(name string, services [][]string, updateBy string, log *zap.SugaredLogger) (err error)

func UpdateProject

func UpdateProject(name string, args *template.Product, log *zap.SugaredLogger) (err error)

UpdateProject 更新项目

func UpdateServiceOrchestration added in v1.6.0

func UpdateServiceOrchestration(name string, services [][]string, updateBy string, log *zap.SugaredLogger) (err error)

func UpdateVariableSet added in v1.9.9

func UpdateVariableSet(args *CreateVariableSetRequest, requestID string, log *zap.SugaredLogger) error

Types

type ContainerInfo

type ContainerInfo struct {
	Value string `bson:"value"              json:"value"`
	Label string `bson:"label"              json:"label"`
}

ContainerInfo ...

type CreateVariableSetRequest added in v1.9.9

type CreateVariableSetRequest struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Description  string `json:"description"`
	ProjectName  string `json:"project_name"`
	VariableYaml string `json:"variable_yaml"`
	UserName     string
}

type CustomParseDataArgs added in v1.5.0

type CustomParseDataArgs struct {
	Rules []*ImageParseData `json:"rules"`
}

type EnvDefinition added in v1.9.9

type EnvDefinition struct {
	EnvName     string `json:"env_name"`
	ClusterName string `json:"cluster_name"`
	Namespace   string `json:"namespace"`
}

type EnvInfo added in v1.9.9

type EnvInfo struct {
	Name       string `json:"name"`
	Production bool   `json:"production"`
	Status     string `json:"status"`
}

type GetGlobalVariableCandidatesRespone added in v1.9.9

type GetGlobalVariableCandidatesRespone struct {
	KeyName        string   `json:"key_name"`
	RelatedService []string `json:"related_service"`
}

func GetGlobalVariableCandidates added in v1.9.9

func GetGlobalVariableCandidates(productName string, production bool, log *zap.SugaredLogger) ([]*GetGlobalVariableCandidatesRespone, error)

type ImageParseData added in v1.5.0

type ImageParseData struct {
	Repo     string `json:"repo,omitempty"`
	Image    string `json:"image,omitempty"`
	Tag      string `json:"tag,omitempty"`
	InUse    bool   `json:"inUse,omitempty"`
	PresetId int    `json:"presetId,omitempty"`
}

func GetCustomMatchRules added in v1.5.0

func GetCustomMatchRules(productName string, log *zap.SugaredLogger) ([]*ImageParseData, error)

type OpenAPICreateProductReq added in v1.9.9

type OpenAPICreateProductReq struct {
	ProjectName string             `json:"project_name"`
	ProjectKey  string             `json:"project_key"`
	IsPublic    bool               `json:"is_public"`
	Description string             `json:"description"`
	ProjectType config.ProjectType `json:"project_type"`
}

func (OpenAPICreateProductReq) Validate added in v1.9.9

func (req OpenAPICreateProductReq) Validate() error

type OpenAPIInitializeProjectReq added in v1.9.9

type OpenAPIInitializeProjectReq struct {
	ProjectName string               `json:"project_name"`
	ProjectKey  string               `json:"project_key"`
	IsPublic    bool                 `json:"is_public"`
	Description string               `json:"description"`
	ServiceList []*ServiceDefinition `json:"service_list"`
	EnvList     []*EnvDefinition     `json:"env_list"`
}

func (OpenAPIInitializeProjectReq) Validate added in v1.9.9

func (req OpenAPIInitializeProjectReq) Validate() error

type OpenAPIListProjectReq added in v1.9.9

type OpenAPIListProjectReq struct {
	PageSize int64 `json:"pageSize" form:"pageSize" default:"20"`
	PageNum  int64 `json:"pageNum"  form:"pageNum"  default:"1"`
}

type OpenAPIProjectDetailResp added in v1.9.9

type OpenAPIProjectDetailResp struct {
	ProjectName string `json:"project_name"`
	ProjectKey  string `json:"project_key"`
	IsPublic    bool   `json:"is_public"`
	Desc        string `json:"desc"`
	DeployType  string `json:"deploy_type"`
	CreateTime  int64  `json:"create_time"`
	CreatedBy   string `json:"created_by"`
}

func GetProjectDetailOpenAPI added in v1.9.9

func GetProjectDetailOpenAPI(projectName string, logger *zap.SugaredLogger) (*OpenAPIProjectDetailResp, error)

type OpenAPIProjectListResp added in v1.9.9

type OpenAPIProjectListResp struct {
	Total    int             `json:"total"`
	Projects []*ProjectBrief `json:"projects"`
}

func ListProjectOpenAPI added in v1.9.9

func ListProjectOpenAPI(pageSize, pageNum int64, logger *zap.SugaredLogger) (*OpenAPIProjectListResp, error)

type ProductInfo

type ProductInfo struct {
	Value       string         `bson:"value"              json:"value"`
	Label       string         `bson:"label"              json:"label"`
	ServiceInfo []*ServiceInfo `bson:"services"           json:"services"`
}

func ListTemplatesHierachy

func ListTemplatesHierachy(userName string, log *zap.SugaredLogger) ([]*ProductInfo, error)

type ProjectBrief added in v1.9.9

type ProjectBrief struct {
	ProjectName string `json:"project_name"`
	ProjectKey  string `json:"project_key"`
	Description string `json:"description"`
	DeployType  string `json:"deploy_type"`
}

type ProjectBriefRepresentation added in v1.5.0

type ProjectBriefRepresentation struct {
	*ProjectMinimalRepresentation
	Envs []string `json:"envs"`
}

type ProjectBriefResponse added in v1.9.9

type ProjectBriefResponse struct {
	ProjectBriefRepresentation []*ProjectBriefRepresentation `json:"projects"`
	Total                      int                           `json:"total"`
}

type ProjectDetailedRepresentation added in v1.5.0

type ProjectDetailedRepresentation struct {
	*ProjectBriefRepresentation
	Alias      string `json:"alias"`
	Desc       string `json:"desc"`
	UpdatedAt  int64  `json:"updatedAt"`
	UpdatedBy  string `json:"updatedBy"`
	Onboard    bool   `json:"onboard"`
	Public     bool   `json:"public"`
	DeployType string `json:"deployType"`
}

type ProjectDetailedResponse added in v1.9.9

type ProjectDetailedResponse struct {
	ProjectDetailedRepresentation []*ProjectDetailedRepresentation `json:"projects"`
	Total                         int                              `json:"total"`
}

type ProjectListOptions added in v1.5.0

type ProjectListOptions struct {
	IgnoreNoEnvs     bool
	IgnoreNoVersions bool
	Verbosity        QueryVerbosity
	Names            []string
	PageSize         int64
	PageNum          int64
	Filter           string
}

type ProjectMinimalRepresentation added in v1.5.0

type ProjectMinimalRepresentation struct {
	Name string `json:"name"`
}

type QueryVerbosity added in v1.5.0

type QueryVerbosity string
const (
	VerbosityDetailed QueryVerbosity = "detailed" // all information
	VerbosityBrief    QueryVerbosity = "brief"    // short information or a summary
	VerbosityMinimal  QueryVerbosity = "minimal"  // very little information, usually only a resource identifier
)

type Service added in v1.9.9

type Service struct {
	Name       string `json:"name"`
	CreatedBy  string `json:"created_by"`
	CreateTime int64  `json:"create_time"`
	Source     string `json:"source"`
	Production bool   `json:"production"`
}

type ServiceDefinition added in v1.9.9

type ServiceDefinition struct {
	Source       string       `json:"source"`
	ServiceName  string       `json:"service_name"`
	TemplateName string       `json:"template_name"`
	VariableYaml util.KVInput `json:"variable_yaml"`
	AutoSync     bool         `json:"auto_sync"`
	Yaml         string       `json:"yaml"`
	ValuesYaml   string       `json:"values_yaml"`
}

type ServiceInfo

type ServiceInfo struct {
	Value         string           `bson:"value"              json:"value"`
	Label         string           `bson:"label"              json:"label"`
	ContainerInfo []*ContainerInfo `bson:"containers"         json:"containers"`
}

type VariableSetFindOption added in v1.9.9

type VariableSetFindOption struct {
	ID          string `json:"id" form:"id"`
	PerPage     int    `json:"perPage" form:"perPage"`
	Page        int    `json:"page" form:"page"`
	ProjectName string `json:"projectName" form:"projectName"`
}

type VariableSetListResp added in v1.9.9

type VariableSetListResp struct {
	VariableSetList []*commonmodels.VariableSet `json:"variable_set_list"`
	Total           int64                       `json:"total"`
}

func ListVariableSets added in v1.9.9

func ListVariableSets(option *VariableSetFindOption, log *zap.SugaredLogger) (*VariableSetListResp, error)

Jump to

Keyboard shortcuts

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