2022-11-13 02:15:47 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2022 Intel Corporation.
|
|
|
|
# All rights reserved.
|
|
|
|
|
2022-01-05 09:32:09 +00:00
|
|
|
from ..proto import sma_pb2
|
|
|
|
|
|
|
|
|
|
|
|
class DeviceException(Exception):
|
|
|
|
def __init__(self, code, message):
|
|
|
|
self.code = code
|
|
|
|
self.message = message
|
|
|
|
|
|
|
|
|
|
|
|
class DeviceManager:
|
2022-11-28 15:31:55 +00:00
|
|
|
def __init__(self, name, protocol, client, allow_delete_volumes=False):
|
2022-01-05 09:32:09 +00:00
|
|
|
self._client = client
|
2022-02-18 07:35:20 +00:00
|
|
|
self.protocol = protocol
|
2022-01-05 09:32:09 +00:00
|
|
|
self.name = name
|
2022-11-28 15:31:55 +00:00
|
|
|
# Configures whether the device allows deleting a device with attached volumes
|
|
|
|
self.allow_delete_volumes = allow_delete_volumes
|
2022-01-05 09:32:09 +00:00
|
|
|
|
|
|
|
def init(self, config):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def create_device(self, request):
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
def delete_device(self, request):
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
def attach_volume(self, request):
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
def detach_volume(self, request):
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
def owns_device(self, id):
|
|
|
|
raise NotImplementedError()
|
2022-08-30 02:49:27 +00:00
|
|
|
|
|
|
|
def set_qos(self, request):
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
def get_qos_capabilities(self, request):
|
|
|
|
raise NotImplementedError()
|