Beispiel #1
0
    def start(self, cluster_id):
        """Start a cluster

        :param cluster_id: id of cluster to start
        :return: Bool
        """
        c = self.get_by_id(cluster_id)
        if not c:
            logger.warning('No cluster found with id={}'.format(cluster_id))
            return False
        h_id = c.get('host_id')
        h = self.host_handler.get_active_host_by_id(h_id)
        if not h:
            logger.warning('No host found with id={}'.format(h_id))
            return False
        result = compose_start(
            name=cluster_id,
            daemon_url=h.get('daemon_url'),
            mapped_ports=c.get('mapped_ports', PEER_SERVICE_PORTS),
            consensus_plugin=c.get('consensus_plugin'),
            consensus_mode=c.get('consensus_mode'),
            log_type=h.get('log_type'),
            log_level=h.get('log_level'),
            log_server='',
            cluster_size=c.get('size'),
        )
        if result:
            self.db_update_one({"id": cluster_id},
                               {"$set": {
                                   'status': 'running'
                               }})
            return True
        else:
            return False
Beispiel #2
0
    def start(self, cluster_id):
        """Start a cluster

        :param cluster_id: id of cluster to start
        :return: Bool
        """
        c = self.get_by_id(cluster_id)
        if not c:
            logger.warning('No cluster found with id={}'.format(cluster_id))
            return False
        h_id = c.get('host_id')
        h = self.host_handler.get_active_host_by_id(h_id)
        if not h:
            logger.warning('No host found with id={}'.format(h_id))
            return False
        result = compose_start(
            name=cluster_id, daemon_url=h.get('daemon_url'),
            mapped_ports=c.get('mapped_ports', PEER_SERVICE_PORTS),
            consensus_plugin=c.get('consensus_plugin'),
            consensus_mode=c.get('consensus_mode'),
            log_type=h.get('log_type'),
            log_level=h.get('log_level'),
            log_server='',
            cluster_size=c.get('size'),
        )
        if result:
            self.db_update_one({"id": cluster_id},
                               {"$set": {'status': 'running'}})
            return True
        else:
            return False
Beispiel #3
0
 def start(self, name, daemon_url, mapped_ports, fabric_version,
           consensus_plugin,
           consensus_mode, log_type, log_level, log_server, cluster_size):
     return compose_start(name, daemon_url, mapped_ports, fabric_version,
                          consensus_plugin, consensus_mode, log_type,
                          log_level, log_server, cluster_size)
Beispiel #4
0
 def start(self, name, worker_api, mapped_ports, log_type, log_level,
           log_server, config):
     return compose_start(name, worker_api, mapped_ports, log_type,
                          log_level, log_server, config)
Beispiel #5
0
 def start(self, name, worker_api, mapped_ports, log_type, log_level,
           log_server, config):
     return compose_start(name, worker_api, mapped_ports, log_type,
                          log_level, log_server, config)