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


Python Service.run方法代码示例

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


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

示例1: service_create

# 需要导入模块: from service import Service [as 别名]
# 或者: from service.Service import run [as 别名]
def service_create(image, name, start, target_num_instances, instance_size, run_command, env, ports, exposes,
                   volumes, links, namespace, scaling_info, custom_domain_name, region_name):
    image_name, image_tag = util.parse_image_name_tag(image)
    instance_ports, port_list = util.parse_instance_ports(ports)
    expose_list = util.merge_internal_external_ports(port_list, exposes)
    instance_ports.extend(expose_list)
    instance_envvars = util.parse_envvars(env)
    links = util.parse_links(links)
    volumes = util.parse_volumes(volumes)
    scaling_mode, scaling_cfg = util.parse_autoscale_info(scaling_info)
    if scaling_mode is None:
        scaling_mode = 'MANUAL'
    service = Service(name=name,
                      image_name=image_name,
                      image_tag=image_tag,
                      target_num_instances=target_num_instances,
                      instance_size=instance_size,
                      run_command=run_command,
                      instance_ports=instance_ports,
                      instance_envvars=instance_envvars,
                      volumes=volumes,
                      links=links,
                      namespace=namespace,
                      scaling_mode=scaling_mode,
                      autoscaling_config=scaling_cfg,
                      custom_domain_name=custom_domain_name,
                      region_name=region_name)
    if start:
        service.run()
    else:
        service.create()
开发者ID:letiantian,项目名称:alauda-CLI,代码行数:33,代码来源:commands.py

示例2: main

# 需要导入模块: from service import Service [as 别名]
# 或者: from service.Service import run [as 别名]
def main(argv):
    root = None
    if len(argv) > 0:
        root = argv[0]

    services = dict()
    config = yaml.safe_load(open('/vagrant/services/config.yml'))

    for name, config in list(config.items()):
        service = Service(name, config)
        services[name] = service

    graph = build_graph(services, root)

    for name in reversed(graph):
        service = services[name]
        print("REMOVE %s ..." % name)
        service.rmi()

    for name in graph:
        service = services[name]
        print("BUILD %s ..." % name)
        service.build()
        print("RUN %s ..." % name)
        service.run()
开发者ID:berresch,项目名称:Docker-Sonderheft,代码行数:27,代码来源:cli.py

示例3: yoback

# 需要导入模块: from service import Service [as 别名]
# 或者: from service.Service import run [as 别名]
@app.route('/yoback/<service_id>')
def yoback(service_id, methods=('POST',)):
    print 'got yo'
    oid = None
    try:
        oid = ObjectId(service_id)
    except Exception, e:
        return abort(404)
    cursor = db.services.find({'_id': oid})
    if cursor.count() == 0:
        return abort(404)
    s = Service(cursor.next())
    data = {x: request.args[x] for x in request.args
            if x in ['username', 'link', 'location']}
    s.run(db, data)
    db.services.update({'_id': s._id}, {'$inc': {'rating': 1}})
    return 'yo'


# Initialize flask-login
init_login()


# Create admin
admin = admin.Admin(app, 'Accounts', index_view=MyAdminIndexView(),
    base_template='my_master.html')


if __name__ == '__main__':
    # Start app
开发者ID:CarletonDevX,项目名称:yomote,代码行数:32,代码来源:server.py


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