chore: adapter node metrics query with `cluster_id ` or `cluster uuid` (#28)
This commit is contained in:
parent
5a02966f2d
commit
9cb54a3381
|
@ -565,6 +565,17 @@ func (h *APIHandler) GetClusterNodes(w http.ResponseWriter, req *http.Request, p
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"bool": util.MapStr{
|
||||||
|
"minimum_should_match": 1,
|
||||||
|
"should": []util.MapStr{
|
||||||
|
{
|
||||||
|
"term": util.MapStr{
|
||||||
|
"metadata.labels.cluster_id": util.MapStr{
|
||||||
|
"value": id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"term": util.MapStr{
|
"term": util.MapStr{
|
||||||
"metadata.labels.cluster_uuid": util.MapStr{
|
"metadata.labels.cluster_uuid": util.MapStr{
|
||||||
|
@ -572,6 +583,9 @@ func (h *APIHandler) GetClusterNodes(w http.ResponseWriter, req *http.Request, p
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"term": util.MapStr{
|
"term": util.MapStr{
|
||||||
"metadata.name": util.MapStr{
|
"metadata.name": util.MapStr{
|
||||||
|
|
|
@ -116,6 +116,17 @@ func (h *APIHandler) getNodeMetrics(ctx context.Context, clusterID string, bucke
|
||||||
}
|
}
|
||||||
|
|
||||||
var must = []util.MapStr{
|
var must = []util.MapStr{
|
||||||
|
{
|
||||||
|
"bool": util.MapStr{
|
||||||
|
"minimum_should_match": 1,
|
||||||
|
"should": []util.MapStr{
|
||||||
|
{
|
||||||
|
"term": util.MapStr{
|
||||||
|
"metadata.labels.cluster_id": util.MapStr{
|
||||||
|
"value": clusterID,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"term": util.MapStr{
|
"term": util.MapStr{
|
||||||
"metadata.labels.cluster_uuid": util.MapStr{
|
"metadata.labels.cluster_uuid": util.MapStr{
|
||||||
|
@ -123,6 +134,9 @@ func (h *APIHandler) getNodeMetrics(ctx context.Context, clusterID string, bucke
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"term": util.MapStr{
|
"term": util.MapStr{
|
||||||
"metadata.category": util.MapStr{
|
"metadata.category": util.MapStr{
|
||||||
|
|
Loading…
Reference in New Issue