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

Generate Intended Config - GraphQL Data - Transposer function #881

Open
NetwerkAdmin opened this issue Feb 7, 2025 · 1 comment
Open
Labels
type: feature Introduction of substantial new functionality to the application

Comments

@NetwerkAdmin
Copy link

NetwerkAdmin commented Feb 7, 2025

Environment

  • Nautobot version: 2.4.2

  • nautobot-golden-config version: 2.3.0

    The new - 'Generate Intended Config' - feature, does not show transposer output in the 'GraphQL Data'

Proposed Functionality

Show transposer output as part of the 'GraphQL Data', just like the 'SOT Aggregate Data' does in 'Config Overview'.

Use Case

@itdependsnetworks
Copy link
Contributor

@gsnider2195 @cmsirbu we should use:

https://github.com/nautobot/nautobot-app-golden-config/blob/d23fbc5e76707f98c7c96a2fd0548c4e5d74af13/nautobot_golden_config/utilities/graphql.py#L15C5-L15C19

instead of

graphql_query = None
graphql_query_id_param = request.query_params.get("graphql_query_id")
if graphql_query_id_param:
try:
graphql_query = GraphQLQuery.objects.get(pk=request.query_params.get("graphql_query_id"))
except GraphQLQuery.DoesNotExist as exc:
raise GenerateIntendedConfigException(
f"GraphQLQuery with id '{graphql_query_id_param}' not found"
) from exc
settings = models.GoldenConfigSetting.objects.get_for_device(device)
if not settings:
raise GenerateIntendedConfigException("No Golden Config settings found for this device")
if not settings.jinja_repository:
raise GenerateIntendedConfigException("Golden Config settings jinja_repository not set")
if graphql_query is None:
if settings.sot_agg_query is not None:
graphql_query = settings.sot_agg_query
else:
raise GenerateIntendedConfigException("Golden Config settings sot_agg_query not set")
if "device_id" not in graphql_query.variables:
raise GenerateIntendedConfigException("The selected GraphQL query is missing a 'device_id' variable")

@smk4664 smk4664 added type: feature Introduction of substantial new functionality to the application and removed type: minor feature labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Introduction of substantial new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants