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

Devices query can specify more than one hostname. #30

Merged
merged 1 commit into from
Apr 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (c *controller) Zones() ([]Zone, error) {
// DevicesArgs is a argument struct for selecting Devices.
// Only devices that match the specified criteria are returned.
type DevicesArgs struct {
Hostname string
Hostname []string
MACAddresses []string
SystemIDs []string
Domain string
Expand All @@ -183,7 +183,7 @@ type DevicesArgs struct {
// Devices implements Controller.
func (c *controller) Devices(args DevicesArgs) ([]Device, error) {
params := NewURLParams()
params.MaybeAdd("hostname", args.Hostname)
params.MaybeAddMany("hostname", args.Hostname)
params.MaybeAddMany("mac_address", args.MACAddresses)
params.MaybeAddMany("id", args.SystemIDs)
params.MaybeAdd("domain", args.Domain)
Expand Down
2 changes: 1 addition & 1 deletion controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (s *controllerSuite) TestDevicesArgs(c *gc.C) {
// that address, but we don't care, all we want to do is capture the request
// and make sure that all the values were set.
controller.Devices(DevicesArgs{
Hostname: "untasted-markita",
Hostname: []string{"untasted-markita"},
MACAddresses: []string{"something"},
SystemIDs: []string{"something-else"},
Domain: "magic",
Expand Down