dop

package
v1.2.0-rc Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const APIMAddr = "dop.marathon.l4lb.thisdcos.directory:9527"

Variables

View Source
var AADAPTOR_CICD_CRON_LIST = apis.ApiSpec{
	Path:         "/api/cicd-crons",
	BackendPath:  "/api/cicd-crons",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineCronListResponse{},
	Doc:          "summary: 定时 pipeline 列表",
}
View Source
var ADAPTOR_CICD_BRANCHES_ALL_VALID = apis.ApiSpec{
	Path:         "/api/cicds/actions/app-all-valid-branch-workspaces",
	BackendPath:  "/api/cicds/actions/app-all-valid-branch-workspaces",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineAppAllValidBranchWorkspaceResponse{},
	Doc:          "summary: 获取应用下所有符合 gitflow 规范的分支列表,以及每个分支对应的 workspace",
}
View Source
var ADAPTOR_CICD_CANCEL = apis.ApiSpec{
	Path:         "/api/cicds/<pipelineID>/actions/cancel",
	BackendPath:  "/api/cicds/<pipelineID>/actions/cancel",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineCancelResponse{},
	Doc:          "summary: 取消 pipeline",
	Audit: func(ctx *spec.AuditContext) error {
		pipelineId, err := ctx.GetParamUInt64("pipelineID")
		if err != nil {
			return err
		}
		pipelineDTO, err := ctx.Bundle.GetPipeline(pipelineId)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(pipelineDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(pipelineDTO.ApplicationID, 10),
				"projectName": pipelineDTO.ProjectName,
				"appName":     pipelineDTO.ApplicationName,
				"pipelineId":  strconv.FormatUint(pipelineDTO.ID, 10),
			},
			ProjectID:    pipelineDTO.ProjectID,
			AppID:        pipelineDTO.ApplicationID,
			ScopeType:    "app",
			TemplateName: apistructs.CancelPipelineTemplate,
			ScopeID:      pipelineDTO.ApplicationID,
		})
	},
}
View Source
var ADAPTOR_CICD_CONFIG_DEL = apis.ApiSpec{
	Path:        "/api/cicds/configs",
	BackendPath: "/api/cicds/configs",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "DELETE",
	CheckLogin:  true,
	Doc:         "summary: 删除Pipeline指定命名空间下的某个配置",
	Audit: func(ctx *spec.AuditContext) error {
		appID := ctx.Request.URL.Query().Get("appID")
		namespaceName := ctx.Request.URL.Query().Get("namespace_name")
		key := ctx.Request.URL.Query().Get("key")
		appDTO, err := ctx.GetApp(appID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(appDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(appDTO.ID, 10),
				"projectName": appDTO.ProjectName,
				"appName":     appDTO.Name,
				"namespace":   namespaceName,
				"key":         key,
			},
			ProjectID:    appDTO.ProjectID,
			AppID:        appDTO.ID,
			ScopeType:    "app",
			ScopeID:      appDTO.ID,
			TemplateName: apistructs.DeletePipelineKeyTemplate,
		})
	},
}
View Source
var ADAPTOR_CICD_CONFIG_GET = apis.ApiSpec{
	Path:        "/api/cicds/multinamespace/configs",
	BackendPath: "/api/cicds/multinamespace/configs",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	Doc:         "summary: 获取Pipeline指定命名空间的所有配置",
}
View Source
var ADAPTOR_CICD_CONFIG_NAMESPACES = apis.ApiSpec{
	Path:         "/api/cicds/actions/fetch-config-namespaces",
	BackendPath:  "/api/cicds/actions/fetch-config-namespaces",
	Host:         "dop.default.svc.cluster.local:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineConfigNamespacesFetchResponse{},
	Doc:          "summary: 获取应用级别的配置的命名空间",
}
View Source
var ADAPTOR_CICD_CONFIG_PUT = apis.ApiSpec{
	Path:        "/api/cicds/configs",
	BackendPath: "/api/cicds/configs",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	RequestType: &apistructs.EnvConfigAddOrUpdateRequest{},
	Doc:         "summary: 修改Pipeline指定命名空间下的一个或多个配置",
	Audit: func(ctx *spec.AuditContext) error {
		appID := ctx.Request.URL.Query().Get("appID")
		namespaceName := ctx.Request.URL.Query().Get("namespace_name")
		var req apistructs.EnvConfigAddOrUpdateRequest
		err := ctx.BindRequestData(&req)
		if err != nil {
			return err
		}
		appDTO, err := ctx.GetApp(appID)
		if err != nil {
			return err
		}
		keys := []string{}
		for _, config := range req.Configs {
			keys = append(keys, config.Key)
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(appDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(appDTO.ID, 10),
				"projectName": appDTO.ProjectName,
				"appName":     appDTO.Name,
				"namespace":   namespaceName,
				"key":         strings.Join(keys, ","),
			},
			ProjectID:    appDTO.ProjectID,
			AppID:        appDTO.ID,
			ScopeType:    "app",
			ScopeID:      appDTO.ID,
			TemplateName: apistructs.UpdatePipelineKeyTemplate,
		})
	},
}
View Source
var ADAPTOR_CICD_CONFIG_WORKSPACES = apis.ApiSpec{
	Path:         "/api/cicds/actions/list-workspaces",
	BackendPath:  "/api/cicds/actions/list-workspaces",
	Host:         "dop.default.svc.cluster.local:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineConfigNamespacesFetchResponse{},
	Doc:          "summary: 获取应用级别的配置的环境名称",
}
View Source
var ADAPTOR_CICD_CREATE = apis.ApiSpec{
	Path:         "/api/cicds",
	BackendPath:  "/api/cicds",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.PipelineCreateRequest{},
	ResponseType: apistructs.PipelineCreateResponse{},
	Doc:          "summary: 创建 pipeline",
	Audit: func(ctx *spec.AuditContext) error {
		var resp apistructs.PipelineCreateResponse
		err := ctx.BindResponseData(&resp)
		if err != nil {
			return err
		}
		pipelineDTO := resp.Data
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(pipelineDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(pipelineDTO.ApplicationID, 10),
				"projectName": pipelineDTO.ProjectName,
				"appName":     pipelineDTO.ApplicationName,
				"pipelineId":  strconv.FormatUint(pipelineDTO.ID, 10),
				"branch":      pipelineDTO.Branch,
			},
			ProjectID:    pipelineDTO.ProjectID,
			AppID:        pipelineDTO.ApplicationID,
			ScopeType:    "app",
			TemplateName: apistructs.CreatePipelineTemplate,
			ScopeID:      pipelineDTO.ApplicationID,
		})
	},
}
View Source
var ADAPTOR_CICD_CRON_START = apis.ApiSpec{
	Path:         "/api/cicd-crons/<cronID>/actions/start",
	BackendPath:  "/api/cicd-crons/<cronID>/actions/start",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPut,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineCronStartResponse{},
	Doc:          "summary: 开始定时 pipeline",
	Audit: func(ctx *spec.AuditContext) error {
		var res apistructs.PipelineCronStartResponse
		err := ctx.BindResponseData(&res)
		if err != nil {
			return err
		}
		cronDTO := res.Data
		app, err := ctx.GetApp(cronDTO.ApplicationID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(app.ProjectID, 10),
				"appId":       strconv.FormatUint(app.ID, 10),
				"projectName": app.ProjectName,
				"appName":     app.Name,
				"pipelineId":  strconv.FormatUint(cronDTO.BasePipelineID, 10),
				"branch":      cronDTO.Branch,
			},
			ProjectID:    app.ProjectID,
			AppID:        app.ID,
			ScopeType:    "app",
			TemplateName: apistructs.StartPipelineTimerTemplate,
			ScopeID:      app.ID,
		})
	},
}
View Source
var ADAPTOR_CICD_CRON_STOP = apis.ApiSpec{
	Path:         "/api/cicd-crons/<cronID>/actions/stop",
	BackendPath:  "/api/cicd-crons/<cronID>/actions/stop",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPut,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineCronStopResponse{},
	Doc:          "summary: 停止定时 pipeline",
	Audit: func(ctx *spec.AuditContext) error {
		var res apistructs.PipelineCronStopResponse
		err := ctx.BindResponseData(&res)
		if err != nil {
			return err
		}
		cronDTO := res.Data
		app, err := ctx.GetApp(cronDTO.ApplicationID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(app.ProjectID, 10),
				"appId":       strconv.FormatUint(app.ID, 10),
				"projectName": app.ProjectName,
				"appName":     app.Name,
				"pipelineId":  strconv.FormatUint(cronDTO.BasePipelineID, 10),
				"branch":      cronDTO.Branch,
			},
			ProjectID:    app.ProjectID,
			AppID:        app.ID,
			ScopeType:    "app",
			TemplateName: apistructs.StopPipelineTimerTemplate,
			ScopeID:      app.ID,
		})
	},
}
View Source
var ADAPTOR_CICD_FETCH_PIPELINE_ID = apis.ApiSpec{
	Path:        "/api/cicds/actions/fetch-pipeline-id",
	BackendPath: "/api/cicds/actions/fetch-pipeline-id",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodGet,
	IsOpenAPI:   true,
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 根据 branch & appID 获取 pipelineID",
}
View Source
var ADAPTOR_CICD_FILETREE_CREATE = apis.ApiSpec{
	Path:         "/api/cicd-pipeline/filetree",
	BackendPath:  "/api/cicd-pipeline/filetree",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	IsOpenAPI:    true,
	CheckLogin:   true,
	ResponseType: apistructs.UnifiedFileTreeNodeCreateRequest{},
	Doc:          "summary: 创建节点",
}
View Source
var ADAPTOR_CICD_FILETREE_DELETE = apis.ApiSpec{
	Path:         "/api/cicd-pipeline/filetree/<inode>",
	BackendPath:  "/api/cicd-pipeline/filetree/<inode>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodDelete,
	IsOpenAPI:    true,
	CheckLogin:   true,
	ResponseType: apistructs.UnifiedFileTreeNodeDeleteRequest{},
	Doc:          "summary: 删除节点",
}
View Source
var ADAPTOR_CICD_FILETREE_FIND_ANCESTORS = apis.ApiSpec{
	Path:         "/api/cicd-pipeline/filetree/<inode>/actions/find-ancestors",
	BackendPath:  "/api/cicd-pipeline/filetree/<inode>/actions/find-ancestors",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.UnifiedFileTreeNodeFindAncestorsRequest{},
	Doc:          "summary: 查询所有父节点",
}
View Source
var ADAPTOR_CICD_FILETREE_FUZZY_SEARCH = apis.ApiSpec{
	Path:         "/api/cicd-pipeline/filetree/actions/fuzzy-search",
	BackendPath:  "/api/cicd-pipeline/filetree/actions/fuzzy-search",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.UnifiedFileTreeNodeFuzzySearchRequest{},
	Doc:          "summary: 模糊搜索节点",
}
View Source
var ADAPTOR_CICD_FILETREE_GET = apis.ApiSpec{
	Path:         "/api/cicd-pipeline/filetree/<inode>",
	BackendPath:  "/api/cicd-pipeline/filetree/<inode>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.UnifiedFileTreeNodeGetRequest{},
	Doc:          "summary: 查询节点详情",
}
View Source
var ADAPTOR_CICD_FILETREE_GET_PIPELINE_FILETREE = apis.ApiSpec{
	Path:        "/api/cicd-pipeline/filetree/actions/get-inode-by-pipeline",
	BackendPath: "/api/cicd-pipeline/filetree/actions/get-inode-by-pipeline",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodGet,
	IsOpenAPI:   true,
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 根据 pipeline id 查询流水线",
}
View Source
var ADAPTOR_CICD_FILETREE_LIST = apis.ApiSpec{
	Path:         "/api/cicd-pipeline/filetree",
	BackendPath:  "/api/cicd-pipeline/filetree",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.UnifiedFileTreeNodeListRequest{},
	Doc:          "summary: 查询子节点列表",
}
View Source
var ADAPTOR_CICD_GET_BRANCH_RULE = apis.ApiSpec{
	Path:         "/api/cicds/<pipelineid>/actions/get-branch-rule",
	BackendPath:  "/api/cicds/<pipelineid>/actions/get-branch-rule",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineGetBranchRuleResponse{},
	Doc:          "获取pipeline对应的分支规则",
}
View Source
var ADAPTOR_CICD_INVOKED_COMBO = apis.ApiSpec{
	Path:         "/api/cicds/actions/app-invoked-combos",
	BackendPath:  "/api/cicds/actions/app-invoked-combos",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.PipelineInvokedComboRequest{},
	ResponseType: apistructs.PipelineInvokedComboResponse{},
	Doc:          "summary: pipeline 侧边栏 combo",
}
View Source
var ADAPTOR_CICD_LIST = apis.ApiSpec{
	Path:         "/api/cicds",
	BackendPath:  "/api/cicds",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.PipelinePageListRequest{},
	ResponseType: apistructs.PipelinePageListResponse{},
	Doc:          "summary: pipeline 列表",
}
View Source
var ADAPTOR_CICD_OPERATE = apis.ApiSpec{
	Path:         "/api/cicds/<pipelineID>",
	BackendPath:  "/api/cicds/<pipelineID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.PipelineOperateRequest{},
	ResponseType: apistructs.PipelineOperateResponse{},
	Doc:          "summary: 操作 pipeline",
	Audit: func(ctx *spec.AuditContext) error {
		pipelineId, err := ctx.GetParamUInt64("pipelineID")
		if err != nil {
			return err
		}
		var req apistructs.PipelineOperateRequest
		err = ctx.BindRequestData(&req)
		if err != nil {
			return err
		}
		pipelineDTO, err := ctx.Bundle.GetPipeline(pipelineId)
		if err != nil {
			return err
		}
		taskName := ""
		for _, operate := range req.TaskOperates {
			task, err := ctx.Bundle.GetPipelineTask(pipelineDTO.ID, operate.TaskID)
			if err != nil {
				return err
			}
			taskName = task.Name
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(pipelineDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(pipelineDTO.ApplicationID, 10),
				"projectName": pipelineDTO.ProjectName,
				"appName":     pipelineDTO.ApplicationName,
				"pipelineId":  strconv.FormatUint(pipelineDTO.ID, 10),
				"taskName":    taskName,
			},
			ProjectID:    pipelineDTO.ProjectID,
			AppID:        pipelineDTO.ApplicationID,
			ScopeType:    "app",
			TemplateName: apistructs.TogglePipelineTaskTemplate,
			ScopeID:      pipelineDTO.ApplicationID,
		})
	},
}
View Source
var ADAPTOR_CICD_PIPELINE_DETAIL = apis.ApiSpec{
	Path:        "/api/cicds/actions/pipeline-detail",
	BackendPath: "/api/cicds/actions/pipeline-detail",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodGet,
	IsOpenAPI:   true,
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: pipeline 详情",
}
View Source
var ADAPTOR_CICD_PIPELINE_YML_LIST = apis.ApiSpec{
	Path:         "/api/cicds/actions/pipelineYmls",
	BackendPath:  "/api/cicds/actions/pipelineYmls",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CICDPipelineYmlListRequest{},
	ResponseType: apistructs.CICDPipelineYmlListResponse{},
	Doc:          "summary: pipeline yml列表",
}
View Source
var ADAPTOR_CICD_PROJECT_CREATE = apis.ApiSpec{
	Path:        "/api/cicds-project",
	BackendPath: "/api/cicds-project",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPost,
	IsOpenAPI:   true,
	CheckLogin:  true,
	CheckToken:  true,
}
View Source
var ADAPTOR_CICD_RERUN = apis.ApiSpec{
	Path:         "/api/cicds/<pipelineID>/actions/rerun",
	BackendPath:  "/api/cicds/<pipelineID>/actions/rerun",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineRerunResponse{},
	Doc:          "summary: pipeline 全流程重试",
	Audit: func(ctx *spec.AuditContext) error {
		pipelineId, err := ctx.GetParamUInt64("pipelineID")
		if err != nil {
			return err
		}
		pipelineDTO, err := ctx.Bundle.GetPipeline(pipelineId)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(pipelineDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(pipelineDTO.ApplicationID, 10),
				"projectName": pipelineDTO.ProjectName,
				"appName":     pipelineDTO.ApplicationName,
				"pipelineId":  strconv.FormatUint(pipelineDTO.ID, 10),
			},
			ProjectID:    pipelineDTO.ProjectID,
			AppID:        pipelineDTO.ApplicationID,
			ScopeType:    "app",
			TemplateName: apistructs.RerunPipelineTemplate,
			ScopeID:      pipelineDTO.ApplicationID,
		})
	},
}
View Source
var ADAPTOR_CICD_RERUN_FAILED = apis.ApiSpec{
	Path:        "/api/cicds/<pipelineID>/actions/rerun-failed",
	BackendPath: "/api/cicds/<pipelineID>/actions/rerun-failed",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPost,
	IsOpenAPI:   true,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.PipelineRerunFailedResponse{},
	Doc:         "summary: pipeline 从失败节点处开始重试",
	Audit: func(ctx *spec.AuditContext) error {
		pipelineId, err := ctx.GetParamUInt64("pipelineID")
		if err != nil {
			return err
		}
		pipelineDTO, err := ctx.Bundle.GetPipeline(pipelineId)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(pipelineDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(pipelineDTO.ApplicationID, 10),
				"projectName": pipelineDTO.ProjectName,
				"appName":     pipelineDTO.ApplicationName,
				"pipelineId":  strconv.FormatUint(pipelineDTO.ID, 10),
			},
			ProjectID:    pipelineDTO.ProjectID,
			AppID:        pipelineDTO.ApplicationID,
			ScopeType:    "app",
			TemplateName: apistructs.RetryPipelineTemplate,
			ScopeID:      pipelineDTO.ApplicationID,
		})
	},
}
View Source
var ADAPTOR_CICD_RUN = apis.ApiSpec{
	Path:         "/api/cicds/<pipelineID>/actions/run",
	BackendPath:  "/api/cicds/<pipelineID>/actions/run",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineRunResponse{},

	Doc: "summary: 开始 pipeline",
	Audit: func(ctx *spec.AuditContext) error {
		pipelineId, err := ctx.GetParamUInt64("pipelineID")
		if err != nil {
			return err
		}
		pipelineDTO, err := ctx.Bundle.GetPipeline(pipelineId)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(pipelineDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(pipelineDTO.ApplicationID, 10),
				"projectName": pipelineDTO.ProjectName,
				"appName":     pipelineDTO.ApplicationName,
				"pipelineId":  strconv.FormatUint(pipelineDTO.ID, 10),
			},
			ProjectID:    pipelineDTO.ProjectID,
			AppID:        pipelineDTO.ApplicationID,
			ScopeType:    "app",
			TemplateName: apistructs.StartPipelineTemplate,
			ScopeID:      pipelineDTO.ApplicationID,
		})
	},
}
View Source
var ADAPTOR_CICD_TASK_LOG = apis.ApiSpec{
	Path:        "/api/cicd/<pipelineID>/tasks/<taskID>/logs",
	BackendPath: "/api/cicd/<pipelineID>/tasks/<taskID>/logs",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: cicd 获取任务日志",
}
View Source
var ADAPTOR_CICD_TASK_LOG_DOWNLOAD = apis.ApiSpec{
	Path:        "/api/cicd/<pipelineID>/tasks/<taskID>/logs/actions/download",
	BackendPath: "/api/cicd/<pipelineID>/tasks/<taskID>/logs/actions/download",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	ChunkAPI:    true,
	Doc:         "summary: cicd 下载任务日志",
}
View Source
var APIDocWebsocket = apis.ApiSpec{
	Path:         "/api/apim-ws/api-docs/filetree/<inode>",
	BackendPath:  "/api/apim-ws/api-docs/filetree/<inode>",
	Host:         APIMAddr,
	Scheme:       "ws",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "api doc websocket",
}
View Source
var APITEST_ATTEMPT = apis.ApiSpec{
	Path:         "/api/apitests/actions/attempt-test",
	BackendPath:  "/api/apitests/actions/attempt-test",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 手动尝试执行单个 usecase API 测试",
	RequestType:  apistructs.APITestsAttemptRequest{},
	ResponseType: apistructs.APITestsAttemptResponse{},
	IsOpenAPI:    true,
}
View Source
var CI_SONAR_STORE = apis.ApiSpec{
	Path:         "/api/qa/actions/sonar-results-store",
	BackendPath:  "/api/qa/actions/sonar-results-store",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 存储 sonar issue",
	RequestType:  apistructs.SonarStoreRequest{},
	ResponseType: apistructs.SonarStoreResponse{},
	IsOpenAPI:    true,
}
View Source
var CMDB_APPLICATION_CREATE = apis.ApiSpec{
	Path:         "/api/applications",
	BackendPath:  "/api/applications",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	IsOpenAPI:    true,
	RequestType:  apistructs.ApplicationCreateRequest{},
	ResponseType: apistructs.ApplicationCreateResponse{},
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 创建应用",
	Audit: func(ctx *spec.AuditContext) error {
		var resp apistructs.ApplicationCreateResponse
		err := ctx.BindResponseData(&resp)
		if err != nil {
			return err
		}
		applicationDTO := resp.Data
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(applicationDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(applicationDTO.ID, 10),
				"projectName": applicationDTO.ProjectName,
				"appName":     applicationDTO.Name,
			},
			ScopeType:    "app",
			ScopeID:      applicationDTO.ID,
			AppID:        applicationDTO.ID,
			ProjectID:    applicationDTO.ProjectID,
			Result:       apistructs.SuccessfulResult,
			TemplateName: apistructs.CreateAppTemplate,
		})
	},
}
View Source
var CMDB_APPLICATION_DELETE = apis.ApiSpec{
	Path:         "/api/applications/<applicationId>",
	BackendPath:  "/api/applications/<applicationId>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "DELETE",
	IsOpenAPI:    true,
	RequestType:  apistructs.ApplicationDeleteRequest{},
	ResponseType: apistructs.ApplicationDeleteResponse{},
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 删除应用",
	Audit: func(ctx *spec.AuditContext) error {
		var resp apistructs.ApplicationDeleteResponse
		err := ctx.BindResponseData(&resp)
		if err != nil {
			return err
		}
		applicationDTO := resp.Data
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(applicationDTO.ProjectID, 10),
				"appId":       strconv.FormatUint(applicationDTO.ID, 10),
				"projectName": applicationDTO.ProjectName,
				"appName":     applicationDTO.Name,
			},
			AppID:        applicationDTO.ID,
			ProjectID:    applicationDTO.ProjectID,
			ScopeType:    "app",
			ScopeID:      applicationDTO.ID,
			Result:       apistructs.SuccessfulResult,
			TemplateName: apistructs.DeleteAppTemplate,
		})
	},
}
View Source
var CMDB_BACKUP_DOWNLOAD = apis.ApiSpec{
	Path:          "/api/backup/<uuid>",
	BackendPath:   "/api/files/<uuid>",
	Host:          "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:        "http",
	Method:        http.MethodGet,
	CheckLogin:    false,
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	ChunkAPI:      true,
	Doc:           "summary: 文件下载,在 path 中指定具体文件",
}
View Source
var CMDB_BRANCH_RULE_CREATE = apis.ApiSpec{
	Path:         "/api/branch-rules",
	BackendPath:  "/api/branch-rules",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	RequestType:  apistructs.CreateBranchRuleRequest{},
	ResponseType: apistructs.CreateBranchRuleResponse{},
	Doc:          "summary: 创建分支规则",
	Audit: func(ctx *spec.AuditContext) error {
		var resp apistructs.CreateBranchRuleResponse
		err := ctx.BindResponseData(&resp)
		if err != nil {
			return err
		}
		ruleDTO := resp.Data
		if ruleDTO.ScopeType != apistructs.ProjectScope {
			return nil
		}
		project, err := ctx.GetProject(ruleDTO.ScopeID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(project.ID, 10),
				"projectName": project.Name,
				"ruleName":    ruleDTO.Rule,
			},
			ScopeType:    "project",
			ScopeID:      project.ID,
			Result:       apistructs.SuccessfulResult,
			TemplateName: apistructs.CreateBranchRuleTemplate,
		})
	},
}
View Source
var CMDB_BRANCH_RULE_DELETE = apis.ApiSpec{
	Path:         "/api/branch-rules/<id>",
	BackendPath:  "/api/branch-rules/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	ResponseType: apistructs.DeleteBranchRuleResponse{},
	Doc:          "summary: 删除分支规则",
	Audit: func(ctx *spec.AuditContext) error {
		var resp apistructs.DeleteBranchRuleResponse
		err := ctx.BindResponseData(&resp)
		if err != nil {
			return err
		}
		ruleDTO := resp.Data
		if ruleDTO.ScopeType != apistructs.ProjectScope {
			return nil
		}
		project, err := ctx.GetProject(ruleDTO.ScopeID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(project.ID, 10),
				"projectName": project.Name,
				"ruleName":    ruleDTO.Rule,
			},
			ScopeType:    "project",
			ScopeID:      project.ID,
			Result:       apistructs.SuccessfulResult,
			TemplateName: apistructs.DeleteBranchRuleTemplate,
		})
	},
}
View Source
var CMDB_BRANCH_RULE_QUERY = apis.ApiSpec{
	Path:         "/api/branch-rules",
	BackendPath:  "/api/branch-rules",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.QueryBranchRuleRequest{},
	ResponseType: apistructs.QueryBranchRuleResponse{},
	Doc:          "summary: 查询分支规则",
}
View Source
var CMDB_BRANCH_RULE_UPDATE = apis.ApiSpec{
	Path:         "/api/branch-rules/<id>",
	BackendPath:  "/api/branch-rules/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	RequestType:  apistructs.UpdateBranchRuleRequest{},
	ResponseType: apistructs.UpdateBranchRuleResponse{},
	Doc:          "summary: 更新分支规则",
	Audit: func(ctx *spec.AuditContext) error {
		var resp apistructs.UpdateBranchRuleResponse
		err := ctx.BindResponseData(&resp)
		if err != nil {
			return err
		}
		ruleDTO := resp.Data
		if ruleDTO.ScopeType != apistructs.ProjectScope {
			return nil
		}
		project, err := ctx.GetProject(ruleDTO.ScopeID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			Context: map[string]interface{}{
				"projectId":   strconv.FormatUint(project.ID, 10),
				"projectName": project.Name,
				"ruleName":    ruleDTO.Rule,
			},
			ScopeType:    "project",
			ScopeID:      project.ID,
			Result:       apistructs.SuccessfulResult,
			TemplateName: apistructs.UpdateBranchRuleTemplate,
		})
	},
}
View Source
var CMDB_CERTIFICATES_APP_LIST = apis.ApiSpec{
	Path:         "/api/certificates/actions/list-application-quotes",
	BackendPath:  "/api/certificates/actions/list-application-quotes",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.AppCertificateListRequest{},
	ResponseType: apistructs.PagingAppCertificateDTO{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取指定应用的所有引用证书列表",
}
View Source
var CMDB_CERTIFICATES_LIST = apis.ApiSpec{
	Path:         "/api/certificates/actions/list-certificates",
	BackendPath:  "/api/certificates/actions/list-certificates",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CertificateListRequest{},
	ResponseType: apistructs.CertificateListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询所有证书列表",
}
View Source
var CMDB_CERTIFICATE_APP_CANCEL = apis.ApiSpec{
	Path:        "/api/certificates/actions/application-cancel-quote",
	BackendPath: "/api/certificates/actions/application-cancel-quote",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "DELETE",
	CheckLogin:  true,
	Doc:         "summary: 应用取消引用证书",
}
View Source
var CMDB_CERTIFICATE_APP_CONFIG = apis.ApiSpec{
	Path:        "/api/certificates/actions/push-configs",
	BackendPath: "/api/certificates/actions/push-configs",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	RequestType: apistructs.PushCertificateConfigsRequest{},
	Doc:         "summary: 推送应用证书到配置管理",
}
View Source
var CMDB_CERTIFICATE_APP_QUOTE = apis.ApiSpec{
	Path:        "/api/certificates/actions/application-quote",
	BackendPath: "/api/certificates/actions/application-quote",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	RequestType: apistructs.CertificateQuoteRequest{},
	Doc:         "summary: 应用引用证书",
}
View Source
var CMDB_CERTIFICATE_CREATE = apis.ApiSpec{
	Path:         "/api/certificates",
	BackendPath:  "/api/certificates",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	RequestType:  apistructs.CertificateCreateRequest{},
	ResponseType: apistructs.CertificateCreateResponse{},
	Doc:          "summary: 创建证书",
	Audit: func(ctx *spec.AuditContext) error {

		var resp apistructs.CertificateCreateResponse
		err := ctx.BindResponseData(&resp)
		if err != nil {
			return err
		}
		if resp.Success {
			return ctx.CreateAudit(&apistructs.Audit{
				ScopeType:    apistructs.OrgScope,
				ScopeID:      uint64(ctx.OrgID),
				TemplateName: apistructs.CreateCertificatesTemplate,
				Context:      map[string]interface{}{"certificateName": resp.Data.Name},
			})
		} else {
			return nil
		}
	},
}
View Source
var CMDB_CERTIFICATE_DELETE = apis.ApiSpec{
	Path:         "/api/certificates/<certificatesID>",
	BackendPath:  "/api/certificates/<certificatesID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	ResponseType: apistructs.CertificateDeleteResponse{},
	Doc:          "summary: 删除证书",
	Audit: func(ctx *spec.AuditContext) error {

		var resp apistructs.CertificateDeleteResponse
		err := ctx.BindResponseData(&resp)
		if err != nil {
			return err
		}
		if resp.Success {
			return ctx.CreateAudit(&apistructs.Audit{
				ScopeType:    apistructs.OrgScope,
				ScopeID:      uint64(ctx.OrgID),
				TemplateName: apistructs.DeleteCertificatesTemplate,
				Context:      map[string]interface{}{"certificateName": resp.Data.Name},
			})

		} else {
			return nil
		}

	},
}
View Source
var CMDB_CERTIFICATE_GET = apis.ApiSpec{
	Path:         "/api/certificates/<certificateID>",
	BackendPath:  "/api/certificates/<certificateID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	ResponseType: apistructs.CertificateDetailResponse{},
	Doc:          "summary: 获取证书详情",
}
View Source
var CMDB_CERTIFICATE_UPDATE = apis.ApiSpec{
	Path:         "/api/certificates/<certificateID>",
	BackendPath:  "/api/certificates/<certificateID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	RequestType:  apistructs.CertificateUpdateRequest{},
	ResponseType: apistructs.CertificateUpdateResponse{},
	Doc:          "summary: 更新证书",
	Audit: func(ctx *spec.AuditContext) error {

		var resp apistructs.CertificateUpdateResponse
		err := ctx.BindResponseData(&resp)
		if err != nil {
			return err
		}
		if resp.Success {
			return ctx.CreateAudit(&apistructs.Audit{
				ScopeType:    apistructs.OrgScope,
				ScopeID:      uint64(ctx.OrgID),
				TemplateName: apistructs.UpdateCertificatesTemplate,
				Context:      map[string]interface{}{"certificateName": resp.Data.Name},
			})

		} else {
			return nil
		}
	},
}
View Source
var CMDB_COMMENT_CREATE = apis.ApiSpec{
	Path:         "/api/comments",
	BackendPath:  "/api/comments",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CommentCreateRequest{},
	ResponseType: apistructs.CommentCreateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建工单评论",
	Group:        "tickets",
}
View Source
var CMDB_COMMENT_LIST = apis.ApiSpec{
	Path:         "/api/comments",
	BackendPath:  "/api/comments",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CommentListRequest{},
	ResponseType: apistructs.CommentListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 工单评论列表",
	Group:        "tickets",
}
View Source
var CMDB_COMMENT_UPDATE = apis.ApiSpec{
	Path:         "/api/comments/<commentID>",
	BackendPath:  "/api/comments/<commentID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CommentUpdateRequest{},
	ResponseType: apistructs.CommentUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 更新工单评论",
	Group:        "tickets",
}
View Source
var CMDB_FILE_DOWNLOAD = apis.ApiSpec{
	Path:          "/api/files",
	BackendPath:   "/api/files",
	Host:          "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:        "http",
	Method:        http.MethodGet,
	CheckLogin:    false,
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	ChunkAPI:      true,
	Doc:           "summary: 文件下载,在 query param 中通过 file=<uuid> 指定具体文件",
}
View Source
var CMDB_FILE_DOWNLOAD_V2 = apis.ApiSpec{
	Path:          "/api/files/<uuid>",
	BackendPath:   "/api/files/<uuid>",
	Host:          "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:        "http",
	Method:        http.MethodGet,
	CheckLogin:    false,
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	ChunkAPI:      true,
	Doc:           "summary: 文件下载,在 path 中指定具体文件",
}
View Source
var CMDB_FILE_HEAD = apis.ApiSpec{
	Path:          "/api/files/<uuid>",
	BackendPath:   "/api/files/<uuid>",
	Host:          "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:        "http",
	Method:        http.MethodHead,
	CheckLogin:    false,
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	Doc:           "summary: HEAD 请求,文件下载,在 path 中指定具体文件",
}
View Source
var CMDB_FILE_UPLOAD = apis.ApiSpec{
	Path:         "/api/files",
	BackendPath:  "/api/files",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ChunkAPI:     true,
	ResponseType: apistructs.FileUploadResponse{},
	Doc:          "summary: 文件上传",
}
View Source
var CMDB_ISSUE_BATCH_UPDATE = apis.ApiSpec{
	Path:        "/api/issues/actions/batch-update",
	BackendPath: "/api/issues/actions/batch-update",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssueBatchUpdateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 批量更新 ISSUE",
}
View Source
var CMDB_ISSUE_BUG_PERCENTAGE = apis.ApiSpec{
	Path:         "/api/issues/actions/bug-percentage",
	BackendPath:  "/api/issues/actions/bug-percentage",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.IssueBugPercentageResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 ISSUE的缺陷率",
}
View Source
var CMDB_ISSUE_BUG_SEVERITY_PERCENTAGE = apis.ApiSpec{
	Path:         "/api/issues/actions/bug-severity-percentage",
	BackendPath:  "/api/issues/actions/bug-severity-percentage",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: []apistructs.IssueBugSeverityPercentageResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 ISSUE的缺陷等级分布",
}
View Source
var CMDB_ISSUE_BUG_STATUS_PERCENTAGE = apis.ApiSpec{
	Path:         "/api/issues/actions/bug-status-percentage",
	BackendPath:  "/api/issues/actions/bug-status-percentage",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: []apistructs.IssueBugStatusPercentageResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 ISSUE的缺陷状态分布",
}
View Source
var CMDB_ISSUE_CREATE = apis.ApiSpec{
	Path:         "/api/issues",
	BackendPath:  "/api/issues",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueCreateRequest{},
	ResponseType: apistructs.IssueCreateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建 ISSUE",
}
View Source
var CMDB_ISSUE_DELETE = apis.ApiSpec{
	Path:        "/api/issues/<id>",
	BackendPath: "/api/issues/<id>",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodDelete,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 删除 ISSUE",
	Audit: func(ctx *spec.AuditContext) error {
		var respBody apistructs.IssueGetResponse
		if err := ctx.BindResponseData(&respBody); err != nil {
			return err
		}
		project, err := ctx.Bundle.GetProject(respBody.Data.ProjectID)
		if err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      project.ID,
			ProjectID:    project.ID,
			TemplateName: apistructs.DeleteIssueTemplate,
			Context: map[string]interface{}{"projectName": project.Name, "issueTitle": respBody.Data.Title,
				"issueType": respBody.Data.Type, "iterationId": respBody.Data.IterationID, "issueId": respBody.Data.ID},
		})
	},
}
View Source
var CMDB_ISSUE_EXPORT_EXCEL = apis.ApiSpec{
	Path:        "/api/issues/actions/export-excel",
	BackendPath: "/api/issues/actions/export-excel",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodGet,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssueExportExcelRequest{},
	IsOpenAPI:   true,
	Doc:         "导出事件到 excel",
}
View Source
var CMDB_ISSUE_FILE_DOWNLOAD = apis.ApiSpec{
	Path:          "/api/issues/action/download/<uuid>",
	BackendPath:   "/api/files/<uuid>",
	Host:          "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:        "http",
	Method:        http.MethodGet,
	CheckLogin:    false,
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	ChunkAPI:      true,
	Doc:           "summary: 文件下载,在 path 中指定具体文件",
}
View Source
var CMDB_ISSUE_GET = apis.ApiSpec{
	Path:         "/api/issues/<id>",
	BackendPath:  "/api/issues/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.IssueGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 ISSUE",
}
View Source
var CMDB_ISSUE_IMPORT_EXCEL = apis.ApiSpec{
	Path:         "/api/issues/actions/import-excel",
	BackendPath:  "/api/issues/actions/import-excel",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueImportExcelRequest{},
	ResponseType: apistructs.IssueImportExcelResponse{},
	IsOpenAPI:    true,
	Doc:          "导入事件到 excel",
}
View Source
var CMDB_ISSUE_INSTANCE_CREATE = apis.ApiSpec{
	Path:        "/api/issues/actions/create-property-instance",
	BackendPath: "/api/issues/actions/create-property-instance",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPost,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssuePropertyRelationCreateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 创建 自定义字段实例",
}
View Source
var CMDB_ISSUE_INSTANCE_GET = apis.ApiSpec{
	Path:         "/api/issues/actions/get-property-instance",
	BackendPath:  "/api/issues/actions/get-property-instance",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssuePropertyRelationGetRequest{},
	ResponseType: apistructs.IssuePropertyRelationGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取 自定义字段实例",
}
View Source
var CMDB_ISSUE_INSTANCE_UPDATE = apis.ApiSpec{
	Path:        "/api/issues/actions/update-property-instance",
	BackendPath: "/api/issues/actions/update-property-instance",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssuePropertyRelationUpdateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 更新 自定义字段实例",
}
View Source
var CMDB_ISSUE_ManHour_SUM = apis.ApiSpec{
	Path:         "/api/issues/actions/man-hour",
	BackendPath:  "/api/issues/actions/man-hour",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.IssueManHourSumResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 ISSUE下所有的任务总和",
}
View Source
var CMDB_ISSUE_PAGING = apis.ApiSpec{
	Path:         "/api/issues",
	BackendPath:  "/api/issues",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssuePagingRequest{},
	ResponseType: apistructs.IssuePagingRequest{},
	IsOpenAPI:    true,
	Doc:          "summary: 分页查询 ISSUE",
}
View Source
var CMDB_ISSUE_PANEL_CREATE = apis.ApiSpec{
	Path:        "/api/issues/actions/create-panel",
	BackendPath: "/api/issues/actions/create-panel",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPost,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssuePanelRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 更新 issue panel",
}
View Source
var CMDB_ISSUE_PANEL_DELETE = apis.ApiSpec{
	Path:         "/api/issues/actions/delete-panel",
	BackendPath:  "/api/issues/actions/delete-panel",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodDelete,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssuePanelRequest{},
	ResponseType: apistructs.IssuePanelDeleteResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 新建 issue panel",
}
View Source
var CMDB_ISSUE_PANEL_GET = apis.ApiSpec{
	Path:         "/api/issues/actions/get-panel",
	BackendPath:  "/api/issues/actions/get-panel",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssuePanelRequest{},
	ResponseType: apistructs.IssuePanelGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 issue panel",
}
View Source
var CMDB_ISSUE_PANEL_ISSUE_UPDATE = apis.ApiSpec{
	Path:        "/api/issues/actions/update-panel-issue",
	BackendPath: "/api/issues/actions/update-panel-issue",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssuePanelRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 更新 panel里的issue关联",
}
View Source
var CMDB_ISSUE_PANEL_UPDATE = apis.ApiSpec{
	Path:        "/api/issues/actions/update-panel",
	BackendPath: "/api/issues/actions/update-panel",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssuePanelRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 新建 issue panel",
}
View Source
var CMDB_ISSUE_PROPERTIES_GET = apis.ApiSpec{
	Path:         "/api/issues/actions/get-properties",
	BackendPath:  "/api/issues/actions/get-properties",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.IssuePropertiesResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取 自定义字段",
}
View Source
var CMDB_ISSUE_PROPERTIES_TIME_GET = apis.ApiSpec{
	Path:         "/api/issues/actions/get-properties-time",
	BackendPath:  "/api/issues/actions/get-properties-time",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.IssuePropertyUpdateTimesResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取 自定义字段 更新时间",
}
View Source
var CMDB_ISSUE_PROPERTY_CREATE = apis.ApiSpec{
	Path:        "/api/issues/actions/create-property",
	BackendPath: "/api/issues/actions/create-property",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPost,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssuePropertyCreateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 创建 自定义字段",
}
View Source
var CMDB_ISSUE_PROPERTY_DELETE = apis.ApiSpec{
	Path:         "/api/issues/actions/delete-property",
	BackendPath:  "/api/issues/actions/delete-property",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodDelete,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssuePropertyDeleteRequest{},
	ResponseType: apistructs.IssuePropertyResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 删除 自定义字段",
}
View Source
var CMDB_ISSUE_PROPERTY_INDEX_UPDATE = apis.ApiSpec{
	Path:         "/api/issues/actions/update-properties-index",
	BackendPath:  "/api/issues/actions/update-properties-index",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssuePropertyIndexUpdateRequest{},
	ResponseType: apistructs.IssuePropertiesResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 更新 自定义字段 优先级",
}
View Source
var CMDB_ISSUE_PROPERTY_UPDATE = apis.ApiSpec{
	Path:        "/api/issues/actions/update-property",
	BackendPath: "/api/issues/actions/update-property",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssuePropertyUpdateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 更新 自定义字段",
}
View Source
var CMDB_ISSUE_RELATION_CREATE = apis.ApiSpec{
	Path:        "/api/issues/<id>/relations",
	BackendPath: "/api/issues/<id>/relations",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPost,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssueRelationCreateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 创建 issue 关联关系",
}
View Source
var CMDB_ISSUE_RELATION_DELETE = apis.ApiSpec{
	Path:        "/api/issues/<id>/relations/<relatedIssueID>",
	BackendPath: "/api/issues/<id>/relations/<relatedIssueID>",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodDelete,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 删除 issue 关联关系",
}
View Source
var CMDB_ISSUE_RELATION_GET = apis.ApiSpec{
	Path:         "/api/issues/<id>/relations",
	BackendPath:  "/api/issues/<id>/relations",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.IssueRelationGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建 issue 关联关系",
}
View Source
var CMDB_ISSUE_STAGE_CREATE = apis.ApiSpec{
	Path:        "/api/issues/action/update-stage",
	BackendPath: "/api/issues/action/update-stage",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssueStageRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 创建 STAGE",
}
View Source
var CMDB_ISSUE_STAGE_GET = apis.ApiSpec{
	Path:         "/api/issues/action/get-stage",
	BackendPath:  "/api/issues/action/get-stage",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueStageRequest{},
	ResponseType: apistructs.IssueStageResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 STAGE",
}
View Source
var CMDB_ISSUE_STATE_BELONG_GET = apis.ApiSpec{
	Path:         "/api/issues/actions/get-states",
	BackendPath:  "/api/issues/actions/get-states",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueStateRelationGetRequest{},
	ResponseType: apistructs.IssueStateTypeBelongGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 issueState 主状态详情关系",
}
View Source
var CMDB_ISSUE_STATE_CREATE = apis.ApiSpec{
	Path:        "/api/issues/actions/create-state",
	BackendPath: "/api/issues/actions/create-state",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPost,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssueStateCreateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 创建 issueState ",
}
View Source
var CMDB_ISSUE_STATE_DELETE = apis.ApiSpec{
	Path:         "/api/issues/actions/delete-state",
	BackendPath:  "/api/issues/actions/delete-state",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodDelete,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueStateDeleteRequest{},
	ResponseType: apistructs.IssueStateDeleteResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 删除 issueState",
}
View Source
var CMDB_ISSUE_STATE_GET = apis.ApiSpec{
	Path:         "/api/issues/actions/get-states",
	BackendPath:  "/api/issues/actions/get-states",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueStatesGetRequest{},
	ResponseType: apistructs.IssueStatesGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 issueState ",
}
View Source
var CMDB_ISSUE_STATE_RELATION_GET = apis.ApiSpec{
	Path:         "/api/issues/actions/get-state-relations",
	BackendPath:  "/api/issues/actions/get-state-relations",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueStateRelationGetRequest{},
	ResponseType: apistructs.IssueStateRelationGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询 工作流",
}
View Source
var CMDB_ISSUE_STATE_RELATION_UPDATE = apis.ApiSpec{
	Path:         "/api/issues/actions/update-state-relation",
	BackendPath:  "/api/issues/actions/update-state-relation",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueStateUpdateRequest{},
	ResponseType: apistructs.IssueStateRelationGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 更新 工作流 ",
}
View Source
var CMDB_ISSUE_STREAM_CREATE = apis.ApiSpec{
	Path:         "/api/issues/<id>/streams",
	BackendPath:  "/api/issues/<id>/streams",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.CommentIssueStreamCreateRequest{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建 issue 评论",
}
View Source
var CMDB_ISSUE_STREAM_PAGING = apis.ApiSpec{
	Path:         "/api/issues/<id>/streams",
	BackendPath:  "/api/issues/<id>/streams",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueStreamPagingRequest{},
	ResponseType: apistructs.IssueStreamPagingResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 分页查询 ISSUE 流水",
}
View Source
var CMDB_ISSUE_SUBSCRIBE = apis.ApiSpec{
	Path:        "/api/issues/<id>/actions/subscribe",
	BackendPath: "/api/issues/<id>/actions/subscribe",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPost,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: subscribe issue",
}
View Source
var CMDB_ISSUE_SUBSCRIBE_BATCH_UPDATE = apis.ApiSpec{
	Path:        "/api/issues/<id>/actions/batch-update-subscriber",
	BackendPath: "/api/issues/<id>/actions/batch-update-subscriber",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: batch update issue subscriber",
}
View Source
var CMDB_ISSUE_TYPE_UPDATE = apis.ApiSpec{
	Path:        "/api/issues/actions/update-issue-type",
	BackendPath: "/api/issues/actions/update-issue-type",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssueTypeUpdateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 转换issue类型",
}
View Source
var CMDB_ISSUE_UNSUBSCRIBE = apis.ApiSpec{
	Path:        "/api/issues/<id>/actions/unsubscribe",
	BackendPath: "/api/issues/<id>/actions/unsubscribe",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodPost,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: unsubscribe issue",
}
View Source
var CMDB_ISSUE_UPDATE = apis.ApiSpec{
	Path:         "/api/issues/<id>",
	BackendPath:  "/api/issues/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IssueUpdateRequest{},
	ResponseType: apistructs.IssueUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 更新 ISSUE",
}
View Source
var CMDB_ITERATION_CREATE = apis.ApiSpec{
	Path:         "/api/iterations",
	BackendPath:  "/api/iterations",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IterationCreateRequest{},
	ResponseType: apistructs.IterationCreateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建迭代",
	Audit: func(ctx *spec.AuditContext) error {
		var reqBody apistructs.IterationCreateRequest
		if err := ctx.BindRequestData(&reqBody); err != nil {
			return err
		}

		var respBody apistructs.IterationCreateResponse
		if err := ctx.BindResponseData(&respBody); err != nil {
			return err
		}

		project, err := ctx.Bundle.GetProject(reqBody.ProjectID)
		if err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      project.ID,
			ProjectID:    project.ID,
			TemplateName: apistructs.CreateIterationTemplate,
			Context: map[string]interface{}{"iterationId": respBody.Data.ID, "iterationName": reqBody.Title,
				"projectName": project.Name},
		})
	},
}
View Source
var CMDB_ITERATION_DELETE = apis.ApiSpec{
	Path:        "/api/iterations/<id>",
	BackendPath: "/api/iterations/<id>",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodDelete,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 删除迭代",
	Audit: func(ctx *spec.AuditContext) error {
		var respBody apistructs.IterationGetResponse
		if err := ctx.BindResponseData(&respBody); err != nil {
			return err
		}
		project, err := ctx.Bundle.GetProject(respBody.Data.ProjectID)
		if err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      project.ID,
			ProjectID:    project.ID,
			TemplateName: apistructs.DeleteIterationTemplate,
			Context: map[string]interface{}{"projectName": project.Name, "iterationId": respBody.Data.ID,
				"iterationName": respBody.Data.Title},
		})
	},
}
View Source
var CMDB_ITERATION_GET = apis.ApiSpec{
	Path:         "/api/iterations/<id>",
	BackendPath:  "/api/iterations/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	ResponseType: apistructs.IterationGetResponse{},
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	Doc:          "summary: 迭代详情",
}
View Source
var CMDB_ITERATION_PAGING = apis.ApiSpec{
	Path:         "/api/iterations",
	BackendPath:  "/api/iterations",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IterationPagingRequest{},
	ResponseType: apistructs.IterationPagingResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 分页查询迭代",
}
View Source
var CMDB_ITERATION_UPDATE = apis.ApiSpec{
	Path:         "/api/iterations/<id>",
	BackendPath:  "/api/iterations/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.IterationUpdateRequest{},
	ResponseType: apistructs.IterationUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 更新迭代",
	Audit: func(ctx *spec.AuditContext) error {
		var respBody apistructs.IterationUpdateResponse
		if err := ctx.BindResponseData(&respBody); err != nil {
			return err
		}
		iteration, err := ctx.Bundle.GetIteration(respBody.Data)
		if err != nil {
			return err
		}
		project, err := ctx.Bundle.GetProject(iteration.ProjectID)
		if err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      project.ID,
			ProjectID:    project.ID,
			TemplateName: apistructs.UpdateIterationTemplate,
			Context: map[string]interface{}{"projectName": project.Name, "iterationId": iteration.ID,
				"iterationName": iteration.Title},
		})
	},
}
View Source
var CMDB_LIBREFERENCE_CREATE = apis.ApiSpec{
	Path:         "/api/lib-references",
	BackendPath:  "/api/lib-references",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.LibReferenceCreateRequest{},
	ResponseType: apistructs.LibReferenceCreateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建库引用",
}
View Source
var CMDB_LIBREFERENCE_DELETE = apis.ApiSpec{
	Path:        "/api/lib-references/<id>",
	BackendPath: "/api/lib-references/<id>",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodDelete,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 删除库引用",
}
View Source
var CMDB_LIBREFERENCE_LIST = apis.ApiSpec{
	Path:         "/api/lib-references",
	BackendPath:  "/api/lib-references",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.LibReferenceListRequest{},
	ResponseType: apistructs.LibReferenceListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 库引用列表",
}
View Source
var CMDB_LIBREFERENCE_LIST_VERSION = apis.ApiSpec{
	Path:        "/api/lib-references/actions/fetch-versions",
	BackendPath: "/api/lib-references/actions/fetch-versions",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      http.MethodGet,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 获取模块订阅版本",
}
View Source
var CMDB_MY_PUBLISHERS_LIST = apis.ApiSpec{
	Path:         "/api/publishers/actions/list-my-publishers",
	BackendPath:  "/api/publishers/actions/list-my-publishers",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.PublisherListRequest{},
	ResponseType: apistructs.PublisherListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询我的Publisher列表",
}
View Source
var CMDB_ORG_CREATE = apis.ApiSpec{
	Path:         "/api/orgs",
	BackendPath:  "/api/orgs",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.OrgCreateRequest{},
	ResponseType: apistructs.OrgCreateResponse{},
	Doc:          "summary: 创建组织",
	Audit: func(ctx *spec.AuditContext) error {
		var requestBody apistructs.OrgCreateRequest
		if err := ctx.BindRequestData(&requestBody); err != nil {
			return err
		}
		var responseBody apistructs.OrgCreateResponse
		if err := ctx.BindResponseData(&responseBody); err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.SysScope,
			ScopeID:      1,
			OrgID:        responseBody.Data.ID,
			TemplateName: apistructs.CreateOrgTemplate,
			Context:      map[string]interface{}{"orgName": requestBody.Name},
		})
	},
}
View Source
var CMDB_ORG_DELETE = apis.ApiSpec{
	Path:        "/api/orgs/<orgID>",
	BackendPath: "/api/orgs/<orgID>",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "DELETE",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 删除企业",
	Audit: func(ctx *spec.AuditContext) error {
		orgID, err := ctx.GetParamInt64("orgID")
		if err != nil {
			return err
		}
		var response struct {
			Data apistructs.OrgDTO
		}
		if err := ctx.BindResponseData(&response); err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.SysScope,
			ScopeID:      1,
			OrgID:        uint64(orgID),
			TemplateName: apistructs.DeleteOrgTemplate,
			Context:      map[string]interface{}{"orgName": response.Data.Name},
		})
	},
}
View Source
var CMDB_ORG_FETCH = apis.ApiSpec{
	Path:         "/api/orgs/<orgID>",
	BackendPath:  "/api/orgs/<orgID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.OrgFetchRequest{},
	ResponseType: apistructs.OrgSearchResponse{},
	Doc:          "summary: 获取组织",
}
View Source
var CMDB_ORG_GET_BY_DOMAIN = apis.ApiSpec{
	Path:          "/api/orgs/actions/get-by-domain",
	BackendPath:   "/api/orgs/actions/get-by-domain",
	Host:          "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:        "http",
	Method:        "GET",
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	RequestType:   apistructs.OrgGetByDomainRequest{},
	ResponseType:  apistructs.OrgGetByDomainResponse{},
	Doc:           "summary: 通过域名获取组织",
}
View Source
var CMDB_ORG_NEXUS_FETCH = apis.ApiSpec{
	Path:         "/api/orgs/<orgID>/nexus",
	BackendPath:  "/api/orgs/<orgID>/nexus",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.OrgNexusGetRequest{},
	ResponseType: apistructs.OrgNexusGetResponse{},
	Doc:          "summary: 获取企业 nexus 信息",
}
View Source
var CMDB_ORG_NEXUS_SHOW_PASSWORD = apis.ApiSpec{
	Path:         "/api/orgs/<orgID>/show-nexus-password",
	BackendPath:  "/api/orgs/<orgID>/show-nexus-password",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.OrgNexusShowPasswordRequest{},
	ResponseType: apistructs.OrgNexusShowPasswordResponse{},
	Doc:          "summary: 获取企业 nexus 密码",
}
View Source
var CMDB_ORG_PUBLIC = apis.ApiSpec{
	Path:          "/api/orgs/actions/list-public",
	BackendPath:   "/api/orgs/actions/list-public",
	Host:          "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:        "http",
	Method:        "GET",
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	RequestType:   apistructs.OrgSearchRequest{},
	ResponseType:  apistructs.OrgSearchResponse{},
	Doc:           "summary: 查询公开组织",
}
View Source
var CMDB_ORG_PUBLISHER_CREATE = apis.ApiSpec{
	Path:        "/api/orgs/<orgID>/actions/create-publisher",
	BackendPath: "/api/orgs/<orgID>/actions/create-publisher",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 创建发布商",
}
View Source
var CMDB_ORG_PUBLISHER_CREATE_GET = apis.ApiSpec{
	Path:        "/api/orgs/<orgID>/actions/create-publisher",
	BackendPath: "/api/orgs/<orgID>/actions/create-publisher",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 创建发布商",
}
View Source
var CMDB_ORG_SEARCH = apis.ApiSpec{
	Path:          "/api/orgs",
	BackendPath:   "/api/orgs",
	Host:          "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:        "http",
	Method:        "GET",
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	RequestType:   apistructs.OrgSearchRequest{},
	ResponseType:  apistructs.OrgSearchResponse{},
	Doc:           "summary: 查询组织",
}
View Source
var CMDB_ORG_UPDATE = apis.ApiSpec{
	Path:         "/api/orgs/<orgID>",
	BackendPath:  "/api/orgs/<orgID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.OrgUpdateRequest{},
	ResponseType: apistructs.OrgUpdateRequestBody{},
	Doc:          "summary: 更新组织",
	Audit: func(ctx *spec.AuditContext) error {
		orgID, err := ctx.GetParamInt64("orgID")
		if err != nil {
			return err
		}
		org, err := ctx.GetOrg(orgID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.SysScope,
			ScopeID:      1,
			OrgID:        uint64(orgID),
			TemplateName: apistructs.UpdateOrgTemplate,
			Context:      map[string]interface{}{"orgName": org.Name},
		})
	},
}
View Source
var CMDB_PROJECTS_FETCH = apis.ApiSpec{
	Path:         "/api/projects",
	BackendPath:  "/api/projects",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ProjectListRequest{},
	ResponseType: apistructs.ProjectListResponse{},
	Doc:          "summary: 查询项目",
}

