Merge "Remove useless interfaces in cond"
This commit is contained in:
commit
e9db6e8797
@ -22,7 +22,6 @@ import uuid
|
|||||||
from cyborg.common import exception
|
from cyborg.common import exception
|
||||||
from cyborg.common import placement_client
|
from cyborg.common import placement_client
|
||||||
from cyborg.conf import CONF
|
from cyborg.conf import CONF
|
||||||
from cyborg import objects
|
|
||||||
from cyborg.objects.attach_handle import AttachHandle
|
from cyborg.objects.attach_handle import AttachHandle
|
||||||
from cyborg.objects.attribute import Attribute
|
from cyborg.objects.attribute import Attribute
|
||||||
from cyborg.objects.control_path import ControlpathID
|
from cyborg.objects.control_path import ControlpathID
|
||||||
@ -49,84 +48,6 @@ class ConductorManager(object):
|
|||||||
def periodic_tasks(self, context, raise_on_error=False):
|
def periodic_tasks(self, context, raise_on_error=False):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def accelerator_create(self, context, obj_acc):
|
|
||||||
"""Create a new accelerator.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_acc: a changed (but not saved) accelerator object.
|
|
||||||
:returns: created accelerator object.
|
|
||||||
"""
|
|
||||||
base_options = {
|
|
||||||
'project_id': context.tenant,
|
|
||||||
'user_id': context.user
|
|
||||||
}
|
|
||||||
obj_acc.update(base_options)
|
|
||||||
obj_acc.create(context)
|
|
||||||
return obj_acc
|
|
||||||
|
|
||||||
def accelerator_update(self, context, obj_acc):
|
|
||||||
"""Update an accelerator.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_acc: an accelerator object to update.
|
|
||||||
:returns: updated accelerator object.
|
|
||||||
"""
|
|
||||||
obj_acc.save(context)
|
|
||||||
return obj_acc
|
|
||||||
|
|
||||||
def accelerator_delete(self, context, obj_acc):
|
|
||||||
"""Delete an accelerator.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_acc: an accelerator object to delete.
|
|
||||||
"""
|
|
||||||
obj_acc.destroy(context)
|
|
||||||
|
|
||||||
def deployable_create(self, context, obj_dep):
|
|
||||||
"""Create a new deployable.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_dep: a changed (but not saved) obj_dep object.
|
|
||||||
:returns: created obj_dep object.
|
|
||||||
"""
|
|
||||||
obj_dep.create(context)
|
|
||||||
return obj_dep
|
|
||||||
|
|
||||||
def deployable_update(self, context, obj_dep):
|
|
||||||
"""Update a deployable.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_dep: a deployable object to update.
|
|
||||||
:returns: updated deployable object.
|
|
||||||
"""
|
|
||||||
obj_dep.save(context)
|
|
||||||
return obj_dep
|
|
||||||
|
|
||||||
def deployable_delete(self, context, obj_dep):
|
|
||||||
"""Delete a deployable.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_dep: a deployable object to delete.
|
|
||||||
"""
|
|
||||||
obj_dep.destroy(context)
|
|
||||||
|
|
||||||
def deployable_get(self, context, uuid):
|
|
||||||
"""Retrieve a deployable.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param uuid: UUID of a deployable.
|
|
||||||
:returns: requested deployable object.
|
|
||||||
"""
|
|
||||||
return objects.Deployable.get(context, uuid)
|
|
||||||
|
|
||||||
def deployable_list(self, context):
|
|
||||||
"""Retrieve a list of deployables.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:returns: a list of deployable objects.
|
|
||||||
"""
|
|
||||||
return objects.Deployable.list(context)
|
|
||||||
|
|
||||||
def device_profile_create(self, context, obj_devprof):
|
def device_profile_create(self, context, obj_devprof):
|
||||||
"""Signal to conductor service to create a device_profile.
|
"""Signal to conductor service to create a device_profile.
|
||||||
|
|
||||||
|
@ -47,104 +47,6 @@ class ConductorAPI(object):
|
|||||||
version_cap=self.RPC_API_VERSION,
|
version_cap=self.RPC_API_VERSION,
|
||||||
serializer=serializer)
|
serializer=serializer)
|
||||||
|
|
||||||
def accelerator_create(self, context, obj_acc):
|
|
||||||
"""Signal to conductor service to create an accelerator.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_acc: a created (but not saved) accelerator object.
|
|
||||||
:returns: created accelerator object.
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
return cctxt.call(context, 'accelerator_create', obj_acc=obj_acc)
|
|
||||||
|
|
||||||
def accelerator_update(self, context, obj_acc):
|
|
||||||
"""Signal to conductor service to update an accelerator.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_acc: an accelerator object to update.
|
|
||||||
:returns: updated accelerator object.
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
return cctxt.call(context, 'accelerator_update', obj_acc=obj_acc)
|
|
||||||
|
|
||||||
def accelerator_delete(self, context, obj_acc):
|
|
||||||
"""Signal to conductor service to delete an accelerator.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_acc: an accelerator object to delete.
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
return cctxt.call(context, 'accelerator_delete', obj_acc=obj_acc)
|
|
||||||
|
|
||||||
def accelerator_list_one(self, context, obj_acc):
|
|
||||||
"""Signal to conductor service to list an accelerator.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_acc: an accelerator object to list.
|
|
||||||
:returns: accelerator object.
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
cctxt.call(context, 'get_one', obj_acc=obj_acc)
|
|
||||||
|
|
||||||
def accelerator_list_all(self, context, obj_acc):
|
|
||||||
"""Signal to conductor service to list all accelerators.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_acc: accelerator objects to list.
|
|
||||||
:returns: accelerator objects.
|
|
||||||
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
return cctxt.call(context, 'get_all', obj_acc=obj_acc)
|
|
||||||
|
|
||||||
def deployable_create(self, context, obj_dep):
|
|
||||||
"""Signal to conductor service to create a deployable.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_dep: a created (but not saved) deployable object.
|
|
||||||
:returns: created deployable object.
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
return cctxt.call(context, 'deployable_create', obj_dep=obj_dep)
|
|
||||||
|
|
||||||
def deployable_update(self, context, obj_dep):
|
|
||||||
"""Signal to conductor service to update a deployable.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_dep: a deployable object to update.
|
|
||||||
:returns: updated deployable object.
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
return cctxt.call(context, 'deployable_update', obj_dep=obj_dep)
|
|
||||||
|
|
||||||
def deployable_delete(self, context, obj_dep):
|
|
||||||
"""Signal to conductor service to delete a deployable.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param obj_dep: a deployable object to delete.
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
cctxt.call(context, 'deployable_delete', obj_dep=obj_dep)
|
|
||||||
|
|
||||||
def deployable_get(self, context, uuid):
|
|
||||||
"""Signal to conductor service to get a deployable.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:param uuid: UUID of a deployable.
|
|
||||||
:returns: requested deployable object.
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
return cctxt.call(context, 'deployable_get', uuid=uuid)
|
|
||||||
|
|
||||||
def deployable_list(self, context):
|
|
||||||
"""Signal to conductor service to get a list of deployables.
|
|
||||||
|
|
||||||
:param context: request context.
|
|
||||||
:returns: a list of deployable objects.
|
|
||||||
"""
|
|
||||||
cctxt = self.client.prepare(topic=self.topic)
|
|
||||||
return cctxt.call(context, 'deployable_list')
|
|
||||||
|
|
||||||
def report_data(self, context, hostname, driver_device_list):
|
def report_data(self, context, hostname, driver_device_list):
|
||||||
"""Signal to conductor service to update the cyborg DB
|
"""Signal to conductor service to update the cyborg DB
|
||||||
:parma context: request context.
|
:parma context: request context.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user