Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic support for definition export #170

Merged
merged 2 commits into from
Dec 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions runtime_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,44 @@ type RuntimeParameter struct {
Value interface{} `json:"value"`
}

// RuntimeDefinitions represents rabbitmq runtime configuration.
type RuntimeDefinitions struct {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are called just definitions, not runtime definitions. A lot of them have nothing to do with runtime parameters and do not change at runtime (e.g. product version).

RabbitVersion string `json:"rabbit_version"`
RabbitmqVersion string `json:"rabbitmq_version"`
ProductName string `json:"product_name"`
ProductVersion string `json:"product_version"`
Users interface{} `json:"users"`
Vhosts interface{} `json:"vhosts"`
Permissions interface{} `json:"permissions"`
TopicPermissions interface{} `json:"topic_permissions"`
Parameters interface{} `json:"parameters"`
GlobalParameters interface{} `json:"global_parameters"`
Policies interface{} `json:"policies"`
Queues interface{} `json:"queues"`
Exchanges interface{} `json:"exchanges"`
Bindings interface{} `json:"bindings"`
}

// RuntimeParameterValue represents arbitrary parameter data.
type RuntimeParameterValue map[string]interface{}

//
// GET /api/definitions
//

func (c *Client) ListRuntimeDefinitions() (p *RuntimeDefinitions, err error) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be renamed per the comment above.

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
}

//
// GET /api/parameters
//
Expand Down