~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/scheduler/rpcapi.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2013-01-11 13:06:56 UTC
  • mto: This revision was merged to the branch mainline in revision 96.
  • Revision ID: package-import@ubuntu.com-20130111130656-z9mceux6qpkqomma
Tags: upstream-2013.1~g2
ImportĀ upstreamĀ versionĀ 2013.1~g2

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from nova.openstack.common import jsonutils
23
23
import nova.openstack.common.rpc.proxy
24
24
 
 
25
rpcapi_opts = [
 
26
    cfg.StrOpt('scheduler_topic',
 
27
               default='scheduler',
 
28
               help='the topic scheduler nodes listen on'),
 
29
]
 
30
 
25
31
CONF = cfg.CONF
26
 
CONF.import_opt('scheduler_topic', 'nova.config')
 
32
CONF.register_opts(rpcapi_opts)
27
33
 
28
34
 
29
35
class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
47
53
        2.1 - Add image_id to create_volume()
48
54
        2.2 - Remove reservations argument to create_volume()
49
55
        2.3 - Remove create_volume()
 
56
        2.4 - Change update_service_capabilities()
 
57
                - accepts a list of capabilities
 
58
        2.5 - Add get_backdoor_port()
50
59
    '''
51
60
 
52
61
    #
77
86
            request_spec, filter_properties, reservations):
78
87
        instance_p = jsonutils.to_primitive(instance)
79
88
        instance_type_p = jsonutils.to_primitive(instance_type)
 
89
        reservations_p = jsonutils.to_primitive(reservations)
 
90
        image_p = jsonutils.to_primitive(image)
80
91
        self.cast(ctxt, self.make_msg('prep_resize',
81
92
                instance=instance_p, instance_type=instance_type_p,
82
 
                image=image, request_spec=request_spec,
 
93
                image=image_p, request_spec=request_spec,
83
94
                filter_properties=filter_properties,
84
 
                reservations=reservations))
 
95
                reservations=reservations_p))
85
96
 
86
97
    def show_host_resources(self, ctxt, host):
87
98
        return self.call(ctxt, self.make_msg('show_host_resources', host=host))
100
111
            capabilities):
101
112
        self.fanout_cast(ctxt, self.make_msg('update_service_capabilities',
102
113
                service_name=service_name, host=host,
103
 
                capabilities=capabilities))
 
114
                capabilities=capabilities),
 
115
                version='2.4')
 
116
 
 
117
    def get_backdoor_port(self, context, host):
 
118
        return self.call(context, self.make_msg('get_backdoor_port'),
 
119
                         version='2.5')