xref: /spdk/python/spdk/sma/device/device.py (revision b7964a3c5a47a5c9c2456b8a3a1735462eb437e3)
1#  SPDX-License-Identifier: BSD-3-Clause
2#  Copyright (C) 2022 Intel Corporation.
3#  All rights reserved.
4
5from ..proto import sma_pb2
6
7
8class DeviceException(Exception):
9    def __init__(self, code, message):
10        self.code = code
11        self.message = message
12
13
14class DeviceManager:
15    def __init__(self, name, protocol, client, allow_delete_volumes=False):
16        self._client = client
17        self.protocol = protocol
18        self.name = name
19        # Configures whether the device allows deleting a device with attached volumes
20        self.allow_delete_volumes = allow_delete_volumes
21
22    def init(self, config):
23        pass
24
25    def create_device(self, request):
26        raise NotImplementedError()
27
28    def delete_device(self, request):
29        raise NotImplementedError()
30
31    def attach_volume(self, request):
32        raise NotImplementedError()
33
34    def detach_volume(self, request):
35        raise NotImplementedError()
36
37    def owns_device(self, id):
38        raise NotImplementedError()
39
40    def set_qos(self, request):
41        raise NotImplementedError()
42
43    def get_qos_capabilities(self, request):
44        raise NotImplementedError()
45