Exemple #1
0
  def get(self, cluster, environ, topology):
    '''
    :param cluster:
    :param environ:
    :param topology:
    :return:
    '''

    # fetch the execution of the topology asynchronously
    estate = yield access.get_execution_state(cluster, environ, topology)

    # fetch scheduler location of the topology
    scheduler_location = yield access.get_scheduler_location(cluster, environ, topology)

    job_page_link = scheduler_location["job_page_link"]

    # convert the topology launch time to display format
    launched_at = datetime.utcfromtimestamp(estate['submission_time'])
    launched_time = launched_at.strftime('%Y-%m-%d %H:%M:%S UTC')

    # pylint: disable=no-member
    options = dict(
        cluster=cluster,
        environ=environ,
        topology=topology,
        estate=estate,
        launched=launched_time,
        status="running" if random.randint(0, 1) else "errors",
        active="topologies",
        job_page_link=job_page_link,
        function=common.className
    )

    # send the single topology page
    self.render("topology.html", **options)
Exemple #2
0
    def get(self, cluster, environ, topology):
        '''
    :param cluster:
    :param environ:
    :param topology:
    :return:
    '''

        # fetch the execution of the topology asynchronously
        estate = yield access.get_execution_state(cluster, environ, topology)

        # fetch scheduler location of the topology
        scheduler_location = yield access.get_scheduler_location(
            cluster, environ, topology)

        job_page_link = scheduler_location["job_page_link"]

        # convert the topology launch time to display format
        launched_at = datetime.utcfromtimestamp(estate['submission_time'])
        launched_time = launched_at.strftime('%Y-%m-%d %H:%M:%S UTC')

        # pylint: disable=no-member
        options = dict(cluster=cluster,
                       environ=environ,
                       topology=topology,
                       estate=estate,
                       launched=launched_time,
                       status="running" if random.randint(0, 1) else "errors",
                       active="topologies",
                       job_page_link=job_page_link,
                       function=common.className)

        # send the single topology page
        self.render("topology.html", **options)
Exemple #3
0
    def get(self, cluster, environ, topology):
        '''
    :param cluster:
    :param environ:
    :param topology:
    :return:
    '''
        start_time = time.time()
        estate = yield access.get_execution_state(cluster, environ, topology)

        result_map = dict(status="success",
                          message="",
                          version=common.VERSION,
                          executiontime=time.time() - start_time,
                          result=estate)

        self.write(result_map)
Exemple #4
0
  def get(self, cluster, environ, topology):
    '''
    :param cluster:
    :param environ:
    :param topology:
    :return:
    '''
    start_time = time.time()
    estate = yield access.get_execution_state(cluster, environ, topology)

    result_map = dict(
        status="success",
        message="",
        version=common.VERSION,
        executiontime=time.time() - start_time,
        result=estate
    )

    self.write(result_map)