cmdb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 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

This section is empty.

Variables

View Source
var APP_PUBLISH_ITEM_RELATION_GET = apis.ApiSpec{
	Path:         "/api/applications/<application>/actions/get-publish-item-relations",
	BackendPath:  "/api/applications/<application>/actions/get-publish-item-relations",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.QueryAppPublishItemRelationResponse{},
	Doc:          "summary: 查询应用发布关联",
}
View Source
var APP_PUBLISH_ITEM_RELATION_UPDATE = apis.ApiSpec{
	Path:         "/api/applications/<application>/actions/update-publish-item-relations",
	BackendPath:  "/api/applications/<application>/actions/update-publish-item-relations",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.UpdateAppPublishItemRelationRequest{},
	ResponseType: apistructs.UpdateAppPublishItemRelationResponse{},
	Doc:          "summary: 更新应用发布关联",
}
View Source
var CMDB_ABNORMAL_HOSTS_LIST = apis.ApiSpec{
	Path:         "/api/hosts/actions/statistics-abnormal",
	BackendPath:  "/api/hosts/actions/statistics-abnormal",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.AbnormalHostUsageListRequest{},
	ResponseType: apistructs.AbnormalHostUsageListResponse{},
	Doc:          "异常主机资源使用列表详情",
}
View Source
var CMDB_ACCOUNT_CREATE = apis.ApiSpec{
	Path:         "/api/cloud-accounts",
	BackendPath:  "/api/cloud-accounts",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CloudAccountCreateRequest{},
	ResponseType: apistructs.CloudAccountCreateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建云账号",
}
View Source
var CMDB_ACCOUNT_DELETE = apis.ApiSpec{
	Path:         "/api/cloud-accounts/<accountID>",
	BackendPath:  "/api/cloud-accounts/<accountID>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.CloudAccountDeleteResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 删除云账号",
}
View Source
var CMDB_ACCOUNT_LIST = apis.ApiSpec{
	Path:         "/api/cloud-accounts",
	BackendPath:  "/api/cloud-accounts",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.CloudAccountListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取云账号列表",
}
View Source
var CMDB_ACCOUNT_UPDATE = apis.ApiSpec{
	Path:         "/api/cloud-accounts/<accountID>",
	BackendPath:  "/api/cloud-accounts/<accountID>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.CloudAccountListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取云账号列表",
}
View Source
var CMDB_APPLICATIONS_LIST = apis.ApiSpec{
	Path:         "/api/applications",
	BackendPath:  "/api/applications",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ApplicationListRequest{},
	ResponseType: apistructs.ApplicationListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询应用",
}

* add for standard

