Beispiel #1
0
def deploy_modules(modules: list, node: str):
    okapi = OkapiClient()
    deployed_modules = [m["srvcId"] for m in okapi.get_deployed_modules()]
    for module in modules:
        name = module.get_modId()
        if not name in deployed_modules:
            log.info("Deploy %s", name)
            okapi.deploy_module(name, node)
            deployed_modules.append(name)
        else:
            log.info("Module %s already deployed", name)
    # Check if all deployed
    deployed_modules = [m["srvcId"] for m in okapi.get_deployed_modules()]
    for module in modules:
        name = module.get_modId()
        if not name in deployed_modules:
            log.error("%s is not deployed", name)
Beispiel #2
0
def print_okapi_all():
    pp = pprint.PrettyPrinter(indent=2)
    okapi = OkapiClient()
    print("# Env")
    pp.pprint(okapi.get_env())
    print("# Nodes")
    pp.pprint(okapi.get_nodes())
    print("# Modules")
    pp.pprint(okapi.get_modules())
    print("# Deployed Modules")
    pp.pprint(okapi.get_deployed_modules())
    print("# Tenants")
    pp.pprint(okapi.get_tenants())