-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1268 from WeBankPartners/dev
Release v2.0.3
- Loading branch information
Showing
32 changed files
with
1,024 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM alpine | ||
FROM ccr.ccs.tencentyun.com/webankpartners/alpine-base:v1.0 | ||
|
||
ENV BASE_HOME=/app/cmdb | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package ci | ||
|
||
import ( | ||
"fmt" | ||
"github.com/WeBankPartners/we-cmdb/cmdb-server/api/middleware" | ||
"github.com/WeBankPartners/we-cmdb/cmdb-server/models" | ||
"github.com/WeBankPartners/we-cmdb/cmdb-server/services/db" | ||
"github.com/gin-gonic/gin" | ||
"strings" | ||
) | ||
|
||
func GetCiDataVariableCallback(c *gin.Context) { | ||
ciType := c.Param("ciType") | ||
rowGuid := c.Param("guid") | ||
if ciType == "" || rowGuid == "" { | ||
middleware.ReturnParamValidateError(c, fmt.Errorf("Param ciType and guid can not empty ")) | ||
return | ||
} | ||
result, err := db.ListCiDataVariableCallback(ciType, rowGuid) | ||
if err != nil { | ||
middleware.ReturnServerHandleError(c, err) | ||
} else { | ||
middleware.ReturnData(c, result) | ||
} | ||
} | ||
|
||
func GetActionQueryData(c *gin.Context) { | ||
operation := c.Param("operation") | ||
ciType := c.Param("ciType") | ||
rowGuid := c.Param("guid") | ||
if operation == "" || ciType == "" || rowGuid == "" { | ||
middleware.ReturnParamValidateError(c, fmt.Errorf("Url param illegal ")) | ||
return | ||
} | ||
var err error | ||
result := models.CiDataActionQuery{} | ||
tmpOperation := strings.ToLower(operation) | ||
if tmpOperation == "rollback" { | ||
queryData, title, rollbackErr := db.DataRollbackList(rowGuid) | ||
if rollbackErr != nil { | ||
middleware.ReturnServerHandleError(c, rollbackErr) | ||
return | ||
} | ||
result.Data = queryData | ||
result.Title = title | ||
} else { | ||
result, err = db.GetCallbackQueryData(ciType, rowGuid) | ||
if err != nil { | ||
middleware.ReturnServerHandleError(c, err) | ||
return | ||
} | ||
} | ||
middleware.ReturnData(c, result) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package models | ||
|
||
import "time" | ||
|
||
type SysWecubeProcessTable struct { | ||
Guid string `json:"guid"` | ||
CiDataGuid string `json:"ci_data_guid"` | ||
WecubeProcInstanceTmp string `json:"wecube_proc_instance_tmp"` | ||
WecubeProcInstance string `json:"wecube_proc_instance"` | ||
WecubeProcDefine string `json:"wecube_proc_define"` | ||
Status string `json:"status"` | ||
UpdateTime time.Time `json:"update_time"` | ||
} | ||
|
||
type CoreProcessQueryResponse struct { | ||
Status string `json:"status"` | ||
Message string `json:"message"` | ||
Data []*CodeProcessQueryObj `json:"data"` | ||
} | ||
|
||
type CodeProcessQueryObj struct { | ||
ExcludeMode string `json:"excludeMode"` | ||
ProcDefId string `json:"procDefId"` | ||
ProcDefKey string `json:"procDefKey"` | ||
ProcDefName string `json:"procDefName"` | ||
ProcDefVersion string `json:"procDefVersion"` | ||
RootEntity string `json:"rootEntity"` | ||
Status string `json:"status"` | ||
CreatedTime string `json:"createdTime"` | ||
CreatedUnixTime int64 `json:"-"` | ||
Tags string `json:"tags"` | ||
} | ||
|
||
type CoreProcessRequest struct { | ||
EventSeqNo string `json:"eventSeqNo"` | ||
EventType string `json:"eventType"` | ||
SourceSubSystem string `json:"sourceSubSystem"` | ||
OperationKey string `json:"operationKey"` | ||
OperationData string `json:"operationData"` | ||
NotifyRequired string `json:"notifyRequired"` | ||
NotifyEndpoint string `json:"notifyEndpoint"` | ||
OperationUser string `json:"operationUser"` | ||
OperationMode string `json:"operationMode"` | ||
} | ||
|
||
type CoreStartProcess struct { | ||
Status string `json:"status"` | ||
Message string `json:"message"` | ||
Data CoreStartProcessData `json:"data"` | ||
} | ||
|
||
type CoreStartProcessData struct { | ||
ProcInstId string `json:"procInstId"` | ||
Status string `json:"status"` | ||
TaskNodeInstances []*CoreStartProcessData `json:"taskNodeInstances"` | ||
} | ||
|
||
type CoreProcessResult struct { | ||
Status string `json:"status"` | ||
Message string `json:"message"` | ||
Data CoreProcessResultData `json:"data"` | ||
} | ||
|
||
type CoreProcessResultData struct { | ||
ProcInstId int `json:"procInstId"` | ||
Status string `json:"status"` | ||
TaskNodeInstances []*CoreProcessResultData `json:"taskNodeInstances"` | ||
} | ||
|
||
type CiDataCallbackParam struct { | ||
CiType string `json:"ciType"` | ||
RowGuid string `json:"rowGuid"` | ||
ProcessKey string `json:"processKey"` | ||
ProcessName string `json:"processName"` | ||
OperationUser string `json:"operationUser"` | ||
} | ||
|
||
type CiDataActionQuery struct { | ||
Title []*CiDataActionQueryTitle `json:"title"` | ||
Data []map[string]interface{} `json:"data"` | ||
Selectable bool `json:"selectable"` | ||
} | ||
|
||
type CiDataActionQueryTitle struct { | ||
Id string `json:"key"` | ||
Name string `json:"title"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.