mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(monitor): rename tags to tag_pairs (#15087)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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, ",", "|")
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user