From 0b68a9c2599e331668990413f456a9329255c2dc Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 7 Feb 2023 15:41:40 -0500 Subject: [PATCH] Docs & cleanup --- docs/models/extras/configcontext.md | 4 ++++ docs/release-notes/version-3.5.md | 1 + netbox/extras/api/serializers.py | 4 +++- ...ata_path_and_more.py => 0085_configcontext_synced_data.py} | 0 4 files changed, 8 insertions(+), 1 deletion(-) rename netbox/extras/migrations/{0085_configcontext_data_file_configcontext_data_path_and_more.py => 0085_configcontext_synced_data.py} (100%) diff --git a/docs/models/extras/configcontext.md b/docs/models/extras/configcontext.md index 156b2d784..1e58b9e01 100644 --- a/docs/models/extras/configcontext.md +++ b/docs/models/extras/configcontext.md @@ -18,6 +18,10 @@ A numeric value which influences the order in which context data is merged. Cont The context data expressed in JSON format. +### Data File + +Config context data may optionally be sourced from a remote [data file](../core/datafile.md), which is synchronized from a remote data source. When designating a data file, there is no need to specify local data for the config context: It will be populated automatically from the data file. + ### Is Active If not selected, this config context will be excluded from rendering. This can be convenient to temporarily disable a config context. diff --git a/docs/release-notes/version-3.5.md b/docs/release-notes/version-3.5.md index ae2d319b3..985953d47 100644 --- a/docs/release-notes/version-3.5.md +++ b/docs/release-notes/version-3.5.md @@ -4,6 +4,7 @@ ### Enhancements +* [#9073](https://github.com/netbox-community/netbox/issues/9073) - Enable syncing config context data from remote sources * [#11254](https://github.com/netbox-community/netbox/issues/11254) - Introduce the `X-Request-ID` HTTP header to annotate the unique ID of each request for change logging * [#11440](https://github.com/netbox-community/netbox/issues/11440) - Add an `enabled` field for device type interfaces * [#11517](https://github.com/netbox-community/netbox/issues/11517) - Standardize the inclusion of related objects across the entire UI diff --git a/netbox/extras/api/serializers.py b/netbox/extras/api/serializers.py index 4135e9015..54627fbb3 100644 --- a/netbox/extras/api/serializers.py +++ b/netbox/extras/api/serializers.py @@ -359,7 +359,9 @@ class ConfigContextSerializer(ValidatedModelSerializer): required=False, many=True ) - data_source = NestedDataSourceSerializer() + data_source = NestedDataSourceSerializer( + required=False + ) data_file = NestedDataFileSerializer( read_only=True ) diff --git a/netbox/extras/migrations/0085_configcontext_data_file_configcontext_data_path_and_more.py b/netbox/extras/migrations/0085_configcontext_synced_data.py similarity index 100% rename from netbox/extras/migrations/0085_configcontext_data_file_configcontext_data_path_and_more.py rename to netbox/extras/migrations/0085_configcontext_synced_data.py