This documents contains exercises about Jinja2, ncclient, Yang Development Kit and Advanced NETCONF Explorer.
This section has two folders :
exercices
with the exercices and instructions,solutions
with example of solutions.
- Create your first template,
- Pass a variable.
- Understand {% include %},
- Understand {% block %},
- Understand the usage of each.
- Use conditions (if, else),
- Use loops (for),
- Combine the two together,
- Whitespace control.
- import variables from a yaml file,
- storing the output in a file.
- Re-use what we have done before
- Create
x
sub-interfaces and equally spready
policy-maps between them.- try with 3000 sub-interfaces and 10 policy-maps
This section has two folders :
exercices
with the exercices and instructions,solutions
with example of solutions.
- getting the running config from the device using
ncclient
- Open a NETCONF session using
ncclient
, - Get the running-configuration (XML) from the device
- Open a NETCONF session using
- Open a NETCONF session using
ncclient
, - Get the running-configuration (XML) from the device
- Connect to the device, via NETCONF, using YDK,
- Getting the list of interfaces of a device,
- Printing it nicely.
- Connect to the device, via NETCONF, using YDK,
- Getting the serial number of the device, for each component,
- Printing it nicely.
Operations are defined here.
OPERATIONS = {
"get": operations.Get,
"get_config": operations.GetConfig,
"get_schema": operations.GetSchema,
"dispatch": operations.Dispatch,
"edit_config": operations.EditConfig,
"copy_config": operations.CopyConfig,
"validate": operations.Validate,
"commit": operations.Commit,
"discard_changes": operations.DiscardChanges,
"cancel_commit": operations.CancelCommit,
"delete_config": operations.DeleteConfig,
"lock": operations.Lock,
"unlock": operations.Unlock,
"create_subscription": operations.CreateSubscription,
"close_session": operations.CloseSession,
"kill_session": operations.KillSession,
"poweroff_machine": operations.PoweroffMachine,
"reboot_machine": operations.RebootMachine,
}