本文整理汇总了Python中ydk.services.ExecutorService类的典型用法代码示例。如果您正苦于以下问题:Python ExecutorService类的具体用法?Python ExecutorService怎么用?Python ExecutorService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ExecutorService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpClass
def setUpClass(self):
self.ncc = NetconfServiceProvider(
address='127.0.0.1',
username='admin',
password='admin',
protocol='ssh',
port=12022)
self.executor = ExecutorService()
示例2: device
help="NETCONF device (ssh://user:[email protected]:port)")
args = parser.parse_args()
device = urlparse(args.device)
# 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()
all = xr_snmp_test_trap_act.All() # create object
# execute RPC on NETCONF device
executor.execute_rpc(provider, all)
exit()
# End of script
示例3: urlparse
args = parser.parse_args()
device = urlparse(args.device)
# 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.RollBackConfigurationTo() # 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
示例4: setUpClass
def setUpClass(self):
self.csp = CodecServiceProvider(type=EncodingFormat.XML)
self.es = ExecutorService()
self.cs = CodecService()
示例5: device
help="NETCONF device (ssh://user:[email protected]:port)")
args = parser.parse_args()
device = urlparse(args.device)
# 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()
platform_hfr_bundle_downed_link = xr_snmp_test_trap_act.PlatformHfrBundleDownedLink() # create object
# execute RPC on NETCONF device
executor.execute_rpc(provider, platform_hfr_bundle_downed_link)
exit()
# End of script
示例6: device
help="NETCONF device (ssh://user:[email protected]:port)")
args = parser.parse_args()
device = urlparse(args.device)
# 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()
routing_bgp_established_remote_peer = xr_snmp_test_trap_act.RoutingBgpEstablishedRemotePeer() # create object
# execute RPC on NETCONF device
executor.execute_rpc(provider, routing_bgp_established_remote_peer)
exit()
# End of script
示例7: urlparse
args = parser.parse_args()
device = urlparse(args.device)
# 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()
interface_link_down = xr_snmp_test_trap_act.InterfaceLinkDown() # create object
prepare_interface_link_down(interface_link_down) # add RPC input
# execute RPC on NETCONF device
executor.execute_rpc(provider, interface_link_down)
exit()
# End of script
示例8: urlparse
args = parser.parse_args()
device = urlparse(args.device)
# 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()
logmsg = xr_syslog_act.Logmsg() # create object
prepare_logmsg(logmsg) # add RPC input
# execute RPC on NETCONF device
executor.execute_rpc(provider, logmsg)
exit()
# End of script
示例9: urlparse
args = parser.parse_args()
device = urlparse(args.device)
# 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()
routing_mpls_tunnel_down = xr_snmp_test_trap_act.RoutingMplsTunnelDown() # create object
prepare_routing_mpls_tunnel_down(routing_mpls_tunnel_down) # add RPC input
# execute RPC on NETCONF device
executor.execute_rpc(provider, routing_mpls_tunnel_down)
exit()
# End of script
示例10: device
help="NETCONF device (ssh://user:[email protected]:port)")
args = parser.parse_args()
device = urlparse(args.device)
# 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()
infra_flash_device_inserted = xr_snmp_test_trap_act.InfraFlashDeviceInserted() # create object
# execute RPC on NETCONF device
executor.execute_rpc(provider, infra_flash_device_inserted)
exit()
# End of script
示例11: device
help="NETCONF device (ssh://user:[email protected]:port)")
args = parser.parse_args()
device = urlparse(args.device)
# 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()
infra_bridge_topology_change = xr_snmp_test_trap_act.InfraBridgeTopologyChange() # create object
# execute RPC on NETCONF device
executor.execute_rpc(provider, infra_bridge_topology_change)
exit()
# End of script
示例12: urlparse
args = parser.parse_args()
device = urlparse(args.device)
# 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()
get_schema = ietf_netconf_monitoring.GetSchema() # create object
prepare_get_schema(get_schema) # add RPC input
# execute RPC on NETCONF device
print(executor.execute_rpc(provider, get_schema))
exit()
# End of script
示例13: device
help="NETCONF device (ssh://user:[email protected]:port)")
args = parser.parse_args()
device = urlparse(args.device)
# 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()
infra_redundancy_progression = xr_snmp_test_trap_act.InfraRedundancyProgression() # create object
# execute RPC on NETCONF device
executor.execute_rpc(provider, infra_redundancy_progression)
exit()
# End of script
示例14: device
help="NETCONF device (ssh://user:[email protected]:port)")
args = parser.parse_args()
device = urlparse(args.device)
# 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()
platform_hfr_plane_state = xr_snmp_test_trap_act.PlatformHfrPlaneState() # create object
# execute RPC on NETCONF device
executor.execute_rpc(provider, platform_hfr_plane_state)
exit()
# End of script
示例15: device
help="NETCONF device (ssh://user:[email protected]:port)")
args = parser.parse_args()
device = urlparse(args.device)
# 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()
entity_fru_fan_tray_inserted = xr_snmp_test_trap_act.EntityFruFanTrayInserted() # create object
# execute RPC on NETCONF device
executor.execute_rpc(provider, entity_fru_fan_tray_inserted)
exit()
# End of script