View Source
var CMDB_APPLICATION_CREATE = apis.ApiSpec{
	Path:         "/api/applications",
	BackendPath:  "/api/applications",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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_APPLICATION_FETCH = apis.ApiSpec{
	Path:         "/api/applications/<applicationId>",
	BackendPath:  "/api/applications/<applicationId>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ApplicationFetchRequest{},
	ResponseType: apistructs.ApplicationFetchResponse{},
	Doc:          "summary: 获取应用",
}
View Source
var CMDB_APPLICATION_INIT = apis.ApiSpec{
	Path:        "/api/applications/<applicationId>/actions/init",
	BackendPath: "/api/applications/<applicationId>/actions/init",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "PUT",
	RequestType: apistructs.ApplicationInitRequest{},
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 应用初始化",
}
View Source
var CMDB_APPLICATION_PIN = apis.ApiSpec{
	Path:        "/api/applications/<applicationId>/actions/pin",
	BackendPath: "/api/applications/<applicationId>/actions/pin",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "PUT",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: pin应用",
}
View Source
var CMDB_APPLICATION_UNPIN = apis.ApiSpec{
	Path:        "/api/applications/<applicationId>/actions/unpin",
	BackendPath: "/api/applications/<applicationId>/actions/unpin",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "PUT",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: unpin应用",
}
View Source
var CMDB_APPLICATION_UPDATE = apis.ApiSpec{
	Path:         "/api/applications/<applicationId>",
	BackendPath:  "/api/applications/<applicationId>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ApplicationUpdateRequest{},
	ResponseType: apistructs.ApplicationUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 更新应用",
	Audit: func(ctx *spec.AuditContext) error {
		appID, err := ctx.GetParamInt64("applicationId")
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    "app",
			ScopeID:      uint64(appID),
			TemplateName: apistructs.UpdateAppTemplate,
			Context:      make(map[string]interface{}, 0),
		})
	},
}
View Source
var CMDB_APPROVE_CREATE = apis.ApiSpec{
	Path:         "/api/approves",
	BackendPath:  "/api/approves",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	RequestType:  apistructs.ApproveCreateRequest{},
	ResponseType: apistructs.ApproveCreateResponse{},
	Doc:          "summary: 创建审批",
}
View Source
var CMDB_APPROVE_GET = apis.ApiSpec{
	Path:         "/api/approves/<approveId>",
	BackendPath:  "/api/approves/<approveId>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	ResponseType: apistructs.ApproveDetailResponse{},
	Doc:          "summary: 获取审批详情",
}
View Source
var CMDB_APPROVE_LIST = apis.ApiSpec{
	Path:         "/api/approves/actions/list-approves",
	BackendPath:  "/api/approves/actions/list-approves",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ApproveListRequest{},
	ResponseType: apistructs.PagingApproveDTO{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询所有审批列表",
}
View Source
var CMDB_APPROVE_UPDATE = apis.ApiSpec{
	Path:         "/api/approves/<approveId>",
	BackendPath:  "/api/approves/<approveId>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	RequestType:  apistructs.ApproveUpdateRequest{},
	ResponseType: apistructs.ApproveUpdateResponse{},
	Doc:          "summary: 更新审批",
}
View Source
var CMDB_APP_LIST_TEMPLATES = apis.ApiSpec{
	Path:        "/api/applications/actions/list-templates",
	BackendPath: "/api/applications/actions/list-templates",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	IsOpenAPI:   true,
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 应用模板列表",
}
View Source
var CMDB_AUDITS_EXPORT = apis.ApiSpec{
	Path:        "/api/audits/actions/export-excel",
	BackendPath: "/api/audits/actions/export-excel",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      http.MethodGet,
	IsOpenAPI:   true,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.AuditsListRequest{},
	Doc:         "summary: 导出审计事件",
}
View Source
var CMDB_AUDITS_LIST = apis.ApiSpec{
	Path:         "/api/audits/actions/list",
	BackendPath:  "/api/audits/actions/list",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.AuditsListRequest{},
	ResponseType: apistructs.AuditsListResponse{},
	Doc:          "summary: List 审计事件",
}
View Source
var CMDB_AUDITS_LIST_SET = apis.ApiSpec{
	Path:         "/api/audits/actions/setting",
	BackendPath:  "/api/audits/actions/setting",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.AuditListCleanCronRequest{},
	ResponseType: apistructs.AuditListCleanCronResponse{},
	Doc:          "summary: 查看审计事件设置",
}
View Source
var CMDB_AUDITS_SET = apis.ApiSpec{
	Path:         "/api/audits/actions/setting",
	BackendPath:  "/api/audits/actions/setting",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodPut,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.AuditSetCleanCronRequest{},
	ResponseType: apistructs.AuditSetCleanCronResponse{},
	Doc:          "summary: 更新审计事件设置",
}
View Source
var CMDB_BACKUP_DOWNLOAD = apis.ApiSpec{
	Path:          "/api/backup/<uuid>",
	BackendPath:   "/api/files/<uuid>",
	Host:          "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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_CLUSTER_CREATE = apis.ApiSpec{
	Path:         "/api/clusters",
	BackendPath:  "/api/clusters",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ClusterCreateRequest{},
	ResponseType: apistructs.ClusterCreateResponse{},
	Doc:          "summary: 创建集群",
	Audit: func(ctx *spec.AuditContext) error {
		var request apistructs.ClusterCreateRequest
		if err := ctx.BindRequestData(&request); err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.OrgScope,
			ScopeID:      uint64(ctx.OrgID),
			TemplateName: apistructs.ImportClusterTemplate,
			Context: map[string]interface{}{
				"clusterName": request.Name,
			},
		})
	},
}
View Source
var CMDB_CLUSTER_DEREFERENCE = apis.ApiSpec{
	Path:         "/api/clusters/actions/dereference",
	BackendPath:  "/api/clusters/actions/dereference",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.DereferenceClusterRequest{},
	ResponseType: apistructs.DereferenceClusterResponse{},
	Doc:          "summary: 解除企业关联集群关系",
	Audit: func(ctx *spec.AuditContext) error {
		orgIDStr := ctx.Request.URL.Query().Get("orgID")
		if orgIDStr == "" {
			err := fmt.Errorf("get orgID failed")
			return err
		}

		clusterName := ctx.Request.URL.Query().Get("clusterName")
		if clusterName == "" {
			err := fmt.Errorf("get clusterName failed")
			return err
		}

		orgID, err := strconv.Atoi(orgIDStr)
		if err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			OrgID:        uint64(orgID),
			ScopeType:    apistructs.OrgScope,
			ScopeID:      uint64(orgID),
			TemplateName: apistructs.ClusterDereferenceTemplate,
			Context: map[string]interface{}{
				"clusterName": clusterName,
			},
		})
	},
}
View Source
var CMDB_CLUSTER_FETCH = apis.ApiSpec{
	Path:         "/api/clusters/<idOrName>",
	BackendPath:  "/api/clusters/<idOrName>",
	Method:       "GET",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	CheckLogin:   true,
	ResponseType: apistructs.ClusterFetchResponse{},
	Doc:          "summary: 根据集群ID或名称获取集群详细信息",
}
View Source
var CMDB_CLUSTER_INSTANCES = apis.ApiSpec{
	Path:        "/api/cmdb/clusters/<cluster>/instances",
	BackendPath: "/api/clusters/<cluster>/instances",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	Doc: `
summary: 获取某集群下的批量实例信息
parameters:
  - in: path
    name: cluster
    type: string
    required: true
    description: 集群名或者ID
  - in: query
    name: type
    type: string
    required: true
    enum: [cluster, host, project, application, runtime, service, component, addon]
    description: 指定请求实例的类型
    example: project
  - in: query
    name: host
    type: string
    description: type 等于 host时,若输入 host,则获取指定 host 信息;如果没有输入,则获取整个集群所有的 hosts 信息
  - in: query
    name: project
    type: string
    description: type 等于 project时,若输入 project,则获取指定 project 实例信息;如果没有输入,则获取整个集群所有的 projects 实例信息
  - in: query
    name: application
    type: string
    description: type 等于 application时,若输入 application,则获取指定 application 实例信息;如果没有输入,则获取整个集群所有的 applications 实例信息
  - in: query
    name: runtime
    type: string
    description: type 等于 runtime时,若输入 runtime,则获取指定 runtime 实例信息;如果没有输入,则获取整个集群所有的 runtimes 实例信息
  - in: query
    name: service
    type: string
    description: type 等于 service时,输入 runtime 必要参数。若输入 service,则获取指定 service 实例信息;如果没有输入,则获取指定runtime下所有的 services 实例信息
  - in: query
    name: component
    type: string
    description: type 等于 component时。若输入 component,则获取指定 component 实例信息;如果没有输入,则获取指定集群所有的 component 实例信息
  - in: query
    name: addon
    type: string
    description: type 等于 addon时。若输入 addon,则获取指定 addon 实例信息;如果没有输入,则获取指定集群所有的 addon 实例信息
produces:
  - application/json
responses:
  '200':
    description: OK
    schema:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
            description: 容器ID
          deleted:
            type: boolean
            description: 资源是否被删除
          started_at:
            type: string
            description: 容器启动时间
          cluster_full_name:
            type: string
            description: 集群ID
          host_private_addr:
            type: string
            description: 宿主机内网地址
          ip_addr:
            type: string
            description: 容器IP地址
          image_name:
            type: string
            description: 容器镜像名
          cpu:
            type: number
            format: double
            description: 分配的cpu
          memory:
            type: integer
            format: int64
            description: 分配的内存(字节)
          disk:
            type: integer
            format: int64
            description: 分配的cpu
          dice_org:
            type: string
            description: 所在的组织
          dice_project:
            type: string
            description: 所在的项目
          dice_application:
            type: string
            description: 所在的应用
          dice_runtime:
            type: string
            description: 所在的runtime
          dice_service:
            type: string
            description: 所在的service
          dice_project_name:
            type: string
            description: 所在的项目名称
          dice_application_name:
            type: string
            description: 所在的应用名称
          dice_runtime_name:
            type: string
            description: 所在的runtime名称
          dice_component:
            type: string
            description: 组件名
          dice_addon:
            type: string
            description: 中间件名
          status:
            type: string
            description: 实例状态
          timestamp:
            type: integer
            format: int64
            description: 消息本身的时间戳
`,
}
View Source
var CMDB_CLUSTER_INSTANCES_USAGE = apis.ApiSpec{
	Path:        "/api/cmdb/clusters/<cluster>/instances-usage",
	BackendPath: "/api/clusters/<cluster>/instances-usage",
	Host:        "orchestrator.marathon.l4lb.thisdcos.directory:8081",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	Doc: `
summary: 获取某类实例集合的资源使用情况
parameters:
  - in: path
    name: cluster
    type: string
    required: true
    description: 集群名或者ID
  - in: query
    name: type
    type: string
    required: true
    enum: [cluster, host, project, application, runtime, service, component, addon]
    description: 指定请求实例的类型
    example: project
  - in: query
    name: host
    type: string
    description: type 等于 host时,若输入 host,则获取指定 host 信息;如果没有输入,则获取整个集群所有的 hosts 信息
  - in: query
    name: project
    type: string
    description: type 等于 project时,若输入 project,则获取指定 project 实例信息;如果没有输入,则获取整个集群所有的 projects 实例信息
  - in: query
    name: application
    type: string
    description: type 等于 application时,若输入 application,则获取指定 application 实例信息;如果没有输入,则获取整个集群所有的 applications 实例信息
  - in: query
    name: runtime
    type: string
    description: type 等于 runtime时,若输入 runtime,则获取指定 runtime 实例信息;如果没有输入,则获取整个集群所有的 runtimes 实例信息
  - in: query
    name: service
    type: string
    description: type 等于 service时,输入 runtime 必要参数。若输入 service,则获取指定 service 实例信息;如果没有输入,则获取指定runtime下所有的 services 实例信息
  - in: query
    name: component
    type: string
    description: type 等于 component时。若输入 component,则获取指定 component 实例信息;如果没有输入,则获取指定集群所有的 component 实例信息
  - in: query
    name: addon
    type: string
    description: type 等于 addon时。若输入 addon,则获取指定 addon 实例信息;如果没有输入,则获取指定集群所有的 addon 实例信息
produces:
  - application/json

responses:
  '200':
    description: OK
    schema:
      type: string
      example: 参考 https://yuque.antfin-inc.com/terminus_paas_dev/paas/gosn9b#va3psl
components:
  schemas:
    ComponentUsage:
      type: object
      properties:
        name:
            type: string
            description: 组件名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    AddonUsage:
      type: object
      properties:
        name:
            type: string
            description: 组件名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    ProjectUsage:
      type: object
      properties:
        id:
            type: string
            description: 项目ID
        name:
            type: string
            description: 项目名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    ApplicationUsage:
      type: object
      properties:
        id:
            type: string
            description: 应用ID
        name:
            type: string
            description: 应用名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    RuntimeUsage:
      type: object
      properties:
        id:
            type: string
            description: runtime ID
        name:
            type: string
            description: runtime名
        application:
            type: string
            description: 应用名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    ServiceUsage:
      type: object
      properties:
        name:
            type: string
            description: service名
        runtime:
            type: string
            description: runtime名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
`,
}
View Source
var CMDB_CLUSTER_LABELS = apis.ApiSpec{
	Path:         "/api/clusters/actions/statistics-labels",
	BackendPath:  "/api/clusters/actions/statistics-labels",
	Method:       "GET",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	CheckLogin:   true,
	RequestType:  apistructs.ClusterLabelsRequest{},
	ResponseType: apistructs.ClusterLabelsResponse{},
	Doc:          "summary: 集群标签占用机器数, 所在机器CPU,MEM总体使用情况, 可调度的CPU,MEM统计等",
}
View Source
var CMDB_CLUSTER_LIST = apis.ApiSpec{
	Path:         "/api/clusters",
	BackendPath:  "/api/clusters",
	Method:       "GET",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	CheckLogin:   true,
	RequestType:  apistructs.ClusterListRequest{},
	ResponseType: apistructs.ClusterListResponse{},
	Doc:          "summary: 集群列表",
}
View Source
var CMDB_CLUSTER_RESOURCE = apis.ApiSpec{
	Path:         "/api/clusters/actions/accumulate-resource",
	BackendPath:  "/api/clusters/actions/accumulate-resource",
	Method:       "GET",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	CheckLogin:   true,
	RequestType:  apistructs.ClusterQueryRequest{},
	ResponseType: apistructs.ClusterResourceResponse{},
	Doc:          "summary: 根据给定集群统计项目,应用,主机,异常主机和runtime的数量",
}
View Source
var CMDB_CLUSTER_SEARCH = apis.ApiSpec{
	Path:        "/api/cmdb/clusters/<cluster>/search",
	BackendPath: "/api/clusters/<cluster>/search",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	Doc: `
summary: 提供指定集群下的关键字搜索功能
parameters:
  - in: path
    name: cluster
    type: string
    required: true
    description: 集群名或者ID
  - in: body
    name: keyword
    description: search key
    schema:
      type: object
      required:
        - keyword
      properties:
        keyword:
          type: string
          description: keyword 使用冒号进行分割,左key右value
produces:
  - application/json
responses:
  '200':
    description: OK
    schema:
      type: string
      example: 参考 https://yuque.antfin-inc.com/terminus_paas_dev/paas/gosn9b#zngglt
`,
}
View Source
var CMDB_CLUSTER_SERVICES_LIST = apis.ApiSpec{
	Path:         "/api/clusters/actions/list-services",
	BackendPath:  "/api/clusters/actions/list-services",
	Method:       "GET",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	CheckLogin:   true,
	RequestType:  apistructs.ServicesUsageListRequest{},
	ResponseType: apistructs.ServicesUsageListResponse{},
	Doc:          "summary: 指定集群下服务资源(包括应用服务和addon)分配列表",
}
View Source
var CMDB_CLUSTER_USAGES = apis.ApiSpec{
	Path:         "/api/clusters-usage",
	BackendPath:  "/api/cluster-usages",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.ClusterUsageListRequest{},
	ResponseType: apistructs.ClusterUsageListResponse{},
	Doc:          "summary: 集群资源使用列表",
}
View Source
var CMDB_COMMENT_CREATE = apis.ApiSpec{
	Path:         "/api/comments",
	BackendPath:  "/api/comments",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.CommentUpdateRequest{},
	ResponseType: apistructs.CommentUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 更新工单评论",
	Group:        "tickets",
}
View Source
var CMDB_ERRORLOG_CREATE = apis.ApiSpec{
	Path:         "/api/task-error/actions/create",
	BackendPath:  "/api/task-error/actions/create",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodPost,
	IsOpenAPI:    true,
	CheckToken:   true,
	RequestType:  apistructs.ErrorLogCreateRequest{},
	ResponseType: apistructs.ErrorLogCreateResponse{},
	Doc:          "summary: 上报错误日志",
}
View Source
var CMDB_ERRORLOG_LIST = apis.ApiSpec{
	Path:         "/api/task-error/actions/list",
	BackendPath:  "/api/task-error/actions/list",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodGet,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ErrorLogListRequest{},
	ResponseType: apistructs.ErrorLogListResponse{},
	Doc:          "summary: List 错误日志",
}
View Source
var CMDB_FILE_DOWNLOAD = apis.ApiSpec{
	Path:          "/api/files",
	BackendPath:   "/api/files",
	Host:          "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:          "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:          "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ChunkAPI:     true,
	ResponseType: apistructs.FileUploadResponse{},
	Doc:          "summary: 文件上传",
}
View Source
var CMDB_HOST_FETCH = apis.ApiSpec{
	Path:         "/api/hosts/<host>",
	BackendPath:  "/api/hosts/<host>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.HostFetchRequest{},
	ResponseType: apistructs.HostFetchResponse{},
	IsOpenAPI:    true,
}
View Source
var CMDB_HOST_LIST = apis.ApiSpec{
	Path:         "/api/hosts",
	BackendPath:  "/api/hosts",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.HostListRequest{},
	ResponseType: apistructs.HostListResponse{},
	IsOpenAPI:    true,
}
View Source
var CMDB_HOST_STATUS = apis.ApiSpec{
	Path:         "/api/host-status",
	BackendPath:  "/api/resources/host-status",
	Host:         "monitor.marathon.l4lb.thisdcos.directory:7096",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	RequestType:  apistructs.HostStatusListRequest{},
	ResponseType: apistructs.HostStatusListResponse{},
	Doc:          "集群主机状态",
}

