Xml Cisco NSO Yang软件包成功加载,但其运行状态仍处于关闭状态
有人玩过Cisco NSO吗?它基本上是一个YANG/XML模型问题,不需要成为NSO专家? 如果是,感谢您对此问题的帮助: 我正在使用Cisco NSO工具开发一个新的Yang模型。 在这里可以找到杨模型:Xml Cisco NSO Yang软件包成功加载,但其运行状态仍处于关闭状态,xml,ietf-netmod-yang,Xml,Ietf Netmod Yang,有人玩过Cisco NSO吗?它基本上是一个YANG/XML模型问题,不需要成为NSO专家? 如果是,感谢您对此问题的帮助: 我正在使用Cisco NSO工具开发一个新的Yang模型。 在这里可以找到杨模型: module snmpTemp1 { namespace "http://com/example/snmpTemp1"; prefix snmpTemp1; import ietf-inet-types { prefix inet; } import t
module snmpTemp1 {
namespace "http://com/example/snmpTemp1";
prefix snmpTemp1;
import ietf-inet-types {
prefix inet;
}
import tailf-ncs {
prefix ncs;
}
import tailf-common {
prefix tailf;
}
list snmpTemp1 {
key comm-str;
uses ncs:service-data;
ncs:servicepoint "snmpTemp1";
leaf comm-str {
tailf:info "snmp-server community-string";
type string;
}
// may replace this with other ways of refering to the devices.
leaf device {
tailf:info "Pick any one of the IOS device";
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}
// replace with your own stuff here
leaf access {
tailf:info "Specify RO or RW";
type enumeration {
enum ro;
enum rw;
}
}
}
}
尝试加载此程序包时,出现错误:
admin@ncs# show packages package snmpTemp1
packages package snmpTemp1
package-version 1.0
description "Template-based snmpTemp1 resource facing service"
ncs-min-version [ 5.3 ]
directory ./state/packages-in-use/1/snmpTemp1
oper-status file-load-error
oper-status error-info "snmpTemp1-template.xml:2 Unknown servicepoint: snmpTemp1"
admin@ncs#
Yang和XML模型之间似乎存在一个问题:
在这里可以找到XML的摘录:
<config-template xmlns="http://tail-f.com/ns/config/1.0"
servicepoint="snmpTemp1">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<!--
Select the devices from some data structure in the service
model. In this skeleton the devices are specified in a leaf-list.
Select all devices in that leaf-list:
-->
<name>{/device}</name>
<config>
<!--
Add device-specific parameters here.
In this skeleton the service has a leaf "dummy"; use that
to set something on the device e.g.:
<ip-address-on-device>{/dummy}</ip-address-on-device>
-->
<snmp-server xmlns="urn:ios">
<community>
<name>{/comm-str}</name>
<RO when="{starts-with(access, 'ro')}"/>
<RW when="{starts-with(access, 'rw')}"/>
</community>
</snmp-server>
</config>
</device>
</devices>
</config-template>
有人玩过Cisco NSO吗?它基本上是一个YANG/XML模型问题,不需要成为NSO专家?
如果是,谢谢你的帮助
关于。通常,如果在重新加载NSO之前未运行make of package,则会发生此类错误 请注意,即使是纯yang+模板,但没有任何服务java/python逻辑,也必须编译包
此外,如果在创建包后修改服务点,则会发生此类错误,因为这会破坏XML模板中C-DB的一致性,因此也提到了服务点,请尝试从XML中删除该服务点。我们不需要在XML模板中添加服务点
<config-template xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<!--
Select the devices from some data structure in the service
model. In this skeleton the devices are specified in a leaf-list.
Select all devices in that leaf-list:
-->
<name>{device-name}</name>
<config>
<interface xmlns="http://tail-f.com/ned/cisco-ios-xr">
<HundredGigE>
<id>{interface}</id>