fix(monitor): rename tags to tag_pairs (#15087)

This commit is contained in:
屈轩
2022-09-28 15:26:29 +08:00
committed by GitHub
parent fc0702d90c
commit 7d772ff1e4
10 changed files with 10 additions and 2 deletions
+1
View File
@@ -78,6 +78,7 @@ func (self BucketDetails) GetMetricTags() map[string]string {
"status": self.Status,
"tenant": self.Project,
"tenant_id": self.ProjectId,
"external_id": self.ExternalId,
}
for k, v := range self.Metadata {
if strings.HasPrefix(k, apis.USER_TAG_PREFIX) {
+1
View File
@@ -340,6 +340,7 @@ func (self DBInstanceDetails) GetMetricTags() map[string]string {
"brand": self.Brand,
"domain_id": self.DomainId,
"project_domain": self.ProjectDomain,
"external_id": self.ExternalId,
}
if len(self.IpAddrs) > 0 {
ret["rds_ip"] = strings.ReplaceAll(self.IpAddrs, ",", "|")
+1
View File
@@ -56,6 +56,7 @@ func (self ElasticcacheDetails) GetMetricTags() map[string]string {
"brand": self.Brand,
"domain_id": self.DomainId,
"project_domain": self.ProjectDomain,
"external_id": self.ExternalId,
}
for k, v := range self.Metadata {
if strings.HasPrefix(k, apis.USER_TAG_PREFIX) {
+1
View File
@@ -287,6 +287,7 @@ func (self ServerDetails) GetMetricTags() map[string]string {
"project_domain": self.ProjectDomain,
"account": self.Account,
"account_id": self.AccountId,
"external_id": self.ExternalId,
}
for k, v := range self.Metadata {
if strings.HasPrefix(k, apis.USER_TAG_PREFIX) {
+1
View File
@@ -249,6 +249,7 @@ func (self HostDetails) GetMetricTags() map[string]string {
"account": self.Account,
"res_type": "host",
"account_id": self.AccountId,
"external_id": self.ExternalId,
}
for k, v := range self.Metadata {
if strings.HasPrefix(k, apis.USER_TAG_PREFIX) {
+1
View File
@@ -65,6 +65,7 @@ func (self KubeClusterDetails) GetMetricTags() map[string]string {
"project_domain": self.ProjectDomain,
"account": self.Account,
"account_id": self.AccountId,
"external_id": self.ExternalId,
}
return ret
}
+1
View File
@@ -63,6 +63,7 @@ func (self ModelartsPoolDetails) GetMetricTags() map[string]string {
"domain_id": self.DomainId,
"account_id": self.AccountId,
"account": self.Account,
"external_id": self.ExternalId,
}
return ret
}
+1
View File
@@ -158,6 +158,7 @@ func (self StorageDetails) GetMetricTags() map[string]string {
"brand": self.Brand,
"domain_id": self.DomainId,
"project_domain": self.ProjectDomain,
"external_id": self.ExternalId,
}
for k, v := range self.Metadata {
if strings.HasPrefix(k, apis.USER_TAG_PREFIX) {
+1 -1
View File
@@ -99,7 +99,7 @@ type SimpleQueryInput struct {
// 结束时间
EndTime time.Time `json:"end_time"`
// 指定标签
Tags map[string]string `json:"tags"`
Tags map[string]string `json:"tag_pairs"`
}
type SimpleQueryOutput struct {
+1 -1
View File
@@ -46,7 +46,7 @@ func (o *SimpleQueryOptions) Params() (jsonutils.JSONObject, error) {
}
}
if len(tags) > 0 {
ret.Set("tags", jsonutils.Marshal(tags))
ret.Set("tag_pairs", jsonutils.Marshal(tags))
}
return ret, nil
}