feat(xinfra): include cluster and mysql version in register payload
This commit is contained in:
@@ -2389,6 +2389,8 @@ type cloudDMDataSource struct {
|
|||||||
InstanceDesc string `json:"instanceDesc"`
|
InstanceDesc string `json:"instanceDesc"`
|
||||||
DSType string `json:"dsType"`
|
DSType string `json:"dsType"`
|
||||||
Host string `json:"host"`
|
Host string `json:"host"`
|
||||||
|
ClusterID *uint64 `json:"cluster_id"`
|
||||||
|
MySQLVersion string `json:"mysql_version"`
|
||||||
SecurityType string `json:"securityType"`
|
SecurityType string `json:"securityType"`
|
||||||
UserName string `json:"userName"`
|
UserName string `json:"userName"`
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
@@ -2466,6 +2468,13 @@ func buildCloudDMRegisterRequest(instance model.DeploymentResult, payload delive
|
|||||||
if description == "" {
|
if description == "" {
|
||||||
description = instance.InstanceName
|
description = instance.InstanceName
|
||||||
}
|
}
|
||||||
|
mysqlVersion := strings.TrimSpace(instance.Version)
|
||||||
|
if mysqlVersion == "" {
|
||||||
|
mysqlVersion = strings.TrimSpace(payload.MySQLVersion)
|
||||||
|
}
|
||||||
|
if mysqlVersion == "" {
|
||||||
|
mysqlVersion = "8.0"
|
||||||
|
}
|
||||||
return cloudDMRegisterRequest{
|
return cloudDMRegisterRequest{
|
||||||
SourceSystem: "xinfra",
|
SourceSystem: "xinfra",
|
||||||
ResourceType: "MYSQL_INSTANCE",
|
ResourceType: "MYSQL_INSTANCE",
|
||||||
@@ -2475,6 +2484,8 @@ func buildCloudDMRegisterRequest(instance model.DeploymentResult, payload delive
|
|||||||
InstanceDesc: description,
|
InstanceDesc: description,
|
||||||
DSType: "MySQL",
|
DSType: "MySQL",
|
||||||
Host: net.JoinHostPort(instance.Host, strconv.Itoa(instance.Port)),
|
Host: net.JoinHostPort(instance.Host, strconv.Itoa(instance.Port)),
|
||||||
|
ClusterID: nil,
|
||||||
|
MySQLVersion: mysqlVersion,
|
||||||
SecurityType: "USER_PASSWD",
|
SecurityType: "USER_PASSWD",
|
||||||
UserName: "root",
|
UserName: "root",
|
||||||
Password: password,
|
Password: password,
|
||||||
|
|||||||
Reference in New Issue
Block a user