* add for standard

View Source
var CMDB_PROJECT_CREATE = apis.ApiSpec{
	Path:         "/api/projects",
	BackendPath:  "/api/projects",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ProjectCreateRequest{},
	ResponseType: apistructs.ProjectCreateResponse{},
	Doc:          "summary: 创建项目",
	Audit: func(ctx *spec.AuditContext) error {
		var requestBody apistructs.ProjectCreateRequest
		if err := ctx.BindRequestData(&requestBody); err != nil {
			return err
		}
		var responseBody apistructs.ProjectCreateResponse
		if err := ctx.BindResponseData(&responseBody); err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.OrgScope,
			ScopeID:      uint64(ctx.OrgID),
			ProjectID:    responseBody.Data,
			TemplateName: apistructs.CreateProjectTemplate,
			Context:      map[string]interface{}{"projectName": requestBody.Name},
		})
	},
}
View Source
var CMDB_PROJECT_DELETE = apis.ApiSpec{
	Path:         "/api/projects/<projectId>",
	BackendPath:  "/api/projects/<projectId>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ProjectDeleteRequest{},
	ResponseType: apistructs.ProjectDeleteResponse{},
	Doc:          "summary: 删除项目",
	Audit: func(ctx *spec.AuditContext) error {
		// 由于与删除project时产生审计事件所需要的返回一样,所以删除project时也用这个接收返回
		var responseBody apistructs.ProjectDetailResponse
		if err := ctx.BindResponseData(&responseBody); err != nil {
			return err
		}
		projectID := responseBody.Data.ID
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      projectID,
			ProjectID:    projectID,
			TemplateName: apistructs.DeleteProjectTemplate,
			Context:      map[string]interface{}{"projectName": responseBody.Data.Name},
		})
	},
}

