Skip to content
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

feat(specs): Initial panos_ethernet_layer3_subinterface spec #277

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kklimonda-cl
Copy link
Contributor

@kklimonda-cl kklimonda-cl commented Jan 14, 2025

This PR adds initial support for nested resources, i.e. resources that are created within other resources.

Code changes:

Specs

Renamed xpath_suffix to panos_xpath and made it into an object, with path and vars 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 exported importToLocation and unimportFromLocation 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants