def __init__(self, host, api_base=None): """ Constructor of HippoServing. """ assert host if api_base is None: api_base = common_util.get_conf('HippoManagerAPI', 'base') # read conf super(HippoServingService, self).__init__( HippoServingService.__APP_NAME, api_host=host, api_base=api_base if api_base else self.__API_BASE)
import click import ConfigParser from common import const from utils import common_util from controller.status_cmd import StatusCommand CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) default_api_host = common_util.get_conf('HippoManagerAPI', 'host') default_api_port = common_util.get_conf('HippoManagerAPI', 'port') @click.command(context_settings=CONTEXT_SETTINGS) @click.option('--id', help='hippo id') @click.option( '--api_host', default=default_api_host, help='hippo manager api host, Default: {}'.format(default_api_host)) @click.option( '--api_port', default=default_api_port, help='hippo manager api port, Default: {}'.format(default_api_port)) @click.option('-a', '--all_mode', is_flag=True, help='Get cluster status, Default: active') @click.option('-n', '--node_mode', is_flag=True, help='Get node (api_host) status') @click.option('-u', '--user', help='filter by register user')