summaryrefslogtreecommitdiffstats
path: root/fuel/deploy/dha.py
blob: f78686bd9afe0f61239d58fe243458c195eb799f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class DeploymentHardwareAdapter(object):
    def __new__(cls, server_type):
        if cls is DeploymentHardwareAdapter:
            if server_type == 'esxi':  return EsxiAdapter()
            if server_type == 'hp': return HpAdapter()
            if server_type == 'dell': return DellAdapter()
            if server_type == 'libvirt': return LibvirtAdapter()
        return super(DeploymentHardwareAdapter, cls).__new__(cls)


class HardwareAdapter(object):

    def power_off_blades(self):
        raise NotImplementedError

    def power_on_blades(self):
        raise NotImplementedError

    def power_cycle_blade(self):
        raise NotImplementedError

    def set_boot_order(self):
        raise NotImplementedError

    def reset_to_factory_defaults(self):
        raise NotImplementedError

    def configure_networking(self):
        raise NotImplementedError

    def get_blade_mac_addresses(self, shelf_id, blade_id):
        raise NotImplementedError

    def get_blade_hardware_info(self, shelf_id, blade_id):
        raise NotImplementedError


class EsxiAdapter(HardwareAdapter):
    pass

class LibvirtAdapter(HardwareAdapter):
    pass

class HpAdapter(HardwareAdapter):
    pass

class DellAdapter(HardwareAdapter):
    pass