Skip to content

Commit

Permalink
api/operator: ServerHost(s) endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
langmartin committed Jun 22, 2020
1 parent e543f49 commit 5c013ee
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
28 changes: 28 additions & 0 deletions api/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,31 @@ func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, *QueryMeta, erro
}
return &reply, qm, nil
}

type HostData struct {
OS string
Network string
ResolvConf string
Hosts string
Systemd string
Disk map[string]DiskUsage
}

type DiskUsage struct {
DiskMB int64
UsedMB int64
}

type HostsReply struct {
HostData map[string]*HostData
QueryMeta
}

func (op *Operator) ServerHosts(q *QueryOptions) (*HostsReply, *QueryMeta, error) {
var reply HostsReply
qm, err := op.c.query("/v1/operator/host/servers", &reply, q)
if err != nil {
return nil, nil, err
}
return &reply, qm, nil
}
28 changes: 28 additions & 0 deletions vendor/github.com/hashicorp/nomad/api/operator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5c013ee

Please sign in to comment.