Seed code for ironic_virtmedia_driver
[ta/ironic-virtmedia-driver.git] / src / ironic_virtmedia_driver / vendors / ironic_virtmedia_hw.py
1 # Copyright 2019 Nokia
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15
16 class IronicVirtMediaHW(object):
17     def __init__(self, log):
18         self.log = log
19
20     def attach_virtual_cd(self, image_filename, driver_info, task):
21         """Attaches the given image as virtual media on the node.
22
23         :param image_filename: the filename of the image to be attached.
24         :param driver_info: the information about the node that the media
25             is being attached to. (provisioning_server, ipmi params etc.)
26         :param task: a TaskManager instance.
27         :raises: VirtmediaOperationError if attaching virtual media failed.
28         """
29
30         raise NotImplementedError
31
32     def detach_virtual_cd(self, driver_info, task):
33         """Detach virtual cd/dvd from a node
34
35         :param task: a TaskManager instance.
36         :raises: VirtmediaOperationError if attaching virtual media failed.
37         """
38         raise NotImplementedError
39
40     def set_boot_device(self, task):
41         """Set virtual boot device from a node
42
43         :param task: a TaskManager instance.
44         :raises: VirtmediaOperationError if attaching virtual media failed.
45         """
46         raise NotImplementedError