From 530a15e90689f8dedb5b4006f79c35d4ba4a5ca4 Mon Sep 17 00:00:00 2001 From: bluikko <14869000+bluikko@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:57:16 +0700 Subject: [PATCH] Closes 14655: Document raw text configuration render Also fix a missing character typo. --- docs/features/configuration-rendering.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/features/configuration-rendering.md b/docs/features/configuration-rendering.md index a87a6eae4..44cacc684 100644 --- a/docs/features/configuration-rendering.md +++ b/docs/features/configuration-rendering.md @@ -39,7 +39,7 @@ When rendered for a specific NetBox device, the template's `device` variable wil ### Context Data -The objet for which the configuration is being rendered is made available as template context as `device` or `virtualmachine` for devices and virtual machines, respectively. Additionally, NetBox model classes can be accessed by the app or plugin in which they reside. For example: +The object for which the configuration is being rendered is made available as template context as `device` or `virtualmachine` for devices and virtual machines, respectively. Additionally, NetBox model classes can be accessed by the app or plugin in which they reside. For example: ``` There are {{ dcim.Site.objects.count() }} sites. @@ -70,6 +70,11 @@ This request will trigger resolution of the device's preferred config template i If no config template has been assigned to any of these three objects, the request will fail. +The configuration can be rendered as JSON or as plaintext by setting the `Accept:` HTTP header. For example: + +* `Accept: application/json` +* `Accept: text/plain` + ### General Purpose Use NetBox config templates can also be rendered without being tied to any specific device, using a separate general purpose REST API endpoint. Any data included with a POST request to this endpoint will be passed as context data for the template.