当前位置: 首页>>代码示例>>Python>>正文


Python jsonutils.to_primitive函数代码示例

本文整理汇总了Python中traffic.openstack.common.jsonutils.to_primitive函数的典型用法代码示例。如果您正苦于以下问题:Python to_primitive函数的具体用法?Python to_primitive怎么用?Python to_primitive使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了to_primitive函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: prep_resize

 def prep_resize(self, ctxt, image, instance, instance_type, host,
                 reservations=None):
     instance_p = jsonutils.to_primitive(instance)
     instance_type_p = jsonutils.to_primitive(instance_type)
     self.cast(ctxt, self.make_msg('prep_resize',
             instance=instance_p, instance_type=instance_type_p,
             image=image, reservations=reservations),
             _compute_topic(self.topic, ctxt, host, None))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:8,代码来源:trpcapi.py

示例2: prep_resize

 def prep_resize(self, ctxt, instance, instance_type, image,
         request_spec, filter_properties, reservations):
     instance_p = jsonutils.to_primitive(instance)
     instance_type_p = jsonutils.to_primitive(instance_type)
     self.cast(ctxt, self.make_msg('prep_resize',
             instance=instance_p, instance_type=instance_type_p,
             image=image, request_spec=request_spec,
             filter_properties=filter_properties,
             reservations=reservations))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:9,代码来源:rpcapi.py

示例3: get_host

 def get_host(self, ctxt, instance, instance_type, image,
         request_spec, filter_properties, reservations):
     instance_p = jsonutils.to_primitive(instance)
     instance_type_p = jsonutils.to_primitive(instance_type)
     return self.call(ctxt, self.make_msg('get_host',
             instance=instance_p, instance_type=instance_type_p,
             image=image, request_spec=request_spec,
             filter_properties=filter_properties,
             reservations=reservations))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:9,代码来源:rpcapi.py

示例4: post_live_migration_at_destination

 def post_live_migration_at_destination(self, ctxt, instance,
         block_migration, host):
     instance_p = jsonutils.to_primitive(instance)
     return self.call(ctxt,
             self.make_msg('post_live_migration_at_destination',
             instance=instance_p, block_migration=block_migration),
             _compute_topic(self.topic, ctxt, host, None))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:7,代码来源:trpcapi.py

示例5: live_migration

 def live_migration(self, ctxt, instance, dest, block_migration, host,
                    migrate_data=None):
     instance_p = jsonutils.to_primitive(instance)
     self.cast(ctxt, self.make_msg('live_migration', instance=instance_p,
             dest=dest, block_migration=block_migration,
             migrate_data=migrate_data),
             topic=_compute_topic(self.topic, ctxt, host, None))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:7,代码来源:trpcapi.py

示例6: resize_instance

 def resize_instance(self, ctxt, instance, migration_id, image,
                     reservations=None):
     topic = _compute_topic(self.topic, ctxt, None, instance)
     instance_p = jsonutils.to_primitive(instance)
     self.cast(ctxt, self.make_msg('resize_instance',
             instance=instance_p, migration_id=migration_id,
             image=image, reservations=reservations), topic)
开发者ID:fengkaicnic,项目名称:traffic,代码行数:7,代码来源:trpcapi.py

示例7: revert_resize

 def revert_resize(self, ctxt, instance, migration_id, host,
                   reservations=None):
     instance_p = jsonutils.to_primitive(instance)
     self.cast(ctxt, self.make_msg('revert_resize',
             instance=instance_p, migration_id=migration_id,
             reservations=reservations),
             topic=_compute_topic(self.topic, ctxt, host, instance))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:7,代码来源:trpcapi.py

示例8: finish_resize

 def finish_resize(self, ctxt, instance, migration_id, image, disk_info,
         host, reservations=None):
     instance_p = jsonutils.to_primitive(instance)
     self.cast(ctxt, self.make_msg('finish_resize',
             instance=instance_p, migration_id=migration_id,
             image=image, disk_info=disk_info, reservations=reservations),
             topic=_compute_topic(self.topic, ctxt, host, None))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:7,代码来源:trpcapi.py

