YANG模型中<rpc-error>的定义
生活随笔
收集整理的這篇文章主要介紹了
YANG模型中<rpc-error>的定义
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.grouping errors 源碼
grouping errors {description"A grouping that contains a YANG containerrepresenting the syntax and semantics of aYANG Patch errors report within a response message.";container errors {config false; // needed so list error does not need a keydescription"Represents an error report returned by the server ifa request results in an error.";list error {description"An entry containing information about onespecific error that occurred while processinga RESTCONF request.";reference "RFC 6241, Section 4.3";leaf error-type {type enumeration {enum transport {description "The transport layer";}enum rpc {description "The rpc or notification layer";}enum protocol {description "The protocol operation layer";}enum application {description "The server application layer";}}mandatory true;description"The protocol layer where the error occurred.";}leaf error-tag {type string;mandatory true;description"The enumerated error tag.";}leaf error-app-tag {type string;description"The application-specific error tag.";}leaf error-path {type data-resource-identifier;description"The target data resource identifier associatedwith the error, if any.";}leaf error-message {type string;description"A message describing the error.";}container error-info {description"A container allowing additional informationto be included in the error report.";// arbitrary anyxml content here}}}}2.定義的節點的解釋
報文中各字段含義:
(1)error-type:定義錯誤發生在協議的層級,有四種取值:transport傳輸層,RPC遠程進程調用,protocol協議層,application應用層。
(2) error-tag:標識錯誤信息內容。
(3)error-app-tag:標識特定的錯誤情形。對于一個特殊的錯誤情形,如果沒有合適的與之關聯,則此元素不會出現。
(4)error-path:標識出錯的位置及具體文件名稱。
(5)error-message:描述出錯內容。
(6)error-info:含有協議或者數據模型特定的錯誤內容。對于一個特殊的錯誤情形,如果沒有提供合適的,這個元素就不會出現。
3.示例
<?xml version="1.0" encoding="utf-8"?><rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"><rpc-error><error-type>application</error-type><error-tag>bad-element</error-tag><error-severity>error</error-severity><error-app-tag>43</error-app-tag><error-path xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"xmlns:acl="http://xxxxx">xxxxxxxx</error-path><error-message xml:lang="en">xxxxxx</error-message><error-info><bad-element>xxxxxxx</bad-element></error-info></rpc-error> </rpc-reply> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-5"><rpc-error><error-type>application</error-type><error-tag>operation-not-supported</error-tag><error-severity>error</error-severity><error-app-tag>no-support</error-app-tag><error-path>/wdm-pg:pgs/wdm-pg:pg[wdm-pg:pg-id='23']</error-path><error-message xml:lang="en">operation not supported</error-message><error-info><error-number xmlns="http://netconfcentral.org/ns/yuma-ncx">273</error-number></error-info></rpc-error> </rpc-reply>總結
以上是生活随笔為你收集整理的YANG模型中<rpc-error>的定义的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 财务管理【23】
- 下一篇: Python编程:从入门到实践pdf