示例#1
0
def _list(json_flag=False):
    """ Provides a list of jobs along with their active runs and history summary
    :returns: process return code
    :rtype: int
    """
    client = metronome.create_client()
    json_list = client.get_jobs(EMBEDS_FOR_JOBS_HISTORY)

    if json_flag:
        emitter.publish(json_list)
    else:
        table = tables.job_table(json_list)
        output = six.text_type(table)
        if output:
            emitter.publish(output)

    return 0
示例#2
0
文件: main.py 项目: sschneid/dcos-cli
def _list(json_flag=False):
    """ Provides a list of jobs along with their active runs and history summary
    :returns: process return code
    :rtype: int
    """
    client = metronome.create_client()
    json_list = client.get_jobs(EMBEDS_FOR_JOBS_HISTORY)

    if json_flag:
        emitter.publish(json_list)
    else:
        table = tables.job_table(json_list)
        output = six.text_type(table)
        if output:
            emitter.publish(output)

    return 0
示例#3
0
def _list(json_flag=False):
    """
    :returns: process return code
    :rtype: int
    """

    try:
        client = metronome.create_client()
        json_list = client.get_jobs()
    except DCOSException as e:
        raise DCOSException(e)

    if json_flag:
        emitter.publish(json_list)
    else:
        table = tables.job_table(json_list)
        output = six.text_type(table)
        if output:
            emitter.publish(output)

    return 0
示例#4
0
def _list(json_flag=False):
    """
    :returns: process return code
    :rtype: int
    """
    response = None
    url = _get_api_url('v1/jobs' + METRONOME_EMBEDDED)
    try:
        response = _do_request(url, 'GET')
    except DCOSException as e:
        raise DCOSException(e)

    json_list = _read_http_response_body(response)

    if json_flag:
        emitter.publish(json_list)
    else:
        table = tables.job_table(json_list)
        output = six.text_type(table)
        if output:
            emitter.publish(output)

    return 0
示例#5
0
def _list(json_flag=False):
    """
    :returns: process return code
    :rtype: int
    """
    response = None
    url = _get_api_url('v1/jobs' + METRONOME_EMBEDDED)
    try:
        response = _do_request(url, 'GET')
    except DCOSException as e:
        raise DCOSException(e)

    json_list = _read_http_response_body(response)

    if json_flag:
        emitter.publish(json_list)
    else:
        table = tables.job_table(json_list)
        output = six.text_type(table)
        if output:
            emitter.publish(output)

    return 0