Ejemplo n.º 1
0
def get_params_parser_create_dash():
    """Parse command line arguments"""

    parser = argparse.ArgumentParser(usage="usage: e2k.py [options]",
                                     description="Create a Kibana dashboard from a template")

    ElasticOcean.add_params(parser)

    parser.add_argument("-d", "--dashboard", help="dashboard to be used as template")
    parser.add_argument("-i", "--index", help="enriched index to be used as data source")
    parser.add_argument("--kibana", dest="kibana_index", default=".kibana",
                        help="Kibana index name (.kibana default)")
    parser.add_argument('-g', '--debug', dest='debug', action='store_true')

    return parser
Ejemplo n.º 2
0
def get_params_parser():
    """Parse command line arguments"""

    parser = argparse.ArgumentParser()

    ElasticOcean.add_params(parser)

    parser.add_argument('-g', '--debug', dest='debug', action='store_true')
    parser.add_argument('-t', '--token', dest='token', help="GitHub token")
    parser.add_argument('-o',
                        '--org',
                        dest='org',
                        help='GitHub Organization to be analyzed')
    parser.add_argument('-c',
                        '--contact',
                        dest='contact',
                        help='Contact (mail) to notify events.')
    parser.add_argument('--twitter',
                        dest='twitter',
                        help='Twitter account to notify.')
    parser.add_argument(
        '-w',
        '--web-dir',
        default='/var/www/cauldron/dashboards',
        dest='web_dir',
        help='Redirect HTML project pages for accessing Kibana dashboards.')
    parser.add_argument('-k',
                        '--kibana-url',
                        default='https://dashboard.cauldron.io',
                        dest='kibana_url',
                        help='Kibana URL.')
    parser.add_argument('-u',
                        '--graas-url',
                        default='https://cauldron.io',
                        dest='graas_url',
                        help='GraaS service URL.')
    parser.add_argument(
        '-n',
        '--nrepos',
        dest='nrepos',
        type=int,
        default=NREPOS,
        help=
        'Number of GitHub repositories from the Organization to be analyzed (default:10)'
    )

    return parser
Ejemplo n.º 3
0
        if backend.get_name() == name:
            found = connector

    return found


if __name__ == '__main__':
    """Gelk: perceval2ocean and ocean2kibana"""

    connectors = [[Bugzilla, BugzillaOcean, BugzillaEnrich],
                  [GitHub, GitHubOcean, GitHubEnrich],
                  [Gerrit, GerritOcean,
                   GerritEnrich]]  # Will come from Registry

    parser = argparse.ArgumentParser()
    ElasticOcean.add_params(parser)

    subparsers = parser.add_subparsers(dest='backend', help='perceval backend')

    for connector in connectors:
        name = connector[0].get_name()
        subparser = subparsers.add_parser(name, help='gelk %s -h' % name)
        # We need params for feed
        connector[0].add_params(subparser)

    args = parser.parse_args()

    app_init = datetime.now()

    backend_name = args.backend