remove scheduler.api.API. naming changes.

This commit is contained in:
Sandy Walsh
2011-03-21 07:49:58 -07:00
parent ac1f686186
commit d82458a370
2 changed files with 20 additions and 25 deletions

View File

@@ -244,7 +244,7 @@ class FanoutPublisher(Publisher):
self.exchange = "%s_fanout" % topic self.exchange = "%s_fanout" % topic
self.queue = "%s_fanout" % topic self.queue = "%s_fanout" % topic
self.durable = False self.durable = False
LOG.info(_("Writing to '%(exchange)s' fanout exchange"), LOG.info(_("Creating '%(exchange)s' fanout exchange"),
dict(exchange=self.exchange)) dict(exchange=self.exchange))
super(FanoutPublisher, self).__init__(connection=connection) super(FanoutPublisher, self).__init__(connection=connection)

View File

@@ -40,30 +40,25 @@ def _call_scheduler(method, context, params=None):
return rpc.call(context, queue, kwargs) return rpc.call(context, queue, kwargs)
class API(object): def get_zone_list(context):
"""API for interacting with the scheduler.""" """Return a list of zones assoicated with this zone."""
items = _call_scheduler('get_zone_list', context)
for item in items:
item['api_url'] = item['api_url'].replace('\\/', '/')
return items
@classmethod
def get_zone_list(cls, context):
"""Return a list of zones assoicated with this zone."""
items = _call_scheduler('get_zone_list', context)
for item in items:
item['api_url'] = item['api_url'].replace('\\/', '/')
return items
@classmethod def get_zone_capabilities(context, service=None):
def get_zone_capabilities(cls, context, service=None): """Returns a dict of key, value capabilities for this zone,
"""Returns a dict of key, value capabilities for this zone, or for a particular class of services running in this zone."""
or for a particular class of services running in this zone.""" return _call_scheduler('get_zone_capabilities', context=context,
return _call_scheduler('get_zone_capabilities', context=context, params=dict(service=service))
params=dict(service=service))
@classmethod
def update_service_capabilities(cls, context, service_name, host, def update_service_capabilities(context, service_name, host, capabilities):
capabilities): """Send an update to all the scheduler services informing them
"""Send an update to all the scheduler services informing them of the capabilities of this service."""
of the capabilities of this service.""" kwargs = dict(method='update_service_capabilities',
kwargs = dict(method='update_service_capabilities', args=dict(service_name=service_name, host=host,
args=dict(service_name=service_name, host=host, capabilities=capabilities))
capabilities=capabilities)) return rpc.fanout_cast(context, 'scheduler', kwargs)
return rpc.fanout_cast(context, 'scheduler', kwargs)