

def register_database_laas(database):
    workspace_json = {
        
    }
    workspace_json['team'] = {
        'name': database.team.name,
        'users': get_users_for_team(database.team),
    }
    if re.match('^mongo.*', database.engine_type):
        app = ['mongod.27017']
    elif re.match('^mysql.*', database.engine_type):
        app = ['mysqld', 'mysql-slow']
    elif re.match('^redis.*', database.engine_type):
        app = ['redis', 'sentinel']
    hosts = get_hosts_for_database(database)
    groups = [{
        'filter_name': ('host:(%s) AND app:(%s)' % (' OR '.join(hosts), ' OR '.join(app))),
        'name': get_group_name(database),
    }]
    workspace_json['workspace'] = {
        'description': ('%s Workspace' % database.team.name),
        'name': database.team.name,
        'groups': groups,
    }
    workspace_json = json.dumps(workspace_json)
    LOG.info(('Register workspace on LaaS. Workspace info: %s' % workspace_json))
    try:
        LaaSProvider.update_laas_workspace(environment=database.environment, laas_workspace=app)
    except Exception as e:
        LOG.error(('Ops... something went wrong: %s' % e))

dataset/ETHPy150Open globocom/database-as-a-service/dbaas/util/laas.py register_database_laas/VarMisuse@230/359 `workspace_json`->`app`