vatesfr / terraform-provider-xenorchestra

Xen Orchestra provider for Terraform
MIT License
150 stars 32 forks source link

Add hosts data source #122

Closed ddelnano closed 3 years ago

ddelnano commented 3 years ago

We have a host data source, but as described in https://github.com/terra-farm/terraform-provider-xenorchestra/issues/109#issuecomment-773835812 I believe we can power more advanced use cases by adding the ability to filter and sort hosts.

gohumble commented 3 years ago

Hello,

Filtering by tag / pool is possible by adding it to the filter parameter within the jsonrpc call.

But is there any possibility to sort results from xo.getAllObjects? I wasn't able to find anything about sorting online. Maybe you can help me out? XOA only defines 3 parameters for getAllObjects.

So my best approach for this would be fetching unsorted and sorting within the provider. Are you okay with that?

ddelnano commented 3 years ago

Yea I don't think we have another option. This could be a feature request made to Xen Orchestra but for now we will need to sort in the provider.

ddelnano commented 3 years ago

This fix will be released in v0.19.0 of the provider. Thanks for all your help @gohumble!