本文整理汇总了Python中nova.compute.utils.usage_volume_info函数的典型用法代码示例。如果您正苦于以下问题:Python usage_volume_info函数的具体用法?Python usage_volume_info怎么用?Python usage_volume_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了usage_volume_info函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: vol_usage_update
def vol_usage_update(
self, context, vol_id, rd_req, rd_bytes, wr_req, wr_bytes, instance, last_refreshed=None, update_totals=False
):
vol_usage = self.db.vol_usage_update(
context,
vol_id,
rd_req,
rd_bytes,
wr_req,
wr_bytes,
instance["uuid"],
instance["project_id"],
instance["user_id"],
instance["availability_zone"],
update_totals,
)
# We have just updated the database, so send the notification now
notifier.notify(
context,
"conductor.%s" % self.host,
"volume.usage",
notifier.INFO,
compute_utils.usage_volume_info(vol_usage),
)
示例2: vol_usage_update
def vol_usage_update(
self, context, vol_id, rd_req, rd_bytes, wr_req, wr_bytes, instance, last_refreshed=None, update_totals=False
):
# The session object is needed here, as the vol_usage object returned
# needs to bound to it in order to refresh its data
session = db_session.get_session()
vol_usage = self.db.vol_usage_update(
context,
vol_id,
rd_req,
rd_bytes,
wr_req,
wr_bytes,
instance["uuid"],
instance["project_id"],
instance["user_id"],
instance["availability_zone"],
update_totals,
session,
)
# We have just updated the database, so send the notification now
notifier.notify(
context,
"conductor.%s" % self.host,
"volume.usage",
notifier.INFO,
compute_utils.usage_volume_info(vol_usage),
)
示例3: vol_usage_update
def vol_usage_update(self, context, vol_id, rd_req, rd_bytes, wr_req,
wr_bytes, instance, last_refreshed, update_totals):
vol_usage = self.db.vol_usage_update(context, vol_id,
rd_req, rd_bytes,
wr_req, wr_bytes,
instance['uuid'],
instance['project_id'],
instance['user_id'],
instance['availability_zone'],
update_totals)
# We have just updated the database, so send the notification now
self.notifier.info(context, 'volume.usage',
compute_utils.usage_volume_info(vol_usage))