You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Cisco设备RestConf请求报错:uri keypath not found,路径存在于Yang模块

解决RestConf请求"uri keypath not found"错误

问题场景

执行以下RestConf GET请求时返回错误:
GET https://<device-ip>/restconf/data/Cisco-IOS-XE-native:native/ip/prefix-lists/prefixes/name

错误响应:

{
    "ietf-restconf:errors": {
        "error": [
            {
                "error-type": "application",
                "error-tag": "invalid-value",
                "error-message": "uri keypath not found"
            }
        ]
    }
}

确认该路径已定义在Cisco-IOS-XE-native Yang模块中,但仍触发此错误。

可能的原因与解决方法

  • 列表节点访问格式错误:Yang模块中prefixes是列表类型节点,name是该列表的键属性,不能直接作为路径节点访问。若要获取指定名称的前缀列表,需使用键值匹配格式:
    https://<device-ip>/restconf/data/Cisco-IOS-XE-native:native/ip/prefix-lists/prefixes=LIST_NAME
    替换LIST_NAME为设备上实际存在的前缀列表名称。

  • 错误的节点层级:若要获取所有前缀列表,应直接访问prefixes节点,请求路径改为:
    https://<device-ip>/restconf/data/Cisco-IOS-XE-native:native/ip/prefix-lists/prefixes

  • 设备无对应配置:即使Yang模块定义了路径,若设备上未配置任何前缀列表,直接访问prefixes/name也会触发错误。先通过CLI或其他方式确认设备上存在目标前缀列表配置。

  • 路径拼写或命名空间错误:检查请求路径中的模块名Cisco-IOS-XE-native是否正确,节点名称(如prefix-lists、prefixes)是否与Yang模块定义完全一致,注意大小写和连字符的使用。

内容的提问来源于stack exchange,提问作者Alok Kumar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 13:24:55