# log debug messages if verbose argument specified if args.verbose: logger = logging.getLogger("ydk") logger.setLevel(logging.INFO) handler = logging.StreamHandler() formatter = logging.Formatter(("%(asctime)s - %(name)s - " "%(levelname)s - %(message)s")) handler.setFormatter(formatter) logger.addHandler(handler) # create NETCONF provider provider = NetconfServiceProvider(address=device.hostname, port=device.port, username=device.username, password=device.password, protocol=device.scheme) # create executor service executor = ExecutorService() roll_back_configuration_to_rpc = xr_cfgmgr_rollback_act.RollBackConfigurationToRpc( ) # create object prepare_roll_back_configuration_to_rpc( roll_back_configuration_to_rpc) # add RPC input # execute RPC on NETCONF device executor.execute_rpc(provider, roll_back_configuration_to_rpc) exit() # End of script
# log debug messages if verbose argument specified if args.verbose: logger = logging.getLogger("ydk") logger.setLevel(logging.INFO) handler = logging.StreamHandler() formatter = logging.Formatter(("%(asctime)s - %(name)s - " "%(levelname)s - %(message)s")) handler.setFormatter(formatter) logger.addHandler(handler) # create NETCONF provider provider = NetconfServiceProvider(address=device.hostname, port=device.port, username=device.username, password=device.password, protocol=device.scheme) # create executor service executor = ExecutorService() roll_back_configuration_last_rpc = xr_cfgmgr_rollback_act.RollBackConfigurationLastRpc( ) # create object prepare_roll_back_configuration_last_rpc( roll_back_configuration_last_rpc) # add RPC input # execute RPC on NETCONF device executor.execute_rpc(provider, roll_back_configuration_last_rpc) exit() # End of script
# log debug messages if verbose argument specified if args.verbose: logger = logging.getLogger("ydk") logger.setLevel(logging.INFO) handler = logging.StreamHandler() formatter = logging.Formatter(("%(asctime)s - %(name)s - " "%(levelname)s - %(message)s")) handler.setFormatter(formatter) logger.addHandler(handler) # create NETCONF provider provider = NetconfServiceProvider(address=device.hostname, port=device.port, username=device.username, password=device.password, protocol=device.scheme) # create executor service executor = ExecutorService() roll_back_configuration_to = xr_cfgmgr_rollback_act.RollBackConfigurationLast( ) # create object prepare_roll_back_configuration_to( roll_back_configuration_to) # add RPC input # execute RPC on NETCONF device # executor.execute_rpc(provider, roll_back_configuration_to) exit() # End of script
# log debug messages if verbose argument specified if args.verbose: logger = logging.getLogger("ydk") logger.setLevel(logging.INFO) handler = logging.StreamHandler() formatter = logging.Formatter(("%(asctime)s - %(name)s - " "%(levelname)s - %(message)s")) handler.setFormatter(formatter) logger.addHandler(handler) # create NETCONF provider provider = NetconfServiceProvider(address=device.hostname, port=device.port, username=device.username, password=device.password, protocol=device.scheme) # create executor service executor = ExecutorService() roll_back_configuration_to_exclude = xr_cfgmgr_rollback_act.RollBackConfigurationToExclude( ) # create object prepare_roll_back_configuration_to_exclude( roll_back_configuration_to_exclude) # add RPC input # execute RPC on NETCONF device executor.execute_rpc(provider, roll_back_configuration_to_exclude) exit() # End of script