forked from michaelklishin/rabbit-hole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
definitions.go
37 lines (32 loc) · 1.05 KB
/
definitions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package rabbithole
// ExportedDefinitions represents definitions exported from a RabbitMQ cluster
type ExportedDefinitions struct {
RabbitVersion string `json:"rabbit_version"`
RabbitMQVersion string `json:"rabbitmq_version"`
ProductName string `json:"product_name"`
ProductVersion string `json:"product_version"`
Users []UserInfo
Vhosts []VhostInfo
Permissions []Permissions
TopicPermissions []TopicPermissionInfo
Parameters []RuntimeParameter
GlobalParameters []GlobalRuntimeParameter `json:"global_parameters"`
Policies []PolicyDefinition
Queues []QueueInfo
Exchanges []ExchangeInfo
Bindings []BindingInfo
}
//
// GET /api/definitions
//
// ListDefinitions returns a set of definitions exported from a RabbitMQ cluster.
func (c *Client) ListDefinitions() (p *ExportedDefinitions, err error) {
req, err := newGETRequest(c, "definitions")
if err != nil {
return nil, err
}
if err = executeAndParseRequest(c, req, &p); err != nil {
return nil, err
}
return p, nil
}