diff --git a/doc/cli_auto_generation/cli_auto_generation.md b/doc/cli_auto_generation/cli_auto_generation.md index 0d2c6689ba..fc88a8a382 100644 --- a/doc/cli_auto_generation/cli_auto_generation.md +++ b/doc/cli_auto_generation/cli_auto_generation.md @@ -114,10 +114,13 @@ discovered_plugins = { The SONiC CLI Auto-generation tool is a part of [sonic-package-manager](https://github.com/stepanblyschak/SONiC/blob/sonic-app-ext-3/doc/sonic-application-extention/sonic-application-extention-hld.md#cli-enhancements) utility. A package [installation](https://github.com/stepanblyschak/SONiC/blob/sonic-app-ext-3/doc/sonic-application-extention/sonic-application-extention-hld.md#package-installation) and [upgrade flow](https://github.com/stepanblyschak/SONiC/blob/sonic-app-ext-3/doc/sonic-application-extention/sonic-application-extention-hld.md#package-upgrade) will trigger the `SONiC CLI auto-generation tool` if the YANG model was provided as part of the Application extension docker image. -In order to get the auto-generated CLI - the YANG model should be a part of the Application extension Docker image and placed along with [manifest.json](https://github.com/stepanblyschak/SONiC/blob/sonic-app-ext-3/doc/sonic-application-extention/sonic-application-extention-hld.md#manifest) file. The user should be able to reach the YANG model by using the docker labels. +In order to get the auto-generated CLI - the YANG model should be a part of the Application extension Docker image and placed along with [manifest.json](https://github.com/stepanblyschak/SONiC/blob/sonic-app-ext-3/doc/sonic-application-extention/sonic-application-extention-hld.md#manifest) file. The user should be able to reach the YANG model by using the docker labels. Several YANG modules might be provided by an application extension: ``` -com.azure.sonic.yang_model +com.azure.sonic.yang-module.sonic- +com.azure.sonic.yang-module.sonic- ``` +where ```sonic-```, ```sonic-``` are the names of the modules, e.g (sonic-vlan, sonic-port, etc.) and should match the module name. + ###### Figure 2: YANG model location as part of Application extension docker image

Figure 2 Yang model location @@ -133,15 +136,23 @@ The [manifest.json](https://github.com/stepanblyschak/SONiC/blob/sonic-app-ext-3 | Path | Type | Mandatory | Description | | --------------------------------- | ------ | --------- | ------------------------------------------------------------------------- | -| /cli/click-cli-auto-generate-config | boolean| yes | ON/OFF triger for auto-generation of CLI command *config*. Default: false | -| /cli/click-cli-auto-generate-show | boolean| yes | ON/OFF triger for auto-generation of CLI command *show*. Default: false | +| /cli/auto-generate-config | boolean| yes | ON/OFF triger for auto-generation of CLI command *config*. Default: false | +| /cli/auto-generate-show | boolean| yes | ON/OFF triger for auto-generation of CLI command *show*. Default: false | + +By default, CLI is autogenerated for all YANG modules provided by the extension. Developer can optionally specify explicitelly which YANG modules to use for auto-generated CLI: + +| Path | Type | Mandatory | Description | +| --------------------------------- | ------ | --------- | ------------------------------------------------------------------------- | +| /cli/auto-generate-config-source-yang-modules | list of strings | no | If set, config CLI auto-generation will only apply to specified YANG modules. The YANG module is referenced by the name recorded in labels (which should match the name of the module) | +| /cli/auto-generate-show-source-yang-modules | list of strings | no | If set, config CLI auto-generation will only apply to specified YANG modules. The YANG module is referenced by the name recorded in labels (which should match the name of the module) | Inside the manifest.json there are [other keys](https://github.com/stepanblyschak/SONiC/blob/sonic-app-ext-3/doc/sonic-application-extention/sonic-application-extention-hld.md#manifest-path-7), that describing a path to a `NOT auto-generated CLI plugins`. For example, there are: | Path | Type | Mandatory | Description | | ---------------------- | ------ | --------- | --------------------------------------------------------------- | -| /cli/show-cli-plugin | string | no | A path to a plugin for sonic-utilities show CLI command. | -| /cli/config-cli-plugin | string | no | A path to a plugin for sonic-utilities config CLI command. | +| /cli/show-cli-plugin | list of strings | no | List of paths to plugins for sonic-utilities show CLI command. | +| /cli/config-cli-plugin | list of strings | no | List of paths to plugins for sonic-utilities config CLI command. | +| /cli/clear-cli-plugin | list of strings | no | List of paths to plugins for sonic-utilities sonic-clear CLI command. | For example, the user can have a `config` CLI auto-generated and the `show` CLI NOT auto-generated. diff --git a/doc/sonic-application-extension/sonic-application-extension-guide.md b/doc/sonic-application-extension/sonic-application-extension-guide.md index 4f6f2f5f57..736f48b6da 100644 --- a/doc/sonic-application-extension/sonic-application-extension-guide.md +++ b/doc/sonic-application-extension/sonic-application-extension-guide.md @@ -209,8 +209,11 @@ The value should contain a JSON serialized as a string. | /processes | list | no | A list defining processes running inside the container. | | /cli | object | no | CLI plugin information. *NOTE*: Later will deprecated and replaced with a YANG module file path. | | /cli/mandatory | boolean| no | Wether CLI is a mandatory functionality for the package. Default: False. | -| /cli/show-cli-plugin | string | no | A path to a plugin for sonic-utilities show CLI command. | -| /cli/config-cli-plugin | string | no | A path to a plugin for sonic-utilities config CLI command. | -| /cli/clear-cli-plugin | string | no | A path to a plugin for sonic-utilities sonic-clear CLI command. | - +| /cli/show-cli-plugin | list of strings | no | List of paths to plugins for sonic-utilities show CLI command. | +| /cli/config-cli-plugin | list of strings | no | List of paths to plugins for sonic-utilities config CLI command. | +| /cli/clear-cli-plugin | list of strings | no | List of paths to plugins for sonic-utilities sonic-clear CLI command. | +| /cli/auto-generate-config | boolean| yes | ON/OFF triger for auto-generation of CLI command *config*. Default: false | +| /cli/auto-generate-show | boolean| yes | ON/OFF triger for auto-generation of CLI command *show*. Default: false | +| /cli/auto-generate-config-source-yang-modules | list of strings | no | If set, config CLI auto-generation will only apply to specified YANG modules. The YANG module is referenced by the name recorded in labels (which should match the name of the module) | +| /cli/auto-generate-show-source-yang-modules | list of strings | no | If set, config CLI auto-generation will only apply to specified YANG modules. The YANG module is referenced by the name recorded in labels (which should match the name of the module) | diff --git a/doc/sonic-application-extension/sonic-application-extention-hld.md b/doc/sonic-application-extension/sonic-application-extention-hld.md index 905bf518d4..12f5f4861d 100644 --- a/doc/sonic-application-extension/sonic-application-extention-hld.md +++ b/doc/sonic-application-extension/sonic-application-extention-hld.md @@ -1130,9 +1130,9 @@ ave to be also auto-generated from YANG in the future. | Path | Type | Mandatory | Description | | ---------------------- | ------ | --------- | --------------------------------------------------------------- | | /cli/mandatory | boolean| no | Wether CLI is a mandatory functionality for the package. Default: False. | -| /cli/show-cli-plugin | string | no | A path to a plugin for sonic-utilities show CLI command. | -| /cli/config-cli-plugin | string | no | A path to a plugin for sonic-utilities config CLI command. | -| /cli/clear-cli-plugin | string | no | A path to a plugin for sonic-utilities sonic-clear CLI command. | +| /cli/show-cli-plugin | list of strings | no | List of paths to plugins for sonic-utilities show CLI command. | +| /cli/config-cli-plugin | list of strings | no | List of paths to plugins for sonic-utilities config CLI command. | +| /cli/clear-cli-plugin | list of strings | no | List of paths to plugins for sonic-utilities sonic-clear CLI command. | ### SONiC Processes and Docker Statistics Telemetry Support