Network Intents provides a very intuitive graphical user interfaces, where users can create, update and execute intent-types and intent instances. This interface provides very broad details to help the user creating new instances, auditing, synchronizing, viewing audit reports, etc. For more details on Network Intents framework capabilities, please read here.
However, users with a developer profile are used to interface with IDEs that facilitate code development and integration, and not to program their code via web browsers. Some situations, like connection issues/timeouts, undesired navigation or refresh of the development window can drive into lose code changes. The purpose of this Visual Studio Code extension for Network Intents is to provide this type of users with a new interface to speed up their code design process/activities.
This activity is community driven, meaning that contributions are expected from anyone with access to the community (bug reporting, code development, etc).
The visual studio code extension, can be Installed directly from vsCode Marketplace
If you wish to compile the project or modify the code, clone the project repository at Github.com
npm install .
npm run compile
vsce package
As prerequisite, we support vsCode rel ^1.76.0.
After successfully installing the extension, you should see in you Explorer > Workspace a new folder called Intent Manager.
For installing the extension, access vsCode Settings (workspace) > Extensions > NOKIA_IM and select Extension Settings form the gear icon. You should see the following attributes to configure:
After modifying these settings, vsCode requires to reload the window. The can be done either closing and reopening vsCode, or by opening the command palette and entering the Developer: Reload Window command
With the installation and setup process successfully completed, a new folder "Intent Manager" will appear in the user's workspace.
This folder contains the intent-types (definitions) and intents (instances) folders for all hosted intent-types.
The extension allows to create a new intent-type, clone an existing intent-type, create a new version of an existing intent type, or delete an intent type.
Enter the name of the intent-type, the author and select from a list of pre-defined examples
Clone intent-type
New intent-type version
All operations are executed in the backend using the remote NSO system.
The extension allows to create, delete and update intent-type resources, script, yang, views and meta info.
To create a new resource, right-click on the desired folder (resource/yang/views) and provide a name. For views, there is no need to provide the extension name, while for other resources (.js, .yang) it is required.
To remove an existing file, right-click on the file and delete permanently. Some files (meta, script, schemaform) are blocked from deletion.
To update the file, open it in the editor view, save and vsCode will automatically upload your changes for you.
vsCode allows the usage of code snippets to help users with the automatic generation of code based on key words (see example below). Snippets should be code fragments that can be easily integrated and reusable.
In this first extension, we include few examples that are documented in the developer portal. However, we expect contributions from anyone on which snippets make sense to be included. This is an open topic, which will be very helpful for developers starting their intent development journey.
The user can open intents, edit and save them to the remote NSP server. Also create a local copy of intent instances by selecting and clicking “Download”. Same applies to upload: a user can copy local intent instances and paste them into the IM folder (automatically creating the intents in Network Intents).
The extension shows the network status of the intent, while also the alignment status. It also implements same functionality as Network Intents, by providing access to synchronize, audit, change network state, etc.
The extension provides some visibility of audit results by loading a webview. For a more comprehensive view, the extension provide the right pointer to the specific intent instance in Network Intents.
The extension allows to download intent-types and intents from the server, so the user can continue their developments offline.
To upload any modification, the current restriction is that it can only be done from the meta-info.json file, so the plugin identifies that you are editing an intent-type and not something different.
By clicking on upload, the plugin explores files and folders on the same path and generates the payload to upload to Network Intents. If the intent-type exists, it updates the existing one. Otherwise it creates one from the scratch.
If no name or version appear in the meta-info.json, the plugin will request this from the user.
Local development provides, among other capabilities, access to source control tools already available in vsCode (git). This allows the developers to have their local repository in sync with their source control platform (GitHub, GitLab) and push their latest changes directly into IM.
The extension has the ability to open a link to OpenSearch to pull logs related to a particular intent.
The functionality uses the intent ID (targets) to filter information. However, if this ID is included in other logs, they may be pulled and included in the report.
This currently works with logs exposed with the “log” and “logger” classes.
Alejandro Aguado (PLM Automation Frameworks)
Sven Wisotzky (DevEx owner)