Local schema file

When the NISH client starts, it provides an initial MD-CLI tree to the user. This MD-CLI environment is based on a local MD-CLI schema definition. The NISH client provides a default built-in local schema. To enable user extensibility in the MD-CLI environment, the operator can create a locally defined MD-CLI schema file.

The local schema file is a text file that contains the details of the locally defined NISH MD-CLI schema extensibility definitions. It can be used in static and manager mode. There are no requirements for the filename.

The following are the requirements for the local schema file:

To use a local schema file, start the NISH client with the --local-schema-file option or --s flag followed by the relative or absolute path to the local schema file, or define the path to the local schema file in an environment variable or a NISH rc file. See NISH rc files.

The local schema file defines a structure called a schema that contains one or more schema branches that can be linked hierarchically. The schema branches are either local or remote.

Local schema
Local schemas define branches in the NISH MD-CLI tree that operate locally on the Linux host; these are currently not supported.
Remote schema
Remote schemas define branches in the NISH MD-CLI tree that connect to SR OS nodes.

The schema names create hierarchical structures within the MD-CLI and define device labels. The connection and all device labels are reserved and cannot be used; see Device labels.

The following example shows a local schema file with a branch containing two remote schemas. The devices schema defines the devices branch within the NISH MD-CLI. The sub-schemas UPF and CPF are remote schemas under the devices branch.

schemas {
  schema {
    name: "devices"
    shortDescription: "Configuration of all devices"
    schema {
      name: "UPF"
      shortDescription: "User plane devices"
      schemaType: remote
    }
    schema {
      name: "CPF"
      shortDescription: "control plane function devices"
      schemaType: remote
    }
  }
}
Note: If reserved device labels are used in the local schema file, the NISH client exits with an error, as shown in the following example:
ERROR: Specified local-schema-file contains reserved schema name 'connection'

After the initial installation, there is an example local schema file in /etc/nish/local-schema.