<commit_before>%%%--------------------------------------------------------------------
%%% This file has been automatically generated from Swagger
%%% specification - DO NOT EDIT!
%%%
%%% @copyright (C) 2019-2021 ACK CYFRONET AGH
%%% This software is released under the MIT license
%%% cited in 'LICENSE.txt'.
%%% @end
%%%--------------------------------------------------------------------
%%% @doc 
%%% This module contains definitions of archive REST methods.
%%% @end
%%%--------------------------------------------------------------------
-module(archive_rest_routes).

-include("http/rest.hrl").

-export([routes/0]).


%%%===================================================================
%%% API
%%%===================================================================


%%--------------------------------------------------------------------
%% @doc
%% Definitions of archive REST paths.
%% @end
%%--------------------------------------------------------------------
-spec routes() -> [{binary(), module(), #rest_req{}}].
routes() -> [
    %% List archives of a dataset
    {<<"/datasets/:did/archives">>, rest_handler, #rest_req{
        method = 'GET',
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_dataset, 
            id = ?BINDING(did), 
            aspect = archives, 
            scope = private
        }
    }},
    %% Create archive from a dataset
    {<<"/archives">>, rest_handler, #rest_req{
        method = 'POST',
        parse_body = as_json_params,
        consumes = [<<"application/json">>],
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = undefined, 
            aspect = instance, 
            scope = private
        }
    }},
    %% Get archive information
    {<<"/archives/:aid">>, rest_handler, #rest_req{
        method = 'GET',
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = ?BINDING(aid), 
            aspect = instance, 
            scope = private
        }
    }},
    %% Update archive
    {<<"/archives/:aid">>, rest_handler, #rest_req{
        method = 'PATCH',
        parse_body = as_json_params,
        consumes = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = ?BINDING(aid), 
            aspect = instance, 
            scope = private
        }
    }},
    %% Delete archive
    {<<"/archives/:aid/delete">>, rest_handler, #rest_req{
        method = 'POST',
        parse_body = as_json_params,
        consumes = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = ?BINDING(aid), 
            aspect = delete, 
            scope = private
        }
    }},
    %% Recall archive
    {<<"/archives/:aid/recall">>, rest_handler, #rest_req{
        method = 'POST',
        parse_body = as_json_params,
        consumes = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = ?BINDING(aid), 
            aspect = recall, 
            scope = private
        }
    }},
    %% Get details of an archive recall
    {<<"/data/:id/recall/details">>, rest_handler, #rest_req{
        method = 'GET',
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_file, 
            id = ?OBJECTID_BINDING(id), 
            aspect = archive_recall_details, 
            scope = private
        }
    }},
    %% Get progress of an archive recall
    {<<"/data/:id/recall/progress">>, rest_handler, #rest_req{
        method = 'GET',
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_file, 
            id = ?OBJECTID_BINDING(id), 
            aspect = archive_recall_progress, 
            scope = private
        }
    }}
].
<commit_msg>Added cancel archive rest endpoint<commit_after>%%%--------------------------------------------------------------------
%%% This file has been automatically generated from Swagger
%%% specification - DO NOT EDIT!
%%%
%%% @copyright (C) 2019-2021 ACK CYFRONET AGH
%%% This software is released under the MIT license
%%% cited in 'LICENSE.txt'.
%%% @end
%%%--------------------------------------------------------------------
%%% @doc 
%%% This module contains definitions of archive REST methods.
%%% @end
%%%--------------------------------------------------------------------
-module(archive_rest_routes).

-include("http/rest.hrl").

-export([routes/0]).


%%%===================================================================
%%% API
%%%===================================================================


%%--------------------------------------------------------------------
%% @doc
%% Definitions of archive REST paths.
%% @end
%%--------------------------------------------------------------------
-spec routes() -> [{binary(), module(), #rest_req{}}].
routes() -> [
    %% List archives of a dataset
    {<<"/datasets/:did/archives">>, rest_handler, #rest_req{
        method = 'GET',
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_dataset, 
            id = ?BINDING(did), 
            aspect = archives, 
            scope = private
        }
    }},
    %% Create archive from a dataset
    {<<"/archives">>, rest_handler, #rest_req{
        method = 'POST',
        parse_body = as_json_params,
        consumes = [<<"application/json">>],
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = undefined, 
            aspect = instance, 
            scope = private
        }
    }},
    %% Get archive information
    {<<"/archives/:aid">>, rest_handler, #rest_req{
        method = 'GET',
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = ?BINDING(aid), 
            aspect = instance, 
            scope = private
        }
    }},
    %% Update archive
    {<<"/archives/:aid">>, rest_handler, #rest_req{
        method = 'PATCH',
        parse_body = as_json_params,
        consumes = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = ?BINDING(aid), 
            aspect = instance, 
            scope = private
        }
    }},
    %% Delete archive
    {<<"/archives/:aid/delete">>, rest_handler, #rest_req{
        method = 'POST',
        parse_body = as_json_params,
        consumes = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = ?BINDING(aid), 
            aspect = delete, 
            scope = private
        }
    }},
    %% Recall archive
    {<<"/archives/:aid/recall">>, rest_handler, #rest_req{
        method = 'POST',
        parse_body = as_json_params,
        consumes = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_archive, 
            id = ?BINDING(aid), 
            aspect = recall, 
            scope = private
        }
    }},
    %% Cancel an archive recall
    {<<"/data/:id/recall/cancel">>, rest_handler, #rest_req{
        method = 'POST',
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_file, 
            id = ?OBJECTID_BINDING(id), 
            aspect = cancel_archive_recall, 
            scope = private
        }
    }},
    %% Get details of an archive recall
    {<<"/data/:id/recall/details">>, rest_handler, #rest_req{
        method = 'GET',
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_file, 
            id = ?OBJECTID_BINDING(id), 
            aspect = archive_recall_details, 
            scope = private
        }
    }},
    %% Get progress of an archive recall
    {<<"/data/:id/recall/progress">>, rest_handler, #rest_req{
        method = 'GET',
        produces = [<<"application/json">>],
        b_gri = #b_gri{
            type = op_file, 
            id = ?OBJECTID_BINDING(id), 
            aspect = archive_recall_progress, 
            scope = private
        }
    }}
].

{'fraction_non_alphanumeric': 0.25255384615384613, 'fraction_numerical': 0.0022153846153846156, 'mean_word_length': 1.5220360024829298, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '665085', 'n_tokens_mistral': 2388, 'n_tokens_neox': 2288, 'n_words': 495}