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

fix: machines get should accept query params #68

Merged
merged 1 commit into from
May 7, 2024

Conversation

@jtoft-crusoe
Copy link

jtoft-crusoe commented Apr 25, 2024

@skatsaounis Awesome work; I was just about to make a PR myself and saw you'd already tackled it.

Hopefully we can get this merged soon.

@skatsaounis skatsaounis marked this pull request as ready for review April 29, 2024 11:25
@skatsaounis skatsaounis requested a review from troyanov April 29, 2024 11:25
@skatsaounis
Copy link
Collaborator Author

This is an example of handpicked filter options that can limit the results:

params := entity.MachinesParams{
	ID:         []string{"qfkedy", "bdfsrr"},
	NotStatus:  []string{"ready"},
	Status:     []string{"deployed"},
	Hostname:   []string{"maas-host"},
	LinkSpeed:  []int{1000},
	MACAddress: []string{"12:34:56:ab:ce:12"},
	Storage:    "root:100(rotary)",
	Devices:    "commissioning_driver=virtio-pci,product_id=1041",
}
results, err := client.Machines.Get(&params)
if err != nil {
	fmt.Println(err)
}
fmt.Println(len(results))

@troyanov troyanov merged commit 608640d into canonical:master May 7, 2024
3 checks passed
@matthewconolly-lambda
Copy link

Thanks for doing this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Providing filter values to machines endpoint
4 participants