當前位置: 首頁>>代碼示例>>Python>>正文


Python services.ExecutorService類代碼示例

本文整理匯總了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()
開發者ID:ReignInChaos,項目名稱:ydk-gen,代碼行數:8,代碼來源:test_sanity_rpc.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-900-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-cfgmgr-rollback-act-32-ydk.py

示例4: setUpClass

 def setUpClass(self):
     self.csp = CodecServiceProvider(type=EncodingFormat.XML)
     self.es = ExecutorService()
     self.cs = CodecService()
開發者ID:111pontes,項目名稱:ydk-gen,代碼行數:4,代碼來源:test_sanity_executor_rpc.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-440-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-500-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-306-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-syslog-act-24-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-552-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-211-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-216-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-ietf-netconf-monitoring-20-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-213-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-448-ydk.py

示例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
開發者ID:111pontes,項目名稱:ydk-py-samples,代碼行數:30,代碼來源:nc-execute-xr-snmp-test-trap-act-420-ydk.py


注:本文中的ydk.services.ExecutorService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。