1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes 14655: Document raw text configuration render

Also fix a missing character typo.
This commit is contained in:
bluikko
2024-01-17 12:57:16 +07:00
committed by Jeremy Stretch
parent 1235b496b4
commit 530a15e906

View File

@ -39,7 +39,7 @@ When rendered for a specific NetBox device, the template's `device` variable wil
### Context Data ### 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. 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. 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 ### 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. 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.