NAME

Thruk::Controller::rest_v1 - Rest interface version 1

DESCRIPTION

Thruk Controller

METHODS

index

process_rest_request

process_rest_request($c, $path_info, [$method])

returns json response

get_request_columns

get_request_columns($c, $type)

$type can be:
    - RAW    - returns columsn as is, alias definitions untouched
    - NAMES  - returns column name
    - ALIAS  - returns column alias or the name if none specified
    - STRUCT - returns column as parsed structure

returns list of requested columns or undef

get_aliased_columns

get_aliased_columns($c)

returns hash of columns with their alias

get_filter_columns

get_filter_columns($c)

returns list of columns required for filtering

column_required

column_required($c, $column_name)

Can be used to exclude expensive columns from beeing generated.

returns true if column is required, ex. for sorting, filtering, etc...

register_rest_path_v1

register_rest_path_v1($protocol, $path|$regex, $function, [$roles], [$first])

register rest path.

returns nothing

get_rest_paths

get_rest_paths([$c])

gather list of available rest paths. If $c is supplied, only enabled plugins will be returned.

returns (path_hash, keys_hash, docs_hash)

load_json_files

load_json_files($c, {
    files                   => $files,
   [ pre_process_callback   => &code_ref ],
   [ authorization_callback => &code_ref ],
   [ post_process_callback  => &code_ref ],
});

generic function to expose json files

returns list of authorized loaded files

guess_field_type

guess_field_type($url, $fieldname)

returns guess about field type