示例9: attach_image

 def attach_image(self, ctxt, instance, image_id, mountpoint):
     
     instance_p = jsonutils.to_primitive(instance)
     self.cast(ctxt, self.make_msg('attach_image',
             instance=instance_p, image_id=image_id,
             mountpoint=mountpoint),
             topic=_compute_topic(self.topic, ctxt, None, instance))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:7,代码来源:trpcapi.py

示例10: confirm_resize

 def confirm_resize(self, ctxt, instance, migration_id, host,
         reservations=None, cast=True):
     rpc_method = self.cast if cast else self.call
     instance_p = jsonutils.to_primitive(instance)
     return rpc_method(ctxt, self.make_msg('confirm_resize',
             instance=instance_p, migration_id=migration_id,
             reservations=reservations),
             topic=_compute_topic(self.topic, ctxt, host, instance))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:8,代码来源:trpcapi.py

示例11: snapshot_instance

 def snapshot_instance(self, ctxt, instance, image_id, image_type,
         backup_type, rotation):
     instance_p = jsonutils.to_primitive(instance)
     self.cast(ctxt, self.make_msg('snapshot_instance',
             instance=instance_p, image_id=image_id,
             image_type=image_type, backup_type=backup_type,
             rotation=rotation),
             topic=_compute_topic(self.topic, ctxt, None, instance))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:8,代码来源:trpcapi.py

示例12: live_migration

 def live_migration(self, ctxt, block_migration, disk_over_commit,
         instance, dest):
     # NOTE(comstud): Call vs cast so we can get exceptions back, otherwise
     # this call in the scheduler driver doesn't return anything.
     instance_p = jsonutils.to_primitive(instance)
     return self.call(ctxt, self.make_msg('live_migration',
             block_migration=block_migration,
             disk_over_commit=disk_over_commit, instance=instance_p,
             dest=dest))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:9,代码来源:rpcapi.py

示例13: check_can_live_migrate_destination

 def check_can_live_migrate_destination(self, ctxt, instance, destination,
                                        block_migration, disk_over_commit):
     instance_p = jsonutils.to_primitive(instance)
     return self.call(ctxt,
                      self.make_msg('check_can_live_migrate_destination',
                                    instance=instance_p,
                                    block_migration=block_migration,
                                    disk_over_commit=disk_over_commit),
                      topic=_compute_topic(self.topic,
                                           ctxt, destination, None))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:10,代码来源:trpcapi.py

示例14: rebuild_instance

 def rebuild_instance(self, ctxt, instance, new_pass, injected_files,
         image_ref, orig_image_ref, orig_sys_metadata):
     instance_p = jsonutils.to_primitive(instance)
     self.cast(ctxt, self.make_msg('rebuild_instance',
             instance=instance_p, new_pass=new_pass,
             injected_files=injected_files, image_ref=image_ref,
             orig_image_ref=orig_image_ref,
             orig_sys_metadata=orig_sys_metadata),
             topic=_compute_topic(self.topic, ctxt, None, instance),
             version='2.1')
开发者ID:fengkaicnic,项目名称:traffic,代码行数:10,代码来源:trpcapi.py

示例15: run_instance

 def run_instance(self, ctxt, instance, host, request_spec,
                  filter_properties, requested_networks,
                  injected_files, admin_password,
                  is_first_time):
     instance_p = jsonutils.to_primitive(instance)
     self.cast(ctxt, self.make_msg('run_instance', instance=instance_p,
             request_spec=request_spec, filter_properties=filter_properties,
             requested_networks=requested_networks,
             injected_files=injected_files, admin_password=admin_password,
             is_first_time=is_first_time),
             topic=_compute_topic(self.topic, ctxt, host, None))
开发者ID:fengkaicnic,项目名称:traffic,代码行数:11,代码来源:trpcapi.py


注:本文中的traffic.openstack.common.jsonutils.to_primitive函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。