Repository¶
-
class
ydk.path.Repository(*args)¶ Repository is used to create a
RootSchemaNodegiven a set of Capabilities. Behind the scenes the repository is responsible for loading and parsing the YANG modules and creating theSchemaNodetree. Service provider is expected to use the methodcreate_root_schemato generate theRootSchemaNode.Parameters: args – Search directory of type stror nothing.Note
If a directory path of type
stris provided, model search path will be located in this path, otherwise, default location~/.cache/ydkwill be used. Example usage:>>> import os >>> from ydk.path import Repository >>> repo_path = os.path.join(os.path.expanduser('~'), 'Cisco', 'yang') # this directory should exist >>> default_repo = Repository() # repository using default location >>> custom_repo = Repository(repo_path) # custom repository
-
create_root_schema(capabilities)¶ Creates the root schema based on the capabilities passed in.
Parameters: capabilities – (list of Capability) Enabled capabilities.
-
create_root_schema(lookup_tables, capabilities) Creates the root schema based on capability lookup tables and capabilities passed in.
Parameters: - lookup_tables – (list of map of string and
Capability) Lookup tables. - capabilities – (list of
Capability) Enabled capabilities.
- lookup_tables – (list of map of string and
-