Linux command
gnmic-set 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Set configuration value
gnmic set -a [router:57400] --update-path [/system/name] --update-value "[router1]"
Delete configuration
gnmic set -a [router:57400] --delete [/interfaces/interface[name=eth1]]
Set from file
gnmic set -a [router:57400] --update-path [/] --update-file [config.json]
Replace configuration
gnmic set -a [router:57400] --replace-path [/interfaces] --replace-file [interfaces.json]
说明
gnmic set modifies configuration on gNMI-enabled devices. It supports update (merge), replace, and delete operations on configuration data. The command can set individual values or apply entire configuration files. It is used for network automation and configuration management via the gNMI protocol.
参数
- -a _ADDRESS_
- Target address.
- --update-path _PATH_
- Path to update.
- --update-value _VALUE_
- Value to set.
- --update-file _FILE_
- Value from file.
- --delete _PATH_
- Path to delete.
- --replace-path _PATH_
- Path to replace.
- --help
- Display help information.
FAQ
What is the gnmic-set command used for?
gnmic set modifies configuration on gNMI-enabled devices. It supports update (merge), replace, and delete operations on configuration data. The command can set individual values or apply entire configuration files. It is used for network automation and configuration management via the gNMI protocol.
How do I run a basic gnmic-set example?
Run `gnmic set -a [router:57400] --update-path [/system/name] --update-value "[router1]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a _ADDRESS_ do in gnmic-set?
Target address.