133 lines
3.7 KiB
Python
133 lines
3.7 KiB
Python
"""Module to provider installer interface.
|
|
|
|
.. moduleauthor:: Xiaodong Wang <xiaodongwang@huawei.com>
|
|
"""
|
|
|
|
|
|
class Installer(object):
|
|
"""Interface for installer."""
|
|
NAME = 'installer'
|
|
|
|
def __repr__(self):
|
|
return '%s[%s]' % (self.__class__.__name__, self.NAME)
|
|
|
|
def sync(self, **kwargs):
|
|
"""virtual method to sync installer."""
|
|
pass
|
|
|
|
def get_global_config(self, **kwargs):
|
|
"""virtual method to get global config."""
|
|
return {}
|
|
|
|
def get_cluster_config(self, clusterid, **kwargs):
|
|
"""virtual method to get cluster config.
|
|
|
|
:param clusterid: the id of the cluster to get configuration.
|
|
:type clusterid: int
|
|
|
|
:returns: cluster configuration as dict.
|
|
"""
|
|
return {}
|
|
|
|
def get_host_config(self, hostid, **kwargs):
|
|
"""virtual method to get host config.
|
|
|
|
:param hostid: the id of host to get configuration.
|
|
:type hostid: int
|
|
|
|
:returns: host configuration as dict.
|
|
"""
|
|
return {}
|
|
|
|
def update_global_config(self, config, **kwargs):
|
|
"""virtual method to update global config.
|
|
|
|
:param config: global configuration.
|
|
:type config: dict
|
|
"""
|
|
pass
|
|
|
|
def update_cluster_config(self, clusterid, config, **kwargs):
|
|
"""virtual method to update cluster config.
|
|
|
|
:param clusterid: the id of the cluster to update the configuration.
|
|
:type clusterid: int
|
|
:param config: cluster configuration to update.
|
|
:type config: dict
|
|
"""
|
|
pass
|
|
|
|
def update_host_config(self, hostid, config, **kwargs):
|
|
"""virtual method to update host config.
|
|
|
|
:param hostid: the id of host to update host configuration.
|
|
:type hostid: int
|
|
:param config: host configuration to update.
|
|
:type config: dict
|
|
"""
|
|
pass
|
|
|
|
def clean_host_installing_progress(
|
|
self, hostid, config, **kwargs
|
|
):
|
|
"""virtual method to clean host installing progress.
|
|
|
|
:param hostid: the id of host to clean the log.
|
|
:type hostid: int
|
|
:param config: host configuration.
|
|
:type config: dict
|
|
"""
|
|
pass
|
|
|
|
def clean_cluster_installing_progress(
|
|
self, clusterid, config, **kwargs
|
|
):
|
|
"""virtual method to clean host installing progress.
|
|
|
|
:param clusterid: the id of cluster to clean the log.
|
|
:type clusterid: int
|
|
:param config: cluster configuration.
|
|
:type config: dict
|
|
"""
|
|
pass
|
|
|
|
def reinstall_host(self, hostid, config, **kwargs):
|
|
"""virtual method to reinstall specific host.
|
|
|
|
:param hostid: the id of the host to reinstall.
|
|
:type hostid: int
|
|
:param config: host configuration to reinstall
|
|
:type config: dict
|
|
"""
|
|
pass
|
|
|
|
def reinstall_cluster(self, clusterid, config, **kwargs):
|
|
"""virtual method to reinstall specific cluster.
|
|
|
|
:param clusterid: the id of the cluster to reinstall.
|
|
:type clusterid: int
|
|
:param config: cluster configuration to reinstall
|
|
:type config: dict
|
|
"""
|
|
pass
|
|
|
|
def clean_host_config(self, hostid, config, **kwargs):
|
|
"""virtual method to clean host config.
|
|
|
|
:param hostid: the id of the host to cleanup.
|
|
:type hostid: int
|
|
:param config: host configuration to cleanup.
|
|
:type config: dict
|
|
"""
|
|
pass
|
|
|
|
def clean_cluster_config(self, clusterid, config, **kwargs):
|
|
"""virtual method to clean cluster config.
|
|
|
|
:param clusterid: the id of the cluster to cleanup.
|
|
:type clusterid: int
|
|
:param config: cluster configuration to cleanup.
|
|
:type config: dict
|
|
"""
|
|
pass
|