TODO 临时添加,3.8 版本机器详情新增状态字段,监控负责维护,不再走告警工单查询

View Source
var CMDB_HOST_USAGE = apis.ApiSpec{
	Path:         "/api/host-usages/<host>",
	BackendPath:  "/api/host-usages/<host>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.HostStaticUsageFetchRequest{},
	ResponseType: apistructs.HostStaticUsageFetchResponse{},
	Doc:          "主机的资源使用详情",
}
View Source
var CMDB_IMAGE_FETCH = apis.ApiSpec{
	Path:        "/api/images/<imageName>",
	BackendPath: "/api/images/<imageName>",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 图片获取",
}

仅图片存储于网盘时使用

View Source
var CMDB_IMAGE_UPLOAD = apis.ApiSpec{
	Path:        "/api/images/actions/upload",
	BackendPath: "/api/images/actions/upload",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 图片上传",
}
View Source
var CMDB_INSTANCES_USAGE = apis.ApiSpec{
	Path:        "/api/instances-usage",
	BackendPath: "/api/instances-usage",
	Host:        "orchestrator.marathon.l4lb.thisdcos.directory:8081",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	Doc: `
summary: 获取某类实例集合的资源使用情况
parameters:
  - in: path
    name: cluster
    type: string
    required: true
    description: 集群名或者ID
  - in: query
    name: type
    type: string
    required: true
    enum: [cluster, host, project, application, runtime, service, component, addon]
    description: 指定请求实例的类型
    example: project
  - in: query
    name: host
    type: string
    description: type 等于 host时,若输入 host,则获取指定 host 信息;如果没有输入,则获取整个集群所有的 hosts 信息
  - in: query
    name: project
    type: string
    description: type 等于 project时,若输入 project,则获取指定 project 实例信息;如果没有输入,则获取整个集群所有的 projects 实例信息
  - in: query
    name: application
    type: string
    description: type 等于 application时,若输入 application,则获取指定 application 实例信息;如果没有输入,则获取整个集群所有的 applications 实例信息
  - in: query
    name: runtime
    type: string
    description: type 等于 runtime时,若输入 runtime,则获取指定 runtime 实例信息;如果没有输入,则获取整个集群所有的 runtimes 实例信息
  - in: query
    name: service
    type: string
    description: type 等于 service时,输入 runtime 必要参数。若输入 service,则获取指定 service 实例信息;如果没有输入,则获取指定runtime下所有的 services 实例信息
  - in: query
    name: component
    type: string
    description: type 等于 component时。若输入 component,则获取指定 component 实例信息;如果没有输入,则获取指定集群所有的 component 实例信息
  - in: query
    name: addon
    type: string
    description: type 等于 addon时。若输入 addon,则获取指定 addon 实例信息;如果没有输入,则获取指定集群所有的 addon 实例信息
produces:
  - application/json

responses:
  '200':
    description: OK
    schema:
      type: string
      example: 参考 https://yuque.antfin-inc.com/terminus_paas_dev/paas/gosn9b#va3psl
components:
  schemas:
    ComponentUsage:
      type: object
      properties:
        name:
            type: string
            description: 组件名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    AddonUsage:
      type: object
      properties:
        name:
            type: string
            description: 组件名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    ProjectUsage:
      type: object
      properties:
        id:
            type: string
            description: 项目ID
        name:
            type: string
            description: 项目名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    ApplicationUsage:
      type: object
      properties:
        id:
            type: string
            description: 应用ID
        name:
            type: string
            description: 应用名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    RuntimeUsage:
      type: object
      properties:
        id:
            type: string
            description: runtime ID
        name:
            type: string
            description: runtime名
        application:
            type: string
            description: 应用名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
    ServiceUsage:
      type: object
      properties:
        name:
            type: string
            description: service名
        runtime:
            type: string
            description: runtime名
        instance:
            type: integer
            description: 实例数
        memory:
            type: number
            format: double
            description: 分配的内存(MB)
        cpu:
            type: number
            format: double
            description: 分配的cpu数
        disk:
            type: number
            format: double
            description: 分配的磁盘空间(MB)
`,
}
View Source
var CMDB_ISSUE_BATCH_UPDATE = apis.ApiSpec{
	Path:        "/api/issues/actions/batch-update",
	BackendPath: "/api/issues/actions/batch-update",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:          "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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_TYPE_UPDATE = apis.ApiSpec{
	Path:        "/api/issues/actions/update-issue-type",
	BackendPath: "/api/issues/actions/update-issue-type",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.IssueTypeUpdateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 转换issue类型",
}
View Source
var CMDB_ISSUE_UPDATE = apis.ApiSpec{
	Path:         "/api/issues/<id>",
	BackendPath:  "/api/issues/<id>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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_LABEL_CREATE = apis.ApiSpec{
	Path:         "/api/labels",
	BackendPath:  "/api/labels",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ProjectLabelCreateRequest{},
	ResponseType: apistructs.ProjectLabelCreateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建 label",
	Audit: func(ctx *spec.AuditContext) error {
		var reqBody apistructs.ProjectLabelCreateRequest
		if err := ctx.BindRequestData(&reqBody); 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.CreateProjectLabelTemplate,
			Context:      map[string]interface{}{"label": reqBody.Name, "projectName": project.Name},
		})
	},
}
View Source
var CMDB_LABEL_DELETE = apis.ApiSpec{
	Path:        "/api/labels/<id>",
	BackendPath: "/api/labels/<id>",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      http.MethodDelete,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 删除 label",
	Audit: func(ctx *spec.AuditContext) error {
		var respBody apistructs.ProjectLabelGetByIDResponseData
		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.DeleteProjectLabelTemplate,
			Context:      map[string]interface{}{"label": respBody.Data.Name, "projectName": project.Name},
		})
	},
}
View Source
var CMDB_LABEL_LIST = apis.ApiSpec{
	Path:         "/api/labels",
	BackendPath:  "/api/labels",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ProjectLabelListRequest{},
	ResponseType: apistructs.ProjectLabelListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 分页查询 label",
}
View Source
var CMDB_LABEL_UPDATE = apis.ApiSpec{
	Path:        "/api/labels/<id>",
	BackendPath: "/api/labels/<id>",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	RequestType: apistructs.ProjectLabelUpdateRequest{},
	IsOpenAPI:   true,
	Doc:         "summary: 更新 label",
	Audit: func(ctx *spec.AuditContext) error {
		idStr := ctx.UrlParams["id"]
		id, err := strconv.ParseUint(idStr, 10, 64)
		if err != nil {
			return err
		}
		label, err := ctx.Bundle.GetLabel(id)
		if err != nil {
			return err
		}
		project, err := ctx.Bundle.GetProject(label.ProjectID)
		if err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      label.ProjectID,
			ProjectID:    label.ProjectID,
			TemplateName: apistructs.UpdateProjectLabelTemplate,
			Context:      map[string]interface{}{"label": label.Name, "projectName": project.Name},
		})
	},
}
View Source
var CMDB_LIBREFERENCE_CREATE = apis.ApiSpec{
	Path:         "/api/lib-references",
	BackendPath:  "/api/lib-references",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      http.MethodGet,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 获取模块订阅版本",
}
View Source
var CMDB_LICENSE = apis.ApiSpec{
	Path:         "/api/license",
	BackendPath:  "/api/license",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	Doc:          "summary: 查询license信息",
	IsOpenAPI:    true,
	CheckLogin:   true,
	ResponseType: apistructs.LicenseResponse{},
}
View Source
var CMDB_MANUAL_REVIEW_ADD = apis.ApiSpec{
	Path:        "/api/reviews/actions/review/approve",
	BackendPath: "/api/reviews/actions/review/approve",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 添加成员",
}
View Source
var CMDB_MANUAL_REVIEW_ADDUSER = apis.ApiSpec{
	Path:        "/api/reviews/actions/user/create",
	BackendPath: "/api/reviews/actions/user/create",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	RequestType: apistructs.CreateReviewUser{},
	Doc:         "summary: 添加用户审核记录",
}
View Source
var CMDB_MANUAL_REVIEW_AUTHORITY = apis.ApiSpec{
	Path:         "/api/reviews/actions/authority",
	BackendPath:  "/api/reviews/actions/authority",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GetAuthorityByUserIdRequest{},
	ResponseType: apistructs.GetAuthorityByUserIdResponse{},
	Doc:          "summary: 查询用户是否有权限",
}
View Source
var CMDB_MANUAL_REVIEW_GET = apis.ApiSpec{
	Path:         "/api/reviews/actions/<id>",
	BackendPath:  "/api/reviews/actions/<id>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GetReviewByTaskIdIdRequest{},
	ResponseType: apistructs.GetReviewByTaskIdIdResponse{},
	Doc:          "summary: 通过taskId查询审核记录是否存在",
}
View Source
var CMDB_MANUAL_REVIEW_LISTBYSPONSORID = apis.ApiSpec{
	Path:         "/api/reviews/actions/list-launched-approval",
	BackendPath:  "/api/reviews/actions/list-launched-approval",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GetReviewsBySponsorIdRequest{},
	ResponseType: apistructs.GetReviewsBySponsorIdResponse{},
	Doc:          "summary: 查询sponsorId(发起人)发起部署审批列表",
}
View Source
var CMDB_MANUAL_REVIEW_LISTBYUserID = apis.ApiSpec{
	Path:         "/api/reviews/actions/list-approved",
	BackendPath:  "/api/reviews/actions/list-approved",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GetReviewsByUserIdRequest{},
	ResponseType: apistructs.GetReviewsByUserIdResponse{},
	Doc:          "summary: 查询用户需要审批的列表",
}
View Source
var CMDB_MANUAL_REVIEW_UPDATE = apis.ApiSpec{
	Path:        "/api/reviews/actions/updateReview",
	BackendPath: "/api/reviews/actions/updateReview",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "PUT",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	RequestType: apistructs.UpdateApproval{},
	Doc:         "summary: 添加成员",
}
View Source
var CMDB_MBOX_GET = apis.ApiSpec{
	Path:        "/api/mboxs/<mboxID>",
	BackendPath: "/api/mboxs/<mboxID>",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 查询站内信详情",
}
View Source
var CMDB_MBOX_LIST = apis.ApiSpec{
	Path:         "/api/mboxs",
	BackendPath:  "/api/mboxs",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.QueryMBoxRequest{},
	ResponseType: apistructs.QueryMBoxResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询站内信列表",
}
View Source
var CMDB_MBOX_STATS = apis.ApiSpec{
	Path:        "/api/mboxs/actions/stats",
	BackendPath: "/api/mboxs/actions/stats",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 查询站内信统计信息",
}
View Source
var CMDB_MEMBER_ADD = apis.ApiSpec{
	Path:         "/api/members",
	BackendPath:  "/api/members",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.MemberAddRequest{},
	ResponseType: apistructs.MemberAddResponse{},
	Doc:          "summary: 添加成员",
	Audit: func(ctx *spec.AuditContext) error {
		var requestBody apistructs.MemberAddRequest
		if err := ctx.BindRequestData(&requestBody); err != nil {
			return err
		}

		scopeID, err := strutil.Atoi64(requestBody.Scope.ID)
		if err != nil {
			return err
		}
		scopeType := requestBody.Scope.Type

		user, err := ctx.Bundle.ListUsers(apistructs.UserListRequest{UserIDs: requestBody.UserIDs})
		if err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    scopeType,
			ScopeID:      uint64(scopeID),
			TemplateName: apistructs.AddMemberTemplate,
			Context:      map[string]interface{}{"users": user.Users},
		})
	},
}
View Source
var CMDB_MEMBER_ADD_BY_INVITECODE = apis.ApiSpec{
	Path:          "/api/members/actions/create-by-invitecode",
	BackendPath:   "/api/members/actions/create-by-invitecode",
	Host:          "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:        "http",
	Method:        "POST",
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	RequestType:   apistructs.MemberAddByInviteCodeRequest{},
	ResponseType:  apistructs.MemberAddByInviteCodeResponse{},
	Doc:           "summary: 通过邀请码添加成员",
}
View Source
var CMDB_MEMBER_LABEL_LIST = apis.ApiSpec{
	Path:         "/api/members/actions/list-labels",
	BackendPath:  "/api/members/actions/list-labels",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.MemberLabelListResponse{},
	Doc:          "summary: 查询成员标签列表",
}
View Source
var CMDB_MEMBER_LIST = apis.ApiSpec{
	Path:         "/api/members",
	BackendPath:  "/api/members",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.MemberListRequest{},
	ResponseType: apistructs.MemberListResponse{},
	Doc:          "summary: 查询成员列表",
}
View Source
var CMDB_MEMBER_REMOVE = apis.ApiSpec{
	Path:         "/api/members/actions/remove",
	BackendPath:  "/api/members/actions/remove",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.MemberRemoveRequest{},
	ResponseType: apistructs.MemberRemoveResponse{},
	Doc:          "summary: 删除成员",
	Audit: func(ctx *spec.AuditContext) error {
		var requestBody apistructs.MemberRemoveRequest
		if err := ctx.BindRequestData(&requestBody); err != nil {
			return err
		}

		scopeID, err := strutil.Atoi64(requestBody.Scope.ID)
		if err != nil {
			return err
		}
		scopeType := requestBody.Scope.Type

		user, err := ctx.Bundle.ListUsers(apistructs.UserListRequest{UserIDs: requestBody.UserIDs})
		if err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    scopeType,
			ScopeID:      uint64(scopeID),
			TemplateName: apistructs.DeleteMemberTemplate,
			Context:      map[string]interface{}{"users": user.Users},
		})
	},
}
View Source
var CMDB_MY_APPLICATIONS_LIST = apis.ApiSpec{
	Path:         "/api/applications/actions/list-my-applications",
	BackendPath:  "/api/applications/actions/list-my-applications",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ApplicationListRequest{},
	ResponseType: apistructs.ApplicationListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询我的应用列表",
}

