Subject: Compact RELAX NG Schema for NETCONF

From: Rob Enns <[email-masked]>
Date: Tue, 16 Nov 2004 13:57:44 -0800

Here is a RELAX NG schema for the NETCONF protocol in compact form.
It was created automatically from the XML form of the RNG schema.

thanks,
 Rob

----

default namespace nc = "urn:ietf:params:xml:ns:netconf:base:1.0"
namespace local = ""
namespace inh = inherit

message-id = attribute message-id { xsd:string }

session-id = element session-id { xsd:unsignedInt }

anyElement = element * { ( attribute * { text } | text | anyElement )* }

config = anyElement*

configName =
   element startup { empty }
 | element candidate { empty }
 | element running { empty }

url = element url { xsd:anyURI }

source = element source { config | configName | url }

target = element target { configName | url }

filter =
   element filter
   {
      attribute type { "subtree" | "xpath" }?,
      ( anyElement | text )?
   }

getConfigType = element get-config { source, filter? }

operation = attribute operation { "merge" | "replace" | "create" | "delete" }

default-operation = element default-operation { "merge" | "replace" | "none" }

test-option = element test-option { "test" | "test-then-set" | "set" }

error-option = element error-option { "stop-on-error" | "ignore-error" }

editConfigType =
   element edit-config
   {
      target,
      default-operation?,
      test-option?,
      error-option?,
      config?
   }

copyConfigType = element copy-config { source, target }

deleteConfigType = element delete-config { target }

getType = element get { filter? }

lockType = element lock { target }

unlockType = element unlock { target }

validateType = element validate { source }

commitType =
   element commit
   {
      element confirmed { empty }?,
      element confirm-timeout { xsd:unsignedInt }?
   }

discardChangesType = element discard-changes { empty }

closeSessionType = element close-session { empty }

killSessionType = element kill-session { session-id }

rpcType =
   getConfigType
 | editConfigType
 | copyConfigType
 | deleteConfigType
 | getType
 | lockType
 | unlockType
 | validateType
 | commitType
 | discardChangesType
 | closeSessionType
 | killSessionType

error-type =
   element error-type { "transport" | "rpc" | "protocol" | "application" }

error-tag =
   element error-tag
   {
      "TOO_BIG"
    | "MISSING_ATTRIBUTE"
    | "BAD_ATTRIBUTE"
    | "UNKNOWN_ATTRIBUTE"
    | "MISSING_ELEMENT"
    | "BAD_ELEMENT"
    | "UNKNOWN_ELEMENT"
    | "ACCESS_DENIED"
    | "LOCK_DENIED"
    | "RESOURCE_DENIED"
    | "ROLLBACK_FAILED"
    | "DATA_EXISTS"
    | "DATA_MISSING"
    | "OPERATION_NOT_SUPPORTED"
    | "OPERATION_FAILED"
    | "PARTIAL_OPERATION"
   }

error-severity = element error-severity { "warning" | "error" }

rpcErrorType =
   element rpc-error
   {
      error-type,
      error-tag,
      error-severity,
      element error-app-tag { text }?,
      element error-path { text }?,
      element error-message { text }?,
      element error-info
      {
         element bad-attribute { text }?,
         element bad-element { text }?,
         element ok-element { text }?,
         element err-element { text }?,
         element noop-element { text }?,
         session-id?,
         anyElement?
      }?
   }

rpcReplyType =
   element ok { empty } | rpcErrorType | element data { anyElement? }

helloType = element capabilities { element capability { text }+ }

start |= element rpc { message-id, rpcType }

start |= element rpc-reply { message-id?, rpcReplyType }

start |= element hello { helloType }

--
to unsubscribe send a message to [email-masked] with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/netconf/>

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Wed, 17 Nov 2004 01:18:45 +0100

>    element ok { empty } | rpcErrorType | element data { anyElement? }

Hm, do the specs not allow for warnings that go along with results?
Do the specs not allow for multiple errors/warnings? I am having
some general questions in this space (but I am not yet done reading
the spec) - so I will probably post more later.

But yes, having a readable specification clearly helps to find these
questions. Perhaps I should take the statement back which I made during
the WG meeting that it might not be worth to switch to Relax NG for the
protocol specification...

/js

-- 
Juergen Schoenwaelder		    International University Bremen
<http://www.eecs.iu-bremen.de/>	    P.O. Box 750 561, 28725 Bremen, Germany