RootSchemaNode¶
- 
class ydk.path.RootSchemaNode¶
- Instances of this class represent the - Rootof the- SchemaTree. A- RootSchemaNodecan be used to instantiate a- DataNodetree or an- Rpcobject. The children of the- RootSchemaNoderepresent the top level- SchemaNodein the YANG module submodules.- 
create_datanode(path, value=None)¶
- Create data node with path and value. This methods creates a - DataNodetree based on the path passed in. The path expression must identify a single node. If the last node created is of schema type- list,- leaf-listor- anyxmlthat value is also set in the node.- The returned - DataNodeis the last node created (the terminal part of the path).- Note in the case of YANG - listnodes the keys must be present in the path expression in the form of predicates.- Parameters: - path – (str) The XPath expression identifying the node relative to the root of the schema tree.
- value – The string representation of the value to set.
 
- path – (
 - 
find(path)¶
- Finds descendant nodes that match the given xpath expression. - This API finds descendant nodes in the - SchemaNodetree that satisfy the given path expression. See How do I use the Path API?.- Parameters: - path – ( - str) The path expression.- Returns: - List of schema node satisfies the criterion. - Return type: - list of - SchemaNode
 - 
get_parent()¶
- Get parent. - Returns: - RootSchemaNode‘s parent, which is- None.- Return type: - None 
 - 
get_path()¶
- Get path. - Returns: - RootSchemaNode‘s path, which is- \.- Return type: - A Python string 
 - 
get_root()¶
- Get the root schema node for - RootSchemaNode.- Returns: - RootSchemaNode‘s Root schema node.- Return type: - SchemaNode
 - 
create_rpc(path)¶
- Create an Rpc instance. - The path expression should point to a - SchemaNodethat represents the- Rpc.- Parameters: - path – ( - str) The path to the rpc schema node.- Returns: - Rpc instance if it could be created. - Return type: - None or - Rpc- Excample usage for creating a - ydk:createrpc:- 1 2 3 4 - from ydk.path import NetconfSession session = NetconfSession('127.0.0.1', 'admin', 'admin') root_schema = session.get_root_schema() root_schema.create_rpc('ydk:create') 
 
-