本文整理汇总了Python中cloudmesh_client.common.Shell.Shell.ping方法的典型用法代码示例。如果您正苦于以下问题:Python Shell.ping方法的具体用法?Python Shell.ping怎么用?Python Shell.ping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloudmesh_client.common.Shell.Shell
的用法示例。
在下文中一共展示了Shell.ping方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: status
# 需要导入模块: from cloudmesh_client.common.Shell import Shell [as 别名]
# 或者: from cloudmesh_client.common.Shell.Shell import ping [as 别名]
def status(cls, host):
msg = "Unknown host"
try:
msg = Shell.ping("-c", "1", host)
except:
pass
if "1 packets transmitted, 1 packets received" in msg:
return True
elif "Unknown host" in msg:
return False
else:
return False
示例2: do_vm
# 需要导入模块: from cloudmesh_client.common.Shell import Shell [as 别名]
# 或者: from cloudmesh_client.common.Shell.Shell import ping [as 别名]
def do_vm(self, args, arguments):
"""
::
Usage:
vm default [--cloud=CLOUD][--format=FORMAT]
vm refresh [all][--cloud=CLOUD]
vm boot [--name=NAME]
[--cloud=CLOUD]
[--username=USERNAME]
[--image=IMAGE]
[--flavor=FLAVOR]
[--group=GROUP]
[--public]
[--secgroup=SECGROUP]
[--key=KEY]
[--dryrun]
vm boot [--n=COUNT]
[--cloud=CLOUD]
[--username=USERNAME]
[--image=IMAGE]
[--flavor=FLAVOR]
[--group=GROUP]
[--public]
[--secgroup=SECGROUP]
[--key=KEY]
[--dryrun]
vm ping [NAME] [N]
vm console [NAME]
[--group=GROUP]
[--cloud=CLOUD]
[--force]
vm start [NAMES]
[--group=GROUP]
[--cloud=CLOUD]
[--force]
vm stop [NAMES]
[--group=GROUP]
[--cloud=CLOUD]
[--force]
vm terminate [NAMES]
[--group=GROUP]
[--cloud=CLOUD]
[--force]
vm delete [NAMES]
[--group=GROUP]
[--cloud=CLOUD]
[--keep]
[--dryrun]
vm ip assign [NAMES]
[--cloud=CLOUD]
vm ip show [NAMES]
[--group=GROUP]
[--cloud=CLOUD]
[--format=FORMAT]
[--refresh]
vm ip inventory [NAMES]
[--header=HEADER]
[--file=FILE]
vm ssh [NAME] [--username=USER]
[--quiet]
[--ip=IP]
[--cloud=CLOUD]
[--key=KEY]
[--command=COMMAND]
vm rename [OLDNAMES] [NEWNAMES] [--force] [--dryrun]
vm list [NAMES]
[--cloud=CLOUDS|--active]
[--group=GROUP]
[--format=FORMAT]
[--refresh]
vm status [NAMES]
vm wait [--cloud=CLOUD] [--interval=SECONDS]
vm info [--cloud=CLOUD]
[--format=FORMAT]
vm check NAME
vm username USERNAME [NAMES] [--cloud=CLOUD]
Arguments:
COMMAND positional arguments, the commands you want to
execute on the server(e.g. ls -a) separated by ';',
you will get a return of executing result instead of login to
the server, note that type in -- is suggested before
you input the commands
NAME server name. By default it is set to the name of last vm from database.
NAMES server name. By default it is set to the name of last vm from database.
KEYPAIR_NAME Name of the openstack keypair to be used to create VM. Note this is
not a path to key.
NEWNAMES New names of the VM while renaming.
OLDNAMES Old names of the VM while renaming.
Options:
--username=USERNAME the username to login into the vm. If not specified it will be guessed
from the image name and the cloud
--ip=IP give the public ip of the server
--cloud=CLOUD give a cloud to work on, if not given, selected
or default cloud will be used
--count=COUNT give the number of servers to start
--detail for table print format, a brief version
is used as default, use this flag to print
#.........这里部分代码省略.........