* add for standard

View Source
var CMDB_MY_PROJECTS_LIST = apis.ApiSpec{
	Path:         "/api/projects/actions/list-my-projects",
	BackendPath:  "/api/projects/actions/list-my-projects",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.ProjectListRequest{},
	ResponseType: apistructs.ProjectListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询我的项目列表",
}

* add for standard

View Source
var CMDB_MY_PUBLISHERS_LIST = apis.ApiSpec{
	Path:         "/api/publishers/actions/list-my-publishers",
	BackendPath:  "/api/publishers/actions/list-my-publishers",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.PublisherListRequest{},
	ResponseType: apistructs.PublisherListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询我的Publisher列表",
}
View Source
var CMDB_NOTICE_CREATE = apis.ApiSpec{
	Path:         "/api/notices",
	BackendPath:  "/api/notices",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.NoticeCreateRequest{},
	ResponseType: apistructs.NoticeCreateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 创建平台公告",
	Audit: func(ctx *spec.AuditContext) error {

		var resp apistructs.NoticeCreateResponse
		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.CreateNoticesTemplate,
				Context:      map[string]interface{}{"notices": resp.Data.Content},
			})
		} else {
			return nil
		}
	},
}
View Source
var CMDB_NOTICE_DELETE = apis.ApiSpec{
	Path:         "/api/notices/<id>",
	BackendPath:  "/api/notices/<id>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodDelete,
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.NoticeDeleteResponse{},
	Doc:          "summary: 删除平台公告",
	Audit: func(ctx *spec.AuditContext) error {

		var resp apistructs.NoticeDeleteResponse
		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.DeleteNoticesTemplate,
				Context:      map[string]interface{}{"notices": resp.Data.Content},
			})
		} else {
			return nil
		}
	},
}
View Source
var CMDB_NOTICE_LIST = apis.ApiSpec{
	Path:         "/api/notices",
	BackendPath:  "/api/notices",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.NoticeListRequest{},
	ResponseType: apistructs.NoticeListResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 平台公告列表",
}
View Source
var CMDB_NOTICE_PUBLISH = apis.ApiSpec{
	Path:         "/api/notices/<id>/actions/publish",
	BackendPath:  "/api/notices/<id>/actions/publish",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	Doc:          "summary: 发布平台公告",
	ResponseType: apistructs.NoticePublishResponse{},
	Audit: func(ctx *spec.AuditContext) error {

		var resp apistructs.NoticePublishResponse
		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.PublishNoticesTemplate,
				Context:      map[string]interface{}{"notices": resp.Data.Content},
			})
		} else {
			return nil
		}
	},
}
View Source
var CMDB_NOTICE_UNPUBLISH = apis.ApiSpec{
	Path:        "/api/notices/<id>/actions/unpublish",
	BackendPath: "/api/notices/<id>/actions/unpublish",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      http.MethodPut,
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 下架平台公告",
	Audit: func(ctx *spec.AuditContext) error {

		var resp apistructs.NoticePublishResponse
		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.UnPublishNoticesTemplate,
				Context:      map[string]interface{}{"notices": resp.Data.Content},
			})
		} else {
			return nil
		}
	},
}
View Source
var CMDB_NOTICE_UPDATE = apis.ApiSpec{
	Path:         "/api/notices/<id>",
	BackendPath:  "/api/notices/<id>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodPut,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.NoticeUpdateRequest{},
	ResponseType: apistructs.NoticeUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 编辑平台公告",
	Audit: func(ctx *spec.AuditContext) error {

		var req apistructs.NoticeUpdateRequest
		err := ctx.BindRequestData(&req)
		if err != nil {
			return err
		}

		var resp apistructs.NoticeUpdateResponse
		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.UpdateNoticesTemplate,
				Context:      map[string]interface{}{"notices": req.Content},
			})
		} else {
			return nil
		}
	},
}
View Source
var CMDB_NOTIFYGROUP_CREATE = apis.ApiSpec{
	Path:         "/api/notify-groups",
	BackendPath:  "/api/notify-groups",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	RequestType:  apistructs.CreateNotifyGroupRequest{},
	ResponseType: apistructs.CreateNotifyGroupResponse{},
	Doc:          "summary: 创建通知组",
	Audit: func(ctx *spec.AuditContext) error {
		var resBody apistructs.CreateNotifyGroupResponse
		if err := ctx.BindResponseData(&resBody); err != nil {
			return err
		}
		auditReq, err := createNotifyGroupAuditData(ctx, &resBody.Data)
		if err != nil {
			return err
		}
		if auditReq.ScopeType == apistructs.OrgScope {
			auditReq.TemplateName = apistructs.CreateOrgNotifyGroupTemplate
		} else if auditReq.ScopeType == apistructs.ProjectScope {
			auditReq.TemplateName = apistructs.CreateProjectNotifyGroupTemplate
		} else if auditReq.ScopeType == apistructs.AppScope {
			auditReq.TemplateName = apistructs.CreateAppNotifyGroupTemplate
		}
		return ctx.CreateAudit(auditReq)
	},
}
View Source
var CMDB_NOTIFYGROUP_DELETE = apis.ApiSpec{
	Path:        "/api/notify-groups/<notifyGroupID>",
	BackendPath: "/api/notify-groups/<notifyGroupID>",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "DELETE",
	CheckLogin:  true,
	Doc:         "summary: 删除通知组",
	Audit: func(ctx *spec.AuditContext) error {
		var resBody apistructs.DeleteNotifyGroupResponse
		if err := ctx.BindResponseData(&resBody); err != nil {
			return err
		}
		auditReq, err := createNotifyGroupAuditData(ctx, &resBody.Data)
		if err != nil {
			return err
		}
		if auditReq.ScopeType == apistructs.OrgScope {
			auditReq.TemplateName = apistructs.DeleteOrgNotifyGroupTemplate
		} else if auditReq.ScopeType == apistructs.ProjectScope {
			auditReq.TemplateName = apistructs.DeleteProjectNotifyGroupTemplate
		} else if auditReq.ScopeType == apistructs.AppScope {
			auditReq.TemplateName = apistructs.DeleteAppNotifyGroupTemplate
		}
		return ctx.CreateAudit(auditReq)
	},
}
View Source
var CMDB_NOTIFYGROUP_QUERY = apis.ApiSpec{
	Path:         "/api/notify-groups",
	BackendPath:  "/api/notify-groups",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.QueryNotifyGroupRequest{},
	ResponseType: apistructs.QueryNotifyGroupResponse{},
	Doc:          "summary: 查询通知组",
}
View Source
var CMDB_NOTIFYGROUP_UPDATE = apis.ApiSpec{
	Path:         "/api/notify-groups/<notifyGroupID>",
	BackendPath:  "/api/notify-groups/<notifyGroupID>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	RequestType:  apistructs.UpdateNotifyGroupRequest{},
	ResponseType: apistructs.UpdateNotifyGroupResponse{},
	Doc:          "summary: 更新通知组",
	Audit: func(ctx *spec.AuditContext) error {
		var resBody apistructs.UpdateNotifyGroupResponse
		if err := ctx.BindResponseData(&resBody); err != nil {
			return err
		}
		auditReq, err := createNotifyGroupAuditData(ctx, &resBody.Data)
		if err != nil {
			return err
		}
		if auditReq.ScopeType == apistructs.OrgScope {
			auditReq.TemplateName = apistructs.UpdateOrgNotifyGroupTemplate
		} else if auditReq.ScopeType == apistructs.ProjectScope {
			auditReq.TemplateName = apistructs.UpdateProjectNotifyGroupTemplate
		} else if auditReq.ScopeType == apistructs.AppScope {
			auditReq.TemplateName = apistructs.UpdateAppNotifyGroupTemplate
		}
		return ctx.CreateAudit(auditReq)
	},
}
View Source
var CMDB_NOTIFYITEM_QUERY = apis.ApiSpec{
	Path:         "/api/notify-items",
	BackendPath:  "/api/notify-items",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.QueryNotifyItemRequest{},
	ResponseType: apistructs.QueryNotifyItemResponse{},
	Doc:          "summary: 查询通知项",
}
View Source
var CMDB_NOTIFYITEM_UPDATE = apis.ApiSpec{
	Path:         "/api/notify-items/<notifyItemID>",
	BackendPath:  "/api/notify-items/<notifyItemID>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	RequestType:  apistructs.UpdateNotifyItemRequest{},
	ResponseType: apistructs.UpdateNotifyItemResponse{},
	Doc:          "summary: 更新通知项",
}
View Source
var CMDB_NOTIFY_CONFIG_GET = apis.ApiSpec{
	Path:         "/api/orgs/<orgID>/actions/get-notify-config",
	BackendPath:  "/api/orgs/<orgID>/actions/get-notify-config",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.NotifyConfigGetResponse{},
	Doc:          "summary: 获取通知配置",
}
View Source
var CMDB_NOTIFY_CONFIG_SET = apis.ApiSpec{
	Path:        "/api/orgs/<orgID>/actions/set-notify-config",
	BackendPath: "/api/orgs/<orgID>/actions/set-notify-config",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	RequestType: apistructs.NotifyConfigUpdateRequestBody{},
	Doc:         "summary: 设置通知配置",
}
View Source
var CMDB_NOTIFY_CREATE = apis.ApiSpec{
	Path:         "/api/notifies",
	BackendPath:  "/api/notifies",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	RequestType:  apistructs.CreateNotifyRequest{},
	ResponseType: apistructs.CreateNotifyResponse{},
	Doc:          "summary: 创建通知",
	Audit: func(ctx *spec.AuditContext) error {
		var resBody apistructs.CreateNotifyResponse
		if err := ctx.BindResponseData(&resBody); err != nil {
			return err
		}
		auditReq, err := createNotifyAuditData(ctx, resBody.Data)
		if err != nil {
			return err
		}
		if auditReq.ScopeType == apistructs.ProjectScope {
			auditReq.TemplateName = apistructs.CreateProjectNotifyTemplate
		} else if auditReq.ScopeType == apistructs.AppScope {
			auditReq.TemplateName = apistructs.CreateAppNotifyTemplate
		}
		return ctx.CreateAudit(auditReq)
	},
}
View Source
var CMDB_NOTIFY_DELETE = apis.ApiSpec{
	Path:         "/api/notifies/<notifyID>",
	BackendPath:  "/api/notifies/<notifyID>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	ResponseType: apistructs.DeleteNotifyResponse{},
	Doc:          "summary: 删除通知",
	Audit: func(ctx *spec.AuditContext) error {
		var resBody apistructs.DeleteNotifyResponse
		if err := ctx.BindResponseData(&resBody); err != nil {
			return err
		}
		auditReq, err := createNotifyAuditData(ctx, resBody.Data)
		if err != nil {
			return err
		}
		if auditReq.ScopeType == apistructs.ProjectScope {
			auditReq.TemplateName = apistructs.DeleteProjectNotifyTemplate
		} else if auditReq.ScopeType == apistructs.AppScope {
			auditReq.TemplateName = apistructs.DeleteAppNotifyTemplate
		}
		return ctx.CreateAudit(auditReq)
	},
}
View Source
var CMDB_NOTIFY_DISABLE = apis.ApiSpec{
	Path:        "/api/notifies/<notifyID>/actions/disable",
	BackendPath: "/api/notifies/<notifyID>/actions/disable",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "PUT",
	CheckLogin:  true,
	Doc:         "summary: 禁用通知",
	Audit: func(ctx *spec.AuditContext) error {
		var resBody apistructs.DisableNotifyResponse
		if err := ctx.BindResponseData(&resBody); err != nil {
			return err
		}
		auditReq, err := createNotifyAuditData(ctx, resBody.Data)
		if err != nil {
			return err
		}
		if auditReq.ScopeType == apistructs.ProjectScope {
			auditReq.TemplateName = apistructs.DisableProjectNotifyTemplate
		} else if auditReq.ScopeType == apistructs.AppScope {
			auditReq.TemplateName = apistructs.DisableAppNotifyTemplate
		}
		return ctx.CreateAudit(auditReq)
	},
}
View Source
var CMDB_NOTIFY_ENABLE = apis.ApiSpec{
	Path:        "/api/notifies/<notifyID>/actions/enable",
	BackendPath: "/api/notifies/<notifyID>/actions/enable",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "PUT",
	CheckLogin:  true,
	Doc:         "summary: 启用通知",
	Audit: func(ctx *spec.AuditContext) error {
		var resBody apistructs.EnableNotifyResponse
		if err := ctx.BindResponseData(&resBody); err != nil {
			return err
		}
		auditReq, err := createNotifyAuditData(ctx, resBody.Data)
		if err != nil {
			return err
		}
		if auditReq.ScopeType == apistructs.ProjectScope {
			auditReq.TemplateName = apistructs.EnableProjectNotifyTemplate
		} else if auditReq.ScopeType == apistructs.AppScope {
			auditReq.TemplateName = apistructs.EnableAppNotifyTemplate
		}
		return ctx.CreateAudit(auditReq)
	},
}
View Source
var CMDB_NOTIFY_FUZZY_QUERY = apis.ApiSpec{
	Path:        "/api/notifies/actions/fuzzy-query-by-source",
	BackendPath: "/api/notifies/actions/fuzzy-query-by-source",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	Doc:         "summary: 模糊查询通知",
}
View Source
var CMDB_NOTIFY_GET = apis.ApiSpec{
	Path:        "/api/notifies/<notifyID>",
	BackendPath: "/api/notifies/<notifyID>",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	Doc:         "summary: 获取通知详情",
}
View Source
var CMDB_NOTIFY_HISTORIES = apis.ApiSpec{
	Path:         "/api/notify-histories",
	BackendPath:  "/api/notify-histories",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.QueryNotifyHistoryRequest{},
	ResponseType: apistructs.QueryNotifyHistoryResponse{},
	Doc:          "summary: 查询通知项",
}
View Source
var CMDB_NOTIFY_QUERY = apis.ApiSpec{
	Path:         "/api/notifies",
	BackendPath:  "/api/notifies",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	RequestType:  apistructs.QueryNotifyRequest{},
	ResponseType: apistructs.QueryNotifyResponse{},
	Doc:          "summary: 查询通知",
}
View Source
var CMDB_NOTIFY_UPDATE = apis.ApiSpec{
	Path:         "/api/notifies/<notifyID>",
	BackendPath:  "/api/notifies/<notifyID>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	RequestType:  apistructs.UpdateNotifyRequest{},
	ResponseType: apistructs.UpdateNotifyResponse{},
	Doc:          "summary: 更新通知",
	Audit: func(ctx *spec.AuditContext) error {
		var resBody apistructs.UpdateNotifyResponse
		if err := ctx.BindResponseData(&resBody); err != nil {
			return err
		}
		auditReq, err := createNotifyAuditData(ctx, resBody.Data)
		if err != nil {
			return err
		}
		if auditReq.ScopeType == apistructs.ProjectScope {
			auditReq.TemplateName = apistructs.UpdateProjectNotifyTemplate
		} else if auditReq.ScopeType == apistructs.AppScope {
			auditReq.TemplateName = apistructs.UpdateAppNotifyTemplate
		}
		return ctx.CreateAudit(auditReq)
	},
}
View Source
var CMDB_ORG_CHANGE = apis.ApiSpec{
	Path:         "/api/orgs/actions/change-current-org",
	BackendPath:  "/api/orgs/actions/switch",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.OrgChangeRequest{},
	ResponseType: apistructs.OrgChangeResponse{},
	Doc:          "summary: 切换组织",
}
View Source
var CMDB_ORG_CLUSTER_RELATE_OPENAPI = apis.ApiSpec{
	Path:        "/api/orgs/actions/relate-cluster",
	BackendPath: "/api/orgs/actions/relate-cluster",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "POST",
	IsOpenAPI:   true,
	RequestType: apistructs.OrgClusterRelationCreateRequest{},
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 添加企业集群关联",
	Audit: func(ctx *spec.AuditContext) error {
		var request apistructs.OrgClusterRelationCreateRequest
		if err := ctx.BindRequestData(&request); err != nil {
			return err
		}

		return ctx.CreateAudit(&apistructs.Audit{
			OrgID:        request.OrgID,
			ScopeType:    apistructs.OrgScope,
			ScopeID:      request.OrgID,
			TemplateName: apistructs.ClusterReferenceTemplate,
			Context: map[string]interface{}{
				"clusterName": request.ClusterName,
			},
		})
	},
}
View Source
var CMDB_ORG_CREATE = apis.ApiSpec{
	Path:         "/api/orgs",
	BackendPath:  "/api/orgs",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:          "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:        "http",
	Method:        "GET",
	TryCheckLogin: true,
	CheckToken:    true,
	IsOpenAPI:     true,
	RequestType:   apistructs.OrgGetByDomainRequest{},
	ResponseType:  apistructs.OrgGetByDomainResponse{},
	Doc:           "summary: 通过域名获取组织",
}
View Source
var CMDB_ORG_INGRESS_UPDATE = apis.ApiSpec{
	Path:         "/api/orgs/ingress/<orgID>",
	BackendPath:  "/api/orgs/ingress/<orgID>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.OrgUpdateResponse{},
	Doc:          "summary: 更新组织入口",
}
View Source
var CMDB_ORG_NEXUS_FETCH = apis.ApiSpec{
	Path:         "/api/orgs/<orgID>/nexus",
	BackendPath:  "/api/orgs/<orgID>/nexus",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:          "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 创建发布商",
}
View Source
var CMDB_ORG_RESOURCE_GET = apis.ApiSpec{
	Path:         "/api/orgs/actions/fetch-resources",
	BackendPath:  "/api/orgs/actions/fetch-resources",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodGet,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.OrgResourceInfo{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取企业资源使用",
}
View Source
var CMDB_ORG_SEARCH = apis.ApiSpec{
	Path:          "/api/orgs",
	BackendPath:   "/api/orgs",
	Host:          "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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_ORG_VERIFICODE_GEN = apis.ApiSpec{
	Path:         "/api/orgs/actions/gen-verify-code",
	BackendPath:  "/api/orgs/actions/gen-verify-code",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.OrgGenVerfiCodeResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 获取企业邀请成员验证码",
}
View Source
var CMDB_PERMISSION_ACCESS = apis.ApiSpec{
	Path:            "/api/permissions/actions/access",
	BackendPath:     "/api/permissions/actions/access",
	Host:            "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:          "http",
	Method:          "POST",
	NeedDesensitize: true,
	TryCheckLogin:   true,
	CheckToken:      true,
	RequestType:     apistructs.ScopeRoleAccessRequest{},
	ResponseType:    apistructs.PermissionListResponse{},
	Doc:             "summary: 访问权限列表",
	Group:           "permissions",
}
View Source
var CMDB_PERMISSION_CHECK = apis.ApiSpec{
	Path:         "/api/permissions/actions/check",
	BackendPath:  "/api/permissions/actions/check",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.PermissionCheckRequest{},
	ResponseType: apistructs.PermissionCheckResponse{},
	Doc:          "summary: 鉴权",
	Group:        "permissions",
}
View Source
var CMDB_PERMISSION_LIST = apis.ApiSpec{
	Path:         "/api/permissions",
	BackendPath:  "/api/permissions",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.ScopeRoleListResponse{},
	Doc:          "summary: 列出用户所有权限",
	Group:        "permissions",
}
View Source
var CMDB_PROJECTS_FETCH = apis.ApiSpec{
	Path:         "/api/projects",
	BackendPath:  "/api/projects",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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_PROJECT_DETAIL = apis.ApiSpec{
	Path:         "/api/projects/<projectIdOrName>",
	BackendPath:  "/api/projects/<projectIdOrName>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ProjectDetailRequest{},
	ResponseType: apistructs.ProjectDetailResponse{},
	Doc:          "summary: 获取项目详情",
}
View Source
var CMDB_PROJECT_FUNCTIONS_GET = apis.ApiSpec{
	Path:        "/api/projects/actions/get-project-functions",
	BackendPath: "/api/projects/actions/get-project-functions",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 获取项目功能配置",
}
View Source
var CMDB_PROJECT_FUNCTIONS_SET = apis.ApiSpec{
	Path:         "/api/projects/actions/set-project-functions",
	BackendPath:  "/api/projects/actions/set-project-functions",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ProjectFunctionSetRequest{},
	ResponseType: apistructs.ProjectFunctionSetResponse{},
	Doc:          "summary: 设置项目功能",
}
View Source
var CMDB_PROJECT_GET_NSINFO = apis.ApiSpec{
	Path:         "/api/projects/<projectID>/actions/get-ns-info",
	BackendPath:  "/api/projects/<projectID>/actions/get-ns-info",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.ProjectNameSpaceInfoResponse{},
	Doc:          "summary: 获取项目级命名空间信息",
}
View Source
var CMDB_PROJECT_METRICS_HISTOGRAM = apis.ApiSpec{
	Path:        "/api/projects/resource/<resourceType>/actions/list-usage-histogram",
	BackendPath: "/api/projects/resource/<resourceType>/actions/list-usage-histogram",
	Host:        "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 查询项目资源汇总监控数据曲线图数据",
}
View Source
var CMDB_PROJECT_UPDATE = apis.ApiSpec{
	Path:         "/api/projects/<projectId>",
	BackendPath:  "/api/projects/<projectId>",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ProjectUpdateRequest{},
	ResponseType: apistructs.ProjectUpdateResponse{},
	Doc:          "summary: 更新项目",
	Audit: func(ctx *spec.AuditContext) error {
		projectID, err := ctx.GetParamInt64("projectId")
		if err != nil {
			return err
		}
		project, err := ctx.GetProject(projectID)
		if err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.ProjectScope,
			ScopeID:      uint64(projectID),
			ProjectID:    uint64(projectID),
			TemplateName: apistructs.UpdateProjectTemplate,
			Context:      map[string]interface{}{"projectName": project.Name},
		})
	},
}

