Ejemplo n.º 1
0
def settings(request):
    settings = django.conf.settings
    if request.method == 'GET':
        response = dict()
        response['blob_hash_algorithm'] = settings.BLOB_HASH_ALGORITHM
        limits = KolejkaLimits(
            cpus=settings.LIMIT_CPUS,
            memory=settings.LIMIT_MEMORY,
            pids=settings.LIMIT_PIDS,
            storage=settings.LIMIT_STORAGE,
            network=settings.LIMIT_NETWORK,
            time=settings.LIMIT_TIME,
        )
        response['limits'] = limits.dump()
        return JsonResponse(response)
Ejemplo n.º 2
0
def settings(request):
    if not request.user.is_authenticated:
        return HttpResponseForbidden()
    if request.method != 'GET':
        return HttpResponseNotAllowed(['GET'])
    settings = django.conf.settings
    response = dict()
    response['blob_hash_algorithm'] = settings.BLOB_HASH_ALGORITHM
    limits = KolejkaLimits(
        cpus=settings.LIMIT_CPUS,
        memory=settings.LIMIT_MEMORY,
        swap=settings.LIMIT_SWAP,
        pids=settings.LIMIT_PIDS,
        storage=settings.LIMIT_STORAGE,
        image=settings.LIMIT_IMAGE,
        workspace=settings.LIMIT_WORKSPACE,
        network=settings.LIMIT_NETWORK,
        time=settings.LIMIT_TIME,
    )
    response['limits'] = limits.dump()
    return OKResponse(response)