-
Notifications
You must be signed in to change notification settings - Fork 52
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
Data opennebula virtual network address range #550
base: master
Are you sure you want to change the base?
Data opennebula virtual network address range #550
Conversation
Before reviewing in depth I wanted to discuss a bit about the consistency of the datasources and their names, I think it's important to keep things consistent across the provider when it's possible. For a bit more of context: Feel free to drop a comment to discuss. |
Now, in data "opennebula_virtual_network_address_range" "Controlplane" {
virtual_network_id = data.opennebula_virtual_network.Controlplane.id
address_range_id = 0
} And here's the corresponding output: {
"address_range_id" = tostring(0)
"address_ranges" = tolist([
{
"ar_type" = "IP4"
"custom" = tomap({})
"global_prefix" = ""
"held_ips" = toset([
"192.168.1.101",
"192.168.1.102",
])
"ip4" = "192.168.1.101"
"mac" = "02:00:c0:a8:01:65"
"size" = 3
},
])
"id" = "83"
"virtual_network_id" = 83
} However, if you don't specify it, the data source will return the entire list of address ranges. The division into When from |
…range data source. Now the data source retrieves information only for the specified address range.
…retrieve minimal information about all address ranges for a virtual network.
Now, when using this data source Additionally, I've introduced a new data source Also updated the documentation to reflect these changes. |
By the way, could you take a quick look at #532 when you get a chance? It's closed now, but it might still be useful to review. |
This pull request is stale because it has been open for 30 days with no activity and it is not in a milestone. Remove 'status: stale' label or comment, or this will be closed in 5 days. |
Sorry for the late reply and thank you for the time spent on this issue. The idea about the naming is to help the user understanding how to use the new resources regarding other resources behavior. There's a consistency among them. There is no use case about filtering address ranges based on their attributes ? An other idea may be to add a |
This pull request is stale because it has been open for 30 days with no activity and it is not in a milestone. Remove 'status: stale' label or comment, or this will be closed in 5 days. |
Some thoughts on why networks = {
test1 = "M|network|test1| |reserve_from:${data.opennebula_virtual_network.test.id}:SIZE=1"
test2 = "M|network|test2| |reserve_from:${data.opennebula_virtual_network.test.id}:SIZE=2"
test3 = "M|network|test3| |reserve_from:${data.opennebula_virtual_network.test.id}:SIZE=3"
test4 = "M|network|test4| |reserve_from:${data.opennebula_virtual_network.test.id}:SIZE=4"
} In these cases, it’s super handy to quickly get the necessary values for each address range. For instance, I need to access Regarding your idea of adding an AR section to the virtual network resource, I’d like to point out that we aren’t creating the virtual networks ourselves; OpenNebula manages that for us. So, having a separate data source for |
Community Note
Description
Refactor: Virtual network address range data source to enhance readability and maintainability.
References
Close #545
New or Affected Resource(s)
opennebula_virtual_network_address_range
data sourceChecklist
References
go fmt
)