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

schema discovery



Hi,

I prefer the <get> based approach for schema discovery.  But I would
also like to see a mechanism to retrieve the actual schema over
NETCONF.  The data model below supports those two concepts.  It is
also extensible so that new schema formats can be added without
modifying this module.

Usage example (namespace-simplified):

  <rpc>
    <get>
      <filter>
        <schemas/>
      </filter>
    <get/>
  </rpc>

  <rpc-reply>
    <data>
      <schemas>
        <schema>
          <identifier>netconf-schema</identifier>
          <version>2007-12-11</version>
          <type>
            <yang/>
          </type>
          <location>http://foo/netconf-schema.yang</location>
          <location>netconf</location>
        </schema>
        <schema>
          ...
        </schema>
      </schemas>
    <data>
  </rpc-reply>


Since one location was 'netconf', we can use the new rpc to get it:

  <rpc>
    <get-schema>
      <identifier>netconf-schema</identifier>
      <version>2007-12-11</version>
      <type>
        <yang/>
      </type>
    </get-schema>
  </rpc>      

  <rpc-reply>
    <data>
      <schema>


module netconf-schema {
  namespace urn:ietf:params:xml:ns:netconf:schema;
  prefix schema;

  import yang-types { prefix yang; }

  organization
    "NETCONF WG, IETF";

  description
    "NETCONF Schema Discovery.";

  revision "2007-12-11" {
    description "Initial revision.";
  }

  grouping schema-type {
    description
      "Reusable, extensible schema type definition.";
    container type {
      choice format {
        leaf xsd  { type empty; }
        leaf yang { type empty; }
      }
    }
  }

  container schemas {
    config false;
    list schema {
      leaf identifier {
        type string;  // should this be the model's namespace instead?
      }
      leaf version {
        type string;
      }
      uses schema-type;
      leaf-list location {
        type union {
          type enumeration {
            enum "netconf" {
              description
                "indicates that the schema can be retrieved
                 using the get-schema rpc.";
            }
          }
          type yang:uri;
        }
      }
    }
  }
  
  rpc get-schema {
    description
      "RPC operation to get a schema over NETCONF.";
    input {
      leaf identifier { type string; }
      leaf version { type string; } // should this really be here??
      uses schema-type;
    }
    output {
      leaf schema { type string; }
    }
  }
}



      </schema>
    </data>
  <rpc-reply>



/martin
      

--
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/>