Repository

class ydk.path.Repository(*args)

Repository is used to create a RootSchemaNode given a set of Capabilities. Behind the scenes the repository is responsible for loading and parsing the YANG modules and creating the SchemaNode tree. Service provider is expected to use the method create_root_schema to generate the RootSchemaNode.

Parameters

args – Search directory of type str or nothing.

Note

If a directory path of type str is provided, model search path will be located in this path, otherwise, default location ~/.cache/ydk will 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.