Terraform search implementation for network template#516
Open
AnilGadiyarHJ wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Terraform list resource for nios_ipam_networktemplate so existing network templates can be queried via Terraform's new query/list framework, and adds resource identity support to the existing nios_ipam_networktemplate resource. Also tightens validation handling for two fields on the resource.
Changes:
- Introduces
NetworktemplateList(networktemplate_list.go) and registers it in the provider, with corresponding docs, example, and acceptance tests. - Adds
ResourceWithIdentity(refas identity) to the network template resource, populating identity in Create/Read/Update/ReadByExtAttrs and consuming it inImportState. - Moves
lease_scavenge_timerange validation intoValidateConfig(to allow the special-1value) and relaxeslow_water_markvalidator fromBetween(1, 100)toBetween(0, 100)to match its0default.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/service/ipam/networktemplate_list.go | New list resource implementation with paginated API calls and identity/resource population. |
| internal/service/ipam/networktemplate_list_test.go | Acceptance tests for basic listing, filter, and extattr filter scenarios. |
| internal/service/ipam/networktemplate_resource.go | Adds identity schema, identity persistence across CRUD, identity-aware import, and lease_scavenge_time validation. |
| internal/service/ipam/model_networktemplate.go | Drops in-schema lease_scavenge_time range validator; widens low_water_mark validator to allow 0. |
| internal/provider/provider.go | Registers NewNetworktemplateList in the provider's list resources. |
| examples/list-resources/nios_ipam_networktemplate/list-resource.tfquery.hcl | Example tfquery configurations for the new list resource. |
| docs/list-resources/ipam_networktemplate.md | Auto-generated documentation page for the new list resource. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
467
to
469
| int64validator.Between(0, 100), | ||
| }, | ||
| MarkdownDescription: "The percentage of DHCP network usage below which the Infoblox appliance generates a syslog message and sends a warning (if enabled). A number that specifies the percentage of allocated addresses. The range is from 1 to 100.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.