forked from go-chef/chef
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstats.go
More file actions
21 lines (18 loc) · 660 Bytes
/
stats.go
File metadata and controls
21 lines (18 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package chef
type StatsService struct {
client *Client
}
// Stats: represents the body of the returned information.
type Stats []map[string]interface{}
// Stat gets the frontend & backend server information.
//
// https://docs.chef.io/api_chef_server/
//
// ?format = text or json or nothing, text is supposed to work but returns a 406
// This module only implements the json option. using a struct for the parse
// out data will force JSON output.
func (e *StatsService) Get(user string, password string) (data Stats, err error) {
format := "json"
err = e.client.basicRequestDecoder("GET", "_stats?format="+format, nil, &data, user, password)
return
}