【问题标题】:Getting JIRA system information from command line从命令行获取 JIRA 系统信息
【发布时间】:2014-01-06 18:33:58
【问题描述】:

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

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

有什么建议吗?

【问题讨论】:

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


    【解决方案1】:

    我会使用 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-22
      • 1970-01-01
      • 2020-12-08
      • 1970-01-01
      相关资源
      最近更新 更多