mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
sync vendored modules
This commit is contained in:
@@ -8,8 +8,6 @@ import (
|
||||
"github.com/posener/complete"
|
||||
)
|
||||
|
||||
//var _ cli.Command = &MetricsCommand{}
|
||||
|
||||
type OperatorMetricsCommand struct {
|
||||
Meta
|
||||
}
|
||||
|
||||
19
vendor/github.com/hashicorp/nomad/api/operator.go
generated
vendored
19
vendor/github.com/hashicorp/nomad/api/operator.go
generated
vendored
@@ -304,3 +304,22 @@ func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, *QueryMeta, erro
|
||||
}
|
||||
return &reply, qm, nil
|
||||
}
|
||||
|
||||
func (op *Operator) Metrics(q *QueryOptions) (string, error) {
|
||||
if q == nil {
|
||||
q = &QueryOptions{}
|
||||
}
|
||||
|
||||
metricsReader, err := op.c.rawQuery("/v1/metrics", q)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
metricsBytes, err := ioutil.ReadAll(metricsReader)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
metrics := string(metricsBytes[:])
|
||||
return metrics, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user