Remove useless interfaces in cond

These APIs will not be used and will cause us
some misunderstandings.

Change-Id: I26a6debc76405ec42c3b23aae4752d450cec4eb0
Story: 38902
This commit is contained in:
chenke 2020-02-29 17:29:54 +08:00
parent 3c7e0868e6
commit 83936803d3
2 changed files with 0 additions and 177 deletions

View File

@ -22,7 +22,6 @@ import uuid
from cyborg.common import exception
from cyborg.common import placement_client
from cyborg.conf import CONF
from cyborg import objects
from cyborg.objects.attach_handle import AttachHandle
from cyborg.objects.attribute import Attribute
from cyborg.objects.control_path import ControlpathID
@ -49,84 +48,6 @@ class ConductorManager(object):
def periodic_tasks(self, context, raise_on_error=False):
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):
"""Signal to conductor service to create a device_profile.

View File

@ -47,104 +47,6 @@ class ConductorAPI(object):
version_cap=self.RPC_API_VERSION,
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):
"""Signal to conductor service to update the cyborg DB
:parma context: request context.