Skip to content

Commit

Permalink
Closes 14655: Document raw text configuration render
Browse files Browse the repository at this point in the history
Also fix a missing character typo.
  • Loading branch information
bluikko authored and jeremystretch committed Jan 17, 2024
1 parent 1235b49 commit 530a15e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/features/configuration-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 530a15e

Please sign in to comment.