コード例 #1
0
ファイル: quotas.py プロジェクト: salsa-dev/synnefo
def service_quotas(request):
    user = request.GET.get('user')
    users = [user] if user is not None else None
    result = service_get_quotas(request.component_instance, users=users)

    if user is not None and result == {}:
        raise ItemNotFound("No such user '%s'" % user)

    return json_response(result)
コード例 #2
0
def service_project_quotas(request):
    projectstr = request.GET.get('project')
    projects = projectstr.split(',') if projectstr is not None else None
    result = service_get_project_quotas(request.component_instance,
                                        projects=projects)

    if projectstr is not None and result == {}:
        raise ItemNotFound("No project with UUID '%s'" % projectstr)

    return json_response(result)
コード例 #3
0
ファイル: quotas.py プロジェクト: vgerak/synnefo
def service_quotas(request):
    userstr = request.GET.get('user')
    users = userstr.split(",") if userstr is not None else None
    projectstr = request.GET.get('project')
    projects = projectstr.split(",") if projectstr is not None else None
    result = service_get_quotas(request.component_instance, users=users,
                                sources=projects)

    if userstr is not None and result == {}:
        raise ItemNotFound("No user with UUID '%s'" % userstr)

    return json_response(result)