本文整理匯總了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"])