shwstppr opened a new pull request, #164:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/164
Currently, filtering is not working when the response object is not
returning an array. This PR makes changes to allow filtering when response
object is an array or a map.
For async apis, filter arg is passed to the query request allowing filtering
to work with the final response.
Output with changes,
```
⇒ make run
main|✚2
▶ Running gofmt…
▶ Building executable… a6552ee
▶ Done!
./bin/cmk
Apache CloudStack 🐵 CloudMonkey 6.4.0
Report issues: https://github.com/apache/cloudstack-cloudmonkey/issues
(lab) 🐱 > deploy virtualmachine zoneid=1bf9db92-f21a-411b-a089-58ce51754581
serviceofferingid=0348031d-aa66-419d-bb4b-b023b3017c0c
templateid=8fe9df86-6de0-11f0-bdac-9843fa67404e (CentOS 5.6 (64-bit) no GUI
(Simulator)) filter=id
{
"virtualmachine": [
{
"id": "d0f4daa2-7adc-4cdf-a65c-ec128d8374be"
}
]
}
(lab) 🐱 > update virtualmachine id=2902e6d3-b261-4de1-a0cf-2fe6e324ea88
display=abc filter=name,id
{
"virtualmachine": [
{
"id": "2902e6d3-b261-4de1-a0cf-2fe6e324ea88",
"name": "VM-2902e6d3-b261-4de1-a0cf-2fe6e324ea88"
}
]
}
(lab) 🐱 > list virtualmachines id=2902e6d3-b261-4de1-a0cf-2fe6e324ea88
filter=id,name
{
"count": 1,
"virtualmachine": [
{
"id": "2902e6d3-b261-4de1-a0cf-2fe6e324ea88",
"name": "VM-2902e6d3-b261-4de1-a0cf-2fe6e324ea88"
}
]
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]