本文整理汇总了Python中juliabox.interactive.SessContainer.session_containers方法的典型用法代码示例。如果您正苦于以下问题:Python SessContainer.session_containers方法的具体用法?Python SessContainer.session_containers怎么用?Python SessContainer.session_containers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类juliabox.interactive.SessContainer
的用法示例。
在下文中一共展示了SessContainer.session_containers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: publish_sessions
# 需要导入模块: from juliabox.interactive import SessContainer [as 别名]
# 或者: from juliabox.interactive.SessContainer import session_containers [as 别名]
def publish_sessions():
iid = Compute.get_instance_id()
for c in SessContainer.session_containers(allcontainers=True):
if ("Names" in c) and (c["Names"] is not None):
sessname = SessContainer(c["Id"]).get_name()
if sessname:
JBoxSessionProps.attach_instance(Compute.get_install_id(), sessname, iid, c["Status"])
示例2: refresh_disk_use_status
# 需要导入模块: from juliabox.interactive import SessContainer [as 别名]
# 或者: from juliabox.interactive.SessContainer import session_containers [as 别名]
def refresh_disk_use_status(container_id_list=None):
JBoxDefaultPackagesVol.LOCK.acquire()
bundles = set()
try:
if container_id_list is None:
container_id_list = [cdesc['Id'] for cdesc in SessContainer.session_containers(allcontainers=True)]
for cid in container_id_list:
mount_points = JBoxDefaultPackagesVol._get_package_mounts_used(cid)
bundles.update(mount_points)
JBoxDefaultPackagesVol.BUNDLES_IN_USE = bundles
JBoxDefaultPackagesVol.log_info("Packages in use: %r", bundles)
finally:
JBoxDefaultPackagesVol.LOCK.release()
示例3: refresh_disk_use_status
# 需要导入模块: from juliabox.interactive import SessContainer [as 别名]
# 或者: from juliabox.interactive.SessContainer import session_containers [as 别名]
def refresh_disk_use_status(container_id_list=None):
JBoxLoopbackVol.LOCK.acquire()
try:
nfree = 0
for idx in range(0, JBoxLoopbackVol.MAX_DISKS):
if JBoxLoopbackVol._is_reserved(idx):
JBoxLoopbackVol.DISK_USE_STATUS[idx] = True
else:
JBoxLoopbackVol.DISK_USE_STATUS[idx] = False
nfree += 1
if container_id_list is None:
container_id_list = [cdesc['Id'] for cdesc in SessContainer.session_containers(allcontainers=True)]
for cid in container_id_list:
disk_ids = JBoxLoopbackVol._get_disk_ids_used(cid)
for disk_id in disk_ids:
JBoxLoopbackVol._mark_disk_used(disk_id)
nfree -= 1
JBoxLoopbackVol.log_info("Loopback Disk free: " + str(nfree) + "/" + str(JBoxLoopbackVol.MAX_DISKS))
finally:
JBoxLoopbackVol.LOCK.release()
示例4: publish_sessions
# 需要导入模块: from juliabox.interactive import SessContainer [as 别名]
# 或者: from juliabox.interactive.SessContainer import session_containers [as 别名]
def publish_sessions():
iid = Compute.get_instance_id()
for c in SessContainer.session_containers(allcontainers=True):
if ('Names' in c) and (c['Names'] is not None):
JBoxSessionProps.attach_instance(Compute.get_install_id(), SessContainer(c['Id']).get_name(), iid,
c["Status"])