* migration

View Source
var CMDB_PUBLISHERS_LIST = apis.ApiSpec{
	Path:         "/api/publishers",
	BackendPath:  "/api/publishers",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.PublisherListRequest{},
	ResponseType: apistructs.PublisherListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询所有Publisher列表",
}
View Source
var CMDB_PUBLISHER_CREATE = apis.ApiSpec{
	Path:         "/api/publishers",
	BackendPath:  "/api/publishers",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	RequestType:  apistructs.PublisherCreateRequest{},
	ResponseType: apistructs.PublisherCreateResponse{},
	Doc:          "summary: 创建 Publisher",
}
View Source
var CMDB_PUBLISHER_DELETE = apis.ApiSpec{
	Path:         "/api/publishers/<publisherID>",
	BackendPath:  "/api/publishers/<publisherID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	ResponseType: apistructs.PublisherDeleteResponse{},
	Doc:          "summary: 删除 Publisher",
}
View Source
var CMDB_PUBLISHER_GET = apis.ApiSpec{
	Path:         "/api/publishers/<publisherID>",
	BackendPath:  "/api/publishers/<publisherID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	ResponseType: apistructs.PublisherDetailResponse{},
	Doc:          "summary: 获取Publisher详情",
}
View Source
var CMDB_PUBLISHER_UPDATE = apis.ApiSpec{
	Path:         "/api/publishers",
	BackendPath:  "/api/publishers",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	RequestType:  apistructs.PublisherUpdateRequest{},
	ResponseType: apistructs.PublisherUpdateResponse{},
	Doc:          "summary: 更新 Publisher",
}
View Source
var CMDB_ROLES_LIST = apis.ApiSpec{
	Path:         "/api/members/actions/list-roles",
	BackendPath:  "/api/members/actions/list-roles",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.MemberRoleListResponse{},
	Doc:          "summary: 获取成员角色列表",
}
View Source
var CMDB_TICKET_CLOSE = apis.ApiSpec{
	Path:         "/api/tickets/<ticketID>/actions/close",
	BackendPath:  "/api/tickets/<ticketID>/actions/close",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.TicketCloseRequest{},
	ResponseType: apistructs.TicketCloseResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 关闭工单",
}
View Source
var CMDB_TICKET_CREATE = apis.ApiSpec{
	Path:         "/api/tickets",
	BackendPath:  "/api/tickets",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.TicketCreateRequest{},
	ResponseType: apistructs.TicketCreateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建工单",
}
View Source
var CMDB_TICKET_DELETE = apis.ApiSpec{
	Path:         "/api/tickets/<ticketID>",
	BackendPath:  "/api/tickets/<ticketID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.TicketDeleteRequest{},
	ResponseType: apistructs.TicketDeleteResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 删除工单",
}
View Source
var CMDB_TICKET_FETCH = apis.ApiSpec{
	Path:         "/api/tickets/<ticketID>",
	BackendPath:  "/api/tickets/<ticketID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.TicketFetchRequest{},
	ResponseType: apistructs.TicketFetchResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取工单详情",
}
View Source
var CMDB_TICKET_LIST = apis.ApiSpec{
	Path:         "/api/tickets",
	BackendPath:  "/api/tickets",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.TicketListRequest{},
	ResponseType: apistructs.TicketListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 工单列表",
}
View Source
var CMDB_TICKET_REOPEN = apis.ApiSpec{
	Path:         "/api/tickets/<ticketID>/actions/reopen",
	BackendPath:  "/api/tickets/<ticketID>/actions/reopen",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.TicketReopenRequest{},
	ResponseType: apistructs.TicketReopenResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 重新打开已关闭工单",
}
View Source
var CMDB_TICKET_UPDATE = apis.ApiSpec{
	Path:         "/api/tickets/<ticketID>",
	BackendPath:  "/api/tickets/<ticketID>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.TicketUpdateRequest{},
	ResponseType: apistructs.TicketUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 更新工单",
}
View Source
var CreateAPIAsset = apis.ApiSpec{
	Path:         "/api/api-assets",
	BackendPath:  "/api/api-assets",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.APIAssetCreateRequest{},
	ResponseType: nil,
	Doc:          "创建 API 资料",
}
View Source
var CreateAPIAssetVersion = apis.ApiSpec{
	Path:        "/api/api-assets/<assetID>/versions",
	BackendPath: "/api/api-assets/<assetID>/versions",
	Host:        APIMAddr,
	Scheme:      "http",
	Method:      http.MethodPost,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: &apistructs.APIAssetVersionCreateRequest{
		OrgID:            0,
		APIAssetID:       "",
		Major:            0,
		Minor:            0,
		Patch:            0,
		Desc:             "",
		SpecProtocol:     "",
		SpecDiceFileUUID: "",
		Spec:             "",
		Inode:            "",
		Instances:        nil,
		IdentityInfo:     apistructs.IdentityInfo{},
		Source:           "",
		AppID:            0,
		Branch:           "",
		ServiceName:      "",
	},
	ResponseType: apistructs.CreateAPIAssetVersionBody{},
	Doc:          "新增 API 资料版本",
}
View Source
var CreateAccess = apis.ApiSpec{
	Path:         "/api/api-access",
	BackendPath:  "/api/api-access",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CreateAccessReq{},
	ResponseType: nil,
	Doc:          "create access",
}
View Source
var CreateAttempTest = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/attempt-test",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/attempt-test",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.APITestReq{},
	ResponseType: apistructs.Header{},
	Doc:          "list access",
}
View Source
var CreateClient = apis.ApiSpec{
	Path:         "/api/api-clients",
	BackendPath:  "/api/api-clients",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CreateClientReq{},
	ResponseType: nil,
	Doc:          "create client",
}
View Source
var CreateContract = apis.ApiSpec{
	Path:         "/api/api-clients/<clientID>/contracts",
	BackendPath:  "/api/api-clients/<clientID>/contracts",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CreateContractReq{},
	ResponseType: nil,
	Doc:          "create contract",
}
View Source
var CreateInstantiation = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/minors/<minor>/instantiations",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/minors/<minor>/instantiations",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CreateInstantiationReq{},
	ResponseType: nil,
	Doc:          "create instantiation",
}
View Source
var CreateSLA = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CreateSLAReq{},
	ResponseType: apistructs.Header{},
	Doc:          "create SLA",
}
View Source
var DeleteAPIAssetVersion = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/versions/<versionID>",
	BackendPath:  "/api/api-assets/<assetID>/versions/<versionID>",
	Method:       http.MethodDelete,
	Host:         APIMAddr,
	Scheme:       "http",
	CheckLogin:   true,
	Doc:          "删除指定版本的 API 资料",
	RequestType:  nil,
	ResponseType: nil,
}
View Source
var DeleteAPIAssets = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>",
	BackendPath:  "/api/api-assets/<assetID>",
	Method:       http.MethodDelete,
	Host:         APIMAddr,
	Scheme:       "http",
	CheckLogin:   true,
	Doc:          "删除 API 资料",
	RequestType:  nil,
	ResponseType: nil,
}
View Source
var DeleteAccess = apis.ApiSpec{
	Path:         "/api/api-access/<accessID>",
	BackendPath:  "/api/api-access/<accessID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodDelete,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "delete access",
}
View Source
var DeleteClient = apis.ApiSpec{
	Path:         "/api/api-clients/<clientID>",
	BackendPath:  "/api/api-clients/<clientID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodDelete,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "delete client",
}
View Source
var DeleteContract = apis.ApiSpec{
	Path:         "/api/api-clients/<clientID>/contracts/<contractID>",
	BackendPath:  "/api/api-clients/<clientID>/contracts/<contractID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodDelete,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.GetContractReq{},
	ResponseType: nil,
	Doc:          "delete contract",
}
View Source
var DeleteSLA = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas/<slaID>",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas/<slaID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodDelete,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.DeleteSLAReq{},
	ResponseType: apistructs.Header{},
	Doc:          "delete SLA",
}
View Source
var ExportSpec = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/versions/<versionID>/export",
	BackendPath:  "/api/api-assets/<assetID>/versions/<versionID>/export",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	RequestType:  apistructs.DownloadSpecTextReq{},
	ResponseType: nil,
	Doc:          "导出 swagger 文本",
}
View Source
var FileTreeCreateNode = apis.ApiSpec{
	Path:         "/api/apim/<treeName>/filetree",
	BackendPath:  "/api/apim/<treeName>/filetree",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.APIDocCreateNodeReq{},
	ResponseType: nil,
	Doc:          "create file tree node",
}
View Source
var FileTreeDeleteNode = apis.ApiSpec{
	Path:         "/api/apim/<treeName>/filetree/<inode>",
	BackendPath:  "/api/apim/<treeName>/filetree/<inode>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodDelete,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "delete file tree node",
}
View Source
var FileTreeGetNode = apis.ApiSpec{
	Path:         "/api/apim/<treeName>/filetree/<inode>",
	BackendPath:  "/api/apim/<treeName>/filetree/<inode>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "get file tree node",
}
View Source
var FileTreeListNodes = apis.ApiSpec{
	Path:         "/api/apim/<treeName>/filetree",
	BackendPath:  "/api/apim/<treeName>/filetree",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "list file tree nodes",
}
View Source
var FileTreeMvCpNode = apis.ApiSpec{
	Path:         "/api/apim/<treeName>/filetree/<inode>/actions/<action>",
	BackendPath:  "/api/apim/<treeName>/filetree/<inode>/actions/<action>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "mv or cp file tree node",
}
View Source
var FileTreeUpdateNode = apis.ApiSpec{
	Path:         "/api/apim/<treeName>/filetree/<inode>",
	BackendPath:  "/api/apim/<treeName>/filetree/<inode>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "update file tree node",
}
View Source
var GetAPIAssetVersion = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/versions/<versionID>",
	BackendPath:  "/api/api-assets/<assetID>/versions/<versionID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	RequestType:  apistructs.GetAPIAssetVersionReq{},
	ResponseType: apistructs.GetAssetVersionRsp{},
	Doc:          "查询 API 资料版本详情",
}
View Source
var GetAPIAssets = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>",
	BackendPath:  "/api/api-assets/<assetID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	RequestType:  apistructs.GetAPIAssetReq{},
	ResponseType: apistructs.APIAssetGetResponse{},
	Doc:          "查询 API 资料",
}
View Source
var GetAccess = apis.ApiSpec{
	Path:         "/api/api-access/<accessID>",
	BackendPath:  "/api/api-access/<accessID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "get access",
	Parameters: &apis.Parameters{
		Tag:    "apim",
		Header: nil,
		QueryValues: url.Values{
			"accessID": nil,
		},
		Body:     nil,
		Response: &apistructs.GetAccessRspAccess{},
	},
}
View Source
var GetClient = apis.ApiSpec{
	Path:         "/api/api-clients/<clientID>",
	BackendPath:  "/api/api-clients/<clientID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.GetClientReq{},
	ResponseType: nil,
	Doc:          "get client",
}
View Source
var GetContract = apis.ApiSpec{
	Path:         "/api/api-clients/<clientID>/contracts/<contractID>",
	BackendPath:  "/api/api-clients/<clientID>/contracts/<contractID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.GetContractReq{},
	ResponseType: nil,
	Doc:          "get contract",
}
View Source
var GetInstantiations = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/minors/<minor>/instantiations",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/minors/<minor>/instantiations",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.GetInstantiationsReq{},
	ResponseType: apistructs.GetAddonInstanceDetailResponse{},
	Doc:          "get instantiations",
}
View Source
var GetOperation = apis.ApiSpec{
	Path:         "/api/apim/operations/<id>",
	BackendPath:  "/api/apim/operations/<id>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.GetOperationReq{},
	ResponseType: apistructs.BaseResponse{},
	Doc:          "搜索集市中的接口",
}
View Source
var GetSLA = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas/<slaID>",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas/<slaID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ListSLAsReq{},
	ResponseType: apistructs.ListSLAsRsp{},
	Doc:          "get SLA",
}
View Source
var ListAPIAssetVersions = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/versions",
	BackendPath:  "/api/api-assets/<assetID>/versions",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	RequestType:  apistructs.GetAPIAssetVersionReq{},
	ResponseType: apistructs.GetAssetVersionRsp{},
	Doc:          "查询 API 资料版本列表",
}
View Source
var ListAPIGateways = apis.ApiSpec{
	Path:         "api/api-assets/<assetID>/api-gateways",
	BackendPath:  "api/api-assets/<assetID>/api-gateways",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ListAPIGatewaysReq{},
	ResponseType: map[string]interface{}{"total": 0, "list": nil},
	Doc:          "list api-gateways",
}
View Source
var ListAccess = apis.ApiSpec{
	Path:         "/api/api-access",
	BackendPath:  "/api/api-access",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ListAccessReq{},
	ResponseType: apistructs.ListAccessRsp{},
	Doc:          "list access",
}
View Source
var ListContract = apis.ApiSpec{
	Path:         "/api/api-clients/<clientID>/contracts",
	BackendPath:  "/api/api-clients/<clientID>/contracts",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ListContractsReq{},
	ResponseType: apistructs.ListContractsRsp{},
	Doc:          "list contract",
}
View Source
var ListContractRecords = apis.ApiSpec{
	Path:         "/api/api-clients/<clientID>/contracts/<contractID>/operation-records",
	BackendPath:  "/api/api-clients/<clientID>/contracts/<contractID>/operation-records",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ListContractRecordsReq{},
	ResponseType: apistructs.ListContractRecordsRsp{},
	Doc:          "list contract records",
}
View Source
var ListInstantiations = apis.ApiSpec{
	Path:         "/api/api-instantiations",
	BackendPath:  "/api/api-instantiations",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "get instantiations",
}
View Source
var ListMyClients = apis.ApiSpec{
	Path:         "/api/api-clients",
	BackendPath:  "/api/api-clients",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ListMyClientsReq{},
	ResponseType: nil,
	Doc:          "list my client",
}
View Source
var ListProjectAPIGateways = apis.ApiSpec{
	Path:         "api/api-gateways/<projectID>",
	BackendPath:  "api/api-gateways/<projectID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ListProjectAPIGatewaysReq{},
	ResponseType: map[string]interface{}{"total": 0, "list": nil},
	Doc:          "list api-gateways",
}
View Source
var ListRuntimeServices = apis.ApiSpec{
	Path:         "/api/api-app-services/<appID>",
	BackendPath:  "/api/api-app-services/<appID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: apistructs.Header{},
	Doc:          "list access",
}
View Source
var ListSLA = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.GetSLAReq{},
	ResponseType: apistructs.GetSLARsp{},
	Doc:          "list SLA",
}
View Source
var ListSwaggerVersionClients = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/clients",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/clients",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ListSwaggerVersionClientsReq{},
	ResponseType: apistructs.ListSwaggerVersionRsp{},
	Doc:          "list swagger version clients",
}
View Source
var ListSwaggerVersions = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ListSwaggerVersionsReq{},
	ResponseType: apistructs.ListSwaggerVersionRsp{},
	Doc:          "list swagger versions",
}
View Source
var PagingAPIAssets = apis.ApiSpec{
	Path:         "/api/api-assets",
	BackendPath:  "/api/api-assets",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	RequestType:  apistructs.PagingAPIAssetsReq{},
	ResponseType: apistructs.APIAssetPagingResponse{},
	Doc:          "分页查询 API 资料",
}
View Source
var ProxyMetrics = apis.ApiSpec{
	Path:         "/api/apim/metrics/<*>",
	BackendPath:  "/api/apim/metrics/<*>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "转发 metrics 请求",
}
View Source
var QA_APITESTS_CANCEL = apis.ApiSpec{
	Path:         "/api/apitests/actions/cancel-testplan",
	BackendPath:  "/api/apitests/actions/cancel-testplan",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ApiTestCancelRequest{},
	ResponseType: apistructs.ApiTestCancelResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 取消测试计划",
}
View Source
var QA_APITESTS_GET = apis.ApiSpec{
	Path:         "/api/apitests/<id>",
	BackendPath:  "/api/apitests/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.ApiTestsGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取apitest详情",
}
View Source
var QA_APITESTS_UPDATE = apis.ApiSpec{
	Path:         "/api/apitests/<id>",
	BackendPath:  "/api/apitests/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ApiTestsUpdateRequest{},
	ResponseType: apistructs.ApiTestsUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          `更新 api test的信息`,
}
View Source
var QA_AUTOTEST_SPACE_GET = apis.ApiSpec{
	Path:         "/api/autotests/spaces/<id>",
	BackendPath:  "/api/autotests/spaces/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.AutoTestSpaceResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取autotest-space详情",
}
View Source
var QA_PIPELINE_TASK_LOGS = apis.ApiSpec{
	Path:         "/api/apitests/pipeline/<pipelineID>/task/<taskID>/logs",
	BackendPath:  "/api/apitests/pipeline/<pipelineID>/task/<taskID>/logs",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.DashboardSpotLogResponse{},
	Doc:          "summary: 查询测试记录的pipeline task 日志",
}
View Source
var QA_RECORDS_GET = apis.ApiSpec{
	Path:         "/api/test-file-records/<id>",
	BackendPath:  "/api/test-file-records/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: get file record",
	ResponseType: apistructs.GetTestFileRecordResponse{},
	IsOpenAPI:    true,
}
View Source
var QA_RECORDS_LIST = apis.ApiSpec{
	Path:         "/api/test-file-records",
	BackendPath:  "/api/test-file-records",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: get file records",
	RequestType:  apistructs.ListTestFileRecordsRequest{},
	ResponseType: apistructs.ListTestFileRecordsResponse{},
	IsOpenAPI:    true,
}
View Source
var QA_SONAR_GET_CREDENTIAL = apis.ApiSpec{
	Path:         "/api/qa/actions/get-sonar-credential",
	BackendPath:  "/api/qa/actions/get-sonar-credential",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   false,
	CheckToken:   true,
	Doc:          "summary: action 获取 sonar credential",
	ResponseType: apistructs.SonarCredentialGetResponse{},
}
View Source
var QA_SONAR_ISSUES = apis.ApiSpec{
	Path:         "/api/qa",
	BackendPath:  "/api/qa",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 获取 sonar issues",
	ResponseType: apistructs.SonarIssueResponse{},
	IsOpenAPI:    true,
}
View Source
var QA_SONAR_METRIC_RULES_BATCH_DELETE = apis.ApiSpec{
	Path:        "/api/sonar-metric-rules/actions/batch-delete",
	BackendPath: "/api/sonar-metric-rules/actions/batch-delete",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "DELETE",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 批量删除 sonar 扫描规则",
	RequestType: apistructs.SonarMetricRulesBatchDeleteRequest{},
	IsOpenAPI:   true,
}
View Source
var QA_SONAR_METRIC_RULES_BATCH_INSERT = apis.ApiSpec{
	Path:        "/api/sonar-metric-rules/actions/batch-insert",
	BackendPath: "/api/sonar-metric-rules/actions/batch-insert",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 批量插入 sonar 扫描规则",
	RequestType: apistructs.SonarMetricRulesBatchInsertRequest{},
	IsOpenAPI:   true,
}
View Source
var QA_SONAR_METRIC_RULES_DELETE = apis.ApiSpec{
	Path:        "/api/sonar-metric-rules/<id>",
	BackendPath: "/api/sonar-metric-rules/<id>",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "DELETE",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 删除 sonar 扫描规则",
	RequestType: apistructs.SonarMetricRulesDeleteRequest{},
	IsOpenAPI:   true,
}
View Source
var QA_SONAR_METRIC_RULES_GET = apis.ApiSpec{
	Path:        "/api/sonar-metric-rules/<id>",
	BackendPath: "/api/sonar-metric-rules/<id>",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 查询 sonar 扫描规则",
	IsOpenAPI:   true,
}
View Source
var QA_SONAR_METRIC_RULES_PAGING = apis.ApiSpec{
	Path:        "/api/sonar-metric-rules",
	BackendPath: "/api/sonar-metric-rules",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 分页查询 sonar 扫描规则",
	RequestType: apistructs.SonarMetricRulesPagingRequest{},
	IsOpenAPI:   true,
}
View Source
var QA_SONAR_METRIC_RULES_QUERY_DEFINITION = apis.ApiSpec{
	Path:        "/api/sonar-metric-rules/actions/query-metric-definition",
	BackendPath: "/api/sonar-metric-rules/actions/query-metric-definition",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 查询 sonar 还未添加的扫描规则",
	RequestType: apistructs.SonarMetricRulesDefinitionListRequest{},
	IsOpenAPI:   true,
}
View Source
var QA_SONAR_METRIC_RULES_QUERY_LIST = apis.ApiSpec{
	Path:        "/api/sonar-metric-rules/actions/query-list",
	BackendPath: "/api/sonar-metric-rules/actions/query-list",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 查询 sonar 的配置列表",
	RequestType: apistructs.SonarMetricRulesListRequest{},
	IsOpenAPI:   true,
}
View Source
var QA_SONAR_METRIC_RULES_UPDATE = apis.ApiSpec{
	Path:        "/api/sonar-metric-rules/<id>",
	BackendPath: "/api/sonar-metric-rules/<id>",
	Host:        "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:      "http",
	Method:      "PUT",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 更新 sonar 扫描规则",
	RequestType: apistructs.SonarMetricRulesUpdateRequest{},
	IsOpenAPI:   true,
}
View Source
var QA_TESTENV_CREATE = apis.ApiSpec{
	Path:         "/api/testenv",
	BackendPath:  "/api/testenv",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	ResponseType: apistructs.APITestEnvCreateRequest{},
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	Doc:          `summary: 更新项目环境变量信息`,
	Audit: func(ctx *spec.AuditContext) error {
		var req apistructs.APITestEnvCreateRequest
		if err := ctx.BindRequestData(&req); err != nil {
			return err
		}
		project, err := ctx.GetProject(req.EnvID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      project.ID,
			TemplateName: apistructs.QaTestEnvCreateTemplate,
			Context: map[string]interface{}{
				"projectName": project.Name,
				"testEnvName": req.Name,
			},
		})
	},
}
View Source
var QA_TESTENV_DELETE = apis.ApiSpec{
	Path:         "/api/testenv/<id>",
	BackendPath:  "/api/testenv/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.APITestEnvDeleteResponse{},
	Doc:          `summary: 更新项目环境变量信息`,
	Audit: func(ctx *spec.AuditContext) error {
		var resp apistructs.APITestEnvDeleteResponse
		if err := ctx.BindResponseData(&resp); err != nil {
			return err
		}
		project, err := ctx.GetProject(resp.Data.EnvID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      project.ID,
			TemplateName: apistructs.QaTestEnvDeleteTemplate,
			Context: map[string]interface{}{
				"projectName": project.Name,
				"testEnvName": resp.Data.Name,
			},
		})
	},
}
View Source
var QA_TESTENV_GET = apis.ApiSpec{
	Path:         "/api/testenv/<id>",
	BackendPath:  "/api/testenv/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.APITestEnvGetResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取API项目测试的环境变量信息",
}
View Source
var QA_TESTENV_LIST = apis.ApiSpec{
	Path:         "/api/testenv/actions/list-envs",
	BackendPath:  "/api/testenv/actions/list-envs",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 获取项目API测试环境变量列表",
	ResponseType: apistructs.APITestEnvListResponse{},
	IsOpenAPI:    true,
}
View Source
var QA_TESTENV_UPDATE = apis.ApiSpec{
	Path:         "/api/testenv/<id>",
	BackendPath:  "/api/testenv/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.APITestEnvUpdateRequest{},
	ResponseType: apistructs.APITestEnvUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          `更新项目环境变量信息`,
	Audit: func(ctx *spec.AuditContext) error {
		var req apistructs.APITestEnvUpdateRequest
		if err := ctx.BindRequestData(&req); err != nil {
			return err
		}
		project, err := ctx.GetProject(req.EnvID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      project.ID,
			TemplateName: apistructs.QaTestEnvUpdateTemplate,
			Context: map[string]interface{}{
				"projectName": project.Name,
				"testEnvName": req.Name,
			},
		})
	},
}
View Source
var QA_TESTPLAN_PIPELINE_DETAIL = apis.ApiSpec{
	Path:         "/api/apitests/pipeline/<pipelineId>",
	BackendPath:  "/api/apitests/pipeline/<pipelineId>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.PipelineDetailResponse{},
	Doc:          "summary: 查询测试记录的pipeline详情",
}
View Source
var QA_TEST_CALLBACK = apis.ApiSpec{
	Path:         "/api/qa/actions/test-callback",
	BackendPath:  "/api/qa/actions/test-callback",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 测试结果回调",
	RequestType:  apistructs.TestCallBackRequest{},
	ResponseType: apistructs.TestCallBackResponse{},
	IsOpenAPI:    true,
}
View Source
var QA_TEST_DETAIL = apis.ApiSpec{
	Path:         "/api/qa/test/<id>",
	BackendPath:  "/api/qa/test/<id>",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 获取测试详情",
	ResponseType: apistructs.TestDetailRecordResponse{},
	IsOpenAPI:    true,
}
View Source
var QA_TEST_LIST = apis.ApiSpec{
	Path:         "/api/qa/actions/test-list",
	BackendPath:  "/api/qa/actions/test-list",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 获取测试列表",
	ResponseType: apistructs.TestRecordsResponse{},
	IsOpenAPI:    true,
}
View Source
var QA_TEST_TYPES = apis.ApiSpec{
	Path:         "/api/qa/actions/all-test-type",
	BackendPath:  "/api/qa/actions/all-test-type",
	Host:         "dop.marathon.l4lb.thisdcos.directory:9527",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	Doc:          "summary: 获取测试类型",
	ResponseType: apistructs.TestTypesResponse{},
	IsOpenAPI:    true,
}
View Source
var SPOT_APITESTS_LOGS = apis.ApiSpec{
	Path:        "/api/apitests/logs",
	BackendPath: "/api/logs",
	Host:        "monitor.marathon.l4lb.thisdcos.directory:7096",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 查询 apitest 的日志内容",
}
View Source
var SPOT_APITESTS_LOGS_DOWNLOAD = apis.ApiSpec{
	Path:        "/api/apitests/logs/actions/download",
	BackendPath: "/api/logs/actions/download",
	Host:        "monitor.marathon.l4lb.thisdcos.directory:7096",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	ChunkAPI:    true,
	Doc:         "summary: Apitests 下载日志内容",
}
View Source
var SearchOperations = apis.ApiSpec{
	Path:         "/api/apim/operations",
	BackendPath:  "/api/apim/operations",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.SearchOperationsReq{},
	ResponseType: apistructs.BaseResponse{},
	Doc:          "搜索集市中的接口",
}
View Source
var UpdateAPIAssset = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>",
	BackendPath:  "/api/api-assets/<assetID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.UpdateAPIAssetReq{},
	ResponseType: nil,
	Doc:          "修改 API 资料",
}
View Source
var UpdateAccess = apis.ApiSpec{
	Path:         "/api/api-access/<accessID>",
	BackendPath:  "/api/api-access/<accessID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "update access",
}
View Source
var UpdateAssetVersion = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/versions/<versionID>",
	BackendPath:  "/api/api-assets/<assetID>/versions/<versionID>",
	Method:       http.MethodPut,
	Host:         APIMAddr,
	Scheme:       "http",
	CheckLogin:   true,
	Doc:          "修改指定版本的 API 资料",
	RequestType:  apistructs.UpdateAssetVersionReq{},
	ResponseType: apistructs.Header{},
}
View Source
var UpdateClient = apis.ApiSpec{
	Path:         "/api/api-clients/<clientID>",
	BackendPath:  "/api/api-clients/<clientID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.UpdateClientReq{},
	ResponseType: map[string]interface{}{"client": "", "sk": ""},
	Doc:          "get client",
}
View Source
var UpdateContract = apis.ApiSpec{
	Path:         "/api/api-clients/<clientID>/contracts/<contractID>",
	BackendPath:  "/api/api-clients/<clientID>/contracts/<contractID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "update contract",
}
View Source
var UpdateInstantiation = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/minors/<minor>/instantiations/<instantiationID>",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/minors/<minor>/instantiations/<instantiationID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.UpdateInstantiationReq{},
	ResponseType: nil,
	Doc:          "update instantiation",
}
View Source
var UpdateSLA = apis.ApiSpec{
	Path:         "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas/<slaID>",
	BackendPath:  "/api/api-assets/<assetID>/swagger-versions/<swaggerVersion>/slas/<slaID>",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.UpdateSLAReq{},
	ResponseType: apistructs.Header{},
	Doc:          "update SLA",
}
View Source
var ValidateSwagger = apis.ApiSpec{
	Path:         "/api/apim/validate-swagger",
	BackendPath:  "/api/apim/validate-swagger",
	Host:         APIMAddr,
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   false,
	CheckToken:   false,
	RequestType:  map[string]string{"content": ""},
	ResponseType: nil,
	Doc:          "validate swagger",
}

Functions

This section is empty.

Types

This section is empty.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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