本文整理汇总了Python中nova.db.instance_extra_update_by_uuid函数的典型用法代码示例。如果您正苦于以下问题:Python instance_extra_update_by_uuid函数的具体用法?Python instance_extra_update_by_uuid怎么用?Python instance_extra_update_by_uuid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了instance_extra_update_by_uuid函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _save
def _save(self):
primitive = self.obj_to_primitive()
payload = jsonutils.dumps(primitive)
values = {"migration_context": payload}
db.instance_extra_update_by_uuid(self._context, self.instance_uuid, values)
self.obj_reset_changes()
开发者ID:yizhongyin,项目名称:OpenstackLiberty,代码行数:7,代码来源:migration_context.py
示例2: create
def create(self, context):
topology = self.topology_from_obj()
if not topology:
return
values = {'numa_topology': topology.to_json()}
db.instance_extra_update_by_uuid(context, self.instance_uuid,
values)
self.obj_reset_changes()
开发者ID:Krylon360,项目名称:nova,代码行数:8,代码来源:instance_numa_topology.py
示例3: save
def save(self, context):
blob = [{'count': x.count,
'spec': x.spec,
'alias_name': x.alias_name,
'is_new': x.is_new,
'request_id': x.request_id} for x in self.requests]
requests = jsonutils.dumps(blob)
db.instance_extra_update_by_uuid(context, self.instance_uuid,
{'pci_requests': requests})
开发者ID:EliseCheng,项目名称:nova,代码行数:9,代码来源:instance_pci_requests.py
示例4: _save_vcpu_model
def _save_vcpu_model(self, context):
# TODO(yjiang5): should merge the db accesses for all the extra
# fields
if "vcpu_model" in self.obj_what_changed():
if self.vcpu_model:
update = jsonutils.dumps(self.vcpu_model.obj_to_primitive())
else:
update = None
db.instance_extra_update_by_uuid(context, self.uuid, {"vcpu_model": update})
开发者ID:isyippee,项目名称:nova,代码行数:9,代码来源:instance.py
示例5: _save_flavor
def _save_flavor(self, context):
# FIXME(danms): We can do this smarterly by updating this
# with all the other extra things at the same time
flavor_info = {
"cur": self.flavor.obj_to_primitive(),
"old": (self.old_flavor and self.old_flavor.obj_to_primitive() or None),
"new": (self.new_flavor and self.new_flavor.obj_to_primitive() or None),
}
db.instance_extra_update_by_uuid(context, self.uuid, {"flavor": jsonutils.dumps(flavor_info)})
self.obj_reset_changes(["flavor", "old_flavor", "new_flavor"])
开发者ID:jcalonsoh,项目名称:openstack-nova,代码行数:10,代码来源:instance.py
示例6: _save_flavor
def _save_flavor(self, context):
if not any([x in self.obj_what_changed() for x in
('flavor', 'old_flavor', 'new_flavor')]):
return
# FIXME(danms): We can do this smarterly by updating this
# with all the other extra things at the same time
flavor_info = {
'cur': self.flavor.obj_to_primitive(),
'old': (self.old_flavor and
self.old_flavor.obj_to_primitive() or None),
'new': (self.new_flavor and
self.new_flavor.obj_to_primitive() or None),
}
db.instance_extra_update_by_uuid(
context, self.uuid,
{'flavor': jsonutils.dumps(flavor_info)})
self.obj_reset_changes(['flavor', 'old_flavor', 'new_flavor'])
开发者ID:amatuerone,项目名称:nova,代码行数:17,代码来源:instance.py
示例7: delete_by_instance_uuid
def delete_by_instance_uuid(cls, context, instance_uuid):
values = {'numa_topology': None}
db.instance_extra_update_by_uuid(context, instance_uuid,
values)
开发者ID:RedGrave,项目名称:nova,代码行数:4,代码来源:instance_numa_topology.py
示例8: _save
def _save(self):
values = {'numa_topology': self._to_json()}
db.instance_extra_update_by_uuid(self._context, self.instance_uuid,
values)
self.obj_reset_changes()
开发者ID:RedGrave,项目名称:nova,代码行数:5,代码来源:instance_numa_topology.py
示例9: save
def save(self, context):
blob = self.to_json()
db.instance_extra_update_by_uuid(context, self.instance_uuid,
{'pci_requests': blob})
开发者ID:milkymiki,项目名称:nova,代码行数:4,代码来源:instance_pci_requests.py
示例10: _destroy
def _destroy(cls, context, instance_uuid):
values = {'migration_context': None}
db.instance_extra_update_by_uuid(context, instance_uuid, values)
开发者ID:375670450,项目名称:nova,代码行数:3,代码来源:migration_context.py
注:本文中的nova.db.instance_extra_update_by_uuid函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论