What is a view?
View files
Views, or view files, are used to augment the intent type YANG to create the input form the user will see when creating an intent, or when using intent-based configuration in another NSP function.
Nokia-signed intent types, which are installed using Artifacts, cannot be edited except to manage views.
To see the list of views for an intent type, double-click on the intent type from the Network Intents, Intent Types view and click MANAGE VIEWS.
The list of views includes:
-
viewConfig files: a viewConfig file defines the changes to make to the attributes in the intent type YANG to define the fields that will appear in the input form and their properties. For example, if the YANG declares that the intent creation form will contain two string fields, a viewConfig file can provide names for the fields.
-
schema forms: the schema form is automatically generated from the viewConfig file. NSP implements the schema form to create the input form.
Choose a schema form in the views list to see a form preview.
-
view.settings files: the view.settings file is automatically generated. It provides a link to the module and container defined in the intent type YANG to identify the YANG entry point.
For detailed information about View file configuration for developers, see the ViewConfig section of the Network Intents tutorial on the Network Developer Portal.
Default viewConfig file
When an intent is created from the Intent Types view, NSP searches for a viewConfig file called default.viewConfig to render the intent creation form.
If there is no default.viewConfig file present, NSP renders a basic form from the intent type YANG. To customize the default intent creation form, configure a default.viewConfig file; see How do I add or change a View file?.
Other viewConfig files can be created for use from other NSP functions.
Parent and child viewConfig files
A viewConfig file can be attached to another as a child. The child file inherits all the attributes and rules configured in the parent file.
The child file can add attributes or overwrite attribute values and rules.
For example:
-
The parent file augments one attribute: attr1. The title of attr1 is set to Parent.
-
The child file augments two attributes: attr1 and attr2. The title of attr1 is set to child and attr2 is set to child2.
In the Form Preview, if you choose the parent schema form, one attribute is changed. The title is Parent. If you choose the child schema form, two attributes are changed. The titles are child and child2.