当前位置: 首页>>代码示例>>Python>>正文


Python Config.cadvisor_ip方法代码示例

本文整理汇总了Python中cattle.Config.cadvisor_ip方法的典型用法代码示例。如果您正苦于以下问题:Python Config.cadvisor_ip方法的具体用法?Python Config.cadvisor_ip怎么用?Python Config.cadvisor_ip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cattle.Config的用法示例。


在下文中一共展示了Config.cadvisor_ip方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_startup

# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
    def on_startup(self):
        cmd = ['cadvisor',
               '-logtostderr=true',
               '-listen_ip', Config.cadvisor_ip(),
               '-port', str(Config.cadvisor_port()),
               '-housekeeping_interval', Config.cadvisor_interval()]

        docker_root = Config.cadvisor_docker_root()
        if docker_root:
            cmd += ["-docker_root", docker_root]

        cadvisor_opts = Config.cadvisor_opts()
        if cadvisor_opts:
            try:
                cmd += shlex.split(cadvisor_opts)
            except ValueError:
                log.exception(
                    "Error missing closing `'` in: {0}".format(cadvisor_opts))
                pass

        wrapper = Config.cadvisor_wrapper()

        if len(wrapper):
            cmd.insert(0, wrapper)
        else:
            if os.path.exists('/host/proc/1/ns/mnt'):
                cmd = ['nsenter', '--mount=/host/proc/1/ns/mnt', '--'] + cmd

        background(cmd)
开发者ID:StrongMonkey,项目名称:python-agent,代码行数:31,代码来源:cadvisor.py

示例2: on_startup

# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
    def on_startup(self):
        cmd = [cadvisor_bin(),
               '-logtostderr=true',
               '-ip', Config.cadvisor_ip(),
               '-port', str(Config.cadvisor_port())]

        if os.path.exists('/host/proc/1/ns/mnt'):
            cmd = ['nsenter', '--mount=/host/proc/1/ns/mnt', '--'] + cmd

        background(cmd)
开发者ID:pranavs18,项目名称:python-agent,代码行数:12,代码来源:cadvisor.py

示例3: __init__

# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
    def __init__(self, docker_client=None):
        self.unit = 1048576
        self.cadvisor = CadvisorAPIClient(Config.cadvisor_ip(),
                                          Config.cadvisor_port())

        self.docker_client = docker_client
        self.docker_storage_driver = None

        if self.docker_client:
            self.docker_storage_driver = \
                self.docker_client.info().get("Driver", None)
开发者ID:vladimir-romaniuk,项目名称:python-agent,代码行数:13,代码来源:disk.py

示例4: on_startup

# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
    def on_startup(self):
        env = dict(os.environ)
        env['HOST_API_CONFIG_FILE'] = host_api_config()

        url = 'http://{0}:{1}'.format(Config.cadvisor_ip(),
                                      Config.cadvisor_port())
        background(['host-api',
                    '-cadvisor-url',  url,
                    '-logtostderr=true',
                    '-ip', Config.host_api_ip(),
                    '-port', str(Config.host_api_port())],
                   env=env)
开发者ID:pranavs18,项目名称:python-agent,代码行数:14,代码来源:host_api.py

示例5: on_startup

# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
    def on_startup(self):
        cmd = ['cadvisor',
               '-logtostderr=true',
               '-listen_ip', Config.cadvisor_ip(),
               '-port', str(Config.cadvisor_port())]

        wrapper = Config.cadvisor_wrapper()

        if len(wrapper):
            cmd.insert(0, wrapper)
        else:
            if os.path.exists('/host/proc/1/ns/mnt'):
                cmd = ['nsenter', '--mount=/host/proc/1/ns/mnt', '--'] + cmd

        background(cmd)
开发者ID:aruneli,项目名称:python-agent,代码行数:17,代码来源:cadvisor.py

示例6: on_startup

# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
    def on_startup(self):
        env = dict(os.environ)
        env['HOST_API_CATTLE_ACCESS_KEY'] = Config.access_key()
        env['HOST_API_CATTLE_SECRET_KEY'] = Config.secret_key()

        url = 'http://{0}:{1}'.format(Config.cadvisor_ip(),
                                      Config.cadvisor_port())

        background(['host-api',
                    '-cadvisor-url',  url,
                    '-logtostderr=true',
                    '-ip', Config.host_api_ip(),
                    '-port', str(Config.host_api_port()),
                    '-auth=true',
                    '-host-uuid', DockerConfig.docker_uuid(),
                    '-public-key', Config.jwt_public_key_file(),
                    '-cattle-url', Config.api_url(),
                    '-cattle-state-dir', Config.container_state_dir()],
                   env=env)
开发者ID:aruneli,项目名称:python-agent,代码行数:21,代码来源:host_api.py

示例7: __init__

# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
 def __init__(self):
     self.unit = 1048576
     self.cadvisor = CadvisorAPIClient(Config.cadvisor_ip(),
                                       Config.cadvisor_port())
开发者ID:aruneli,项目名称:python-agent,代码行数:6,代码来源:disk.py


注:本文中的cattle.Config.cadvisor_ip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。