从命令行获取JIRA系统信息

时间:2014-01-06 18:33:58

标签: jira jira-plugin jira-rest-api

我试图从命令行获取JIRA系统信息。我想从仪表板监视Java VM内存统计信息。

我知道JIRA CLI,但是,没有看到任何可以帮助我的选项。

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

我使用jira-python和server_info方法,例如

def connect_jira(log, options):
'''
Connect to JIRA. Prompt for a password if none was specified.
Return None on error
'''
try:
    log.info("Connecting to JIRA: %s" % options.jira_server)
    jira_options = {'server': options.jira_server}
    if options.jira_password:
        jira_password = options.jira_password
    else:
        jira_password = getpass.getpass()

    jira = JIRA(options=jira_options,
                # Note the tuple
                basic_auth=(options.jira_user, 
                            jira_password))
    # Test the connection by retrieving server information
    info = jira.server_info()

    return jira
except Exception,e:
    log.error("Failed to connect to JIRA: %s" % e)
    return None