mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix(cloudmon): huawei metric pull (#19236)
This commit is contained in:
@@ -38,7 +38,7 @@ func init() {
|
||||
|
||||
Usable *bool `help:"List regions where networks are usable"`
|
||||
UsableVpc *bool `help:"List regions where VPC are usable"`
|
||||
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers"`
|
||||
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers|elasticcaches"`
|
||||
|
||||
City string `help:"List regions in the specified city"`
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ require (
|
||||
k8s.io/client-go v0.19.3
|
||||
k8s.io/cluster-bootstrap v0.19.3
|
||||
moul.io/http2curl/v2 v2.3.0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111104539-da7cf2b94be6
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111122145-cb7fc83612a1
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
|
||||
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19
|
||||
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361
|
||||
|
||||
@@ -1201,8 +1201,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111104539-da7cf2b94be6 h1:6ntC7GqAuXJg7zXAKfKGE20/EL7iJOUZD0CRbp/UgTs=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111104539-da7cf2b94be6/go.mod h1:aj1gR9PPb6eqqKOwvANe26CoZFY8ydmXy0fuvgKYXH0=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111122145-cb7fc83612a1 h1:owTUaCPLsoqJJpiqmWGEi942k1BOIbz2lg5QBfgbgHQ=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111122145-cb7fc83612a1/go.mod h1:aj1gR9PPb6eqqKOwvANe26CoZFY8ydmXy0fuvgKYXH0=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
|
||||
@@ -146,6 +146,7 @@ func (self *SCollectByResourceIdDriver) CollectDBInstanceMetrics(ctx context.Con
|
||||
EndTime: end,
|
||||
}
|
||||
opts.ResourceId = rds.ExternalId
|
||||
opts.RegionExtId = rds.RegionExtId
|
||||
opts.Engine = rds.Engine
|
||||
|
||||
tags := []influxdb.SKeyValue{}
|
||||
@@ -601,6 +602,7 @@ func (self *SCollectByResourceIdDriver) CollectLoadbalancerMetrics(ctx context.C
|
||||
EndTime: end,
|
||||
}
|
||||
opts.ResourceId = lb.ExternalId
|
||||
opts.RegionExtId = lb.RegionExtId
|
||||
|
||||
tags := []influxdb.SKeyValue{}
|
||||
for k, v := range lb.GetMetricTags() {
|
||||
|
||||
@@ -86,6 +86,7 @@ func (self *HuaweiCollect) CollectModelartsPoolMetrics(ctx context.Context, mana
|
||||
EndTime: end,
|
||||
}
|
||||
opts.ResourceId = pool.ExternalId
|
||||
opts.RegionExtId = pool.RegionExtId
|
||||
|
||||
tags := []influxdb.SKeyValue{}
|
||||
for k, v := range pool.GetMetricTags() {
|
||||
|
||||
@@ -124,6 +124,7 @@ func (self *DBInstanceAccountCreateTask) CreateDBInstanceAccount(ctx context.Con
|
||||
DBInstanceaccountId: account.Id,
|
||||
DBInstancedatabaseId: privilege.DBInstancedatabaseId,
|
||||
}
|
||||
_privilege.ExternalId = fmt.Sprintf("%s/%s/%s", account.Name, privilege.Database, privilege.Privilege)
|
||||
models.DBInstancePrivilegeManager.TableSpec().Insert(ctx, &_privilege)
|
||||
logclient.AddActionLogWithStartable(self, account, logclient.ACT_GRANT_PRIVILEGE, privilege, self.UserCred, true)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1465,7 +1465,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
|
||||
# sigs.k8s.io/yaml v1.2.0
|
||||
## explicit; go 1.12
|
||||
sigs.k8s.io/yaml
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111104539-da7cf2b94be6
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111122145-cb7fc83612a1
|
||||
## explicit; go 1.18
|
||||
yunion.io/x/cloudmux/pkg/apis
|
||||
yunion.io/x/cloudmux/pkg/apis/billing
|
||||
|
||||
+1
-1
@@ -602,7 +602,7 @@ func (self *SHuaweiClient) getUrl(service, regionId, resource string, method htt
|
||||
case SERVICE_VPC_V3:
|
||||
url = fmt.Sprintf("https://vpc.%s.myhuaweicloud.com/v3/%s/%s", regionId, projectId, resource)
|
||||
case SERVICE_CES:
|
||||
url = fmt.Sprintf("https://ces.%s.myhuaweicloud.com/v1.0/%s/%s", regionId, projectId, resource)
|
||||
url = fmt.Sprintf("https://ces.%s.myhuaweicloud.com/V1.0/%s/%s", regionId, projectId, resource)
|
||||
case SERVICE_MODELARTS:
|
||||
url = fmt.Sprintf("https://modelarts.%s.myhuaweicloud.com/v2/%s/%s", regionId, projectId, resource)
|
||||
case SERVICE_MODELARTS_V1:
|
||||
|
||||
+13
@@ -76,6 +76,7 @@ type SElasticcache struct {
|
||||
VpcID int64 `json:"VpcId"`
|
||||
WANIP string `json:"WanIp"`
|
||||
ZoneID int `json:"ZoneId"`
|
||||
WanAddress string
|
||||
}
|
||||
|
||||
func (self *SElasticcache) SetTags(tags map[string]string, replace bool) error {
|
||||
@@ -448,6 +449,12 @@ func (self *SElasticcache) GetPrivateConnectPort() int {
|
||||
}
|
||||
|
||||
func (self *SElasticcache) GetPublicDNS() string {
|
||||
if len(self.WanAddress) > 0 {
|
||||
if idx := strings.Index(self.WanAddress, ":"); idx > 0 {
|
||||
return self.WanAddress[:idx]
|
||||
}
|
||||
return self.WanAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -456,6 +463,12 @@ func (self *SElasticcache) GetPublicIpAddr() string {
|
||||
}
|
||||
|
||||
func (self *SElasticcache) GetPublicConnectPort() int {
|
||||
if idx := strings.Index(self.WanAddress, ":"); idx > 0 {
|
||||
port, _ := strconv.Atoi(self.WanAddress[idx+1:])
|
||||
if port > 0 {
|
||||
return port
|
||||
}
|
||||
}
|
||||
return self.Port
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user