* already migration

View Source
var CMDB_PUBLISHERS_LIST = apis.ApiSpec{
	Path:         "/api/publishers",
	BackendPath:  "/api/publishers",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.MemberRoleListResponse{},
	Doc:          "summary: 获取成员角色列表",
}
View Source
var CMDB_ROLES_LIST_BY_USER = apis.ApiSpec{
	Path:         "/api/members/actions/list-user-roles",
	BackendPath:  "/api/members/actions/list-user-roles",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ListMemberRolesByUserRequest{},
	ResponseType: apistructs.ListMemberRolesByUserResponse{},
	Doc:          "summary: 根据用户id获取成员角色列表",
}
View Source
var CMDB_RUNNING_TASKS_LIST = apis.ApiSpec{
	Path:         "/api/org/actions/list-running-tasks",
	BackendPath:  "/api/org/actions/list-running-tasks",
	Method:       "GET",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	CheckLogin:   true,
	RequestType:  apistructs.OrgRunningTasksListRequest{},
	ResponseType: apistructs.OrgRunningTasksListResponse{},
	Doc:          "summary: 获取指定企业的任务 (job/deployment) 列表",
}
View Source
var CMDB_TICKET_CLOSE = apis.ApiSpec{
	Path:         "/api/tickets/<ticketID>/actions/close",
	BackendPath:  "/api/tickets/<ticketID>/actions/close",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	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:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "PUT",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.TicketUpdateRequest{},
	ResponseType: apistructs.TicketUpdateResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 更新工单",
}
View Source
var CMDB_USER_LIST = apis.ApiSpec{
	Path:         "/api/users",
	BackendPath:  "/api/users",
	Host:         "cmdb.marathon.l4lb.thisdcos.directory:9093",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.UserListRequest{},
	ResponseType: apistructs.UserListResponse{},
	Doc:          "summary: 批量查询用户",
	Group:        "users",
}

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