add network users subcommand

This commit is contained in:
Anish Mukherjee
2022-11-29 19:23:39 +05:30
parent 683fe7abb1
commit a98a116bf7
11 changed files with 227 additions and 0 deletions

View File

@@ -12,14 +12,17 @@ func GetNodeMetrics(networkName, nodeID string) *models.Metrics {
return request[models.Metrics](http.MethodGet, fmt.Sprintf("/api/metrics/%s/%s", networkName, nodeID), nil)
}
// GetNetworkNodeMetrics - fetch an entire network's metrics
func GetNetworkNodeMetrics(networkName string) *models.NetworkMetrics {
return request[models.NetworkMetrics](http.MethodGet, "/api/metrics/"+networkName, nil)
}
// GetAllMetrics - fetch all metrics
func GetAllMetrics() *models.NetworkMetrics {
return request[models.NetworkMetrics](http.MethodGet, "/api/metrics", nil)
}
// GetNetworkExtMetrics - fetch external client metrics belonging to a network
func GetNetworkExtMetrics(networkName string) *map[string]models.Metric {
return request[map[string]models.Metric](http.MethodGet, "/api/metrics-ext/"+networkName, nil)
}