From 3d4abfa76d085ce80283eed9e4b0ca7b54ea6184 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 11:59:57 +0100 Subject: [PATCH 01/26] #15: Create SwaggerGenerator class --- src/swagger/swagger_generator.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/swagger/swagger_generator.py diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py new file mode 100644 index 00000000..3d60ac29 --- /dev/null +++ b/src/swagger/swagger_generator.py @@ -0,0 +1,2 @@ +class SwaggerGenerator(object): + pass \ No newline at end of file From 134e74f7e29f994fdf59e55f5557466ae0b9281f Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:03:13 +0100 Subject: [PATCH 02/26] #15: Create init and endpoints list for SwaggerGen --- src/swagger/swagger_generator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index 3d60ac29..7293b57f 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -1,2 +1,6 @@ class SwaggerGenerator(object): + + def __init__(self): + self.endpoints = [] + pass \ No newline at end of file From c955db045e874ddf2ead87d04cf012e686823143 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:03:47 +0100 Subject: [PATCH 03/26] #15: Create class wrapper to collect endpoints --- src/swagger/swagger_generator.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index 7293b57f..0c31e1df 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -3,4 +3,13 @@ class SwaggerGenerator(object): def __init__(self): self.endpoints = [] - pass \ No newline at end of file + def resource_wrapper(self): + """ + Wrapper for Resource classes that appends the class name to the endpoints list + """ + + def decorate(cls): + self.endpoints.append(cls.__name__) + return cls + + return decorate From 6a7c575fd841b0decbf4b02c9ec4026cfcf01788 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:04:44 +0100 Subject: [PATCH 04/26] #15: Add filepath for openapi.yaml --- src/swagger/swagger_generator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index 0c31e1df..47c6fe8b 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -1,4 +1,6 @@ +import os class SwaggerGenerator(object): + FILE_PATH = os.getcwd() + "\\swagger\\openapi.yaml" def __init__(self): self.endpoints = [] From a6c90ce9850b0614b7446e3e29328d1ec4a174f2 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:05:16 +0100 Subject: [PATCH 05/26] #15: Create method for converting from PascalCase --- src/swagger/swagger_generator.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index 47c6fe8b..27e07654 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -1,10 +1,24 @@ import os +import re + + class SwaggerGenerator(object): FILE_PATH = os.getcwd() + "\\swagger\\openapi.yaml" def __init__(self): self.endpoints = [] + @staticmethod + def pascal_to_normal(input): + """ + Converts PascalCase to words seperated by spaces. All lowercase + + :param input: The PascalCase input to be converted + :return: The converted string + """ + words = re.findall(r"[A-Z]?[a-z]+|[A-Z]{2,}(?=[A-Z][a-z]|\d|\W|$)|\d+", input) + return " ".join(map(str.lower, words)) + def resource_wrapper(self): """ Wrapper for Resource classes that appends the class name to the endpoints list From 5b0c8a0bf7c3c677077ed600cb00610f43ae8842 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:06:14 +0100 Subject: [PATCH 06/26] #15: Create method to write top part --- src/swagger/swagger_generator.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index 27e07654..8f1a1fe8 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -29,3 +29,21 @@ def decorate(cls): return cls return decorate + + + @staticmethod + def get_yaml_top(): + """ + Gets the top part of the openapi spec without the paths + + :return: String containing the top part of the openapi spec + """ + return (f'''openapi: "3.0.0" +info: + title: DataGateway API + description: ICAT API to interface with the Data Gateway + version: "0" +servers: + - url: http://localhost:5000 + +paths:''') From 3687e823ee209c5f7f1e081e2539b63f81197c7c Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:06:42 +0100 Subject: [PATCH 07/26] #15: Create method to write paths --- src/swagger/swagger_generator.py | 196 +++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index 8f1a1fe8..bcb2bb5e 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -47,3 +47,199 @@ def get_yaml_top(): - url: http://localhost:5000 paths:''') + + def get_yaml_paths(self): + """ + Gets the paths for the openapi spec + + :return: String containing the paths and their methods of the openapi spec + """ + base = "" + for endpoint in self.endpoints: + base += f''' + /{endpoint.lower()}: + get: + summary: Get {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned + required: false + schema: + type: object + - name: order + in: query + description: order the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The {SwaggerGenerator.pascal_to_normal(endpoint).lower()} found. + '404': + description: When no result is found + post: + summary: Create one of more {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + tags: + - Entities + responses: + '200': + description: The created {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + patch: + summary: Update one or multiple {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + tags: + - Entities + responses: + 200: + description: The updated {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + /{endpoint.lower()}/count: + get: + summary: Return the count of the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned + required: false + schema: + type: object + - name: order + in: query + description: order the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + /{endpoint.lower()}/findOne: + get: + summary: Return the first {SwaggerGenerator.pascal_to_normal(endpoint).lower()} matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned + required: false + schema: + type: object + - name: order + in: query + description: order the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first {SwaggerGenerator.pascal_to_normal(endpoint).lower()} matching + /{endpoint.lower()}/{{id}}: + get: + summary: Find the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + responses: + '200': + description: The matching {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + '404': + description: When no {SwaggerGenerator.pascal_to_normal(endpoint).lower()} matches the given ID + delete: + summary: Delete the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + responses: + '203': + description: Blank responses, when the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} is deleted + '404': + description: When the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} can't be found + patch: + summary: Update the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + responses: + '200': + description: The updated {SwaggerGenerator.pascal_to_normal(endpoint).lower()} + '404': + description: When the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} can't be found''' + return base + + +swagger_gen = SwaggerGenerator() From a6df922b6b3c29865871453866d1c52dcc9d75e4 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:07:12 +0100 Subject: [PATCH 08/26] #15: Create method to write to the file --- src/swagger/swagger_generator.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index bcb2bb5e..b5ca8d1a 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -30,6 +30,15 @@ def decorate(cls): return decorate + def write_swagger_spec(self): + """ + Writes the openapi.yaml file + + """ + with open(SwaggerGenerator.FILE_PATH, "w+") as target: + target.write(self.get_yaml_top()) + target.write(self.get_yaml_paths()) + target.close() @staticmethod def get_yaml_top(): From 166fcddc377ddd2e2b7f024e7fe7df9426645538 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:07:57 +0100 Subject: [PATCH 09/26] #15: Apply decorator to resources --- src/resources/entities/applications_endpoints.py | 2 ++ src/resources/entities/datacollection_datafiles_endpoints.py | 2 ++ src/resources/entities/datacollection_datasets_endpoints.py | 2 ++ src/resources/entities/datacollection_parameters_endpoints.py | 2 ++ src/resources/entities/datacollections_endpoints.py | 2 ++ src/resources/entities/datafile_formats_endpoints.py | 2 ++ src/resources/entities/datafile_parameters_endpoints.py | 2 ++ src/resources/entities/datafiles_endpoints.py | 2 ++ src/resources/entities/dataset_type_endpoints.py | 2 ++ src/resources/entities/datasets_endpoints.py | 2 ++ src/resources/entities/facilities_endpoints.py | 2 ++ src/resources/entities/facility_cycles_endpoints.py | 2 ++ src/resources/entities/groupings_endpoints.py | 2 ++ src/resources/entities/instrument_scientists_endpoints.py | 2 ++ src/resources/entities/instruments_endpoints.py | 2 ++ src/resources/entities/investigation_groups_endpoints.py | 2 ++ src/resources/entities/investigation_instruments_endpoints.py | 2 ++ src/resources/entities/investigation_parameters_endpoints.py | 2 ++ src/resources/entities/investigation_types_endpoints.py | 2 ++ src/resources/entities/investigation_users_endpoints.py | 2 ++ src/resources/entities/investigations_endpoints.py | 2 ++ src/resources/entities/jobs_endpoints.py | 2 ++ src/resources/entities/keywords_endpoints.py | 2 ++ src/resources/entities/parameter_types_endpoints.py | 2 ++ src/resources/entities/permissible_string_values_endpoints.py | 2 ++ src/resources/entities/public_steps_endpoints.py | 2 ++ src/resources/entities/publications_endpoints.py | 2 ++ src/resources/entities/related_datafiles_endpoints.py | 2 ++ src/resources/entities/rules_endpoints.py | 2 ++ src/resources/entities/sample_parameters_endpoints.py | 2 ++ src/resources/entities/sample_types_endpoints.py | 2 ++ src/resources/entities/samples_endpoints.py | 2 ++ src/resources/entities/shifts_endpoints.py | 2 ++ src/resources/entities/studies_endpoints.py | 2 ++ src/resources/entities/study_investigations_endpoints.py | 2 ++ src/resources/entities/user_groups_endpoints.py | 2 ++ src/resources/entities/users_endpoints.py | 2 ++ 37 files changed, 74 insertions(+) diff --git a/src/resources/entities/applications_endpoints.py b/src/resources/entities/applications_endpoints.py index 976ccd1b..f47ef231 100644 --- a/src/resources/entities/applications_endpoints.py +++ b/src/resources/entities/applications_endpoints.py @@ -5,8 +5,10 @@ from common.database_helpers import get_row_by_id, delete_row_by_id, update_row_from_id, get_rows_by_filter, \ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Applications(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/datacollection_datafiles_endpoints.py b/src/resources/entities/datacollection_datafiles_endpoints.py index 274eb2b5..9fac3085 100644 --- a/src/resources/entities/datacollection_datafiles_endpoints.py +++ b/src/resources/entities/datacollection_datafiles_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATACOLLECTIONDATAFILE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class DataCollectionDatafiles(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/datacollection_datasets_endpoints.py b/src/resources/entities/datacollection_datasets_endpoints.py index f097f72d..2d4447aa 100644 --- a/src/resources/entities/datacollection_datasets_endpoints.py +++ b/src/resources/entities/datacollection_datasets_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATACOLLECTIONDATASET +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class DataCollectionDatasets(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/datacollection_parameters_endpoints.py b/src/resources/entities/datacollection_parameters_endpoints.py index aefb1180..d2c9bd4b 100644 --- a/src/resources/entities/datacollection_parameters_endpoints.py +++ b/src/resources/entities/datacollection_parameters_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATACOLLECTIONPARAMETER +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class DataCollectionParameters(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/datacollections_endpoints.py b/src/resources/entities/datacollections_endpoints.py index d57b0b91..5eed7f95 100644 --- a/src/resources/entities/datacollections_endpoints.py +++ b/src/resources/entities/datacollections_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATACOLLECTION +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class DataCollections(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/datafile_formats_endpoints.py b/src/resources/entities/datafile_formats_endpoints.py index eff52937..ed86621a 100644 --- a/src/resources/entities/datafile_formats_endpoints.py +++ b/src/resources/entities/datafile_formats_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATAFILEFORMAT +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class DatafileFormats(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/datafile_parameters_endpoints.py b/src/resources/entities/datafile_parameters_endpoints.py index a9663845..5511eedf 100644 --- a/src/resources/entities/datafile_parameters_endpoints.py +++ b/src/resources/entities/datafile_parameters_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATAFILEPARAMETER +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class DatafileParameters(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/datafiles_endpoints.py b/src/resources/entities/datafiles_endpoints.py index 88146f9f..8d891607 100644 --- a/src/resources/entities/datafiles_endpoints.py +++ b/src/resources/entities/datafiles_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATAFILE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Datafiles(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/dataset_type_endpoints.py b/src/resources/entities/dataset_type_endpoints.py index f3454d70..0455b828 100644 --- a/src/resources/entities/dataset_type_endpoints.py +++ b/src/resources/entities/dataset_type_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATASETTYPE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class DatasetTypes(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/datasets_endpoints.py b/src/resources/entities/datasets_endpoints.py index 8a345d7c..dd2f736f 100644 --- a/src/resources/entities/datasets_endpoints.py +++ b/src/resources/entities/datasets_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import DATASET +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Datasets(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/facilities_endpoints.py b/src/resources/entities/facilities_endpoints.py index 1491d357..3ce016d0 100644 --- a/src/resources/entities/facilities_endpoints.py +++ b/src/resources/entities/facilities_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import FACILITY +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Facilities(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/facility_cycles_endpoints.py b/src/resources/entities/facility_cycles_endpoints.py index 6532b560..3bdf54c7 100644 --- a/src/resources/entities/facility_cycles_endpoints.py +++ b/src/resources/entities/facility_cycles_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import FACILITYCYCLE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class FacilityCycles(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/groupings_endpoints.py b/src/resources/entities/groupings_endpoints.py index 65b03f26..b4c0000b 100644 --- a/src/resources/entities/groupings_endpoints.py +++ b/src/resources/entities/groupings_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import GROUPING +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Groupings(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/instrument_scientists_endpoints.py b/src/resources/entities/instrument_scientists_endpoints.py index c3d19005..293d5db0 100644 --- a/src/resources/entities/instrument_scientists_endpoints.py +++ b/src/resources/entities/instrument_scientists_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INSTRUMENTSCIENTIST +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class InstrumentScientists(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/instruments_endpoints.py b/src/resources/entities/instruments_endpoints.py index 9f250f60..7dcfc204 100644 --- a/src/resources/entities/instruments_endpoints.py +++ b/src/resources/entities/instruments_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INSTRUMENT +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Instruments(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_groups_endpoints.py b/src/resources/entities/investigation_groups_endpoints.py index 632278bb..f2e76927 100644 --- a/src/resources/entities/investigation_groups_endpoints.py +++ b/src/resources/entities/investigation_groups_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONGROUP +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class InvestigationGroups(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_instruments_endpoints.py b/src/resources/entities/investigation_instruments_endpoints.py index eed61fd1..e969b4b2 100644 --- a/src/resources/entities/investigation_instruments_endpoints.py +++ b/src/resources/entities/investigation_instruments_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONINSTRUMENT +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class InvestigationInstruments(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_parameters_endpoints.py b/src/resources/entities/investigation_parameters_endpoints.py index c1a8ab43..b5b068d9 100644 --- a/src/resources/entities/investigation_parameters_endpoints.py +++ b/src/resources/entities/investigation_parameters_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONPARAMETER +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class InvestigationParameters(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_types_endpoints.py b/src/resources/entities/investigation_types_endpoints.py index 0ae8d2ef..7bb7bd75 100644 --- a/src/resources/entities/investigation_types_endpoints.py +++ b/src/resources/entities/investigation_types_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONTYPE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class InvestigationTypes(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/investigation_users_endpoints.py b/src/resources/entities/investigation_users_endpoints.py index 6332d5fa..f63acbaa 100644 --- a/src/resources/entities/investigation_users_endpoints.py +++ b/src/resources/entities/investigation_users_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATIONUSER +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class InvestigationUsers(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/investigations_endpoints.py b/src/resources/entities/investigations_endpoints.py index 70818b5a..8e2607b4 100644 --- a/src/resources/entities/investigations_endpoints.py +++ b/src/resources/entities/investigations_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import INVESTIGATION +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Investigations(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/jobs_endpoints.py b/src/resources/entities/jobs_endpoints.py index 2a6c40fc..12e7cdd5 100644 --- a/src/resources/entities/jobs_endpoints.py +++ b/src/resources/entities/jobs_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import JOB +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Jobs(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/keywords_endpoints.py b/src/resources/entities/keywords_endpoints.py index 01c7e033..500b0a4a 100644 --- a/src/resources/entities/keywords_endpoints.py +++ b/src/resources/entities/keywords_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import KEYWORD +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Keywords(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/parameter_types_endpoints.py b/src/resources/entities/parameter_types_endpoints.py index cae38c28..981aaa77 100644 --- a/src/resources/entities/parameter_types_endpoints.py +++ b/src/resources/entities/parameter_types_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import PARAMETERTYPE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class ParameterTypes(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/permissible_string_values_endpoints.py b/src/resources/entities/permissible_string_values_endpoints.py index a0b4d440..1053120f 100644 --- a/src/resources/entities/permissible_string_values_endpoints.py +++ b/src/resources/entities/permissible_string_values_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import PERMISSIBLESTRINGVALUE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class PermissibleStringValues(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/public_steps_endpoints.py b/src/resources/entities/public_steps_endpoints.py index 59e95f12..0cd519ac 100644 --- a/src/resources/entities/public_steps_endpoints.py +++ b/src/resources/entities/public_steps_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import PUBLICSTEP +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class PublicSteps(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/publications_endpoints.py b/src/resources/entities/publications_endpoints.py index 5345f302..2079b940 100644 --- a/src/resources/entities/publications_endpoints.py +++ b/src/resources/entities/publications_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import PUBLICATION +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Publications(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/related_datafiles_endpoints.py b/src/resources/entities/related_datafiles_endpoints.py index d48d4e97..89db3031 100644 --- a/src/resources/entities/related_datafiles_endpoints.py +++ b/src/resources/entities/related_datafiles_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import RELATEDDATAFILE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class RelatedDatafiles(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/rules_endpoints.py b/src/resources/entities/rules_endpoints.py index 61cdf33e..bcabdb59 100644 --- a/src/resources/entities/rules_endpoints.py +++ b/src/resources/entities/rules_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import RULE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Rules(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/sample_parameters_endpoints.py b/src/resources/entities/sample_parameters_endpoints.py index 2f1eb9fc..2d6c1ce8 100644 --- a/src/resources/entities/sample_parameters_endpoints.py +++ b/src/resources/entities/sample_parameters_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import SAMPLEPARAMETER +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class SampleParameters(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/sample_types_endpoints.py b/src/resources/entities/sample_types_endpoints.py index 9ced725a..0b1c0a19 100644 --- a/src/resources/entities/sample_types_endpoints.py +++ b/src/resources/entities/sample_types_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import SAMPLETYPE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class SampleTypes(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/samples_endpoints.py b/src/resources/entities/samples_endpoints.py index 22ee3f69..ac32465e 100644 --- a/src/resources/entities/samples_endpoints.py +++ b/src/resources/entities/samples_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import SAMPLE +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Samples(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/shifts_endpoints.py b/src/resources/entities/shifts_endpoints.py index 1ce61ea3..86771697 100644 --- a/src/resources/entities/shifts_endpoints.py +++ b/src/resources/entities/shifts_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import SHIFT +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Shifts(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/studies_endpoints.py b/src/resources/entities/studies_endpoints.py index 363209fe..03eae006 100644 --- a/src/resources/entities/studies_endpoints.py +++ b/src/resources/entities/studies_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import STUDY +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Studies(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/study_investigations_endpoints.py b/src/resources/entities/study_investigations_endpoints.py index b47f0576..0e385eb1 100644 --- a/src/resources/entities/study_investigations_endpoints.py +++ b/src/resources/entities/study_investigations_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import STUDYINVESTIGATION +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class StudyInvestigations(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/user_groups_endpoints.py b/src/resources/entities/user_groups_endpoints.py index 8293557e..d553e50c 100644 --- a/src/resources/entities/user_groups_endpoints.py +++ b/src/resources/entities/user_groups_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import USERGROUP +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class UserGroups(Resource): @requires_session_id @queries_records diff --git a/src/resources/entities/users_endpoints.py b/src/resources/entities/users_endpoints.py index aab57d8b..25ca655d 100644 --- a/src/resources/entities/users_endpoints.py +++ b/src/resources/entities/users_endpoints.py @@ -5,8 +5,10 @@ get_filtered_row_count, get_first_filtered_row, create_row_from_json, patch_entities from common.helpers import requires_session_id, queries_records, get_filters_from_query_string from common.models.db_models import USER +from src.swagger.swagger_generator import swagger_gen +@swagger_gen.resource_wrapper() class Users(Resource): @requires_session_id @queries_records From 8c6b525ef89d4ae5aa0325b3eb4c5c48d19992ca Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:08:28 +0100 Subject: [PATCH 10/26] #15: Import generator and write to file --- src/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index c5b1dedd..8df00ad8 100644 --- a/src/main.py +++ b/src/main.py @@ -40,7 +40,9 @@ from src.resources.entities.study_investigations_endpoints import * from src.resources.entities.user_groups_endpoints import * from src.resources.entities.users_endpoints import * +from src.swagger.swagger_generator import swagger_gen +swagger_gen.write_swagger_spec() app = Flask(__name__) api = Api(app) @@ -199,5 +201,7 @@ api.add_resource(UserGroupsFindOne, "/usergroups/findOne") + if __name__ == "__main__": - app.run(debug=True) \ No newline at end of file + + app.run(debug=True) From b6e2f66aaac7c6f8baf53204cb59102095b23403 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 25 Jul 2019 12:08:45 +0100 Subject: [PATCH 11/26] #15: Output of generator --- src/swagger/openapi.yaml | 6743 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 6743 insertions(+) create mode 100644 src/swagger/openapi.yaml diff --git a/src/swagger/openapi.yaml b/src/swagger/openapi.yaml new file mode 100644 index 00000000..dd9a38a9 --- /dev/null +++ b/src/swagger/openapi.yaml @@ -0,0 +1,6743 @@ +openapi: "3.0.0" +info: + title: DataGateway API + description: ICAT API to interface with the Data Gateway + version: "0" +servers: + - url: http://localhost:5000 + +paths: + /datasettypes: + get: + summary: Get dataset types + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the dataset types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of dataset types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of dataset types returned + required: false + schema: + type: object + - name: order + in: query + description: order the dataset types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The dataset types found. + '404': + description: When no result is found + post: + summary: Create one of more dataset types + tags: + - Entities + responses: + '200': + description: The created dataset types + patch: + summary: Update one or multiple dataset types + tags: + - Entities + responses: + 200: + description: The updated dataset types + /datasettypes/count: + get: + summary: Return the count of the dataset types + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the dataset types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of dataset types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of dataset types returned + required: false + schema: + type: object + - name: order + in: query + description: order the dataset types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of dataset types + /datasettypes/findOne: + get: + summary: Return the first dataset types matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the dataset types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of dataset types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of dataset types returned + required: false + schema: + type: object + - name: order + in: query + description: order the dataset types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first dataset types matching + /datasettypes/{id}: + get: + summary: Find the dataset types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the dataset types + responses: + '200': + description: The matching dataset types + '404': + description: When no dataset types matches the given ID + delete: + summary: Delete the dataset types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the dataset types + responses: + '203': + description: Blank responses, when the dataset types is deleted + '404': + description: When the dataset types can't be found + patch: + summary: Update the dataset types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the dataset types + responses: + '200': + description: The updated dataset types + '404': + description: When the dataset types can't be found + /applications: + get: + summary: Get applications + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the applications + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of applications returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of applications returned + required: false + schema: + type: object + - name: order + in: query + description: order the applications by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The applications found. + '404': + description: When no result is found + post: + summary: Create one of more applications + tags: + - Entities + responses: + '200': + description: The created applications + patch: + summary: Update one or multiple applications + tags: + - Entities + responses: + 200: + description: The updated applications + /applications/count: + get: + summary: Return the count of the applications + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the applications + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of applications returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of applications returned + required: false + schema: + type: object + - name: order + in: query + description: order the applications by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of applications + /applications/findOne: + get: + summary: Return the first applications matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the applications + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of applications returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of applications returned + required: false + schema: + type: object + - name: order + in: query + description: order the applications by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first applications matching + /applications/{id}: + get: + summary: Find the applications matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the applications + responses: + '200': + description: The matching applications + '404': + description: When no applications matches the given ID + delete: + summary: Delete the applications matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the applications + responses: + '203': + description: Blank responses, when the applications is deleted + '404': + description: When the applications can't be found + patch: + summary: Update the applications matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the applications + responses: + '200': + description: The updated applications + '404': + description: When the applications can't be found + /datacollectiondatafiles: + get: + summary: Get data collection datafiles + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collection datafiles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collection datafiles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collection datafiles returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collection datafiles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The data collection datafiles found. + '404': + description: When no result is found + post: + summary: Create one of more data collection datafiles + tags: + - Entities + responses: + '200': + description: The created data collection datafiles + patch: + summary: Update one or multiple data collection datafiles + tags: + - Entities + responses: + 200: + description: The updated data collection datafiles + /datacollectiondatafiles/count: + get: + summary: Return the count of the data collection datafiles + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collection datafiles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collection datafiles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collection datafiles returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collection datafiles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of data collection datafiles + /datacollectiondatafiles/findOne: + get: + summary: Return the first data collection datafiles matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collection datafiles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collection datafiles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collection datafiles returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collection datafiles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first data collection datafiles matching + /datacollectiondatafiles/{id}: + get: + summary: Find the data collection datafiles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collection datafiles + responses: + '200': + description: The matching data collection datafiles + '404': + description: When no data collection datafiles matches the given ID + delete: + summary: Delete the data collection datafiles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collection datafiles + responses: + '203': + description: Blank responses, when the data collection datafiles is deleted + '404': + description: When the data collection datafiles can't be found + patch: + summary: Update the data collection datafiles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collection datafiles + responses: + '200': + description: The updated data collection datafiles + '404': + description: When the data collection datafiles can't be found + /datacollectiondatasets: + get: + summary: Get data collection datasets + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collection datasets + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collection datasets returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collection datasets returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collection datasets by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The data collection datasets found. + '404': + description: When no result is found + post: + summary: Create one of more data collection datasets + tags: + - Entities + responses: + '200': + description: The created data collection datasets + patch: + summary: Update one or multiple data collection datasets + tags: + - Entities + responses: + 200: + description: The updated data collection datasets + /datacollectiondatasets/count: + get: + summary: Return the count of the data collection datasets + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collection datasets + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collection datasets returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collection datasets returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collection datasets by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of data collection datasets + /datacollectiondatasets/findOne: + get: + summary: Return the first data collection datasets matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collection datasets + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collection datasets returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collection datasets returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collection datasets by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first data collection datasets matching + /datacollectiondatasets/{id}: + get: + summary: Find the data collection datasets matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collection datasets + responses: + '200': + description: The matching data collection datasets + '404': + description: When no data collection datasets matches the given ID + delete: + summary: Delete the data collection datasets matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collection datasets + responses: + '203': + description: Blank responses, when the data collection datasets is deleted + '404': + description: When the data collection datasets can't be found + patch: + summary: Update the data collection datasets matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collection datasets + responses: + '200': + description: The updated data collection datasets + '404': + description: When the data collection datasets can't be found + /datacollectionparameters: + get: + summary: Get data collection parameters + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collection parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collection parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collection parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collection parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The data collection parameters found. + '404': + description: When no result is found + post: + summary: Create one of more data collection parameters + tags: + - Entities + responses: + '200': + description: The created data collection parameters + patch: + summary: Update one or multiple data collection parameters + tags: + - Entities + responses: + 200: + description: The updated data collection parameters + /datacollectionparameters/count: + get: + summary: Return the count of the data collection parameters + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collection parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collection parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collection parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collection parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of data collection parameters + /datacollectionparameters/findOne: + get: + summary: Return the first data collection parameters matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collection parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collection parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collection parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collection parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first data collection parameters matching + /datacollectionparameters/{id}: + get: + summary: Find the data collection parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collection parameters + responses: + '200': + description: The matching data collection parameters + '404': + description: When no data collection parameters matches the given ID + delete: + summary: Delete the data collection parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collection parameters + responses: + '203': + description: Blank responses, when the data collection parameters is deleted + '404': + description: When the data collection parameters can't be found + patch: + summary: Update the data collection parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collection parameters + responses: + '200': + description: The updated data collection parameters + '404': + description: When the data collection parameters can't be found + /datacollections: + get: + summary: Get data collections + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collections + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collections returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collections returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collections by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The data collections found. + '404': + description: When no result is found + post: + summary: Create one of more data collections + tags: + - Entities + responses: + '200': + description: The created data collections + patch: + summary: Update one or multiple data collections + tags: + - Entities + responses: + 200: + description: The updated data collections + /datacollections/count: + get: + summary: Return the count of the data collections + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collections + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collections returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collections returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collections by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of data collections + /datacollections/findOne: + get: + summary: Return the first data collections matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the data collections + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of data collections returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of data collections returned + required: false + schema: + type: object + - name: order + in: query + description: order the data collections by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first data collections matching + /datacollections/{id}: + get: + summary: Find the data collections matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collections + responses: + '200': + description: The matching data collections + '404': + description: When no data collections matches the given ID + delete: + summary: Delete the data collections matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collections + responses: + '203': + description: Blank responses, when the data collections is deleted + '404': + description: When the data collections can't be found + patch: + summary: Update the data collections matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the data collections + responses: + '200': + description: The updated data collections + '404': + description: When the data collections can't be found + /datafileformats: + get: + summary: Get datafile formats + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datafile formats + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datafile formats returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datafile formats returned + required: false + schema: + type: object + - name: order + in: query + description: order the datafile formats by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The datafile formats found. + '404': + description: When no result is found + post: + summary: Create one of more datafile formats + tags: + - Entities + responses: + '200': + description: The created datafile formats + patch: + summary: Update one or multiple datafile formats + tags: + - Entities + responses: + 200: + description: The updated datafile formats + /datafileformats/count: + get: + summary: Return the count of the datafile formats + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datafile formats + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datafile formats returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datafile formats returned + required: false + schema: + type: object + - name: order + in: query + description: order the datafile formats by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of datafile formats + /datafileformats/findOne: + get: + summary: Return the first datafile formats matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datafile formats + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datafile formats returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datafile formats returned + required: false + schema: + type: object + - name: order + in: query + description: order the datafile formats by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first datafile formats matching + /datafileformats/{id}: + get: + summary: Find the datafile formats matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datafile formats + responses: + '200': + description: The matching datafile formats + '404': + description: When no datafile formats matches the given ID + delete: + summary: Delete the datafile formats matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datafile formats + responses: + '203': + description: Blank responses, when the datafile formats is deleted + '404': + description: When the datafile formats can't be found + patch: + summary: Update the datafile formats matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datafile formats + responses: + '200': + description: The updated datafile formats + '404': + description: When the datafile formats can't be found + /datafileparameters: + get: + summary: Get datafile parameters + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datafile parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datafile parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datafile parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the datafile parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The datafile parameters found. + '404': + description: When no result is found + post: + summary: Create one of more datafile parameters + tags: + - Entities + responses: + '200': + description: The created datafile parameters + patch: + summary: Update one or multiple datafile parameters + tags: + - Entities + responses: + 200: + description: The updated datafile parameters + /datafileparameters/count: + get: + summary: Return the count of the datafile parameters + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datafile parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datafile parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datafile parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the datafile parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of datafile parameters + /datafileparameters/findOne: + get: + summary: Return the first datafile parameters matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datafile parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datafile parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datafile parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the datafile parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first datafile parameters matching + /datafileparameters/{id}: + get: + summary: Find the datafile parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datafile parameters + responses: + '200': + description: The matching datafile parameters + '404': + description: When no datafile parameters matches the given ID + delete: + summary: Delete the datafile parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datafile parameters + responses: + '203': + description: Blank responses, when the datafile parameters is deleted + '404': + description: When the datafile parameters can't be found + patch: + summary: Update the datafile parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datafile parameters + responses: + '200': + description: The updated datafile parameters + '404': + description: When the datafile parameters can't be found + /datafiles: + get: + summary: Get datafiles + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datafiles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datafiles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datafiles returned + required: false + schema: + type: object + - name: order + in: query + description: order the datafiles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The datafiles found. + '404': + description: When no result is found + post: + summary: Create one of more datafiles + tags: + - Entities + responses: + '200': + description: The created datafiles + patch: + summary: Update one or multiple datafiles + tags: + - Entities + responses: + 200: + description: The updated datafiles + /datafiles/count: + get: + summary: Return the count of the datafiles + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datafiles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datafiles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datafiles returned + required: false + schema: + type: object + - name: order + in: query + description: order the datafiles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of datafiles + /datafiles/findOne: + get: + summary: Return the first datafiles matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datafiles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datafiles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datafiles returned + required: false + schema: + type: object + - name: order + in: query + description: order the datafiles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first datafiles matching + /datafiles/{id}: + get: + summary: Find the datafiles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datafiles + responses: + '200': + description: The matching datafiles + '404': + description: When no datafiles matches the given ID + delete: + summary: Delete the datafiles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datafiles + responses: + '203': + description: Blank responses, when the datafiles is deleted + '404': + description: When the datafiles can't be found + patch: + summary: Update the datafiles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datafiles + responses: + '200': + description: The updated datafiles + '404': + description: When the datafiles can't be found + /datasets: + get: + summary: Get datasets + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datasets + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datasets returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datasets returned + required: false + schema: + type: object + - name: order + in: query + description: order the datasets by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The datasets found. + '404': + description: When no result is found + post: + summary: Create one of more datasets + tags: + - Entities + responses: + '200': + description: The created datasets + patch: + summary: Update one or multiple datasets + tags: + - Entities + responses: + 200: + description: The updated datasets + /datasets/count: + get: + summary: Return the count of the datasets + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datasets + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datasets returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datasets returned + required: false + schema: + type: object + - name: order + in: query + description: order the datasets by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of datasets + /datasets/findOne: + get: + summary: Return the first datasets matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the datasets + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of datasets returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of datasets returned + required: false + schema: + type: object + - name: order + in: query + description: order the datasets by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first datasets matching + /datasets/{id}: + get: + summary: Find the datasets matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datasets + responses: + '200': + description: The matching datasets + '404': + description: When no datasets matches the given ID + delete: + summary: Delete the datasets matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datasets + responses: + '203': + description: Blank responses, when the datasets is deleted + '404': + description: When the datasets can't be found + patch: + summary: Update the datasets matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the datasets + responses: + '200': + description: The updated datasets + '404': + description: When the datasets can't be found + /facilities: + get: + summary: Get facilities + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the facilities + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of facilities returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of facilities returned + required: false + schema: + type: object + - name: order + in: query + description: order the facilities by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The facilities found. + '404': + description: When no result is found + post: + summary: Create one of more facilities + tags: + - Entities + responses: + '200': + description: The created facilities + patch: + summary: Update one or multiple facilities + tags: + - Entities + responses: + 200: + description: The updated facilities + /facilities/count: + get: + summary: Return the count of the facilities + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the facilities + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of facilities returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of facilities returned + required: false + schema: + type: object + - name: order + in: query + description: order the facilities by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of facilities + /facilities/findOne: + get: + summary: Return the first facilities matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the facilities + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of facilities returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of facilities returned + required: false + schema: + type: object + - name: order + in: query + description: order the facilities by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first facilities matching + /facilities/{id}: + get: + summary: Find the facilities matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the facilities + responses: + '200': + description: The matching facilities + '404': + description: When no facilities matches the given ID + delete: + summary: Delete the facilities matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the facilities + responses: + '203': + description: Blank responses, when the facilities is deleted + '404': + description: When the facilities can't be found + patch: + summary: Update the facilities matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the facilities + responses: + '200': + description: The updated facilities + '404': + description: When the facilities can't be found + /facilitycycles: + get: + summary: Get facility cycles + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the facility cycles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of facility cycles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of facility cycles returned + required: false + schema: + type: object + - name: order + in: query + description: order the facility cycles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The facility cycles found. + '404': + description: When no result is found + post: + summary: Create one of more facility cycles + tags: + - Entities + responses: + '200': + description: The created facility cycles + patch: + summary: Update one or multiple facility cycles + tags: + - Entities + responses: + 200: + description: The updated facility cycles + /facilitycycles/count: + get: + summary: Return the count of the facility cycles + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the facility cycles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of facility cycles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of facility cycles returned + required: false + schema: + type: object + - name: order + in: query + description: order the facility cycles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of facility cycles + /facilitycycles/findOne: + get: + summary: Return the first facility cycles matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the facility cycles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of facility cycles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of facility cycles returned + required: false + schema: + type: object + - name: order + in: query + description: order the facility cycles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first facility cycles matching + /facilitycycles/{id}: + get: + summary: Find the facility cycles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the facility cycles + responses: + '200': + description: The matching facility cycles + '404': + description: When no facility cycles matches the given ID + delete: + summary: Delete the facility cycles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the facility cycles + responses: + '203': + description: Blank responses, when the facility cycles is deleted + '404': + description: When the facility cycles can't be found + patch: + summary: Update the facility cycles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the facility cycles + responses: + '200': + description: The updated facility cycles + '404': + description: When the facility cycles can't be found + /groupings: + get: + summary: Get groupings + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the groupings + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of groupings returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of groupings returned + required: false + schema: + type: object + - name: order + in: query + description: order the groupings by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The groupings found. + '404': + description: When no result is found + post: + summary: Create one of more groupings + tags: + - Entities + responses: + '200': + description: The created groupings + patch: + summary: Update one or multiple groupings + tags: + - Entities + responses: + 200: + description: The updated groupings + /groupings/count: + get: + summary: Return the count of the groupings + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the groupings + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of groupings returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of groupings returned + required: false + schema: + type: object + - name: order + in: query + description: order the groupings by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of groupings + /groupings/findOne: + get: + summary: Return the first groupings matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the groupings + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of groupings returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of groupings returned + required: false + schema: + type: object + - name: order + in: query + description: order the groupings by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first groupings matching + /groupings/{id}: + get: + summary: Find the groupings matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the groupings + responses: + '200': + description: The matching groupings + '404': + description: When no groupings matches the given ID + delete: + summary: Delete the groupings matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the groupings + responses: + '203': + description: Blank responses, when the groupings is deleted + '404': + description: When the groupings can't be found + patch: + summary: Update the groupings matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the groupings + responses: + '200': + description: The updated groupings + '404': + description: When the groupings can't be found + /instrumentscientists: + get: + summary: Get instrument scientists + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the instrument scientists + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of instrument scientists returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of instrument scientists returned + required: false + schema: + type: object + - name: order + in: query + description: order the instrument scientists by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The instrument scientists found. + '404': + description: When no result is found + post: + summary: Create one of more instrument scientists + tags: + - Entities + responses: + '200': + description: The created instrument scientists + patch: + summary: Update one or multiple instrument scientists + tags: + - Entities + responses: + 200: + description: The updated instrument scientists + /instrumentscientists/count: + get: + summary: Return the count of the instrument scientists + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the instrument scientists + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of instrument scientists returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of instrument scientists returned + required: false + schema: + type: object + - name: order + in: query + description: order the instrument scientists by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of instrument scientists + /instrumentscientists/findOne: + get: + summary: Return the first instrument scientists matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the instrument scientists + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of instrument scientists returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of instrument scientists returned + required: false + schema: + type: object + - name: order + in: query + description: order the instrument scientists by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first instrument scientists matching + /instrumentscientists/{id}: + get: + summary: Find the instrument scientists matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the instrument scientists + responses: + '200': + description: The matching instrument scientists + '404': + description: When no instrument scientists matches the given ID + delete: + summary: Delete the instrument scientists matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the instrument scientists + responses: + '203': + description: Blank responses, when the instrument scientists is deleted + '404': + description: When the instrument scientists can't be found + patch: + summary: Update the instrument scientists matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the instrument scientists + responses: + '200': + description: The updated instrument scientists + '404': + description: When the instrument scientists can't be found + /instruments: + get: + summary: Get instruments + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the instruments + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of instruments returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of instruments returned + required: false + schema: + type: object + - name: order + in: query + description: order the instruments by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The instruments found. + '404': + description: When no result is found + post: + summary: Create one of more instruments + tags: + - Entities + responses: + '200': + description: The created instruments + patch: + summary: Update one or multiple instruments + tags: + - Entities + responses: + 200: + description: The updated instruments + /instruments/count: + get: + summary: Return the count of the instruments + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the instruments + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of instruments returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of instruments returned + required: false + schema: + type: object + - name: order + in: query + description: order the instruments by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of instruments + /instruments/findOne: + get: + summary: Return the first instruments matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the instruments + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of instruments returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of instruments returned + required: false + schema: + type: object + - name: order + in: query + description: order the instruments by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first instruments matching + /instruments/{id}: + get: + summary: Find the instruments matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the instruments + responses: + '200': + description: The matching instruments + '404': + description: When no instruments matches the given ID + delete: + summary: Delete the instruments matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the instruments + responses: + '203': + description: Blank responses, when the instruments is deleted + '404': + description: When the instruments can't be found + patch: + summary: Update the instruments matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the instruments + responses: + '200': + description: The updated instruments + '404': + description: When the instruments can't be found + /investigationgroups: + get: + summary: Get investigation groups + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation groups + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation groups returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation groups returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation groups by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The investigation groups found. + '404': + description: When no result is found + post: + summary: Create one of more investigation groups + tags: + - Entities + responses: + '200': + description: The created investigation groups + patch: + summary: Update one or multiple investigation groups + tags: + - Entities + responses: + 200: + description: The updated investigation groups + /investigationgroups/count: + get: + summary: Return the count of the investigation groups + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation groups + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation groups returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation groups returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation groups by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of investigation groups + /investigationgroups/findOne: + get: + summary: Return the first investigation groups matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation groups + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation groups returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation groups returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation groups by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first investigation groups matching + /investigationgroups/{id}: + get: + summary: Find the investigation groups matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation groups + responses: + '200': + description: The matching investigation groups + '404': + description: When no investigation groups matches the given ID + delete: + summary: Delete the investigation groups matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation groups + responses: + '203': + description: Blank responses, when the investigation groups is deleted + '404': + description: When the investigation groups can't be found + patch: + summary: Update the investigation groups matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation groups + responses: + '200': + description: The updated investigation groups + '404': + description: When the investigation groups can't be found + /investigationinstruments: + get: + summary: Get investigation instruments + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation instruments + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation instruments returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation instruments returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation instruments by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The investigation instruments found. + '404': + description: When no result is found + post: + summary: Create one of more investigation instruments + tags: + - Entities + responses: + '200': + description: The created investigation instruments + patch: + summary: Update one or multiple investigation instruments + tags: + - Entities + responses: + 200: + description: The updated investigation instruments + /investigationinstruments/count: + get: + summary: Return the count of the investigation instruments + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation instruments + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation instruments returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation instruments returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation instruments by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of investigation instruments + /investigationinstruments/findOne: + get: + summary: Return the first investigation instruments matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation instruments + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation instruments returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation instruments returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation instruments by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first investigation instruments matching + /investigationinstruments/{id}: + get: + summary: Find the investigation instruments matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation instruments + responses: + '200': + description: The matching investigation instruments + '404': + description: When no investigation instruments matches the given ID + delete: + summary: Delete the investigation instruments matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation instruments + responses: + '203': + description: Blank responses, when the investigation instruments is deleted + '404': + description: When the investigation instruments can't be found + patch: + summary: Update the investigation instruments matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation instruments + responses: + '200': + description: The updated investigation instruments + '404': + description: When the investigation instruments can't be found + /investigationparameters: + get: + summary: Get investigation parameters + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The investigation parameters found. + '404': + description: When no result is found + post: + summary: Create one of more investigation parameters + tags: + - Entities + responses: + '200': + description: The created investigation parameters + patch: + summary: Update one or multiple investigation parameters + tags: + - Entities + responses: + 200: + description: The updated investigation parameters + /investigationparameters/count: + get: + summary: Return the count of the investigation parameters + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of investigation parameters + /investigationparameters/findOne: + get: + summary: Return the first investigation parameters matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first investigation parameters matching + /investigationparameters/{id}: + get: + summary: Find the investigation parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation parameters + responses: + '200': + description: The matching investigation parameters + '404': + description: When no investigation parameters matches the given ID + delete: + summary: Delete the investigation parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation parameters + responses: + '203': + description: Blank responses, when the investigation parameters is deleted + '404': + description: When the investigation parameters can't be found + patch: + summary: Update the investigation parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation parameters + responses: + '200': + description: The updated investigation parameters + '404': + description: When the investigation parameters can't be found + /investigationtypes: + get: + summary: Get investigation types + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation types returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The investigation types found. + '404': + description: When no result is found + post: + summary: Create one of more investigation types + tags: + - Entities + responses: + '200': + description: The created investigation types + patch: + summary: Update one or multiple investigation types + tags: + - Entities + responses: + 200: + description: The updated investigation types + /investigationtypes/count: + get: + summary: Return the count of the investigation types + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation types returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of investigation types + /investigationtypes/findOne: + get: + summary: Return the first investigation types matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation types returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first investigation types matching + /investigationtypes/{id}: + get: + summary: Find the investigation types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation types + responses: + '200': + description: The matching investigation types + '404': + description: When no investigation types matches the given ID + delete: + summary: Delete the investigation types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation types + responses: + '203': + description: Blank responses, when the investigation types is deleted + '404': + description: When the investigation types can't be found + patch: + summary: Update the investigation types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation types + responses: + '200': + description: The updated investigation types + '404': + description: When the investigation types can't be found + /investigationusers: + get: + summary: Get investigation users + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation users + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation users returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation users returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation users by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The investigation users found. + '404': + description: When no result is found + post: + summary: Create one of more investigation users + tags: + - Entities + responses: + '200': + description: The created investigation users + patch: + summary: Update one or multiple investigation users + tags: + - Entities + responses: + 200: + description: The updated investigation users + /investigationusers/count: + get: + summary: Return the count of the investigation users + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation users + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation users returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation users returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation users by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of investigation users + /investigationusers/findOne: + get: + summary: Return the first investigation users matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigation users + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigation users returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigation users returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigation users by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first investigation users matching + /investigationusers/{id}: + get: + summary: Find the investigation users matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation users + responses: + '200': + description: The matching investigation users + '404': + description: When no investigation users matches the given ID + delete: + summary: Delete the investigation users matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation users + responses: + '203': + description: Blank responses, when the investigation users is deleted + '404': + description: When the investigation users can't be found + patch: + summary: Update the investigation users matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigation users + responses: + '200': + description: The updated investigation users + '404': + description: When the investigation users can't be found + /investigations: + get: + summary: Get investigations + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigations + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigations returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigations returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigations by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The investigations found. + '404': + description: When no result is found + post: + summary: Create one of more investigations + tags: + - Entities + responses: + '200': + description: The created investigations + patch: + summary: Update one or multiple investigations + tags: + - Entities + responses: + 200: + description: The updated investigations + /investigations/count: + get: + summary: Return the count of the investigations + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigations + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigations returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigations returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigations by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of investigations + /investigations/findOne: + get: + summary: Return the first investigations matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the investigations + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of investigations returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of investigations returned + required: false + schema: + type: object + - name: order + in: query + description: order the investigations by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first investigations matching + /investigations/{id}: + get: + summary: Find the investigations matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigations + responses: + '200': + description: The matching investigations + '404': + description: When no investigations matches the given ID + delete: + summary: Delete the investigations matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigations + responses: + '203': + description: Blank responses, when the investigations is deleted + '404': + description: When the investigations can't be found + patch: + summary: Update the investigations matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the investigations + responses: + '200': + description: The updated investigations + '404': + description: When the investigations can't be found + /jobs: + get: + summary: Get jobs + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the jobs + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of jobs returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of jobs returned + required: false + schema: + type: object + - name: order + in: query + description: order the jobs by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The jobs found. + '404': + description: When no result is found + post: + summary: Create one of more jobs + tags: + - Entities + responses: + '200': + description: The created jobs + patch: + summary: Update one or multiple jobs + tags: + - Entities + responses: + 200: + description: The updated jobs + /jobs/count: + get: + summary: Return the count of the jobs + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the jobs + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of jobs returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of jobs returned + required: false + schema: + type: object + - name: order + in: query + description: order the jobs by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of jobs + /jobs/findOne: + get: + summary: Return the first jobs matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the jobs + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of jobs returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of jobs returned + required: false + schema: + type: object + - name: order + in: query + description: order the jobs by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first jobs matching + /jobs/{id}: + get: + summary: Find the jobs matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the jobs + responses: + '200': + description: The matching jobs + '404': + description: When no jobs matches the given ID + delete: + summary: Delete the jobs matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the jobs + responses: + '203': + description: Blank responses, when the jobs is deleted + '404': + description: When the jobs can't be found + patch: + summary: Update the jobs matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the jobs + responses: + '200': + description: The updated jobs + '404': + description: When the jobs can't be found + /keywords: + get: + summary: Get keywords + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the keywords + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of keywords returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of keywords returned + required: false + schema: + type: object + - name: order + in: query + description: order the keywords by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The keywords found. + '404': + description: When no result is found + post: + summary: Create one of more keywords + tags: + - Entities + responses: + '200': + description: The created keywords + patch: + summary: Update one or multiple keywords + tags: + - Entities + responses: + 200: + description: The updated keywords + /keywords/count: + get: + summary: Return the count of the keywords + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the keywords + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of keywords returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of keywords returned + required: false + schema: + type: object + - name: order + in: query + description: order the keywords by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of keywords + /keywords/findOne: + get: + summary: Return the first keywords matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the keywords + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of keywords returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of keywords returned + required: false + schema: + type: object + - name: order + in: query + description: order the keywords by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first keywords matching + /keywords/{id}: + get: + summary: Find the keywords matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the keywords + responses: + '200': + description: The matching keywords + '404': + description: When no keywords matches the given ID + delete: + summary: Delete the keywords matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the keywords + responses: + '203': + description: Blank responses, when the keywords is deleted + '404': + description: When the keywords can't be found + patch: + summary: Update the keywords matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the keywords + responses: + '200': + description: The updated keywords + '404': + description: When the keywords can't be found + /parametertypes: + get: + summary: Get parameter types + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the parameter types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of parameter types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of parameter types returned + required: false + schema: + type: object + - name: order + in: query + description: order the parameter types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The parameter types found. + '404': + description: When no result is found + post: + summary: Create one of more parameter types + tags: + - Entities + responses: + '200': + description: The created parameter types + patch: + summary: Update one or multiple parameter types + tags: + - Entities + responses: + 200: + description: The updated parameter types + /parametertypes/count: + get: + summary: Return the count of the parameter types + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the parameter types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of parameter types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of parameter types returned + required: false + schema: + type: object + - name: order + in: query + description: order the parameter types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of parameter types + /parametertypes/findOne: + get: + summary: Return the first parameter types matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the parameter types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of parameter types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of parameter types returned + required: false + schema: + type: object + - name: order + in: query + description: order the parameter types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first parameter types matching + /parametertypes/{id}: + get: + summary: Find the parameter types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the parameter types + responses: + '200': + description: The matching parameter types + '404': + description: When no parameter types matches the given ID + delete: + summary: Delete the parameter types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the parameter types + responses: + '203': + description: Blank responses, when the parameter types is deleted + '404': + description: When the parameter types can't be found + patch: + summary: Update the parameter types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the parameter types + responses: + '200': + description: The updated parameter types + '404': + description: When the parameter types can't be found + /permissiblestringvalues: + get: + summary: Get permissible string values + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the permissible string values + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of permissible string values returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of permissible string values returned + required: false + schema: + type: object + - name: order + in: query + description: order the permissible string values by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The permissible string values found. + '404': + description: When no result is found + post: + summary: Create one of more permissible string values + tags: + - Entities + responses: + '200': + description: The created permissible string values + patch: + summary: Update one or multiple permissible string values + tags: + - Entities + responses: + 200: + description: The updated permissible string values + /permissiblestringvalues/count: + get: + summary: Return the count of the permissible string values + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the permissible string values + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of permissible string values returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of permissible string values returned + required: false + schema: + type: object + - name: order + in: query + description: order the permissible string values by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of permissible string values + /permissiblestringvalues/findOne: + get: + summary: Return the first permissible string values matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the permissible string values + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of permissible string values returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of permissible string values returned + required: false + schema: + type: object + - name: order + in: query + description: order the permissible string values by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first permissible string values matching + /permissiblestringvalues/{id}: + get: + summary: Find the permissible string values matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the permissible string values + responses: + '200': + description: The matching permissible string values + '404': + description: When no permissible string values matches the given ID + delete: + summary: Delete the permissible string values matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the permissible string values + responses: + '203': + description: Blank responses, when the permissible string values is deleted + '404': + description: When the permissible string values can't be found + patch: + summary: Update the permissible string values matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the permissible string values + responses: + '200': + description: The updated permissible string values + '404': + description: When the permissible string values can't be found + /publicsteps: + get: + summary: Get public steps + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the public steps + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of public steps returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of public steps returned + required: false + schema: + type: object + - name: order + in: query + description: order the public steps by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The public steps found. + '404': + description: When no result is found + post: + summary: Create one of more public steps + tags: + - Entities + responses: + '200': + description: The created public steps + patch: + summary: Update one or multiple public steps + tags: + - Entities + responses: + 200: + description: The updated public steps + /publicsteps/count: + get: + summary: Return the count of the public steps + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the public steps + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of public steps returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of public steps returned + required: false + schema: + type: object + - name: order + in: query + description: order the public steps by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of public steps + /publicsteps/findOne: + get: + summary: Return the first public steps matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the public steps + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of public steps returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of public steps returned + required: false + schema: + type: object + - name: order + in: query + description: order the public steps by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first public steps matching + /publicsteps/{id}: + get: + summary: Find the public steps matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the public steps + responses: + '200': + description: The matching public steps + '404': + description: When no public steps matches the given ID + delete: + summary: Delete the public steps matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the public steps + responses: + '203': + description: Blank responses, when the public steps is deleted + '404': + description: When the public steps can't be found + patch: + summary: Update the public steps matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the public steps + responses: + '200': + description: The updated public steps + '404': + description: When the public steps can't be found + /publications: + get: + summary: Get publications + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the publications + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of publications returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of publications returned + required: false + schema: + type: object + - name: order + in: query + description: order the publications by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The publications found. + '404': + description: When no result is found + post: + summary: Create one of more publications + tags: + - Entities + responses: + '200': + description: The created publications + patch: + summary: Update one or multiple publications + tags: + - Entities + responses: + 200: + description: The updated publications + /publications/count: + get: + summary: Return the count of the publications + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the publications + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of publications returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of publications returned + required: false + schema: + type: object + - name: order + in: query + description: order the publications by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of publications + /publications/findOne: + get: + summary: Return the first publications matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the publications + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of publications returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of publications returned + required: false + schema: + type: object + - name: order + in: query + description: order the publications by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first publications matching + /publications/{id}: + get: + summary: Find the publications matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the publications + responses: + '200': + description: The matching publications + '404': + description: When no publications matches the given ID + delete: + summary: Delete the publications matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the publications + responses: + '203': + description: Blank responses, when the publications is deleted + '404': + description: When the publications can't be found + patch: + summary: Update the publications matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the publications + responses: + '200': + description: The updated publications + '404': + description: When the publications can't be found + /relateddatafiles: + get: + summary: Get related datafiles + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the related datafiles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of related datafiles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of related datafiles returned + required: false + schema: + type: object + - name: order + in: query + description: order the related datafiles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The related datafiles found. + '404': + description: When no result is found + post: + summary: Create one of more related datafiles + tags: + - Entities + responses: + '200': + description: The created related datafiles + patch: + summary: Update one or multiple related datafiles + tags: + - Entities + responses: + 200: + description: The updated related datafiles + /relateddatafiles/count: + get: + summary: Return the count of the related datafiles + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the related datafiles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of related datafiles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of related datafiles returned + required: false + schema: + type: object + - name: order + in: query + description: order the related datafiles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of related datafiles + /relateddatafiles/findOne: + get: + summary: Return the first related datafiles matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the related datafiles + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of related datafiles returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of related datafiles returned + required: false + schema: + type: object + - name: order + in: query + description: order the related datafiles by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first related datafiles matching + /relateddatafiles/{id}: + get: + summary: Find the related datafiles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the related datafiles + responses: + '200': + description: The matching related datafiles + '404': + description: When no related datafiles matches the given ID + delete: + summary: Delete the related datafiles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the related datafiles + responses: + '203': + description: Blank responses, when the related datafiles is deleted + '404': + description: When the related datafiles can't be found + patch: + summary: Update the related datafiles matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the related datafiles + responses: + '200': + description: The updated related datafiles + '404': + description: When the related datafiles can't be found + /rules: + get: + summary: Get rules + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the rules + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of rules returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of rules returned + required: false + schema: + type: object + - name: order + in: query + description: order the rules by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The rules found. + '404': + description: When no result is found + post: + summary: Create one of more rules + tags: + - Entities + responses: + '200': + description: The created rules + patch: + summary: Update one or multiple rules + tags: + - Entities + responses: + 200: + description: The updated rules + /rules/count: + get: + summary: Return the count of the rules + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the rules + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of rules returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of rules returned + required: false + schema: + type: object + - name: order + in: query + description: order the rules by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of rules + /rules/findOne: + get: + summary: Return the first rules matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the rules + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of rules returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of rules returned + required: false + schema: + type: object + - name: order + in: query + description: order the rules by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first rules matching + /rules/{id}: + get: + summary: Find the rules matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the rules + responses: + '200': + description: The matching rules + '404': + description: When no rules matches the given ID + delete: + summary: Delete the rules matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the rules + responses: + '203': + description: Blank responses, when the rules is deleted + '404': + description: When the rules can't be found + patch: + summary: Update the rules matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the rules + responses: + '200': + description: The updated rules + '404': + description: When the rules can't be found + /sampleparameters: + get: + summary: Get sample parameters + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the sample parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of sample parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of sample parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the sample parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The sample parameters found. + '404': + description: When no result is found + post: + summary: Create one of more sample parameters + tags: + - Entities + responses: + '200': + description: The created sample parameters + patch: + summary: Update one or multiple sample parameters + tags: + - Entities + responses: + 200: + description: The updated sample parameters + /sampleparameters/count: + get: + summary: Return the count of the sample parameters + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the sample parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of sample parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of sample parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the sample parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of sample parameters + /sampleparameters/findOne: + get: + summary: Return the first sample parameters matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the sample parameters + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of sample parameters returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of sample parameters returned + required: false + schema: + type: object + - name: order + in: query + description: order the sample parameters by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first sample parameters matching + /sampleparameters/{id}: + get: + summary: Find the sample parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the sample parameters + responses: + '200': + description: The matching sample parameters + '404': + description: When no sample parameters matches the given ID + delete: + summary: Delete the sample parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the sample parameters + responses: + '203': + description: Blank responses, when the sample parameters is deleted + '404': + description: When the sample parameters can't be found + patch: + summary: Update the sample parameters matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the sample parameters + responses: + '200': + description: The updated sample parameters + '404': + description: When the sample parameters can't be found + /sampletypes: + get: + summary: Get sample types + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the sample types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of sample types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of sample types returned + required: false + schema: + type: object + - name: order + in: query + description: order the sample types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The sample types found. + '404': + description: When no result is found + post: + summary: Create one of more sample types + tags: + - Entities + responses: + '200': + description: The created sample types + patch: + summary: Update one or multiple sample types + tags: + - Entities + responses: + 200: + description: The updated sample types + /sampletypes/count: + get: + summary: Return the count of the sample types + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the sample types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of sample types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of sample types returned + required: false + schema: + type: object + - name: order + in: query + description: order the sample types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of sample types + /sampletypes/findOne: + get: + summary: Return the first sample types matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the sample types + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of sample types returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of sample types returned + required: false + schema: + type: object + - name: order + in: query + description: order the sample types by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first sample types matching + /sampletypes/{id}: + get: + summary: Find the sample types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the sample types + responses: + '200': + description: The matching sample types + '404': + description: When no sample types matches the given ID + delete: + summary: Delete the sample types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the sample types + responses: + '203': + description: Blank responses, when the sample types is deleted + '404': + description: When the sample types can't be found + patch: + summary: Update the sample types matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the sample types + responses: + '200': + description: The updated sample types + '404': + description: When the sample types can't be found + /samples: + get: + summary: Get samples + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the samples + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of samples returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of samples returned + required: false + schema: + type: object + - name: order + in: query + description: order the samples by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The samples found. + '404': + description: When no result is found + post: + summary: Create one of more samples + tags: + - Entities + responses: + '200': + description: The created samples + patch: + summary: Update one or multiple samples + tags: + - Entities + responses: + 200: + description: The updated samples + /samples/count: + get: + summary: Return the count of the samples + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the samples + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of samples returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of samples returned + required: false + schema: + type: object + - name: order + in: query + description: order the samples by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of samples + /samples/findOne: + get: + summary: Return the first samples matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the samples + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of samples returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of samples returned + required: false + schema: + type: object + - name: order + in: query + description: order the samples by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first samples matching + /samples/{id}: + get: + summary: Find the samples matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the samples + responses: + '200': + description: The matching samples + '404': + description: When no samples matches the given ID + delete: + summary: Delete the samples matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the samples + responses: + '203': + description: Blank responses, when the samples is deleted + '404': + description: When the samples can't be found + patch: + summary: Update the samples matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the samples + responses: + '200': + description: The updated samples + '404': + description: When the samples can't be found + /shifts: + get: + summary: Get shifts + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the shifts + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of shifts returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of shifts returned + required: false + schema: + type: object + - name: order + in: query + description: order the shifts by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The shifts found. + '404': + description: When no result is found + post: + summary: Create one of more shifts + tags: + - Entities + responses: + '200': + description: The created shifts + patch: + summary: Update one or multiple shifts + tags: + - Entities + responses: + 200: + description: The updated shifts + /shifts/count: + get: + summary: Return the count of the shifts + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the shifts + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of shifts returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of shifts returned + required: false + schema: + type: object + - name: order + in: query + description: order the shifts by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of shifts + /shifts/findOne: + get: + summary: Return the first shifts matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the shifts + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of shifts returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of shifts returned + required: false + schema: + type: object + - name: order + in: query + description: order the shifts by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first shifts matching + /shifts/{id}: + get: + summary: Find the shifts matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the shifts + responses: + '200': + description: The matching shifts + '404': + description: When no shifts matches the given ID + delete: + summary: Delete the shifts matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the shifts + responses: + '203': + description: Blank responses, when the shifts is deleted + '404': + description: When the shifts can't be found + patch: + summary: Update the shifts matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the shifts + responses: + '200': + description: The updated shifts + '404': + description: When the shifts can't be found + /studies: + get: + summary: Get studies + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the studies + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of studies returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of studies returned + required: false + schema: + type: object + - name: order + in: query + description: order the studies by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The studies found. + '404': + description: When no result is found + post: + summary: Create one of more studies + tags: + - Entities + responses: + '200': + description: The created studies + patch: + summary: Update one or multiple studies + tags: + - Entities + responses: + 200: + description: The updated studies + /studies/count: + get: + summary: Return the count of the studies + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the studies + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of studies returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of studies returned + required: false + schema: + type: object + - name: order + in: query + description: order the studies by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of studies + /studies/findOne: + get: + summary: Return the first studies matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the studies + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of studies returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of studies returned + required: false + schema: + type: object + - name: order + in: query + description: order the studies by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first studies matching + /studies/{id}: + get: + summary: Find the studies matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the studies + responses: + '200': + description: The matching studies + '404': + description: When no studies matches the given ID + delete: + summary: Delete the studies matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the studies + responses: + '203': + description: Blank responses, when the studies is deleted + '404': + description: When the studies can't be found + patch: + summary: Update the studies matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the studies + responses: + '200': + description: The updated studies + '404': + description: When the studies can't be found + /studyinvestigations: + get: + summary: Get study investigations + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the study investigations + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of study investigations returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of study investigations returned + required: false + schema: + type: object + - name: order + in: query + description: order the study investigations by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The study investigations found. + '404': + description: When no result is found + post: + summary: Create one of more study investigations + tags: + - Entities + responses: + '200': + description: The created study investigations + patch: + summary: Update one or multiple study investigations + tags: + - Entities + responses: + 200: + description: The updated study investigations + /studyinvestigations/count: + get: + summary: Return the count of the study investigations + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the study investigations + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of study investigations returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of study investigations returned + required: false + schema: + type: object + - name: order + in: query + description: order the study investigations by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of study investigations + /studyinvestigations/findOne: + get: + summary: Return the first study investigations matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the study investigations + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of study investigations returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of study investigations returned + required: false + schema: + type: object + - name: order + in: query + description: order the study investigations by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first study investigations matching + /studyinvestigations/{id}: + get: + summary: Find the study investigations matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the study investigations + responses: + '200': + description: The matching study investigations + '404': + description: When no study investigations matches the given ID + delete: + summary: Delete the study investigations matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the study investigations + responses: + '203': + description: Blank responses, when the study investigations is deleted + '404': + description: When the study investigations can't be found + patch: + summary: Update the study investigations matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the study investigations + responses: + '200': + description: The updated study investigations + '404': + description: When the study investigations can't be found + /usergroups: + get: + summary: Get user groups + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the user groups + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of user groups returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of user groups returned + required: false + schema: + type: object + - name: order + in: query + description: order the user groups by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The user groups found. + '404': + description: When no result is found + post: + summary: Create one of more user groups + tags: + - Entities + responses: + '200': + description: The created user groups + patch: + summary: Update one or multiple user groups + tags: + - Entities + responses: + 200: + description: The updated user groups + /usergroups/count: + get: + summary: Return the count of the user groups + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the user groups + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of user groups returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of user groups returned + required: false + schema: + type: object + - name: order + in: query + description: order the user groups by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of user groups + /usergroups/findOne: + get: + summary: Return the first user groups matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the user groups + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of user groups returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of user groups returned + required: false + schema: + type: object + - name: order + in: query + description: order the user groups by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first user groups matching + /usergroups/{id}: + get: + summary: Find the user groups matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the user groups + responses: + '200': + description: The matching user groups + '404': + description: When no user groups matches the given ID + delete: + summary: Delete the user groups matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the user groups + responses: + '203': + description: Blank responses, when the user groups is deleted + '404': + description: When the user groups can't be found + patch: + summary: Update the user groups matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the user groups + responses: + '200': + description: The updated user groups + '404': + description: When the user groups can't be found + /users: + get: + summary: Get users + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the users + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of users returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of users returned + required: false + schema: + type: object + - name: order + in: query + description: order the users by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + '200': + description: The users found. + '404': + description: When no result is found + post: + summary: Create one of more users + tags: + - Entities + responses: + '200': + description: The created users + patch: + summary: Update one or multiple users + tags: + - Entities + responses: + 200: + description: The updated users + /users/count: + get: + summary: Return the count of the users + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the users + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of users returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of users returned + required: false + schema: + type: object + - name: order + in: query + description: order the users by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The count of users + /users/findOne: + get: + summary: Return the first users matching a given filter + tags: + - Entities + parameters: + - name: where + in: query + description: Apply a where filter to the users + required: false + schema: + type: object + - name: limit + in: query + description: Limit the number of users returned + required: false + schema: + type: object + - name: skip + in: query + description: Skip the number of users returned + required: false + schema: + type: object + - name: order + in: query + description: order the users by the given field + required: false + schema: + type: object + - name: include + in: query + description: include the related entities given + required: false + schema: + type: object + responses: + 200: + description: The first users matching + /users/{id}: + get: + summary: Find the users matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the users + responses: + '200': + description: The matching users + '404': + description: When no users matches the given ID + delete: + summary: Delete the users matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the users + responses: + '203': + description: Blank responses, when the users is deleted + '404': + description: When the users can't be found + patch: + summary: Update the users matching the given ID + tags: + - Entities + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The id matching the users + responses: + '200': + description: The updated users + '404': + description: When the users can't be found \ No newline at end of file From 8e414f6dd30dd6001ce61b2cafc390d2459b7de4 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Fri, 26 Jul 2019 08:35:26 +0100 Subject: [PATCH 12/26] #13: Add config file --- config.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 config.json diff --git a/config.json b/config.json new file mode 100644 index 00000000..0f44a0ca --- /dev/null +++ b/config.json @@ -0,0 +1,9 @@ +{ + "DB_URL": "mysql+pymysql://root:rootpw@localhost:13306/icatdb", + "log_level": "WARN", + "debug_mode": false +} + + + + From c6bcff624aded513e6646dff92f13616a4bbf627 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Fri, 26 Jul 2019 08:37:20 +0100 Subject: [PATCH 13/26] #13: Create config class --- common/config.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 common/config.py diff --git a/common/config.py b/common/config.py new file mode 100644 index 00000000..cc4cdd43 --- /dev/null +++ b/common/config.py @@ -0,0 +1,21 @@ +import json + + +class Config(object): + + def __init__(self): + with open("../config.json") as target: + self.config = json.load(target) + target.close() + + def get_db_url(self): + return self.config["DB_URL"] + + def get_log_level(self): + return self.config["log_level"] + + def is_debug_mode(self): + return self.config["debug_mode"] + + +config = Config() From 4b6f0e93769a34d3e18b41558f594adbf4f3b416 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Fri, 26 Jul 2019 08:37:49 +0100 Subject: [PATCH 14/26] #13: Use config class --- common/constants.py | 5 ++++- common/logger_setup.py | 6 +++--- src/main.py | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common/constants.py b/common/constants.py index 5ac55a36..c831f7e7 100644 --- a/common/constants.py +++ b/common/constants.py @@ -1,2 +1,5 @@ +from common.config import config + + class Constants: - DATABASE_URL = "mysql+pymysql://root:rootpw@localhost:13306/icatdb" + DATABASE_URL = config.get_db_url() diff --git a/common/logger_setup.py b/common/logger_setup.py index 445b96f4..1b7d9548 100644 --- a/common/logger_setup.py +++ b/common/logger_setup.py @@ -1,5 +1,5 @@ import logging.config - +from common.config import config log_level = "DEBUG" LOG_FILE_NAME = "../logs.log" @@ -9,7 +9,7 @@ "format": "[%(asctime)s] {%(module)s:%(filename)s:%(funcName)s:%(lineno)d} %(levelname)s -%(message)s ", }}, "handlers": {"default": { - "level": "DEBUG", + "level": config.get_log_level(), "formatter": "default", "class": "logging.handlers.RotatingFileHandler", "filename": LOG_FILE_NAME, @@ -17,7 +17,7 @@ "backupCount": 10 }}, "root": { - "level": log_level, + "level": config.get_log_level(), "handlers": ["default"] } } diff --git a/src/main.py b/src/main.py index c5b1dedd..5ac5d6ac 100644 --- a/src/main.py +++ b/src/main.py @@ -1,6 +1,7 @@ from flask import Flask from flask_restful import Api +from common.config import config from common.logger_setup import setup_logger from src.resources.entities.dataset_type_endpoints import * from src.resources.entities.applications_endpoints import * @@ -200,4 +201,4 @@ if __name__ == "__main__": - app.run(debug=True) \ No newline at end of file + app.run(debug=config.is_debug_mode()) \ No newline at end of file From ff81709b074247194b0554e01764f7fda79e9221 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Fri, 26 Jul 2019 08:41:19 +0100 Subject: [PATCH 15/26] #13: Update README.md --- README.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 58835c10..46ba283c 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,7 @@ The required python libraries: - [requests](https://2.python-requests.org/en/master/) ## Setup and running the API -The database connection needs to be set up first, currently it is set in `common/constants.py` - -```python -class Constants: - DATABASE_URL = "mysql+pymysql://root:rootpw@localhost:13306/icatdb" -``` +The database connection needs to be set up first. This is set in config.json To run the API from the command line, the enviroment variable `FLASK_APP` should be set to `src/main.py`. Once this is @@ -83,15 +78,17 @@ This is illustrated below. │ ├── swagger │ │ └── openapi.yaml │ └── main.py - └── test - ├── resources - │ ├── entities - │ │ └──test_.py - │ └── non_entities - │ └── test_.py - └── test_base - ├── constants.py - └── rest_test.py + ├── test + │ ├── resources + │ │ ├── entities + │ │ │ └──test_.py + │ │ └── non_entities + │ │ └── test_.py + │ └── test_base + │ ├── constants.py + │ └── rest_test.py + ├── logs.log + └── config.json ````` #### Main: The main entry point is in `/src/main.py`. This is where each endpoint route is defined and its From eec6821b7aca62769d00c8e23ecfef4a9eeaa967 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 29 Jul 2019 07:23:34 +0100 Subject: [PATCH 16/26] #13: Exit on missing config values --- common/config.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/common/config.py b/common/config.py index cc4cdd43..c21489d6 100644 --- a/common/config.py +++ b/common/config.py @@ -1,4 +1,5 @@ import json +import sys class Config(object): @@ -9,13 +10,22 @@ def __init__(self): target.close() def get_db_url(self): - return self.config["DB_URL"] + try: + return self.config["DB_URL"] + except: + sys.exit("Missing config value, DB_URL") def get_log_level(self): - return self.config["log_level"] + try: + return self.config["log_level"] + except: + sys.exit("Missing config value, log_level") def is_debug_mode(self): - return self.config["debug_mode"] + try: + return self.config["debug_mode"] + except: + sys.exit("Missing config value, debug_mode") config = Config() From fb96925c810f81c93b8835e806727dcb232f39f7 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 29 Jul 2019 07:24:54 +0100 Subject: [PATCH 17/26] #13: Add example config --- config.json.example | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 config.json.example diff --git a/config.json.example b/config.json.example new file mode 100644 index 00000000..0f44a0ca --- /dev/null +++ b/config.json.example @@ -0,0 +1,9 @@ +{ + "DB_URL": "mysql+pymysql://root:rootpw@localhost:13306/icatdb", + "log_level": "WARN", + "debug_mode": false +} + + + + From e6e418ade496a08aefcd39e4d8076b148ca69ba1 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 29 Jul 2019 07:31:52 +0100 Subject: [PATCH 18/26] #15: Change path --- src/swagger/swagger_generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index b5ca8d1a..40735f88 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -1,9 +1,10 @@ import os import re +from pathlib import Path class SwaggerGenerator(object): - FILE_PATH = os.getcwd() + "\\swagger\\openapi.yaml" + FILE_PATH = Path.cwd() / "swagger" / "openapi.yaml" def __init__(self): self.endpoints = [] From 33ef610f9a310582165da54afcda78fd9df60aa2 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 29 Jul 2019 07:34:43 +0100 Subject: [PATCH 19/26] #15: Allow generator to be disabled --- src/swagger/swagger_generator.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index 40735f88..c940b2f2 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -5,6 +5,7 @@ class SwaggerGenerator(object): FILE_PATH = Path.cwd() / "swagger" / "openapi.yaml" + is_generating = False def __init__(self): self.endpoints = [] @@ -24,22 +25,23 @@ def resource_wrapper(self): """ Wrapper for Resource classes that appends the class name to the endpoints list """ + if SwaggerGenerator.is_generating: + def decorate(cls): + self.endpoints.append(cls.__name__) + return cls - def decorate(cls): - self.endpoints.append(cls.__name__) - return cls - - return decorate + return decorate def write_swagger_spec(self): """ Writes the openapi.yaml file """ - with open(SwaggerGenerator.FILE_PATH, "w+") as target: - target.write(self.get_yaml_top()) - target.write(self.get_yaml_paths()) - target.close() + if SwaggerGenerator.is_generating: + with open(SwaggerGenerator.FILE_PATH, "w+") as target: + target.write(self.get_yaml_top()) + target.write(self.get_yaml_paths()) + target.close() @staticmethod def get_yaml_top(): From 56fdfe907c2a3e031e5b52d807fe45c03bf4bb7d Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 5 Aug 2019 17:00:00 +0100 Subject: [PATCH 20/26] #15: Remove unused filters from count --- src/swagger/swagger_generator.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index c940b2f2..065de11d 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -136,30 +136,6 @@ def get_yaml_paths(self): required: false schema: type: object - - name: limit - in: query - description: Limit the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned - required: false - schema: - type: object - - name: order - in: query - description: order the {SwaggerGenerator.pascal_to_normal(endpoint).lower()} by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} From 5a504729b9bd580c22ba52a257e0d68a7ab2449c Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 5 Aug 2019 17:01:00 +0100 Subject: [PATCH 21/26] #15: Remove limit filter from findOne --- src/swagger/swagger_generator.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index 065de11d..4063a883 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -151,12 +151,6 @@ def get_yaml_paths(self): required: false schema: type: object - - name: limit - in: query - description: Limit the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of {SwaggerGenerator.pascal_to_normal(endpoint).lower()} returned From 0e4a7c0c800724901327872cb5defc9fe2227c5d Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 5 Aug 2019 17:06:34 +0100 Subject: [PATCH 22/26] #15: Regenerate Swagger --- src/swagger/openapi.yaml | 1166 +------------------------------------- 1 file changed, 28 insertions(+), 1138 deletions(-) diff --git a/src/swagger/openapi.yaml b/src/swagger/openapi.yaml index dd9a38a9..c89bf8c1 100644 --- a/src/swagger/openapi.yaml +++ b/src/swagger/openapi.yaml @@ -5,7 +5,7 @@ info: version: "0" servers: - url: http://localhost:5000 - + paths: /datasettypes: get: @@ -74,30 +74,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of dataset types returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of dataset types returned - required: false - schema: - type: object - - name: order - in: query - description: order the dataset types by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of dataset types @@ -113,12 +89,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of dataset types returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of dataset types returned @@ -256,30 +226,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of applications returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of applications returned - required: false - schema: - type: object - - name: order - in: query - description: order the applications by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of applications @@ -295,12 +241,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of applications returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of applications returned @@ -438,30 +378,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of data collection datafiles returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of data collection datafiles returned - required: false - schema: - type: object - - name: order - in: query - description: order the data collection datafiles by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of data collection datafiles @@ -477,12 +393,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of data collection datafiles returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of data collection datafiles returned @@ -620,30 +530,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of data collection datasets returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of data collection datasets returned - required: false - schema: - type: object - - name: order - in: query - description: order the data collection datasets by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of data collection datasets @@ -659,12 +545,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of data collection datasets returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of data collection datasets returned @@ -802,30 +682,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of data collection parameters returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of data collection parameters returned - required: false - schema: - type: object - - name: order - in: query - description: order the data collection parameters by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of data collection parameters @@ -841,12 +697,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of data collection parameters returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of data collection parameters returned @@ -984,30 +834,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of data collections returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of data collections returned - required: false - schema: - type: object - - name: order - in: query - description: order the data collections by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of data collections @@ -1023,12 +849,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of data collections returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of data collections returned @@ -1166,30 +986,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of datafile formats returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of datafile formats returned - required: false - schema: - type: object - - name: order - in: query - description: order the datafile formats by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of datafile formats @@ -1205,12 +1001,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of datafile formats returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of datafile formats returned @@ -1348,30 +1138,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of datafile parameters returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of datafile parameters returned - required: false - schema: - type: object - - name: order - in: query - description: order the datafile parameters by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of datafile parameters @@ -1387,12 +1153,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of datafile parameters returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of datafile parameters returned @@ -1530,48 +1290,18 @@ paths: required: false schema: type: object - - name: limit + responses: + 200: + description: The count of datafiles + /datafiles/findOne: + get: + summary: Return the first datafiles matching a given filter + tags: + - Entities + parameters: + - name: where in: query - description: Limit the number of datafiles returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of datafiles returned - required: false - schema: - type: object - - name: order - in: query - description: order the datafiles by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object - responses: - 200: - description: The count of datafiles - /datafiles/findOne: - get: - summary: Return the first datafiles matching a given filter - tags: - - Entities - parameters: - - name: where - in: query - description: Apply a where filter to the datafiles - required: false - schema: - type: object - - name: limit - in: query - description: Limit the number of datafiles returned + description: Apply a where filter to the datafiles required: false schema: type: object @@ -1712,30 +1442,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of datasets returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of datasets returned - required: false - schema: - type: object - - name: order - in: query - description: order the datasets by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of datasets @@ -1751,12 +1457,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of datasets returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of datasets returned @@ -1894,30 +1594,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of facilities returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of facilities returned - required: false - schema: - type: object - - name: order - in: query - description: order the facilities by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of facilities @@ -1933,12 +1609,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of facilities returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of facilities returned @@ -2076,30 +1746,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of facility cycles returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of facility cycles returned - required: false - schema: - type: object - - name: order - in: query - description: order the facility cycles by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of facility cycles @@ -2115,12 +1761,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of facility cycles returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of facility cycles returned @@ -2258,30 +1898,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of groupings returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of groupings returned - required: false - schema: - type: object - - name: order - in: query - description: order the groupings by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of groupings @@ -2297,12 +1913,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of groupings returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of groupings returned @@ -2440,30 +2050,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of instrument scientists returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of instrument scientists returned - required: false - schema: - type: object - - name: order - in: query - description: order the instrument scientists by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of instrument scientists @@ -2479,12 +2065,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of instrument scientists returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of instrument scientists returned @@ -2622,30 +2202,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of instruments returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of instruments returned - required: false - schema: - type: object - - name: order - in: query - description: order the instruments by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of instruments @@ -2661,12 +2217,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of instruments returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of instruments returned @@ -2804,30 +2354,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation groups returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of investigation groups returned - required: false - schema: - type: object - - name: order - in: query - description: order the investigation groups by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of investigation groups @@ -2843,12 +2369,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation groups returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of investigation groups returned @@ -2986,30 +2506,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation instruments returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of investigation instruments returned - required: false - schema: - type: object - - name: order - in: query - description: order the investigation instruments by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of investigation instruments @@ -3025,12 +2521,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation instruments returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of investigation instruments returned @@ -3168,30 +2658,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation parameters returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of investigation parameters returned - required: false - schema: - type: object - - name: order - in: query - description: order the investigation parameters by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of investigation parameters @@ -3207,12 +2673,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation parameters returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of investigation parameters returned @@ -3350,30 +2810,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation types returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of investigation types returned - required: false - schema: - type: object - - name: order - in: query - description: order the investigation types by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of investigation types @@ -3389,12 +2825,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation types returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of investigation types returned @@ -3532,30 +2962,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation users returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of investigation users returned - required: false - schema: - type: object - - name: order - in: query - description: order the investigation users by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of investigation users @@ -3571,12 +2977,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigation users returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of investigation users returned @@ -3703,38 +3103,14 @@ paths: 200: description: The updated investigations /investigations/count: - get: - summary: Return the count of the investigations - tags: - - Entities - parameters: - - name: where - in: query - description: Apply a where filter to the investigations - required: false - schema: - type: object - - name: limit - in: query - description: Limit the number of investigations returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of investigations returned - required: false - schema: - type: object - - name: order - in: query - description: order the investigations by the given field - required: false - schema: - type: object - - name: include + get: + summary: Return the count of the investigations + tags: + - Entities + parameters: + - name: where in: query - description: include the related entities given + description: Apply a where filter to the investigations required: false schema: type: object @@ -3753,12 +3129,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of investigations returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of investigations returned @@ -3896,30 +3266,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of jobs returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of jobs returned - required: false - schema: - type: object - - name: order - in: query - description: order the jobs by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of jobs @@ -3935,12 +3281,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of jobs returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of jobs returned @@ -4078,30 +3418,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of keywords returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of keywords returned - required: false - schema: - type: object - - name: order - in: query - description: order the keywords by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of keywords @@ -4117,12 +3433,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of keywords returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of keywords returned @@ -4260,30 +3570,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of parameter types returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of parameter types returned - required: false - schema: - type: object - - name: order - in: query - description: order the parameter types by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of parameter types @@ -4299,12 +3585,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of parameter types returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of parameter types returned @@ -4442,30 +3722,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of permissible string values returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of permissible string values returned - required: false - schema: - type: object - - name: order - in: query - description: order the permissible string values by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of permissible string values @@ -4481,12 +3737,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of permissible string values returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of permissible string values returned @@ -4624,30 +3874,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of public steps returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of public steps returned - required: false - schema: - type: object - - name: order - in: query - description: order the public steps by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of public steps @@ -4663,12 +3889,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of public steps returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of public steps returned @@ -4806,30 +4026,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of publications returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of publications returned - required: false - schema: - type: object - - name: order - in: query - description: order the publications by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of publications @@ -4845,12 +4041,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of publications returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of publications returned @@ -4988,30 +4178,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of related datafiles returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of related datafiles returned - required: false - schema: - type: object - - name: order - in: query - description: order the related datafiles by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of related datafiles @@ -5027,12 +4193,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of related datafiles returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of related datafiles returned @@ -5157,40 +4317,16 @@ paths: - Entities responses: 200: - description: The updated rules - /rules/count: - get: - summary: Return the count of the rules - tags: - - Entities - parameters: - - name: where - in: query - description: Apply a where filter to the rules - required: false - schema: - type: object - - name: limit - in: query - description: Limit the number of rules returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of rules returned - required: false - schema: - type: object - - name: order - in: query - description: order the rules by the given field - required: false - schema: - type: object - - name: include + description: The updated rules + /rules/count: + get: + summary: Return the count of the rules + tags: + - Entities + parameters: + - name: where in: query - description: include the related entities given + description: Apply a where filter to the rules required: false schema: type: object @@ -5209,12 +4345,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of rules returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of rules returned @@ -5352,30 +4482,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of sample parameters returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of sample parameters returned - required: false - schema: - type: object - - name: order - in: query - description: order the sample parameters by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of sample parameters @@ -5391,12 +4497,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of sample parameters returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of sample parameters returned @@ -5534,30 +4634,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of sample types returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of sample types returned - required: false - schema: - type: object - - name: order - in: query - description: order the sample types by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of sample types @@ -5573,12 +4649,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of sample types returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of sample types returned @@ -5716,30 +4786,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of samples returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of samples returned - required: false - schema: - type: object - - name: order - in: query - description: order the samples by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of samples @@ -5755,12 +4801,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of samples returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of samples returned @@ -5898,30 +4938,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of shifts returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of shifts returned - required: false - schema: - type: object - - name: order - in: query - description: order the shifts by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of shifts @@ -5937,12 +4953,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of shifts returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of shifts returned @@ -6080,30 +5090,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of studies returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of studies returned - required: false - schema: - type: object - - name: order - in: query - description: order the studies by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of studies @@ -6119,12 +5105,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of studies returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of studies returned @@ -6262,30 +5242,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of study investigations returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of study investigations returned - required: false - schema: - type: object - - name: order - in: query - description: order the study investigations by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of study investigations @@ -6301,12 +5257,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of study investigations returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of study investigations returned @@ -6444,30 +5394,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of user groups returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of user groups returned - required: false - schema: - type: object - - name: order - in: query - description: order the user groups by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of user groups @@ -6483,12 +5409,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of user groups returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of user groups returned @@ -6626,30 +5546,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of users returned - required: false - schema: - type: object - - name: skip - in: query - description: Skip the number of users returned - required: false - schema: - type: object - - name: order - in: query - description: order the users by the given field - required: false - schema: - type: object - - name: include - in: query - description: include the related entities given - required: false - schema: - type: object responses: 200: description: The count of users @@ -6665,12 +5561,6 @@ paths: required: false schema: type: object - - name: limit - in: query - description: Limit the number of users returned - required: false - schema: - type: object - name: skip in: query description: Skip the number of users returned From 6dcdc7b263284e1acc429bc5f7a705cb8d67803b Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 5 Aug 2019 17:18:07 +0100 Subject: [PATCH 23/26] #15: Fix crash when not generating --- src/swagger/swagger_generator.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index 4063a883..f09da43a 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -25,12 +25,11 @@ def resource_wrapper(self): """ Wrapper for Resource classes that appends the class name to the endpoints list """ - if SwaggerGenerator.is_generating: - def decorate(cls): + def decorate(cls): + if SwaggerGenerator.is_generating: self.endpoints.append(cls.__name__) - return cls - - return decorate + return cls + return decorate def write_swagger_spec(self): """ From 468bf73e4a24b3305b81c79958b13730bad6b126 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 5 Aug 2019 17:27:15 +0100 Subject: [PATCH 24/26] #15: Add swagger generation to config files --- config.json | 3 ++- config.json.example | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 0f44a0ca..70c182f6 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,8 @@ { "DB_URL": "mysql+pymysql://root:rootpw@localhost:13306/icatdb", "log_level": "WARN", - "debug_mode": false + "debug_mode": false, + "generate_swagger": false } diff --git a/config.json.example b/config.json.example index 0f44a0ca..70c182f6 100644 --- a/config.json.example +++ b/config.json.example @@ -1,7 +1,8 @@ { "DB_URL": "mysql+pymysql://root:rootpw@localhost:13306/icatdb", "log_level": "WARN", - "debug_mode": false + "debug_mode": false, + "generate_swagger": false } From cd1668dc5beb0e5dc5a813d26398c2157ca03327 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 5 Aug 2019 17:27:48 +0100 Subject: [PATCH 25/26] #15: Add is_generate_swagger to config class --- common/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/config.py b/common/config.py index c21489d6..e68d87b3 100644 --- a/common/config.py +++ b/common/config.py @@ -27,5 +27,10 @@ def is_debug_mode(self): except: sys.exit("Missing config value, debug_mode") + def is_generate_swagger(self): + try: + return self.config["generate_swagger"] + except: + sys.exit("Missing config value, generate_swagger") config = Config() From 735eda40118a1d9b49af085775c520f2d8705703 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Mon, 5 Aug 2019 17:28:09 +0100 Subject: [PATCH 26/26] #15: Use config to control generation --- src/swagger/swagger_generator.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/swagger/swagger_generator.py b/src/swagger/swagger_generator.py index f09da43a..dd83befc 100644 --- a/src/swagger/swagger_generator.py +++ b/src/swagger/swagger_generator.py @@ -2,10 +2,11 @@ import re from pathlib import Path +from common.config import config + class SwaggerGenerator(object): FILE_PATH = Path.cwd() / "swagger" / "openapi.yaml" - is_generating = False def __init__(self): self.endpoints = [] @@ -26,7 +27,7 @@ def resource_wrapper(self): Wrapper for Resource classes that appends the class name to the endpoints list """ def decorate(cls): - if SwaggerGenerator.is_generating: + if config.is_generate_swagger(): self.endpoints.append(cls.__name__) return cls return decorate @@ -36,7 +37,7 @@ def write_swagger_spec(self): Writes the openapi.yaml file """ - if SwaggerGenerator.is_generating: + if config.is_generate_swagger(): with open(SwaggerGenerator.FILE_PATH, "w+") as target: target.write(self.get_yaml_top()) target.write(self.get_yaml_paths())