[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compact RELAX NG Schema for NETCONF



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 netconf-request@ops.ietf.org with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/netconf/>