Beispiel #1
0
 def stop(self, name, daemon_url, mapped_ports, fabric_version,
          consensus_plugin, consensus_mode, log_type, log_level,
          log_server, cluster_size):
     return compose_stop(name, daemon_url, mapped_ports, fabric_version,
                         consensus_plugin,
                         consensus_mode, log_type, log_level, log_server,
                         cluster_size)
Beispiel #2
0
    def stop(self, cluster_id):
        """Stop a cluster

        :param cluster_id: id of cluster to stop
        :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_stop(
            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': 'stopped',
                                   'health': ''
                               }})
            return True
        else:
            return False
Beispiel #3
0
    def stop(self, cluster_id):
        """Stop a cluster

        :param cluster_id: id of cluster to stop
        :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_stop(
            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': 'stopped', 'health': ''}})
            return True
        else:
            return False
Beispiel #4
0
 def stop(self, name, worker_api, mapped_ports, log_type, log_level,
          log_server, config):
     return compose_stop(name, worker_api, mapped_ports, log_type,
                         log_level, log_server, config)
Beispiel #5
0
 def stop(self, name, worker_api, mapped_ports, log_type, log_level,
          log_server, config):
     return compose_stop(name, worker_api, mapped_ports, log_type,
                         log_level, log_server, config)