-
Notifications
You must be signed in to change notification settings - Fork 57
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
Feature: Add REST API to render intended config Jinja templates #824
Conversation
…or device, update tests, update docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I like the test improvements as well.
@jeffkala let's sync on this one. The PR looks good, I just want to make sure that there is thought around where the core rendering logic goes, as an example could/should we make it the same piece of code that is ran in the job |
As discussed, we'll update this to spin up a Nornir task to leverage We'll need to set the |
This is part of the jinja template editor epic. This PR introduces the
/api/plugins/golden-config/generate-intended-config/
REST API endpoint. This endpoint allows template developers to test jinja template rendering of intended configs using an arbitrary git repository on a single device.This PR also contains some housekeeping changes:
GoldenConfigSetting
model to add aget_for_device
convenience methodGoldenConfigSetting.get_jinja_template_path_for_device
instance method for conveniently retrieving this filesystem pathConfigPlanTest
setUpTestData
instead ofsetUp
Not implemented
GoldenConfigSetting.jinja_repository
. I think we should consider how this overlaps with the existing REST API for config post-processing (/api/plugins/golden-config/sotagg/<uuid:pk>/
) before making this decisionDocs
Sample Data
Git repo used for testing this feature is here
Jinja template used for testing
Request
Response