sync vendored modules

This commit is contained in:
davemay99
2020-10-06 09:16:52 -04:00
parent bf8bdc94f8
commit 29dbd22395
2 changed files with 19 additions and 2 deletions

View File

@@ -8,8 +8,6 @@ import (
"github.com/posener/complete"
)
//var _ cli.Command = &MetricsCommand{}
type OperatorMetricsCommand struct {
Meta
}

View File

@@ -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
}