core_services

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.UpdateAppPublishItemRelationRequest{},
	ResponseType: apistructs.UpdateAppPublishItemRelationResponse{},
	Doc:          "summary: 更新应用发布关联",
}
View Source
var CMDB_APPLICATIONS_LIST = apis.ApiSpec{
	Path:         "/api/applications",
	BackendPath:  "/api/applications",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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_FETCH = apis.ApiSpec{
	Path:         "/api/applications/<applicationId>",
	BackendPath:  "/api/applications/<applicationId>",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	RequestType:  apistructs.ApproveCreateRequest{},
	ResponseType: apistructs.ApproveCreateResponse{},
	Doc:          "summary: 创建审批",
}
View Source
var CMDB_APP_LIST_TEMPLATES = apis.ApiSpec{
	Path:        "/api/applications/actions/list-templates",
	BackendPath: "/api/applications/actions/list-templates",
	Host:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:      "http",
	Method:      "GET",
	IsOpenAPI:   true,
	CheckLogin:  true,
	CheckToken:  true,
	Doc:         "summary: 应用模板列表",
}
View Source
var CMDB_AUDITS_LIST_SET = apis.ApiSpec{
	Path:         "/api/audits/actions/setting",
	BackendPath:  "/api/audits/actions/setting",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       http.MethodPut,
	IsOpenAPI:    true,
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.AuditSetCleanCronRequest{},
	ResponseType: apistructs.AuditSetCleanCronResponse{},
	Doc:          "summary: 更新审计事件设置",
}
View Source
var CMDB_CLUSTER_DEREFERENCE = apis.ApiSpec{
	Path:         "/api/clusters/actions/dereference",
	BackendPath:  "/api/clusters/actions/dereference",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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_ERRORLOG_CREATE = apis.ApiSpec{
	Path:         "/api/task-error/actions/create",
	BackendPath:  "/api/task-error/actions/create",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:          "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:          "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:          "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       http.MethodPost,
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ChunkAPI:     true,
	ResponseType: apistructs.FileUploadResponse{},
	Doc:          "summary: 文件上传",
}
View Source
var CMDB_IMAGE_FETCH = apis.ApiSpec{
	Path:        "/api/images/<imageName>",
	BackendPath: "/api/images/<imageName>",
	Host:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: 图片上传",
}
View Source
var CMDB_LABEL_CREATE = apis.ApiSpec{
	Path:         "/api/labels",
	BackendPath:  "/api/labels",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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_LICENSE = apis.ApiSpec{
	Path:         "/api/license",
	BackendPath:  "/api/license",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	RequestType:  apistructs.QueryMBoxRequest{},
	ResponseType: apistructs.QueryMBoxResponse{},
	IsOpenAPI:    true,
	Doc:          "summary: 查询站内信列表",
}
View Source
var CMDB_MBOX_READ_ALL = apis.ApiSpec{
	Path:        "/api/mboxs/actions/read-all",
	BackendPath: "/api/mboxs/actions/read-all",
	Host:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	CheckToken:  true,
	IsOpenAPI:   true,
	Doc:         "summary: read all unread mbox with one click",
}
View Source
var CMDB_MBOX_STATS = apis.ApiSpec{
	Path:        "/api/mboxs/actions/stats",
	BackendPath: "/api/mboxs/actions/stats",
	Host:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:          "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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_NOTIFYGROUP_CREATE = apis.ApiSpec{
	Path:         "/api/notify-groups",
	BackendPath:  "/api/notify-groups",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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_INGRESS_UPDATE = apis.ApiSpec{
	Path:         "/api/orgs/ingress/<orgID>",
	BackendPath:  "/api/orgs/ingress/<orgID>",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.OrgUpdateIngressResponse{},
	Doc:          "summary: 更新组织入口",
}
View Source
var CMDB_ORG_VERIFICODE_GEN = apis.ApiSpec{
	Path:         "/api/orgs/actions/gen-verify-code",
	BackendPath:  "/api/orgs/actions/gen-verify-code",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:            "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	ResponseType: apistructs.ScopeRoleListResponse{},
	Doc:          "summary: 列出用户所有权限",
	Group:        "permissions",
}
View Source
var CMDB_PROJECT_FUNCTIONS_GET = apis.ApiSpec{
	Path:        "/api/projects/actions/get-project-functions",
	BackendPath: "/api/projects/actions/get-project-functions",
	Host:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:        "core-services.marathon.l4lb.thisdcos.directory:9526",
	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:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	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_ROLES_LIST_BY_USER = apis.ApiSpec{
	Path:         "/api/members/actions/list-user-roles",
	BackendPath:  "/api/members/actions/list-user-roles",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.ListMemberRolesByUserRequest{},
	ResponseType: apistructs.ListMemberRolesByUserResponse{},
	Doc:          "summary: 根据用户id获取成员角色列表",
}
View Source
var QUOTA_GET_PROJECT_NAMESPACES = apis.ApiSpec{
	Path:         "/api/projects-namespaces",
	BackendPath:  "/api/projects-namespaces",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "",
}
View Source
var QUOTA_GET_PROJECT_QUOTA = apis.ApiSpec{
	Path:         "/api/projects-quota",
	BackendPath:  "/api/projects-quota",
	Host:         "core-services.marathon.l4lb.thisdcos.directory:9526",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	CheckToken:   true,
	IsOpenAPI:    true,
	RequestType:  nil,
	ResponseType: nil,
	Doc:          "",
}

Functions

This section is empty.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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