Beispiel #1
0
def edit_action(req, cache_id, cluster_id):

    key_encoded = req.POST['key'].encode('utf8').encode('hex')
    new_path = '{}?key={}'.format(req.path.replace('action/', ''), key_encoded)

    extra = {'new_path': new_path}

    return invoke_service_with_json_response(
        req,
        'zato.cache.builtin.entry.update',
        _create_edit_action_message('edit', req.POST, cache_id, cluster_id),
        'OK, entry updated successfully.',
        'Entry could not be updated, e:{e}',
        extra=extra)
Beispiel #2
0
def clear(req):
    return invoke_service_with_json_response(
        req, 'zato.cache.builtin.clear', {
            'cluster_id': req.POST['cluster_id'],
            'cache_id': req.POST['cache_id']
        }, 'OK, cache cleared.', 'Cache could not be cleared, e:{e}')
Beispiel #3
0
def create_action(req, cache_id, cluster_id):

    return invoke_service_with_json_response(
        req, 'zato.cache.builtin.entry.create',
        _create_edit_action_message('create', req.POST, cache_id, cluster_id),
        'OK, entry created successfully.', 'Entry could not be created, e:{e}')
Beispiel #4
0
def clear(req):
    return invoke_service_with_json_response(
        req, 'zato.audit-log.event.clear', {
            'cluster_id': req.POST['cluster_id'],
            'cache_id': req.POST['cache_id']
        }, 'OK, audit log cleared.', 'Audit log could not be cleared, e:{e}')