feat(specs): Initial panos_ethernet_layer3_subinterface spec #277
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.
This PR adds initial support for nested resources, i.e. resources that are created within other resources.
Code changes:
Specs
Renamed
xpath_suffix
topanos_xpath
and made it into an object, withpath
andvars
keys. Both can be used in conjunction to render xpath suffix with multiple variables.Codegen
Some parameters are now skipped in Go SDK, as they are only used in terraform, and translated into panos xpath variables.
Go SDK
Created a new method on location objects
XpathWithComponents
with variable arguments, that can be used to generate xpaths with multiple variables (before we only had to append entry name to static location xpath for a given resource).Added new low-level service methods:
CreateWithXpath
,ReadWithXpath
,UpdateWithXpath
that expect to be given rendered xpath as string, and do no further xpath processing. They also don't handle importing and unimporting, so exportedimportToLocation
andunimportFromLocation
methods where needed.Terraform
Rewrote SDK manager to use
*WithXpath
method variants, and handle importing/unimporting explicitly. CRUD methods now pass location and a list of xpath components (xpath variable values) that are used to render final Xpath.During Read() terraform attributes that are part of xpath are read from xpath and set in the state.