From a9f3b08fca2e0214af2ef804bf385e59f0cbb20f Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 3 Nov 2020 11:08:10 +0000 Subject: [PATCH 01/20] #184: Add trailing commas to meet flake8 output --- datagateway_api/common/backend.py | 8 +-- datagateway_api/common/database/backend.py | 12 ++--- datagateway_api/common/database/filters.py | 6 +-- datagateway_api/common/database/helpers.py | 10 ++-- datagateway_api/common/database/models.py | 50 +++++++++--------- .../common/database/session_manager.py | 2 +- datagateway_api/common/date_handler.py | 2 +- datagateway_api/common/exceptions.py | 2 +- datagateway_api/common/filters.py | 2 +- datagateway_api/common/helpers.py | 4 +- datagateway_api/common/icat/backend.py | 18 +++---- datagateway_api/common/icat/filters.py | 12 ++--- datagateway_api/common/icat/helpers.py | 51 ++++++++++--------- datagateway_api/common/icat/query.py | 22 ++++---- datagateway_api/common/logger_setup.py | 4 +- datagateway_api/src/main.py | 8 +-- .../src/resources/entities/entity_endpoint.py | 10 ++-- .../src/resources/entities/entity_map.py | 4 +- .../table_endpoints/table_endpoints.py | 4 +- .../src/swagger/apispec_flask_restful.py | 8 +-- .../src/swagger/initialise_spec.py | 36 ++++++------- test/test_database_helpers.py | 17 ++++--- test/test_entityHelper.py | 2 +- test/test_helpers.py | 26 +++++----- util/icat_db_generator.py | 16 +++--- 25 files changed, 172 insertions(+), 164 deletions(-) diff --git a/datagateway_api/common/backend.py b/datagateway_api/common/backend.py index c58f53d8..5b799b7a 100644 --- a/datagateway_api/common/backend.py +++ b/datagateway_api/common/backend.py @@ -143,7 +143,7 @@ def update_with_id(self, session_id, entity_type, id_, data): @abstractmethod def get_facility_cycles_for_instrument_with_filters( - self, session_id, instrument_id, filters + self, session_id, instrument_id, filters, ): """ Given an instrument_id get facility cycles where the instrument has @@ -158,7 +158,7 @@ def get_facility_cycles_for_instrument_with_filters( @abstractmethod def get_facility_cycles_for_instrument_count_with_filters( - self, session_id, instrument_id, filters + self, session_id, instrument_id, filters, ): """ Given an instrument_id get the facility cycles count where the instrument has @@ -173,7 +173,7 @@ def get_facility_cycles_for_instrument_count_with_filters( @abstractmethod def get_investigations_for_instrument_in_facility_cycle_with_filters( - self, session_id, instrument_id, facilitycycle_id, filters + self, session_id, instrument_id, facilitycycle_id, filters, ): """ Given an instrument id and facility cycle id, get investigations that use the @@ -189,7 +189,7 @@ def get_investigations_for_instrument_in_facility_cycle_with_filters( @abstractmethod def get_investigations_for_instrument_in_facility_cycle_count_with_filters( - self, session_id, instrument_id, facilitycycle_id, filters + self, session_id, instrument_id, facilitycycle_id, filters, ): """ Given an instrument id and facility cycle id, get the count of the diff --git a/datagateway_api/common/database/backend.py b/datagateway_api/common/database/backend.py index 6a0f3e29..8d429f80 100644 --- a/datagateway_api/common/database/backend.py +++ b/datagateway_api/common/database/backend.py @@ -110,31 +110,31 @@ def update_with_id(self, session_id, entity_type, id_, data): @requires_session_id @queries_records def get_facility_cycles_for_instrument_with_filters( - self, session_id, instrument_id, filters + self, session_id, instrument_id, filters, ): return get_facility_cycles_for_instrument(instrument_id, filters) @requires_session_id @queries_records def get_facility_cycles_for_instrument_count_with_filters( - self, session_id, instrument_id, filters + self, session_id, instrument_id, filters, ): return get_facility_cycles_for_instrument_count(instrument_id, filters) @requires_session_id @queries_records def get_investigations_for_instrument_in_facility_cycle_with_filters( - self, session_id, instrument_id, facilitycycle_id, filters + self, session_id, instrument_id, facilitycycle_id, filters, ): return get_investigations_for_instrument_in_facility_cycle( - instrument_id, facilitycycle_id, filters + instrument_id, facilitycycle_id, filters, ) @requires_session_id @queries_records def get_investigations_for_instrument_in_facility_cycle_count_with_filters( - self, session_id, instrument_id, facilitycycle_id, filters + self, session_id, instrument_id, facilitycycle_id, filters, ): return get_investigations_for_instrument_in_facility_cycle_count( - instrument_id, facilitycycle_id, filters + instrument_id, facilitycycle_id, filters, ) diff --git a/datagateway_api/common/database/filters.py b/datagateway_api/common/database/filters.py index 89099416..34148d21 100644 --- a/datagateway_api/common/database/filters.py +++ b/datagateway_api/common/database/filters.py @@ -53,14 +53,14 @@ def apply_filter(self, query): field = getattr(query.table, self.field) except AttributeError: raise FilterError( - f"Unknown attribute {self.field} on table {query.table.__name__}" + f"Unknown attribute {self.field} on table {query.table.__name__}", ) if self.included_included_field: included_table = getattr(models, self.field) included_included_table = getattr(models, self.included_field) query.base_query = query.base_query.join(included_table).join( - included_included_table + included_included_table, ) field = getattr(included_included_table, self.included_included_field) @@ -85,7 +85,7 @@ def apply_filter(self, query): query.base_query = query.base_query.filter(field.in_(self.value)) else: raise FilterError( - f" Bad operation given to where filter. operation: {self.operation}" + f" Bad operation given to where filter. operation: {self.operation}", ) diff --git a/datagateway_api/common/database/helpers.py b/datagateway_api/common/database/helpers.py index 228381b7..4479145b 100644 --- a/datagateway_api/common/database/helpers.py +++ b/datagateway_api/common/database/helpers.py @@ -47,7 +47,7 @@ else: raise ApiError( "Cannot select which implementation of filters to import, check the config file" - " has a valid backend type" + " has a valid backend type", ) log = logging.getLogger() @@ -521,7 +521,7 @@ def __init__(self, instrument_id, facility_cycle_id): def get_investigations_for_instrument_in_facility_cycle( - instrument_id, facility_cycle_id, filters + instrument_id, facility_cycle_id, filters, ): """ Given an instrument id and facility cycle id, get investigations that use the given @@ -534,7 +534,7 @@ def get_investigations_for_instrument_in_facility_cycle( """ filter_handler = FilterOrderHandler() with InstrumentFacilityCycleInvestigationsQuery( - instrument_id, facility_cycle_id + instrument_id, facility_cycle_id, ) as query: return get_filtered_read_query_results(filter_handler, filters, query) @@ -558,7 +558,7 @@ def __init__(self, instrument_id, facility_cycle_id): def get_investigations_for_instrument_in_facility_cycle_count( - instrument_id, facility_cycle_id, filters + instrument_id, facility_cycle_id, filters, ): """ Given an instrument id and facility cycle id, get the count of the investigations @@ -570,7 +570,7 @@ def get_investigations_for_instrument_in_facility_cycle_count( :return: The investigations count """ with InstrumentFacilityCycleInvestigationsCountQuery( - instrument_id, facility_cycle_id + instrument_id, facility_cycle_id, ) as query: filter_handler = FilterOrderHandler() filter_handler.add_filters(filters) diff --git a/datagateway_api/common/database/models.py b/datagateway_api/common/database/models.py index 15476767..1958439a 100644 --- a/datagateway_api/common/database/models.py +++ b/datagateway_api/common/database/models.py @@ -74,7 +74,7 @@ def get_entity_object_from_name(entity_name): return globals()[entity_name.upper()] except KeyError: raise ApiError( - f"Entity class cannot be found. Please create a class for {entity_name}" + f"Entity class cannot be found, missing class for {entity_name}", ) def to_dict(self): @@ -132,17 +132,17 @@ def _nest_dictionary_include(self, dictionary, include): related_entity = self.get_related_entity(list(include)[0]) if not isinstance(related_entity, InstrumentedList): dictionary[related_entity.__tablename__] = related_entity.to_nested_dict( - include[list(include)[0]] + include[list(include)[0]], ) else: for entity in related_entity: if entity.__tablename__ in dictionary.keys(): dictionary[entity.__tablename__].append( - entity.to_nested_dict(include[list(include)[0]]) + entity.to_nested_dict(include[list(include)[0]]), ) else: dictionary[entity.__tablename__] = [ - entity.to_nested_dict(include[list(include)[0]]) + entity.to_nested_dict(include[list(include)[0]]), ] def _nest_string_include(self, dictionary, include): @@ -289,7 +289,7 @@ class DATACOLLECTIONPARAMETER(Base, EntityHelper): __tablename__ = "DATACOLLECTIONPARAMETER" __table_args__ = ( Index( - "UNQ_DATACOLLECTIONPARAMETER_0", "DATACOLLECTION_ID", "PARAMETER_TYPE_ID" + "UNQ_DATACOLLECTIONPARAMETER_0", "DATACOLLECTION_ID", "PARAMETER_TYPE_ID", ), ) @@ -306,7 +306,7 @@ class DATACOLLECTIONPARAMETER(Base, EntityHelper): STRING_VALUE = Column(String(4000)) DATACOLLECTION_ID = Column(ForeignKey("DATACOLLECTION.ID"), nullable=False) PARAMETER_TYPE_ID = Column( - ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True + ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True, ) DATACOLLECTION = relationship( @@ -347,7 +347,7 @@ class DATAFILE(Base, EntityHelper): backref="DATAFILE", ) DATASET = relationship( - "DATASET", primaryjoin="DATAFILE.DATASET_ID == DATASET.ID", backref="DATAFILE" + "DATASET", primaryjoin="DATAFILE.DATASET_ID == DATASET.ID", backref="DATAFILE", ) @@ -392,7 +392,7 @@ class DATAFILEPARAMETER(Base, EntityHelper): STRING_VALUE = Column(String(4000)) DATAFILE_ID = Column(ForeignKey("DATAFILE.ID"), nullable=False) PARAMETER_TYPE_ID = Column( - ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True + ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True, ) DATAFILE = relationship( @@ -433,7 +433,7 @@ class DATASET(Base, EntityHelper): backref="DATASET", ) SAMPLE = relationship( - "SAMPLE", primaryjoin="DATASET.SAMPLE_ID == SAMPLE.ID", backref="DATASET" + "SAMPLE", primaryjoin="DATASET.SAMPLE_ID == SAMPLE.ID", backref="DATASET", ) DATASETTYPE = relationship( "DATASETTYPE", @@ -461,7 +461,7 @@ class DATASETPARAMETER(Base, EntityHelper): STRING_VALUE = Column(String(4000)) DATASET_ID = Column(ForeignKey("DATASET.ID"), nullable=False) PARAMETER_TYPE_ID = Column( - ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True + ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True, ) DATASET = relationship( @@ -622,7 +622,7 @@ class INVESTIGATIONGROUP(Base, EntityHelper): ROLE = Column(String(255), nullable=False) GROUP_ID = Column(ForeignKey("GROUPING.ID"), nullable=False) INVESTIGATION_ID = Column( - ForeignKey("INVESTIGATION.ID"), nullable=False, index=True + ForeignKey("INVESTIGATION.ID"), nullable=False, index=True, ) GROUPING = relationship( @@ -682,7 +682,7 @@ class INVESTIGATIONPARAMETER(Base, EntityHelper): STRING_VALUE = Column(String(4000)) INVESTIGATION_ID = Column(ForeignKey("INVESTIGATION.ID"), nullable=False) PARAMETER_TYPE_ID = Column( - ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True + ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True, ) INVESTIGATION = relationship( @@ -730,7 +730,7 @@ class INVESTIGATIONUSER(Base, EntityHelper): MOD_TIME = Column(DateTime, nullable=False) ROLE = Column(String(255), nullable=False) INVESTIGATION_ID = Column( - ForeignKey("INVESTIGATION.ID"), nullable=False, index=True + ForeignKey("INVESTIGATION.ID"), nullable=False, index=True, ) USER_ID = Column(ForeignKey("USER_.ID"), nullable=False) @@ -760,7 +760,9 @@ class JOB(Base, EntityHelper): OUTPUTDATACOLLECTION_ID = Column(ForeignKey("DATACOLLECTION.ID"), index=True) APPLICATION = relationship( - "APPLICATION", primaryjoin="JOB.APPLICATION_ID == APPLICATION.ID", backref="JOB" + "APPLICATION", + primaryjoin="JOB.APPLICATION_ID == APPLICATION.ID", + backref="JOB", ) DATACOLLECTION = relationship( "DATACOLLECTION", @@ -780,7 +782,7 @@ class KEYWORD(Base, EntityHelper): MOD_TIME = Column(DateTime, nullable=False) NAME = Column(String(255), nullable=False) INVESTIGATION_ID = Column( - ForeignKey("INVESTIGATION.ID"), nullable=False, index=True + ForeignKey("INVESTIGATION.ID"), nullable=False, index=True, ) INVESTIGATION = relationship( @@ -840,7 +842,7 @@ class PERMISSIBLESTRINGVALUE(Base, EntityHelper): MOD_TIME = Column(DateTime, nullable=False) VALUE = Column(String(255), nullable=False) PARAMETERTYPE_ID = Column( - ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True + ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True, ) PARAMETERTYPE = relationship( @@ -864,7 +866,7 @@ class PUBLICATION(Base, EntityHelper): REPOSITORYID = Column(String(255)) URL = Column(String(255)) INVESTIGATION_ID = Column( - ForeignKey("INVESTIGATION.ID"), nullable=False, index=True + ForeignKey("INVESTIGATION.ID"), nullable=False, index=True, ) INVESTIGATION = relationship( @@ -932,7 +934,7 @@ class RULE(Base, EntityHelper): GROUPING_ID = Column(ForeignKey("GROUPING.ID"), index=True) GROUPING = relationship( - "GROUPING", primaryjoin="RULE.GROUPING_ID == GROUPING.ID", backref="RULE" + "GROUPING", primaryjoin="RULE.GROUPING_ID == GROUPING.ID", backref="RULE", ) @@ -978,7 +980,7 @@ class SAMPLEPARAMETER(Base, EntityHelper): STRING_VALUE = Column(String(4000)) SAMPLE_ID = Column(ForeignKey("SAMPLE.ID"), nullable=False) PARAMETER_TYPE_ID = Column( - ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True + ForeignKey("PARAMETERTYPE.ID"), nullable=False, index=True, ) PARAMETERTYPE = relationship( @@ -1049,10 +1051,12 @@ class USERGROUP(Base, EntityHelper): USER_ID = Column(ForeignKey("USER_.ID"), nullable=False) GROUPING = relationship( - "GROUPING", primaryjoin="USERGROUP.GROUP_ID == GROUPING.ID", backref="USERGROUP" + "GROUPING", + primaryjoin="USERGROUP.GROUP_ID == GROUPING.ID", + backref="USERGROUP", ) USER_ = relationship( - "USER", primaryjoin="USERGROUP.USER_ID == USER.ID", backref="USERGROUP" + "USER", primaryjoin="USERGROUP.USER_ID == USER.ID", backref="USERGROUP", ) @@ -1068,7 +1072,7 @@ class STUDYINVESTIGATION(Base, EntityHelper): MOD_ID = Column(String(255), nullable=False) MOD_TIME = Column(DateTime, nullable=False) INVESTIGATION_ID = Column( - ForeignKey("INVESTIGATION.ID"), nullable=False, index=True + ForeignKey("INVESTIGATION.ID"), nullable=False, index=True, ) STUDY_ID = Column(ForeignKey("STUDY.ID"), nullable=False) @@ -1099,7 +1103,7 @@ class STUDY(Base, EntityHelper): USER_ID = Column(ForeignKey("USER_.ID"), index=True) USER_ = relationship( - "USER", primaryjoin="STUDY.USER_ID == USER.ID", backref="STUDY" + "USER", primaryjoin="STUDY.USER_ID == USER.ID", backref="STUDY", ) diff --git a/datagateway_api/common/database/session_manager.py b/datagateway_api/common/database/session_manager.py index 9466d4fc..0e3dfce9 100644 --- a/datagateway_api/common/database/session_manager.py +++ b/datagateway_api/common/database/session_manager.py @@ -5,7 +5,7 @@ from datagateway_api.common.constants import Constants engine = create_engine( - Constants.DATABASE_URL, poolclass=QueuePool, pool_size=100, max_overflow=0 + Constants.DATABASE_URL, poolclass=QueuePool, pool_size=100, max_overflow=0, ) session_factory = sessionmaker(engine) diff --git a/datagateway_api/common/date_handler.py b/datagateway_api/common/date_handler.py index f192e3ae..8fcc8593 100644 --- a/datagateway_api/common/date_handler.py +++ b/datagateway_api/common/date_handler.py @@ -55,7 +55,7 @@ def str_to_datetime_object(data): raise BadRequestError( "Bad request made, the date entered is not in the correct format. Use" f" the {Constants.ACCEPTED_DATE_FORMAT} format to submit dates to the" - " API" + " API", ) return data diff --git a/datagateway_api/common/exceptions.py b/datagateway_api/common/exceptions.py index 0a75d1d5..833ba6f2 100644 --- a/datagateway_api/common/exceptions.py +++ b/datagateway_api/common/exceptions.py @@ -22,7 +22,7 @@ def __init__( self, msg="Bad request, only one include filter may be given per request", *args, - **kwargs + **kwargs, ): super().__init__(msg, *args, **kwargs) self.status_code = 400 diff --git a/datagateway_api/common/filters.py b/datagateway_api/common/filters.py index c101c67f..74d06dcc 100644 --- a/datagateway_api/common/filters.py +++ b/datagateway_api/common/filters.py @@ -31,7 +31,7 @@ def __init__(self, field, value, operation): if not isinstance(self.value, list): raise BadRequestError( "When using the 'in' operation for a WHERE filter, the values must" - " be in a list format e.g. [1, 2, 3]" + " be in a list format e.g. [1, 2, 3]", ) diff --git a/datagateway_api/common/helpers.py b/datagateway_api/common/helpers.py index 4a8b2d1d..ebf0837d 100644 --- a/datagateway_api/common/helpers.py +++ b/datagateway_api/common/helpers.py @@ -64,7 +64,7 @@ def get_session_id_from_auth_header(): raise MissingCredentialsError(f"No credentials provided in auth header") if len(auth_header) != 2 or auth_header[0] != "Bearer": raise AuthenticationError( - f" Could not authenticate consumer with auth header {auth_header}" + f" Could not authenticate consumer with auth header {auth_header}", ) return auth_header[1] @@ -97,7 +97,7 @@ def get_filters_from_query_string(): for arg in request.args: for value in request.args.getlist(arg): filters.append( - QueryFilterFactory.get_query_filter({arg: json.loads(value)}) + QueryFilterFactory.get_query_filter({arg: json.loads(value)}), ) return filters except Exception as e: diff --git a/datagateway_api/common/icat/backend.py b/datagateway_api/common/icat/backend.py index 25834bbe..61b035e6 100644 --- a/datagateway_api/common/icat/backend.py +++ b/datagateway_api/common/icat/backend.py @@ -41,7 +41,7 @@ def __init__(self): # use an endpoint before logging in. Also helps to give a bit of certainty to # what's stored here self.client = icat.client.Client( - config.get_icat_url(), checkCert=config.get_icat_check_cert() + config.get_icat_url(), checkCert=config.get_icat_check_cert(), ) def login(self, credentials): @@ -49,7 +49,7 @@ def login(self, credentials): # Client object is re-created here so session IDs aren't overwritten in the # database self.client = icat.client.Client( - config.get_icat_url(), checkCert=config.get_icat_check_cert() + config.get_icat_url(), checkCert=config.get_icat_check_cert(), ) # Syntax for Python ICAT @@ -129,7 +129,7 @@ def update_with_id(self, session_id, entity_type, id_, data): @requires_session_id @queries_records def get_facility_cycles_for_instrument_with_filters( - self, session_id, instrument_id, filters + self, session_id, instrument_id, filters, ): self.client.sessionId = session_id return get_facility_cycles_for_instrument(self.client, instrument_id, filters) @@ -137,29 +137,29 @@ def get_facility_cycles_for_instrument_with_filters( @requires_session_id @queries_records def get_facility_cycles_for_instrument_count_with_filters( - self, session_id, instrument_id, filters + self, session_id, instrument_id, filters, ): self.client.sessionId = session_id return get_facility_cycles_for_instrument_count( - self.client, instrument_id, filters + self.client, instrument_id, filters, ) @requires_session_id @queries_records def get_investigations_for_instrument_in_facility_cycle_with_filters( - self, session_id, instrument_id, facilitycycle_id, filters + self, session_id, instrument_id, facilitycycle_id, filters, ): self.client.sessionId = session_id return get_investigations_for_instrument_in_facility_cycle( - self.client, instrument_id, facilitycycle_id, filters + self.client, instrument_id, facilitycycle_id, filters, ) @requires_session_id @queries_records def get_investigations_for_instrument_in_facility_cycle_count_with_filters( - self, session_id, instrument_id, facilitycycle_id, filters + self, session_id, instrument_id, facilitycycle_id, filters, ): self.client.sessionId = session_id return get_investigations_for_instrument_in_facility_cycle_count( - self.client, instrument_id, facilitycycle_id, filters + self.client, instrument_id, facilitycycle_id, filters, ) diff --git a/datagateway_api/common/icat/filters.py b/datagateway_api/common/icat/filters.py index f4f86a3a..ef81876a 100644 --- a/datagateway_api/common/icat/filters.py +++ b/datagateway_api/common/icat/filters.py @@ -51,7 +51,7 @@ def apply_filter(self, query): query.addConditions(where_filter) except ValueError: raise FilterError( - "Something went wrong when adding WHERE filter to ICAT query" + "Something went wrong when adding WHERE filter to ICAT query", ) @staticmethod @@ -200,7 +200,7 @@ def _extract_filter_fields(self, field): if not isinstance(key, str): raise FilterError( "Include Filter: Dictionary key should only be a string, not" - " any other type" + " any other type", ) if isinstance(value, str): @@ -214,24 +214,24 @@ def _extract_filter_fields(self, field): if not isinstance(inner_key, str): raise FilterError( "Include Filter: Dictionary key should only be a string" - ", not any other type" + ", not any other type", ) # Will end up as: key.inner_key.inner_value self._extract_filter_fields( - {".".join((key, inner_key)): inner_value} + {".".join((key, inner_key)): inner_value}, ) else: raise FilterError( "Include Filter: Inner field type (inside dictionary) not" - " recognised, cannot interpret input" + " recognised, cannot interpret input", ) elif isinstance(field, list): for element in field: self._extract_filter_fields(element) else: raise FilterError( - "Include Filter: Field type not recognised, cannot interpret input" + "Include Filter: Field type not recognised, cannot interpret input", ) def apply_filter(self, query): diff --git a/datagateway_api/common/icat/helpers.py b/datagateway_api/common/icat/helpers.py index 64ff60f8..abb8080c 100644 --- a/datagateway_api/common/icat/helpers.py +++ b/datagateway_api/common/icat/helpers.py @@ -129,7 +129,7 @@ def get_icat_entity_name_as_camel_case(client, entity_name): # Raise a 400 if a valid entity cannot be found if python_icat_entity_name is None: raise BadRequestError( - f"Bad request made, cannot find {entity_name} entity within Python ICAT" + f"Bad request made, cannot find {entity_name} entity within Python ICAT", ) return python_icat_entity_name @@ -157,7 +157,7 @@ def update_attributes(old_entity, new_entity): except AttributeError: raise BadRequestError( f"Bad request made, cannot find attribute '{key}' within the" - f" {old_entity.BeanName} entity" + f" {old_entity.BeanName} entity", ) try: @@ -165,7 +165,7 @@ def update_attributes(old_entity, new_entity): except AttributeError: raise BadRequestError( f"Bad request made, cannot modify attribute '{key}' within the" - f" {old_entity.BeanName} entity" + f" {old_entity.BeanName} entity", ) try: @@ -211,7 +211,7 @@ def get_entity_by_id( includes_value = "1" if return_related_entities == True else None id_query = ICATQuery( - client, entity_type, conditions=id_condition, includes=includes_value + client, entity_type, conditions=id_condition, includes=includes_value, ) entity_by_id_data = id_query.execute_query(client, return_json_formattable_data) @@ -255,7 +255,7 @@ def update_entity_by_id(client, entity_type, id_, new_data): log.info("Updating %s of ID %s", entity_type, id_) entity_id_data = get_entity_by_id( - client, entity_type, id_, False, return_related_entities=True + client, entity_type, id_, False, return_related_entities=True, ) # There will only ever be one record associated with a single ID - if a record with # the specified ID cannot be found, it'll be picked up by the MissingRecordError in @@ -349,7 +349,8 @@ def get_first_result_with_filters(client, entity_type, filters): result of the query """ log.info( - "Getting only first result of %s, making use of filters in request", entity_type + "Getting only first result of %s, making use of filters in request", + entity_type, ) limit_filter = PythonICATLimitFilter(1) @@ -386,13 +387,13 @@ def update_entities(client, entity_type, data_to_update): for entity in data_to_update: try: updated_result = update_entity_by_id( - client, entity_type, entity["id"], entity + client, entity_type, entity["id"], entity, ) updated_data.append(updated_result) except KeyError: raise BadRequestError( "The new data in the request body must contain the ID (using the key:" - " 'id') of the entity you wish to update" + " 'id') of the entity you wish to update", ) return updated_data @@ -420,8 +421,8 @@ def create_entities(client, entity_type, data): for result in data: new_entity = client.new( get_icat_entity_name_as_camel_case( - client, entity_type, camel_case_output=True - ) + client, entity_type, camel_case_output=True, + ), ) for attribute_name, value in result.items(): @@ -460,7 +461,7 @@ def create_entities(client, entity_type, data): def get_facility_cycles_for_instrument( - client, instrument_id, filters, count_query=False + client, instrument_id, filters, count_query=False, ): """ Given an Instrument ID, get the Facility Cycles where there are Instruments that @@ -483,7 +484,7 @@ def get_facility_cycles_for_instrument( query = ICATQuery(client, "FacilityCycle", aggregate=query_aggregate) instrument_id_check = PythonICATWhereFilter( - "facility.instruments.id", instrument_id, "eq" + "facility.instruments.id", instrument_id, "eq", ) investigation_instrument_id_check = PythonICATWhereFilter( "facility.investigations.investigationInstruments.instrument.id", @@ -491,10 +492,10 @@ def get_facility_cycles_for_instrument( "eq", ) investigation_start_date_check = PythonICATWhereFilter( - "facility.investigations.startDate", "o.startDate", "gte" + "facility.investigations.startDate", "o.startDate", "gte", ) investigation_end_date_check = PythonICATWhereFilter( - "facility.investigations.startDate", "o.endDate", "lte" + "facility.investigations.startDate", "o.endDate", "lte", ) facility_cycle_filters = [ @@ -529,15 +530,15 @@ def get_facility_cycles_for_instrument_count(client, instrument_id, filters): :return: The number of Facility Cycles that match the query """ log.info( - "Getting the number of facility cycles from the specified instrument for ISIS" + "Getting the number of facility cycles from the specified instrument for ISIS", ) return get_facility_cycles_for_instrument( - client, instrument_id, filters, count_query=True + client, instrument_id, filters, count_query=True, )[0] def get_investigations_for_instrument_in_facility_cycle( - client, instrument_id, facilitycycle_id, filters, count_query=False + client, instrument_id, facilitycycle_id, filters, count_query=False, ): """ Given Instrument and Facility Cycle IDs, get investigations that use the given @@ -559,26 +560,26 @@ def get_investigations_for_instrument_in_facility_cycle( """ log.info( "Getting a list of investigations from the specified instrument and facility" - " cycle, for ISIS" + " cycle, for ISIS", ) query_aggregate = "COUNT:DISTINCT" if count_query else "DISTINCT" query = ICATQuery(client, "Investigation", aggregate=query_aggregate) instrument_id_check = PythonICATWhereFilter( - "facility.instruments.id", instrument_id, "eq" + "facility.instruments.id", instrument_id, "eq", ) investigation_instrument_id_check = PythonICATWhereFilter( "investigationInstruments.instrument.id", instrument_id, "eq", ) facility_cycle_id_check = PythonICATWhereFilter( - "facility.facilityCycles.id", facilitycycle_id, "eq" + "facility.facilityCycles.id", facilitycycle_id, "eq", ) facility_cycle_start_date_check = PythonICATWhereFilter( - "facility.facilityCycles.startDate", "o.startDate", "lte" + "facility.facilityCycles.startDate", "o.startDate", "lte", ) facility_cycle_end_date_check = PythonICATWhereFilter( - "facility.facilityCycles.endDate", "o.startDate", "gte" + "facility.facilityCycles.endDate", "o.startDate", "gte", ) required_filters = [ @@ -601,7 +602,7 @@ def get_investigations_for_instrument_in_facility_cycle( def get_investigations_for_instrument_in_facility_cycle_count( - client, instrument_id, facilitycycle_id, filters + client, instrument_id, facilitycycle_id, filters, ): """ Given Instrument and Facility Cycle IDs, get the number of investigations that use @@ -619,8 +620,8 @@ def get_investigations_for_instrument_in_facility_cycle_count( """ log.info( "Getting the number of investigations from the specified instrument and" - " facility cycle, for ISIS" + " facility cycle, for ISIS", ) return get_investigations_for_instrument_in_facility_cycle( - client, instrument_id, facilitycycle_id, filters, count_query=True + client, instrument_id, facilitycycle_id, filters, count_query=True, )[0] diff --git a/datagateway_api/common/icat/query.py b/datagateway_api/common/icat/query.py index b6a0c586..15cde6a7 100644 --- a/datagateway_api/common/icat/query.py +++ b/datagateway_api/common/icat/query.py @@ -50,7 +50,7 @@ def __init__( except ValueError: raise PythonICATError( "An issue has occurred while creating a Python ICAT Query object," - " suggesting an invalid argument" + " suggesting an invalid argument", ) def execute_query(self, client, return_json_formattable=False): @@ -93,7 +93,7 @@ def execute_query(self, client, return_json_formattable=False): distinct_attributes = self.iterate_query_conditions_for_distinctiveness() if distinct_attributes != []: mapped_distinct_fields = self.map_distinct_attributes_to_entity_names( - distinct_attributes, flat_query_includes + distinct_attributes, flat_query_includes, ) log.debug( "Attribute names used in the distinct filter, mapped to the entity they" @@ -108,7 +108,7 @@ def execute_query(self, client, return_json_formattable=False): for result in query_result: if not count_query: dict_result = self.entity_to_dict( - result, flat_query_includes, mapped_distinct_fields + result, flat_query_includes, mapped_distinct_fields, ) data.append(dict_result) else: @@ -125,11 +125,11 @@ def iterate_query_conditions_for_distinctiveness(self): if isinstance(where_statement, list): for sub_value in where_statement: self.check_attribute_name_for_distinct( - distinct_attributes, attribute_name, sub_value + distinct_attributes, attribute_name, sub_value, ) elif isinstance(where_statement, str): self.check_attribute_name_for_distinct( - distinct_attributes, attribute_name, where_statement + distinct_attributes, attribute_name, where_statement, ) return distinct_attributes @@ -184,18 +184,18 @@ def entity_to_dict(self, entity, includes, distinct_fields=None): except ValueError: log.warning( "Key couldn't be found to remove from include list, this could" - " cause an issue further on in the request" + " cause an issue further on in the request", ) if isinstance(target, Entity): if distinct_fields is not None: distinct_fields_copy = self.prepare_distinct_fields_for_recursion( - key, distinct_fields + key, distinct_fields, ) else: distinct_fields_copy = None d[key] = self.entity_to_dict( - target, includes_copy, distinct_fields_copy + target, includes_copy, distinct_fields_copy, ) # Related fields with one-many relationships are stored as EntityLists @@ -204,13 +204,13 @@ def entity_to_dict(self, entity, includes, distinct_fields=None): for e in target: if distinct_fields is not None: distinct_fields_copy = self.prepare_distinct_fields_for_recursion( - key, distinct_fields + key, distinct_fields, ) else: distinct_fields_copy = None d[key].append( - self.entity_to_dict(e, includes_copy, distinct_fields_copy) + self.entity_to_dict(e, includes_copy, distinct_fields_copy), ) # Add actual piece of data to the dictionary else: @@ -291,7 +291,7 @@ def map_distinct_attributes_to_entity_names(self, distinct_fields, included_fiel "A distinct field that has a relationship with another entity does" " not have the included entity within an include filter in this" " request. Please add all related entities which are required for" - " the fields in the distinct filter distinct to an include filter." + " the fields in the distinct filter distinct to an include filter.", ) return distinct_field_dict diff --git a/datagateway_api/common/logger_setup.py b/datagateway_api/common/logger_setup.py index 827ff9fb..58c66c76 100644 --- a/datagateway_api/common/logger_setup.py +++ b/datagateway_api/common/logger_setup.py @@ -10,7 +10,7 @@ "formatters": { "default": { "format": "[%(asctime)s] {%(module)s:%(filename)s:%(funcName)s:%(lineno)d} %(levelname)s -%(message)s ", - } + }, }, "handlers": { "default": { @@ -20,7 +20,7 @@ "filename": LOG_FILE_NAME, "maxBytes": 5000000, "backupCount": 10, - } + }, }, "root": {"level": config.get_log_level(), "handlers": ["default"]}, } diff --git a/datagateway_api/src/main.py b/datagateway_api/src/main.py index 5056e731..a8e8b4a6 100644 --- a/datagateway_api/src/main.py +++ b/datagateway_api/src/main.py @@ -69,13 +69,13 @@ def handle_error(e): spec.path(resource=get_id_endpoint_resource, api=api) get_count_endpoint_resource = get_count_endpoint( - entity_name, endpoints[entity_name] + entity_name, endpoints[entity_name], ) api.add_resource(get_count_endpoint_resource, f"/{entity_name.lower()}/count") spec.path(resource=get_count_endpoint_resource, api=api) get_find_one_endpoint_resource = get_find_one_endpoint( - entity_name, endpoints[entity_name] + entity_name, endpoints[entity_name], ) api.add_resource(get_find_one_endpoint_resource, f"/{entity_name.lower()}/findone") spec.path(resource=get_find_one_endpoint_resource, api=api) @@ -89,7 +89,7 @@ def handle_error(e): api.add_resource(InstrumentsFacilityCycles, "/instruments//facilitycycles") spec.path(resource=InstrumentsFacilityCycles, api=api) api.add_resource( - InstrumentsFacilityCyclesCount, "/instruments//facilitycycles/count" + InstrumentsFacilityCyclesCount, "/instruments//facilitycycles/count", ) spec.path(resource=InstrumentsFacilityCyclesCount, api=api) api.add_resource( @@ -124,5 +124,5 @@ def specs(): if __name__ == "__main__": app.run( - host=config.get_host(), port=config.get_port(), debug=config.is_debug_mode() + host=config.get_host(), port=config.get_port(), debug=config.is_debug_mode(), ) diff --git a/datagateway_api/src/resources/entities/entity_endpoint.py b/datagateway_api/src/resources/entities/entity_endpoint.py index 10de64d3..e1fe22f0 100644 --- a/datagateway_api/src/resources/entities/entity_endpoint.py +++ b/datagateway_api/src/resources/entities/entity_endpoint.py @@ -65,7 +65,7 @@ def get(self): def post(self): return ( backend.create( - get_session_id_from_auth_header(), entity_type, request.json + get_session_id_from_auth_header(), entity_type, request.json, ), 200, ) @@ -107,7 +107,7 @@ def post(self): def patch(self): return ( backend.update( - get_session_id_from_auth_header(), entity_type, request.json + get_session_id_from_auth_header(), entity_type, request.json, ), 200, ) @@ -165,7 +165,7 @@ class EndpointWithID(Resource): def get(self, id_): return ( backend.get_with_id( - get_session_id_from_auth_header(), entity_type, id_ + get_session_id_from_auth_header(), entity_type, id_, ), 200, ) @@ -292,7 +292,7 @@ def get(self): filters = get_filters_from_query_string() return ( backend.count_with_filters( - get_session_id_from_auth_header(), entity_type, filters + get_session_id_from_auth_header(), entity_type, filters, ), 200, ) @@ -344,7 +344,7 @@ def get(self): filters = get_filters_from_query_string() return ( backend.get_one_with_filters( - get_session_id_from_auth_header(), entity_type, filters + get_session_id_from_auth_header(), entity_type, filters, ), 200, ) diff --git a/datagateway_api/src/resources/entities/entity_map.py b/datagateway_api/src/resources/entities/entity_map.py index 30acdc0b..81cba38c 100644 --- a/datagateway_api/src/resources/entities/entity_map.py +++ b/datagateway_api/src/resources/entities/entity_map.py @@ -103,7 +103,7 @@ def create_entity_models(): or relationship_class.direction.name == "ONETOONE" ): params[relationship_name] = { - "$ref": f"#/components/schemas/{relationship_name.strip('_')}" + "$ref": f"#/components/schemas/{relationship_name.strip('_')}", } if ( relationship_class.direction.name == "MANYTOMANY" @@ -112,7 +112,7 @@ def create_entity_models(): params[relationship_name] = { "type": "array", "items": { - "$ref": f"#/components/schemas/{relationship_name.strip('_')}" + "$ref": f"#/components/schemas/{relationship_name.strip('_')}", }, } endpoint_models[endpoint_table.__name__] = { diff --git a/datagateway_api/src/resources/table_endpoints/table_endpoints.py b/datagateway_api/src/resources/table_endpoints/table_endpoints.py index 4ef116ff..da59e3de 100644 --- a/datagateway_api/src/resources/table_endpoints/table_endpoints.py +++ b/datagateway_api/src/resources/table_endpoints/table_endpoints.py @@ -54,7 +54,7 @@ def get(self, id_): """ return ( backend.get_facility_cycles_for_instrument_with_filters( - get_session_id_from_auth_header(), id_, get_filters_from_query_string() + get_session_id_from_auth_header(), id_, get_filters_from_query_string(), ), 200, ) @@ -95,7 +95,7 @@ def get(self, id_): """ return ( backend.get_facility_cycles_for_instrument_count_with_filters( - get_session_id_from_auth_header(), id_, get_filters_from_query_string() + get_session_id_from_auth_header(), id_, get_filters_from_query_string(), ), 200, ) diff --git a/datagateway_api/src/swagger/apispec_flask_restful.py b/datagateway_api/src/swagger/apispec_flask_restful.py index 6d3fe3fa..e28a3279 100644 --- a/datagateway_api/src/swagger/apispec_flask_restful.py +++ b/datagateway_api/src/swagger/apispec_flask_restful.py @@ -31,7 +31,7 @@ def deduce_path(resource, **kwargs): break else: raise APISpecError( - "Cannot find blueprint resource {}".format(resource.endpoint) + "Cannot find blueprint resource {}".format(resource.endpoint), ) else: # Application not initialized yet, fallback to path @@ -59,7 +59,7 @@ def parse_operations(resource, operations): operation = None if not operation: logging.getLogger(__name__).warning( - "Cannot load docstring for {}/{}".format(resource, method) + "Cannot load docstring for {}/{}".format(resource, method), ) operations[method.lower()] = operation or dict() @@ -76,7 +76,7 @@ def path_helper(self, path=None, operations=None, parameters=None, **kwargs): return path except Exception as exc: logging.getLogger(__name__).exception( - "Exception parsing APISpec", exc_info=exc + "Exception parsing APISpec", exc_info=exc, ) raise @@ -88,6 +88,6 @@ def operation_helper(self, path=None, operations=None, **kwargs): parse_operations(resource, operations) except Exception as exc: logging.getLogger(__name__).exception( - "Exception parsing APISpec", exc_info=exc + "Exception parsing APISpec", exc_info=exc, ) raise diff --git a/datagateway_api/src/swagger/initialise_spec.py b/datagateway_api/src/swagger/initialise_spec.py index d9c272e6..a5bb4a94 100644 --- a/datagateway_api/src/swagger/initialise_spec.py +++ b/datagateway_api/src/swagger/initialise_spec.py @@ -11,7 +11,7 @@ def initialise_spec(spec): """ spec.components.security_scheme( - "session_id", {"type": "http", "scheme": "bearer", "bearerFormat": "uuid"} + "session_id", {"type": "http", "scheme": "bearer", "bearerFormat": "uuid"}, ) entity_schemas = create_entity_models() @@ -47,8 +47,8 @@ def initialise_spec(spec): {"type": "number"}, {"type": "integer"}, {"type": "boolean"}, - ] - } + ], + }, }, }, { @@ -59,8 +59,8 @@ def initialise_spec(spec): "oneOf": [ {"type": "number"}, {"type": "integer"}, - ] - } + ], + }, }, }, { @@ -71,8 +71,8 @@ def initialise_spec(spec): "oneOf": [ {"type": "number"}, {"type": "integer"}, - ] - } + ], + }, }, }, { @@ -91,9 +91,9 @@ def initialise_spec(spec): {"type": "string"}, {"type": "number"}, {"type": "integer"}, - ] + ], }, - } + }, }, }, ], @@ -177,10 +177,10 @@ def initialise_spec(spec): "type": "array", "items": [{"type": "string"}], }, - ] + ], }, }, - ] + ], }, }, { @@ -189,24 +189,24 @@ def initialise_spec(spec): "oneOf": [ {"type": "string"}, {"type": "array", "items": [{"type": "string"}]}, - ] + ], }, }, - ] + ], }, "examples": { "single": {"value": "RELATED_COLUMN"}, "array": {"value": ["RELATED_COLUMN_1", "RELATED_COLUMN_2"]}, "multi-level": { - "value": {"RELATED_COLUMN": "RELATED_COLUMN_RELATED_COLUMN"} + "value": {"RELATED_COLUMN": "RELATED_COLUMN_RELATED_COLUMN"}, }, "multi-level array": { "value": { "RELATED_COLUMN": [ "RELATED_COLUMN_RELATED_COLUMN_1", "RELATED_COLUMN_RELATED_COLUMN_2", - ] - } + ], + }, }, "array of multi-level": { "value": [ @@ -216,9 +216,9 @@ def initialise_spec(spec): "RELATED_COLUMN_3": [ "RELATED_COLUMN_3_RELATED_COLUMN_1", "RELATED_COLUMN_3_RELATED_COLUMN_2", - ] + ], }, - ] + ], }, }, }, diff --git a/test/test_database_helpers.py b/test/test_database_helpers.py index 881e7f7b..f10551d9 100644 --- a/test/test_database_helpers.py +++ b/test/test_database_helpers.py @@ -27,24 +27,25 @@ else: raise ApiError( "Cannot select which implementation of filters to import, check the config file" - " has a valid backend type" + " has a valid backend type", ) class TestQueryFilterFactory(TestCase): def test_order_filter(self): self.assertIs( - OrderFilter, type(QueryFilterFactory.get_query_filter({"order": "ID DESC"})) + OrderFilter, + type(QueryFilterFactory.get_query_filter({"order": "ID DESC"})), ) def test_limit_filter(self): self.assertIs( - LimitFilter, type(QueryFilterFactory.get_query_filter({"limit": 10})) + LimitFilter, type(QueryFilterFactory.get_query_filter({"limit": 10})), ) def test_skip_filter(self): self.assertIs( - SkipFilter, type(QueryFilterFactory.get_query_filter({"skip": 10})) + SkipFilter, type(QueryFilterFactory.get_query_filter({"skip": 10})), ) def test_where_filter(self): @@ -68,8 +69,8 @@ def test_where_filter(self): WhereFilter, type( QueryFilterFactory.get_query_filter( - {"where": {"ID": {"in": ["1", "2", "3"]}}} - ) + {"where": {"ID": {"in": ["1", "2", "3"]}}}, + ), ), ) @@ -86,8 +87,8 @@ def test_include_filter(self): IncludeFilter, type( QueryFilterFactory.get_query_filter( - {"include": {"Test": ["TEST1", "Test2"]}} - ) + {"include": {"Test": ["TEST1", "Test2"]}}, + ), ), ) diff --git a/test/test_entityHelper.py b/test/test_entityHelper.py index ebee4e1a..58f15356 100644 --- a/test/test_entityHelper.py +++ b/test/test_entityHelper.py @@ -142,7 +142,7 @@ def test_to_nested_dict(self): }, } self.assertEqual( - expected_dict, self.datafile.to_nested_dict({"DATASET": "INVESTIGATION"}) + expected_dict, self.datafile.to_nested_dict({"DATASET": "INVESTIGATION"}), ) def test_get_related_entity(self): diff --git a/test/test_helpers.py b/test/test_helpers.py index 749d4785..e656c6d4 100644 --- a/test/test_helpers.py +++ b/test/test_helpers.py @@ -75,7 +75,7 @@ def test_invalid_credentials(self): self.assertEqual( 403, self.app.get( - "/datafiles", headers=self.invalid_credentials_header + "/datafiles", headers=self.invalid_credentials_header, ).status_code, ) @@ -89,7 +89,7 @@ def test_good_credentials(self): self.assertEqual( 200, self.app.get( - "/datafiles?limit=0", headers=self.good_credentials_header + "/datafiles?limit=0", headers=self.good_credentials_header, ).status_code, ) @@ -194,7 +194,7 @@ def test_limit_filter(self): self.app.get("/?limit=10") filters = get_filters_from_query_string() self.assertEqual( - 1, len(filters), msg="Returned incorrect number of filters" + 1, len(filters), msg="Returned incorrect number of filters", ) self.assertIs(LimitFilter, type(filters[0]), msg="Incorrect type of filter") @@ -203,10 +203,10 @@ def test_order_filter(self): self.app.get('/?order="ID DESC"') filters = get_filters_from_query_string() self.assertEqual( - 1, len(filters), msg="Returned incorrect number of filters" + 1, len(filters), msg="Returned incorrect number of filters", ) self.assertIs( - OrderFilter, type(filters[0]), msg="Incorrect type of filter returned" + OrderFilter, type(filters[0]), msg="Incorrect type of filter returned", ) def test_where_filter(self): @@ -214,10 +214,10 @@ def test_where_filter(self): self.app.get('/?where={"ID":{"eq":3}}') filters = get_filters_from_query_string() self.assertEqual( - 1, len(filters), msg="Returned incorrect number of filters" + 1, len(filters), msg="Returned incorrect number of filters", ) self.assertIs( - WhereFilter, type(filters[0]), msg="Incorrect type of filter returned" + WhereFilter, type(filters[0]), msg="Incorrect type of filter returned", ) def test_skip_filter(self): @@ -225,10 +225,10 @@ def test_skip_filter(self): self.app.get("/?skip=10") filters = get_filters_from_query_string() self.assertEqual( - 1, len(filters), msg="Returned incorrect number of filters" + 1, len(filters), msg="Returned incorrect number of filters", ) self.assertIs( - SkipFilter, type(filters[0]), msg="Incorrect type of filter returned" + SkipFilter, type(filters[0]), msg="Incorrect type of filter returned", ) def test_include_filter(self): @@ -236,10 +236,12 @@ def test_include_filter(self): self.app.get('/?include="TEST"') filters = get_filters_from_query_string() self.assertEqual( - 1, len(filters), msg="Incorrect number of filters returned" + 1, len(filters), msg="Incorrect number of filters returned", ) self.assertIs( - IncludeFilter, type(filters[0]), msg="Incorrect type of filter returned" + IncludeFilter, + type(filters[0]), + msg="Incorrect type of filter returned", ) def test_distinct_filter(self): @@ -247,7 +249,7 @@ def test_distinct_filter(self): self.app.get('/?distinct="ID"') filters = get_filters_from_query_string() self.assertEqual( - 1, len(filters), msg="Incorrect number of filters returned" + 1, len(filters), msg="Incorrect number of filters returned", ) self.assertIs( DistinctFieldFilter, diff --git a/util/icat_db_generator.py b/util/icat_db_generator.py index fa874cc6..c0723910 100644 --- a/util/icat_db_generator.py +++ b/util/icat_db_generator.py @@ -65,13 +65,13 @@ def get_start_date(i): :return: """ return datetime.datetime( - 2000 + i // 4, ((i + 1) * (i + 1)) % 11 + 1, ((i + 1) * (i + 2) % 28 + 1) + 2000 + i // 4, ((i + 1) * (i + 1)) % 11 + 1, ((i + 1) * (i + 2) % 28 + 1), ) def get_end_date(i): return datetime.datetime( - 2000 + i // 4, (((i + 1) * (i + 2)) % 11) + 1, ((i + 1) ** 2) % 28 + 1 + 2000 + i // 4, (((i + 1) * (i + 2)) % 11) + 1, ((i + 1) ** 2) % 28 + 1, ) @@ -353,7 +353,7 @@ class InvestigationInstrumentGenerator(Generator): def generate(self): self.pool_map( - InvestigationInstrumentGenerator.generate_investigation_instrument + InvestigationInstrumentGenerator.generate_investigation_instrument, ) @staticmethod @@ -505,7 +505,7 @@ def generate_investigation_parameter(i): apply_common_parameter_attributes(investigation_parameter, i) investigation_parameter.INVESTIGATION_ID = i investigation_parameter.PARAMETER_TYPE_ID = randrange( - 1, ParameterTypeGenerator.amount + 1, ParameterTypeGenerator.amount, ) post_entity(investigation_parameter) @@ -628,7 +628,7 @@ class DataCollectionParameterGenerator(Generator): def generate(self): self.pool_map( - DataCollectionParameterGenerator.generate_data_collection_parameter + DataCollectionParameterGenerator.generate_data_collection_parameter, ) @staticmethod @@ -638,7 +638,7 @@ def generate_data_collection_parameter(i): apply_common_parameter_attributes(datacollection_parameter, i) datacollection_parameter.DATACOLLECTION_ID = i datacollection_parameter.PARAMETER_TYPE_ID = randrange( - 1, ParameterTypeGenerator.amount + 1, ParameterTypeGenerator.amount, ) post_entity(datacollection_parameter) @@ -683,7 +683,7 @@ def generate_all(i, generators): if generator.tier == i: print( f"Adding {type(generator).__name__.replace('Generator', '') + 's'} of" - f" tier {generator.tier}" + f" tier {generator.tier}", ) processes.append(Process(target=generator.generate)) @@ -701,7 +701,7 @@ def main(): print( f"Added {sum(generator.amount for generator in generators)} entities in" - f" {datetime.datetime.now() - start_time}" + f" {datetime.datetime.now() - start_time}", ) From 3b208a0a2c54574621f496957e1bc1f680cb1704 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 3 Nov 2020 11:37:46 +0000 Subject: [PATCH 02/20] #184: Fix local import names - This is so flake8 can correctly detect which import statements are bringing in local code, so said statements can be ordered in a consistent style --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index ebf130ec..fa836f63 100644 --- a/.flake8 +++ b/.flake8 @@ -4,7 +4,7 @@ select = A,B,B9,BLK,C,E,F,I,N,S,W ignore = E203,W503,E501 max-complexity = 10 max-line-length = 80 -application-import-names = common,src,test,util +application-import-names = datagateway_api,test,util import-order-style = google per-file-ignores = test/*:S101 enable-extensions=G From ffe23fe7d7c16e18263211b98b38280720097672 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 3 Nov 2020 13:12:46 +0000 Subject: [PATCH 03/20] #184: Reorder import statements --- datagateway_api/common/backends.py | 8 ++-- datagateway_api/common/config.py | 6 ++- datagateway_api/common/database/backend.py | 23 ++++++----- datagateway_api/common/database/filters.py | 16 ++++---- datagateway_api/common/database/helpers.py | 40 +++++++++---------- datagateway_api/common/database/models.py | 17 ++++---- .../common/database/session_manager.py | 2 +- datagateway_api/common/date_handler.py | 3 +- datagateway_api/common/exceptions.py | 3 -- .../common/filter_order_handler.py | 2 +- datagateway_api/common/helpers.py | 6 +-- datagateway_api/common/icat/backend.py | 24 +++++------ datagateway_api/common/icat/filters.py | 12 +++--- datagateway_api/common/icat/helpers.py | 13 +++--- datagateway_api/common/icat/query.py | 10 ++--- datagateway_api/src/main.py | 17 ++++---- .../src/resources/entities/entity_endpoint.py | 4 +- .../src/resources/entities/entity_map.py | 5 ++- .../non_entities/sessions_endpoints.py | 12 ++---- .../table_endpoints/table_endpoints.py | 10 +---- .../src/swagger/apispec_flask_restful.py | 2 +- noxfile.py | 3 +- test/test_database_helpers.py | 14 +++---- test/test_entityHelper.py | 2 +- test/test_helpers.py | 18 ++++----- util/icat_db_generator.py | 6 +-- 26 files changed, 138 insertions(+), 140 deletions(-) diff --git a/datagateway_api/common/backends.py b/datagateway_api/common/backends.py index 17c013d9..a124ec14 100644 --- a/datagateway_api/common/backends.py +++ b/datagateway_api/common/backends.py @@ -1,8 +1,10 @@ -from datagateway_api.common.database.backend import DatabaseBackend -from datagateway_api.common.icat.backend import PythonICATBackend +import sys + from datagateway_api.common.backend import Backend from datagateway_api.common.config import config -import sys +from datagateway_api.common.database.backend import DatabaseBackend +from datagateway_api.common.icat.backend import PythonICATBackend + backend_type = config.get_backend_type() diff --git a/datagateway_api/common/config.py b/datagateway_api/common/config.py index a40d3f2f..265e963f 100644 --- a/datagateway_api/common/config.py +++ b/datagateway_api/common/config.py @@ -1,8 +1,10 @@ import json -import sys +import logging from pathlib import Path +import sys + import requests -import logging + log = logging.getLogger() diff --git a/datagateway_api/common/database/backend.py b/datagateway_api/common/database/backend.py index 8d429f80..60ebd71f 100644 --- a/datagateway_api/common/database/backend.py +++ b/datagateway_api/common/database/backend.py @@ -1,27 +1,28 @@ +import datetime +import logging +import uuid + from datagateway_api.common.backend import Backend from datagateway_api.common.database.helpers import ( + create_rows_from_json, + delete_row_by_id, get_facility_cycles_for_instrument, get_facility_cycles_for_instrument_count, + get_filtered_row_count, + get_first_filtered_row, get_investigations_for_instrument_in_facility_cycle, get_investigations_for_instrument_in_facility_cycle_count, - get_rows_by_filter, - create_rows_from_json, - patch_entities, get_row_by_id, + get_rows_by_filter, insert_row_into_table, - delete_row_by_id, - update_row_from_id, - get_filtered_row_count, - get_first_filtered_row, + patch_entities, requires_session_id, + update_row_from_id, ) -from datagateway_api.common.helpers import queries_records from datagateway_api.common.database.models import EntityHelper, SESSION -import uuid from datagateway_api.common.exceptions import AuthenticationError -import datetime +from datagateway_api.common.helpers import queries_records -import logging log = logging.getLogger() diff --git a/datagateway_api/common/database/filters.py b/datagateway_api/common/database/filters.py index 34148d21..ffc1d40f 100644 --- a/datagateway_api/common/database/filters.py +++ b/datagateway_api/common/database/filters.py @@ -1,16 +1,18 @@ +import logging + +from sqlalchemy import asc, desc + +from datagateway_api.common.database import models +from datagateway_api.common.exceptions import FilterError, MultipleIncludeError from datagateway_api.common.filters import ( - WhereFilter, DistinctFieldFilter, + IncludeFilter, + LimitFilter, OrderFilter, SkipFilter, - LimitFilter, - IncludeFilter, + WhereFilter, ) -from datagateway_api.common.exceptions import FilterError, MultipleIncludeError -from datagateway_api.common.database import models -from sqlalchemy import asc, desc -import logging log = logging.getLogger() diff --git a/datagateway_api/common/database/helpers.py b/datagateway_api/common/database/helpers.py index 4479145b..d234c624 100644 --- a/datagateway_api/common/database/helpers.py +++ b/datagateway_api/common/database/helpers.py @@ -1,48 +1,48 @@ -import datetime -import logging from abc import ABC, abstractmethod +import datetime from functools import wraps +import logging from sqlalchemy.orm import aliased -from datagateway_api.common.exceptions import ( - ApiError, - AuthenticationError, - MissingRecordError, - FilterError, - BadRequestError, - MultipleIncludeError, -) +from datagateway_api.common.config import config from datagateway_api.common.database.models import ( - INVESTIGATION, - INSTRUMENT, + FACILITY, FACILITYCYCLE, + INSTRUMENT, + INVESTIGATION, INVESTIGATIONINSTRUMENT, - FACILITY, SESSION, ) from datagateway_api.common.database.session_manager import session_manager +from datagateway_api.common.exceptions import ( + ApiError, + AuthenticationError, + BadRequestError, + FilterError, + MissingRecordError, +) from datagateway_api.common.filter_order_handler import FilterOrderHandler -from datagateway_api.common.config import config + backend_type = config.get_backend_type() if backend_type == "db": from datagateway_api.common.database.filters import ( - DatabaseWhereFilter as WhereFilter, DatabaseDistinctFieldFilter as DistinctFieldFilter, + DatabaseIncludeFilter as IncludeFilter, + DatabaseLimitFilter as LimitFilter, DatabaseOrderFilter as OrderFilter, DatabaseSkipFilter as SkipFilter, - DatabaseLimitFilter as LimitFilter, - DatabaseIncludeFilter as IncludeFilter, + DatabaseWhereFilter as WhereFilter, ) elif backend_type == "python_icat": from datagateway_api.common.icat.filters import ( - PythonICATWhereFilter as WhereFilter, PythonICATDistinctFieldFilter as DistinctFieldFilter, + PythonICATIncludeFilter as IncludeFilter, + PythonICATLimitFilter as LimitFilter, PythonICATOrderFilter as OrderFilter, PythonICATSkipFilter as SkipFilter, - PythonICATLimitFilter as LimitFilter, - PythonICATIncludeFilter as IncludeFilter, + PythonICATWhereFilter as WhereFilter, ) else: raise ApiError( diff --git a/datagateway_api/common/database/models.py b/datagateway_api/common/database/models.py index 1958439a..1ce06e7c 100644 --- a/datagateway_api/common/database/models.py +++ b/datagateway_api/common/database/models.py @@ -1,26 +1,25 @@ -import enum - from datetime import datetime from decimal import Decimal +import enum from sqlalchemy import ( - Index, - Column, BigInteger, - String, + Boolean, + Column, DateTime, + FetchedValue, + Float, ForeignKey, + Index, Integer, - Float, - FetchedValue, + String, TypeDecorator, - Boolean, ) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy.orm.collections import InstrumentedList -from datagateway_api.common.exceptions import FilterError, DatabaseError, ApiError +from datagateway_api.common.exceptions import ApiError, DatabaseError, FilterError Base = declarative_base() diff --git a/datagateway_api/common/database/session_manager.py b/datagateway_api/common/database/session_manager.py index 0e3dfce9..5353fd26 100644 --- a/datagateway_api/common/database/session_manager.py +++ b/datagateway_api/common/database/session_manager.py @@ -1,5 +1,5 @@ from sqlalchemy import create_engine -from sqlalchemy.orm import sessionmaker, scoped_session +from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.pool import QueuePool from datagateway_api.common.constants import Constants diff --git a/datagateway_api/common/date_handler.py b/datagateway_api/common/date_handler.py index 8fcc8593..04709de8 100644 --- a/datagateway_api/common/date_handler.py +++ b/datagateway_api/common/date_handler.py @@ -1,8 +1,9 @@ from datetime import datetime + from dateutil.parser import parse -from datagateway_api.common.exceptions import BadRequestError from datagateway_api.common.constants import Constants +from datagateway_api.common.exceptions import BadRequestError class DateHandler: diff --git a/datagateway_api/common/exceptions.py b/datagateway_api/common/exceptions.py index 833ba6f2..1d82ef6a 100644 --- a/datagateway_api/common/exceptions.py +++ b/datagateway_api/common/exceptions.py @@ -1,6 +1,3 @@ -import werkzeug - - class ApiError(Exception): status_code = 500 diff --git a/datagateway_api/common/filter_order_handler.py b/datagateway_api/common/filter_order_handler.py index b2c6e1ee..471dca10 100644 --- a/datagateway_api/common/filter_order_handler.py +++ b/datagateway_api/common/filter_order_handler.py @@ -2,8 +2,8 @@ from datagateway_api.common.icat.filters import ( PythonICATLimitFilter, - PythonICATSkipFilter, PythonICATOrderFilter, + PythonICATSkipFilter, ) log = logging.getLogger() diff --git a/datagateway_api/common/helpers.py b/datagateway_api/common/helpers.py index ebf0837d..4ef7b8bc 100644 --- a/datagateway_api/common/helpers.py +++ b/datagateway_api/common/helpers.py @@ -1,6 +1,6 @@ +from functools import wraps import json import logging -from functools import wraps from flask import request from flask_restful import reqparse @@ -10,11 +10,9 @@ from datagateway_api.common.exceptions import ( ApiError, AuthenticationError, - FilterError, BadRequestError, + FilterError, MissingCredentialsError, - MissingRecordError, - MultipleIncludeError, ) log = logging.getLogger() diff --git a/datagateway_api/common/icat/backend.py b/datagateway_api/common/icat/backend.py index 61b035e6..3f165c52 100644 --- a/datagateway_api/common/icat/backend.py +++ b/datagateway_api/common/icat/backend.py @@ -4,28 +4,28 @@ from icat.exception import ICATSessionError from datagateway_api.common.backend import Backend +from datagateway_api.common.config import config +from datagateway_api.common.exceptions import AuthenticationError from datagateway_api.common.helpers import queries_records from datagateway_api.common.icat.helpers import ( - requires_session_id, - get_session_details_helper, - logout_icat_client, - refresh_client_session, - get_entity_by_id, - update_entity_by_id, + create_entities, delete_entity_by_id, - get_entity_with_filters, get_count_with_filters, - get_first_result_with_filters, - update_entities, - create_entities, + get_entity_by_id, + get_entity_with_filters, get_facility_cycles_for_instrument, get_facility_cycles_for_instrument_count, + get_first_result_with_filters, get_investigations_for_instrument_in_facility_cycle, get_investigations_for_instrument_in_facility_cycle_count, + get_session_details_helper, + logout_icat_client, + refresh_client_session, + requires_session_id, + update_entities, + update_entity_by_id, ) -from datagateway_api.common.config import config -from datagateway_api.common.exceptions import AuthenticationError log = logging.getLogger() diff --git a/datagateway_api/common/icat/filters.py b/datagateway_api/common/icat/filters.py index ef81876a..a83c978e 100644 --- a/datagateway_api/common/icat/filters.py +++ b/datagateway_api/common/icat/filters.py @@ -1,16 +1,16 @@ import logging +from datagateway_api.common.constants import Constants +from datagateway_api.common.exceptions import FilterError from datagateway_api.common.filters import ( - WhereFilter, DistinctFieldFilter, + IncludeFilter, + LimitFilter, OrderFilter, SkipFilter, - LimitFilter, - IncludeFilter, + WhereFilter, ) -from datagateway_api.common.exceptions import FilterError -from datagateway_api.common.config import config -from datagateway_api.common.constants import Constants + log = logging.getLogger() diff --git a/datagateway_api/common/icat/helpers.py b/datagateway_api/common/icat/helpers.py index abb8080c..e56d659e 100644 --- a/datagateway_api/common/icat/helpers.py +++ b/datagateway_api/common/icat/helpers.py @@ -1,16 +1,19 @@ +from datetime import datetime, timedelta from functools import wraps import logging -from datetime import datetime, timedelta + from icat.entities import getTypeMap from icat.exception import ( - ICATSessionError, - ICATValidationError, ICATInternalError, - ICATObjectExistsError, ICATNoObjectError, + ICATObjectExistsError, ICATParameterError, + ICATSessionError, + ICATValidationError, ) + +from datagateway_api.common.date_handler import DateHandler from datagateway_api.common.exceptions import ( AuthenticationError, BadRequestError, @@ -18,8 +21,6 @@ PythonICATError, ) from datagateway_api.common.filter_order_handler import FilterOrderHandler -from datagateway_api.common.date_handler import DateHandler -from datagateway_api.common.constants import Constants from datagateway_api.common.icat.filters import ( PythonICATLimitFilter, PythonICATWhereFilter, diff --git a/datagateway_api/common/icat/query.py b/datagateway_api/common/icat/query.py index 15cde6a7..43d9617f 100644 --- a/datagateway_api/common/icat/query.py +++ b/datagateway_api/common/icat/query.py @@ -1,14 +1,14 @@ -import logging from datetime import datetime +import logging from icat.entity import Entity, EntityList -from icat.entities import getTypeMap +from icat.exception import ICATInternalError, ICATValidationError from icat.query import Query -from icat.exception import ICATValidationError, ICATInternalError -from datagateway_api.common.exceptions import PythonICATError, FilterError -from datagateway_api.common.date_handler import DateHandler from datagateway_api.common.constants import Constants +from datagateway_api.common.date_handler import DateHandler +from datagateway_api.common.exceptions import FilterError, PythonICATError + log = logging.getLogger() diff --git a/datagateway_api/src/main.py b/datagateway_api/src/main.py index a8e8b4a6..b456fc03 100644 --- a/datagateway_api/src/main.py +++ b/datagateway_api/src/main.py @@ -1,28 +1,30 @@ +import json +import logging +from pathlib import Path + +from apispec import APISpec from flask import Flask from flask_cors import CORS from flask_restful import Api from flask_swagger_ui import get_swaggerui_blueprint from datagateway_api.common.config import config +from datagateway_api.common.exceptions import ApiError from datagateway_api.common.logger_setup import setup_logger from datagateway_api.src.resources.entities.entity_endpoint import ( - get_endpoint, - get_id_endpoint, get_count_endpoint, + get_endpoint, get_find_one_endpoint, + get_id_endpoint, ) from datagateway_api.src.resources.entities.entity_map import endpoints -from datagateway_api.src.resources.non_entities.sessions_endpoints import * +from datagateway_api.src.resources.non_entities.sessions_endpoints import Sessions from datagateway_api.src.resources.table_endpoints.table_endpoints import ( InstrumentsFacilityCycles, InstrumentsFacilityCyclesCount, InstrumentsFacilityCyclesInvestigations, InstrumentsFacilityCyclesInvestigationsCount, ) -from datagateway_api.common.exceptions import ApiError -from apispec import APISpec -from pathlib import Path -import json from datagateway_api.src.swagger.apispec_flask_restful import RestfulPlugin from datagateway_api.src.swagger.initialise_spec import initialise_spec @@ -55,6 +57,7 @@ def handle_error(e): app.register_blueprint(swaggerui_blueprint, url_prefix="/") setup_logger() +log = logging.getLogger() log.info("Logging now setup") initialise_spec(spec) diff --git a/datagateway_api/src/resources/entities/entity_endpoint.py b/datagateway_api/src/resources/entities/entity_endpoint.py index e1fe22f0..1d493062 100644 --- a/datagateway_api/src/resources/entities/entity_endpoint.py +++ b/datagateway_api/src/resources/entities/entity_endpoint.py @@ -1,11 +1,11 @@ from flask import request from flask_restful import Resource +from datagateway_api.common.backends import backend from datagateway_api.common.helpers import ( - get_session_id_from_auth_header, get_filters_from_query_string, + get_session_id_from_auth_header, ) -from datagateway_api.common.backends import backend def get_endpoint(name, entity_type): diff --git a/datagateway_api/src/resources/entities/entity_map.py b/datagateway_api/src/resources/entities/entity_map.py index 81cba38c..feaaedd5 100644 --- a/datagateway_api/src/resources/entities/entity_map.py +++ b/datagateway_api/src/resources/entities/entity_map.py @@ -1,7 +1,10 @@ -from datagateway_api.common.database.models import EntityHelper import datetime + from sqlalchemy.inspection import inspect +from datagateway_api.common.database.models import EntityHelper + + # endpoint_name: entity_name endpoints = { "Applications": "Application", diff --git a/datagateway_api/src/resources/non_entities/sessions_endpoints.py b/datagateway_api/src/resources/non_entities/sessions_endpoints.py index 0c3b97dc..1ac35b1d 100644 --- a/datagateway_api/src/resources/non_entities/sessions_endpoints.py +++ b/datagateway_api/src/resources/non_entities/sessions_endpoints.py @@ -1,18 +1,12 @@ -import uuid import logging from flask import request -from flask_restful import Resource, reqparse +from flask_restful import Resource -from datagateway_api.common.database.helpers import ( - insert_row_into_table, - delete_row_by_id, - get_row_by_id, -) -from datagateway_api.common.helpers import get_session_id_from_auth_header -from datagateway_api.common.database.models import SESSION from datagateway_api.common.backends import backend from datagateway_api.common.exceptions import AuthenticationError +from datagateway_api.common.helpers import get_session_id_from_auth_header + log = logging.getLogger() diff --git a/datagateway_api/src/resources/table_endpoints/table_endpoints.py b/datagateway_api/src/resources/table_endpoints/table_endpoints.py index da59e3de..5ae49164 100644 --- a/datagateway_api/src/resources/table_endpoints/table_endpoints.py +++ b/datagateway_api/src/resources/table_endpoints/table_endpoints.py @@ -1,16 +1,10 @@ from flask_restful import Resource -from datagateway_api.common.database.helpers import ( - get_facility_cycles_for_instrument, - get_facility_cycles_for_instrument_count, - get_investigations_for_instrument_in_facility_cycle, - get_investigations_for_instrument_in_facility_cycle_count, -) +from datagateway_api.common.backends import backend from datagateway_api.common.helpers import ( - get_session_id_from_auth_header, get_filters_from_query_string, + get_session_id_from_auth_header, ) -from datagateway_api.common.backends import backend class InstrumentsFacilityCycles(Resource): diff --git a/datagateway_api/src/swagger/apispec_flask_restful.py b/datagateway_api/src/swagger/apispec_flask_restful.py index e28a3279..8573b0f8 100644 --- a/datagateway_api/src/swagger/apispec_flask_restful.py +++ b/datagateway_api/src/swagger/apispec_flask_restful.py @@ -4,10 +4,10 @@ import logging import re -import yaml import apispec from apispec import yaml_utils from apispec.exceptions import APISpecError +import yaml def deduce_path(resource, **kwargs): diff --git a/noxfile.py b/noxfile.py index a256a64a..1b34f3f4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,6 +1,7 @@ -import nox import tempfile +import nox + # Separating Black away from the rest of the sessions nox.options.sessions = "lint", "safety" code_locations = "datagateway_api", "test", "util", "noxfile.py" diff --git a/test/test_database_helpers.py b/test/test_database_helpers.py index f10551d9..c97404a5 100644 --- a/test/test_database_helpers.py +++ b/test/test_database_helpers.py @@ -1,28 +1,28 @@ from unittest import TestCase -from datagateway_api.common.database.helpers import QueryFilterFactory from datagateway_api.common.config import config +from datagateway_api.common.database.helpers import QueryFilterFactory from datagateway_api.common.exceptions import ApiError backend_type = config.get_backend_type() if backend_type == "db": from datagateway_api.common.database.filters import ( - DatabaseWhereFilter as WhereFilter, DatabaseDistinctFieldFilter as DistinctFieldFilter, + DatabaseIncludeFilter as IncludeFilter, + DatabaseLimitFilter as LimitFilter, DatabaseOrderFilter as OrderFilter, DatabaseSkipFilter as SkipFilter, - DatabaseLimitFilter as LimitFilter, - DatabaseIncludeFilter as IncludeFilter, + DatabaseWhereFilter as WhereFilter, ) elif backend_type == "python_icat": # TODO - Adapt these tests for the ICAT implementation of filters from datagateway_api.common.icat.filters import ( - PythonICATWhereFilter as WhereFilter, PythonICATDistinctFieldFilter as DistinctFieldFilter, + PythonICATIncludeFilter as IncludeFilter, + PythonICATLimitFilter as LimitFilter, PythonICATOrderFilter as OrderFilter, PythonICATSkipFilter as SkipFilter, - PythonICATLimitFilter as LimitFilter, - PythonICATIncludeFilter as IncludeFilter, + PythonICATWhereFilter as WhereFilter, ) else: raise ApiError( diff --git a/test/test_entityHelper.py b/test/test_entityHelper.py index 58f15356..9fac7c99 100644 --- a/test/test_entityHelper.py +++ b/test/test_entityHelper.py @@ -3,8 +3,8 @@ from datagateway_api.common.database.models import ( DATAFILE, - DATASET, DATAFILEFORMAT, + DATASET, INVESTIGATION, ) diff --git a/test/test_helpers.py b/test/test_helpers.py index e656c6d4..21906488 100644 --- a/test/test_helpers.py +++ b/test/test_helpers.py @@ -4,28 +4,28 @@ from datagateway_api.common.database.helpers import ( delete_row_by_id, - insert_row_into_table, - LimitFilter, DistinctFieldFilter, IncludeFilter, + insert_row_into_table, + LimitFilter, + OrderFilter, SkipFilter, WhereFilter, - OrderFilter, ) +from datagateway_api.common.database.models import SESSION from datagateway_api.common.exceptions import ( - MissingRecordError, - FilterError, + AuthenticationError, BadRequestError, + FilterError, MissingCredentialsError, - AuthenticationError, + MissingRecordError, ) from datagateway_api.common.helpers import ( + get_filters_from_query_string, + get_session_id_from_auth_header, is_valid_json, queries_records, - get_session_id_from_auth_header, - get_filters_from_query_string, ) -from datagateway_api.common.database.models import SESSION from test.test_base import FlaskAppTest diff --git a/util/icat_db_generator.py b/util/icat_db_generator.py index c0723910..a1585d49 100644 --- a/util/icat_db_generator.py +++ b/util/icat_db_generator.py @@ -1,8 +1,8 @@ +from abc import ABC, abstractmethod import argparse import datetime -from abc import ABC, abstractmethod -from multiprocessing import Process, Pool -from random import randrange, seed, choice +from multiprocessing import Pool, Process +from random import choice, randrange, seed from faker import Faker From 51fabee7c47a4ca782a9a29230785a5812b57bfa Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 3 Nov 2020 13:20:50 +0000 Subject: [PATCH 04/20] #184: Remove reassignment of Python builtins --- datagateway_api/common/database/helpers.py | 26 +++++++++---------- .../common/filter_order_handler.py | 16 ++++++------ noxfile.py | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/datagateway_api/common/database/helpers.py b/datagateway_api/common/database/helpers.py index d234c624..cf682cd8 100644 --- a/datagateway_api/common/database/helpers.py +++ b/datagateway_api/common/database/helpers.py @@ -204,7 +204,7 @@ def execute_query(self): class QueryFilterFactory(object): @staticmethod - def get_query_filter(filter): + def get_query_filter(request_filter): """ Given a filter return a matching Query filter object @@ -213,29 +213,29 @@ def get_query_filter(filter): be based off the abstract classes (because they're in the same file) which won't enable filters to be unique to the backend - :param filter: dict - The filter to create the QueryFilter for + :param request_filter: dict - The filter to create the QueryFilter for :return: The QueryFilter object created """ - filter_name = list(filter)[0].lower() + filter_name = list(request_filter)[0].lower() if filter_name == "where": - field = list(filter[filter_name].keys())[0] - operation = list(filter[filter_name][field].keys())[0] - value = filter[filter_name][field][operation] + field = list(request_filter[filter_name].keys())[0] + operation = list(request_filter[filter_name][field].keys())[0] + value = request_filter[filter_name][field][operation] return WhereFilter(field, value, operation) elif filter_name == "order": - field = filter["order"].split(" ")[0] - direction = filter["order"].split(" ")[1] + field = request_filter["order"].split(" ")[0] + direction = request_filter["order"].split(" ")[1] return OrderFilter(field, direction) elif filter_name == "skip": - return SkipFilter(filter["skip"]) + return SkipFilter(request_filter["skip"]) elif filter_name == "limit": - return LimitFilter(filter["limit"]) + return LimitFilter(request_filter["limit"]) elif filter_name == "include": - return IncludeFilter(filter["include"]) + return IncludeFilter(request_filter["include"]) elif filter_name == "distinct": - return DistinctFieldFilter(filter["distinct"]) + return DistinctFieldFilter(request_filter["distinct"]) else: - raise FilterError(f" Bad filter: {filter}") + raise FilterError(f" Bad filter: {request_filter}") def insert_row_into_table(table, row): diff --git a/datagateway_api/common/filter_order_handler.py b/datagateway_api/common/filter_order_handler.py index 471dca10..da283043 100644 --- a/datagateway_api/common/filter_order_handler.py +++ b/datagateway_api/common/filter_order_handler.py @@ -18,14 +18,14 @@ class FilterOrderHandler(object): def __init__(self): self.filters = [] - def add_filter(self, filter): - self.filters.append(filter) + def add_filter(self, query_filter): + self.filters.append(query_filter) - def add_filters(self, filters): - self.filters.extend(filters) + def add_filters(self, query_filter): + self.filters.extend(query_filter) - def remove_filter(self, filter): - self.filters.remove(filter) + def remove_filter(self, query_filter): + self.filters.remove(query_filter) def sort_filters(self): """ @@ -41,8 +41,8 @@ def apply_filters(self, query): """ self.sort_filters() - for filter in self.filters: - filter.apply_filter(query) + for query_filter in self.filters: + query_filter.apply_filter(query) def merge_python_icat_limit_skip_filters(self): """ diff --git a/noxfile.py b/noxfile.py index 1b34f3f4..5abf3111 100644 --- a/noxfile.py +++ b/noxfile.py @@ -21,7 +21,7 @@ def install_with_constraints(session, *args, **kwargs): @nox.session(python="3.6", reuse_venv=True) -def format(session): +def black(session): args = session.posargs or code_locations install_with_constraints(session, "black") session.run("black", *args, external=True) From 9b85ea7be70d09289f4066e0943f300e4b5c568e Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 3 Nov 2020 14:41:13 +0000 Subject: [PATCH 05/20] #184: Avoid catching bare exceptions --- datagateway_api/common/config.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/datagateway_api/common/config.py b/datagateway_api/common/config.py index 265e963f..0425ef98 100644 --- a/datagateway_api/common/config.py +++ b/datagateway_api/common/config.py @@ -13,65 +13,61 @@ class Config(object): def __init__(self): config_path = Path(__file__).parent.parent.parent / "config.json" with open(config_path) as target: - self.config = json.load(target) target.close() def get_backend_type(self): try: return self.config["backend"] - except: + except KeyError: sys.exit("Missing config value, backend") def get_db_url(self): try: return self.config["DB_URL"] - except: + except KeyError: sys.exit("Missing config value, DB_URL") def get_icat_url(self): try: return self.config["ICAT_URL"] - except: + except KeyError: sys.exit("Missing config value, ICAT_URL") def get_icat_check_cert(self): try: return self.config["icat_check_cert"] - except: - # This could be set to true if there's no value, and log a warning - # that no value has been found from the config - save app from - # exiting + except KeyError: sys.exit("Missing config value, icat_check_cert") def get_log_level(self): try: return self.config["log_level"] - except: + except KeyError: sys.exit("Missing config value, log_level") def is_debug_mode(self): try: return self.config["debug_mode"] - except: + except KeyError: sys.exit("Missing config value, debug_mode") def is_generate_swagger(self): try: return self.config["generate_swagger"] - except: + except KeyError: sys.exit("Missing config value, generate_swagger") def get_host(self): try: return self.config["host"] - except: + except KeyError: sys.exit("Missing config value, host") def get_port(self): try: return self.config["port"] - except: + except KeyError: sys.exit("Missing config value, port") def get_icat_properties(self): From 81671f4d4fd94b956a7976ed6a788e40a1fa661a Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 3 Nov 2020 16:46:57 +0000 Subject: [PATCH 06/20] #184: Ensure every line meets 88 character length - This is the suggested line length defined by Black, which flake8 is configured to also follow --- datagateway_api/common/backend.py | 2 +- datagateway_api/common/database/backend.py | 2 +- datagateway_api/common/icat/backend.py | 2 +- datagateway_api/common/icat/query.py | 10 +-- datagateway_api/common/logger_setup.py | 3 +- datagateway_api/src/main.py | 3 +- .../src/resources/entities/entity_endpoint.py | 81 +++++++++++-------- .../non_entities/sessions_endpoints.py | 8 +- .../table_endpoints/table_endpoints.py | 49 ++++++----- .../src/swagger/initialise_spec.py | 19 +++-- 10 files changed, 107 insertions(+), 72 deletions(-) diff --git a/datagateway_api/common/backend.py b/datagateway_api/common/backend.py index 5b799b7a..c09d06a6 100644 --- a/datagateway_api/common/backend.py +++ b/datagateway_api/common/backend.py @@ -188,7 +188,7 @@ def get_investigations_for_instrument_in_facility_cycle_with_filters( pass @abstractmethod - def get_investigations_for_instrument_in_facility_cycle_count_with_filters( + def get_investigation_count_for_instrument_facility_cycle_with_filters( self, session_id, instrument_id, facilitycycle_id, filters, ): """ diff --git a/datagateway_api/common/database/backend.py b/datagateway_api/common/database/backend.py index 60ebd71f..65d7eb6c 100644 --- a/datagateway_api/common/database/backend.py +++ b/datagateway_api/common/database/backend.py @@ -133,7 +133,7 @@ def get_investigations_for_instrument_in_facility_cycle_with_filters( @requires_session_id @queries_records - def get_investigations_for_instrument_in_facility_cycle_count_with_filters( + def get_investigation_count_for_instrument_facility_cycle_with_filters( self, session_id, instrument_id, facilitycycle_id, filters, ): return get_investigations_for_instrument_in_facility_cycle_count( diff --git a/datagateway_api/common/icat/backend.py b/datagateway_api/common/icat/backend.py index 3f165c52..f7af97eb 100644 --- a/datagateway_api/common/icat/backend.py +++ b/datagateway_api/common/icat/backend.py @@ -156,7 +156,7 @@ def get_investigations_for_instrument_in_facility_cycle_with_filters( @requires_session_id @queries_records - def get_investigations_for_instrument_in_facility_cycle_count_with_filters( + def get_investigation_count_for_instrument_facility_cycle_with_filters( self, session_id, instrument_id, facilitycycle_id, filters, ): self.client.sessionId = session_id diff --git a/datagateway_api/common/icat/query.py b/datagateway_api/common/icat/query.py index 43d9617f..27d6dc98 100644 --- a/datagateway_api/common/icat/query.py +++ b/datagateway_api/common/icat/query.py @@ -96,8 +96,8 @@ def execute_query(self, client, return_json_formattable=False): distinct_attributes, flat_query_includes, ) log.debug( - "Attribute names used in the distinct filter, mapped to the entity they" - " are a part of: %s", + "Attribute names used in the distinct filter, mapped to the entity" + " they are a part of: %s", mapped_distinct_fields, ) @@ -188,7 +188,7 @@ def entity_to_dict(self, entity, includes, distinct_fields=None): ) if isinstance(target, Entity): if distinct_fields is not None: - distinct_fields_copy = self.prepare_distinct_fields_for_recursion( + distinct_fields_copy = self.prepare_distinct_fields( key, distinct_fields, ) else: @@ -203,7 +203,7 @@ def entity_to_dict(self, entity, includes, distinct_fields=None): d[key] = [] for e in target: if distinct_fields is not None: - distinct_fields_copy = self.prepare_distinct_fields_for_recursion( + distinct_fields_copy = self.prepare_distinct_fields( key, distinct_fields, ) else: @@ -296,7 +296,7 @@ def map_distinct_attributes_to_entity_names(self, distinct_fields, included_fiel return distinct_field_dict - def prepare_distinct_fields_for_recursion(self, entity_name, distinct_fields): + def prepare_distinct_fields(self, entity_name, distinct_fields): """ Copy `distinct_fields` and move the data held in `entity_name` portion of the dictionary to the "base" section of the dictionary. This function is called in diff --git a/datagateway_api/common/logger_setup.py b/datagateway_api/common/logger_setup.py index 58c66c76..5bf13396 100644 --- a/datagateway_api/common/logger_setup.py +++ b/datagateway_api/common/logger_setup.py @@ -9,7 +9,8 @@ "version": 1, "formatters": { "default": { - "format": "[%(asctime)s] {%(module)s:%(filename)s:%(funcName)s:%(lineno)d} %(levelname)s -%(message)s ", + "format": "[%(asctime)s] {%(module)s:%(filename)s:%(funcName)s:%(lineno)d}" + " %(levelname)s - %(message)s", }, }, "handlers": { diff --git a/datagateway_api/src/main.py b/datagateway_api/src/main.py index b456fc03..da8aba1d 100644 --- a/datagateway_api/src/main.py +++ b/datagateway_api/src/main.py @@ -102,7 +102,8 @@ def handle_error(e): spec.path(resource=InstrumentsFacilityCyclesInvestigations, api=api) api.add_resource( InstrumentsFacilityCyclesInvestigationsCount, - "/instruments//facilitycycles//investigations/count", + "/instruments//facilitycycles//investigations" + "/count", ) spec.path(resource=InstrumentsFacilityCyclesInvestigationsCount, api=api) diff --git a/datagateway_api/src/resources/entities/entity_endpoint.py b/datagateway_api/src/resources/entities/entity_endpoint.py index 1d493062..1cdf2af7 100644 --- a/datagateway_api/src/resources/entities/entity_endpoint.py +++ b/datagateway_api/src/resources/entities/entity_endpoint.py @@ -19,6 +19,8 @@ def get_endpoint(name, entity_type): :return: The generated endpoint class """ + entity_schema_name = entity_type.strip("_").upper() + class Endpoint(Resource): def get(self): return ( @@ -45,21 +47,23 @@ def get(self): - INCLUDE_FILTER responses: 200: - description: Success - returns {entity_type} that satisfy the filters + description: Success - returns {entity_type} that satisfy the + filters content: application/json: schema: type: array items: - $ref: '#/components/schemas/{entity_type.strip("_").upper()}' + $ref: + '#/components/schemas/{entity_schema_name}' 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ def post(self): @@ -73,7 +77,8 @@ def post(self): post.__doc__ = f""" --- summary: Create new {name} - description: Creates new {entity_type} object(s) with details provided in the request body + description: Creates new {entity_type} object(s) with details provided in + the request body tags: - {name} requestBody: @@ -84,7 +89,7 @@ def post(self): schema: type: array items: - $ref: '#/components/schemas/{entity_type.strip("_").upper()}' + $ref: '#/components/schemas/{entity_schema_name}' responses: 200: description: Success - returns the created object @@ -93,15 +98,15 @@ def post(self): schema: type: array items: - $ref: '#/components/schemas/{entity_type.strip("_").upper()}' + $ref: '#/components/schemas/{entity_schema_name}' 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ def patch(self): @@ -115,7 +120,8 @@ def patch(self): patch.__doc__ = f""" --- summary: Update {name} - description: Updates {entity_type} object(s) with details provided in the request body + description: Updates {entity_type} object(s) with details provided in the + request body tags: - {name} requestBody: @@ -126,7 +132,7 @@ def patch(self): schema: type: array items: - $ref: '#/components/schemas/{entity_type.strip("_").upper()}' + $ref: '#/components/schemas/{entity_schema_name}' responses: 200: description: Success - returns the updated object(s) @@ -135,15 +141,15 @@ def patch(self): schema: type: array items: - $ref: '#/components/schemas/{entity_type.strip("_").upper()}' + $ref: '#/components/schemas/{entity_schema_name}' 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ Endpoint.__name__ = name @@ -161,6 +167,8 @@ def get_id_endpoint(name, entity_type): :return: The generated id endpoint class """ + entity_schema_name = entity_type.strip("_").upper() + class EndpointWithID(Resource): def get(self, id_): return ( @@ -189,15 +197,15 @@ def get(self, id_): content: application/json: schema: - $ref: '#/components/schemas/{entity_type.strip("_").upper()}' + $ref: '#/components/schemas/{entity_schema_name}' 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ def delete(self, id_): @@ -207,7 +215,8 @@ def delete(self, id_): delete.__doc__ = f""" --- summary: Delete {name} by id - description: Updates {entity_type} with the specified ID with details provided in the request body + description: Updates {entity_type} with the specified ID with details + provided in the request body tags: - {name} parameters: @@ -223,11 +232,11 @@ def delete(self, id_): 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ def patch(self, id_): @@ -238,7 +247,8 @@ def patch(self, id_): patch.__doc__ = f""" --- summary: Update {name} by id - description: Updates {entity_type} with the specified ID with details provided in the request body + description: Updates {entity_type} with the specified ID with details + provided in the request body tags: - {name} parameters: @@ -254,22 +264,22 @@ def patch(self, id_): content: application/json: schema: - $ref: '#/components/schemas/{entity_type.strip("_").upper()}' + $ref: '#/components/schemas/{entity_schema_name}' responses: 200: description: Success - returns the updated object content: application/json: schema: - $ref: '#/components/schemas/{entity_type.strip("_").upper()}' + $ref: '#/components/schemas/{entity_schema_name}' 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ EndpointWithID.__name__ = f"{name}WithID" @@ -300,7 +310,8 @@ def get(self): get.__doc__ = f""" --- summary: Count {name} - description: Return the count of the {entity_type} objects that would be retrieved given the filters provided + description: Return the count of the {entity_type} objects that would be + retrieved given the filters provided tags: - {name} parameters: @@ -317,11 +328,11 @@ def get(self): 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ CountEndpoint.__name__ = f"{name}Count" @@ -339,6 +350,8 @@ def get_find_one_endpoint(name, entity_type): :return: The generated findOne endpoint class """ + entity_schema_name = entity_type.strip("_").upper() + class FindOneEndpoint(Resource): def get(self): filters = get_filters_from_query_string() @@ -352,7 +365,8 @@ def get(self): get.__doc__ = f""" --- summary: Get single {entity_type} - description: Retrieves the first {entity_type} objects that satisfies the filters. + description: Retrieves the first {entity_type} objects that satisfies the + filters. tags: - {name} parameters: @@ -364,19 +378,20 @@ def get(self): - INCLUDE_FILTER responses: 200: - description: Success - a {entity_type} object that satisfies the filters + description: Success - a {entity_type} object that satisfies the + filters content: application/json: schema: - $ref: '#/components/schemas/{entity_type.strip("_").upper()}' + $ref: '#/components/schemas/{entity_schema_name}' 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ FindOneEndpoint.__name__ = f"{name}FindOne" diff --git a/datagateway_api/src/resources/non_entities/sessions_endpoints.py b/datagateway_api/src/resources/non_entities/sessions_endpoints.py index 1ac35b1d..13f0a2e6 100644 --- a/datagateway_api/src/resources/non_entities/sessions_endpoints.py +++ b/datagateway_api/src/resources/non_entities/sessions_endpoints.py @@ -50,7 +50,7 @@ def post(self): description: Session ID example: xxxxxx-yyyyyyy-zzzzzz 400: - description: Bad request. User credentials were not provided in request body. + description: Bad request. User credentials not provided in request body 403: description: Forbidden. User credentials were invalid """ @@ -81,7 +81,7 @@ def delete(self): 400: description: Bad request - something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: @@ -120,7 +120,7 @@ def get(self): type: string description: Username associated with this session 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid """ @@ -145,7 +145,7 @@ def put(self): description: Session ID example: xxxxxx-yyyyyyy-zzzzzz 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid """ diff --git a/datagateway_api/src/resources/table_endpoints/table_endpoints.py b/datagateway_api/src/resources/table_endpoints/table_endpoints.py index 5ae49164..3f246ef5 100644 --- a/datagateway_api/src/resources/table_endpoints/table_endpoints.py +++ b/datagateway_api/src/resources/table_endpoints/table_endpoints.py @@ -12,7 +12,8 @@ def get(self, id_): """ --- summary: Get an Instrument's FacilityCycles - description: Given an Instrument id get facility cycles where the instrument has investigations that occur within that cycle, subject to the given filters + description: Given an Instrument id get facility cycles where the instrument has + investigations that occur within that cycle, subject to the given filters tags: - FacilityCycles parameters: @@ -30,7 +31,8 @@ def get(self, id_): - INCLUDE_FILTER responses: 200: - description: Success - returns a list of the instrument's facility cycles that satisfy the filters + description: Success - returns a list of the instrument's facility + cycles that satisfy the filters content: application/json: schema: @@ -40,11 +42,11 @@ def get(self, id_): 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ return ( backend.get_facility_cycles_for_instrument_with_filters( @@ -59,7 +61,9 @@ def get(self, id_): """ --- summary: Count an Instrument's FacilityCycles - description: Return the count of the Facility Cycles that have investigations that occur within that cycle on the specified instrument that would be retrieved given the filters provided + description: Return the count of the Facility Cycles that have investigations + that occur within that cycle on the specified instrument that would be + retrieved given the filters provided tags: - FacilityCycles parameters: @@ -73,7 +77,8 @@ def get(self, id_): - DISTINCT_FILTER responses: 200: - description: Success - The count of the instrument's facility cycles that satisfy the filters + description: Success - The count of the instrument's facility cycles + that satisfy the filters content: application/json: schema: @@ -81,11 +86,11 @@ def get(self, id_): 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ return ( backend.get_facility_cycles_for_instrument_count_with_filters( @@ -100,7 +105,9 @@ def get(self, instrument_id, cycle_id): """ --- summary: Get the investigations for a given Facility Cycle & Instrument - description: Given an Instrument id and Facility Cycle id, get the investigations that occur within that cycle on that instrument, subject to the given filters + description: Given an Instrument id and Facility Cycle id, get the + investigations that occur within that cycle on that instrument, subject to + the given filters tags: - Investigations parameters: @@ -113,7 +120,7 @@ def get(self, instrument_id, cycle_id): - in: path required: true name: cycle_id - description: The id of the facility cycles to retrieve the investigations of + description: The id of the facility cycle to retrieve the investigations schema: type: integer - WHERE_FILTER @@ -124,7 +131,8 @@ def get(self, instrument_id, cycle_id): - INCLUDE_FILTER responses: 200: - description: Success - returns a list of the investigations for the given instrument and facility cycle that satisfy the filters + description: Success - returns a list of the investigations for the + given instrument and facility cycle that satisfy the filters content: application/json: schema: @@ -134,11 +142,11 @@ def get(self, instrument_id, cycle_id): 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ return ( backend.get_investigations_for_instrument_in_facility_cycle_with_filters( @@ -156,7 +164,9 @@ def get(self, instrument_id, cycle_id): """ --- summary: Count investigations for a given Facility Cycle & Instrument - description: Given an Instrument id and Facility Cycle id, get the number of investigations that occur within that cycle on that instrument, subject to the given filters + description: Given an Instrument id and Facility Cycle id, get the number of + investigations that occur within that cycle on that instrument, subject to + the given filters tags: - Investigations parameters: @@ -169,14 +179,15 @@ def get(self, instrument_id, cycle_id): - in: path required: true name: cycle_id - description: The id of the facility cycles to retrieve the investigations of + description: The id of the facility cycle to retrieve the investigations schema: type: integer - WHERE_FILTER - DISTINCT_FILTER responses: 200: - description: Success - The count of the investigations for the given instrument and facility cycle that satisfy the filters + description: Success - The count of the investigations for the given + instrument and facility cycle that satisfy the filters content: application/json: schema: @@ -184,14 +195,14 @@ def get(self, instrument_id, cycle_id): 400: description: Bad request - Something was wrong with the request 401: - description: Unauthorized - No session ID was found in the HTTP Authorization header + description: Unauthorized - No session ID found in HTTP Auth. header 403: description: Forbidden - The session ID provided is invalid 404: - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT """ return ( - backend.get_investigations_for_instrument_in_facility_cycle_count_with_filters( + backend.get_investigation_count_for_instrument_facility_cycle_with_filters( get_session_id_from_auth_header(), instrument_id, cycle_id, diff --git a/datagateway_api/src/swagger/initialise_spec.py b/datagateway_api/src/swagger/initialise_spec.py index a5bb4a94..95b021b4 100644 --- a/datagateway_api/src/swagger/initialise_spec.py +++ b/datagateway_api/src/swagger/initialise_spec.py @@ -25,7 +25,8 @@ def initialise_spec(spec): { "in": "query", "name": "where", - "description": "Apply where filters to the query. The possible operators are like, gte, lte, in and eq", + "description": "Apply where filters to the query. The possible operators" + " are like, gte, lte, in and eq", "schema": { "type": "array", "items": { @@ -116,7 +117,8 @@ def initialise_spec(spec): { "in": "query", "name": "order", - "description": "Apply order filters to the query. Given a field and direction, order the returned entities.", + "description": "Apply order filters to the query. Given a field and" + " direction, order the returned entities.", "schema": {"type": "array", "items": {"type": "string"}}, "examples": {"asc": {"value": ["ID asc"]}, "desc": {"value": ["ID desc"]}}, }, @@ -128,7 +130,8 @@ def initialise_spec(spec): { "in": "query", "name": "limit", - "description": "Apply limit filter to the query. Limit the number of entities returned.", + "description": "Apply limit filter to the query. Limit the number of" + " entities returned.", "schema": {"type": "integer"}, }, ) @@ -139,7 +142,8 @@ def initialise_spec(spec): { "in": "query", "name": "skip", - "description": "Apply skip filter to the query. Offset the returned entities by a given number.", + "description": "Apply skip filter to the query. Offset the returned" + " entities by a given number.", "schema": {"type": "integer"}, }, ) @@ -149,7 +153,8 @@ def initialise_spec(spec): { "in": "query", "name": "distinct", - "description": "Apply distinct filter to the query. Return unique values for the fields requested.", + "description": "Apply distinct filter to the query. Return unique values" + " for the fields requested.", "schema": {"type": "array", "items": {"type": "string"}}, }, ) @@ -159,7 +164,9 @@ def initialise_spec(spec): { "in": "query", "name": "include", - "description": "Apply include filter to the query. Given the names of related entities, include them in the results. Only one include parameter is allowed.", + "description": "Apply include filter to the query. Given the names of" + " related entities, include them in the results. Only one include parameter" + " is allowed.", "schema": { "oneOf": [ {"type": "string"}, From 4846a3d3e270fa6d1f9d2ab54c3dd87e72946ade Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 3 Nov 2020 16:48:09 +0000 Subject: [PATCH 07/20] #184: Edit docs to reflect Nox session renaming --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 429cd259..ec1f9cb9 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ nox -s [SESSION/FUNCTION NAME] ``` Currently, the following Nox sessions have been created: -- `format` - this uses [Black](https://black.readthedocs.io/en/stable/) to format Python +- `black` - this uses [Black](https://black.readthedocs.io/en/stable/) to format Python code to a pre-defined style. - `lint` - this uses [flake8](https://flake8.pycqa.org/en/latest/) with a number of additional plugins (see the included `noxfile.py` to see which plugins are used) to From 93e1e3bf851d3a96349a6b1242d838dfea54a63f Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 3 Nov 2020 16:48:40 +0000 Subject: [PATCH 08/20] #184: Rebuild openapi.yaml file to reflect recent changes --- datagateway_api/src/swagger/openapi.yaml | 1558 +++++++++------------- 1 file changed, 622 insertions(+), 936 deletions(-) diff --git a/datagateway_api/src/swagger/openapi.yaml b/datagateway_api/src/swagger/openapi.yaml index 5ec7f1c8..6bde92cb 100644 --- a/datagateway_api/src/swagger/openapi.yaml +++ b/datagateway_api/src/swagger/openapi.yaml @@ -1781,12 +1781,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Applications tags: - Applications @@ -1814,12 +1813,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Applications tags: - Applications @@ -1847,12 +1845,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Applications tags: - Applications @@ -1873,12 +1870,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Applications by id tags: - Applications @@ -1901,12 +1897,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Application matching the given ID tags: - Applications @@ -1937,12 +1932,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Applications by id tags: - Applications @@ -1964,12 +1958,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Applications tags: - Applications @@ -1993,12 +1986,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Application tags: - Applications @@ -2024,12 +2016,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get DataCollectionDatafiles tags: - DataCollectionDatafiles @@ -2057,12 +2048,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DataCollectionDatafiles tags: - DataCollectionDatafiles @@ -2090,12 +2080,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new DataCollectionDatafiles tags: - DataCollectionDatafiles @@ -2116,12 +2105,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete DataCollectionDatafiles by id tags: - DataCollectionDatafiles @@ -2144,12 +2132,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the DataCollectionDatafile matching the given ID tags: - DataCollectionDatafiles @@ -2180,12 +2167,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DataCollectionDatafiles by id tags: - DataCollectionDatafiles @@ -2207,12 +2193,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count DataCollectionDatafiles tags: - DataCollectionDatafiles @@ -2238,12 +2223,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single DataCollectionDatafile tags: - DataCollectionDatafiles @@ -2269,12 +2253,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get DataCollectionDatasets tags: - DataCollectionDatasets @@ -2302,12 +2285,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DataCollectionDatasets tags: - DataCollectionDatasets @@ -2335,12 +2317,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new DataCollectionDatasets tags: - DataCollectionDatasets @@ -2361,12 +2342,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete DataCollectionDatasets by id tags: - DataCollectionDatasets @@ -2389,12 +2369,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the DataCollectionDataset matching the given ID tags: - DataCollectionDatasets @@ -2425,12 +2404,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DataCollectionDatasets by id tags: - DataCollectionDatasets @@ -2452,12 +2430,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count DataCollectionDatasets tags: - DataCollectionDatasets @@ -2483,12 +2460,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single DataCollectionDataset tags: - DataCollectionDatasets @@ -2515,12 +2491,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get DataCollectionParameters tags: - DataCollectionParameters @@ -2548,12 +2523,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DataCollectionParameters tags: - DataCollectionParameters @@ -2581,12 +2555,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new DataCollectionParameters tags: - DataCollectionParameters @@ -2607,12 +2580,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete DataCollectionParameters by id tags: - DataCollectionParameters @@ -2635,12 +2607,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the DataCollectionParameter matching the given ID tags: - DataCollectionParameters @@ -2671,12 +2642,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DataCollectionParameters by id tags: - DataCollectionParameters @@ -2698,12 +2668,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count DataCollectionParameters tags: - DataCollectionParameters @@ -2729,12 +2698,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single DataCollectionParameter tags: - DataCollectionParameters @@ -2760,12 +2728,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get DataCollections tags: - DataCollections @@ -2793,12 +2760,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DataCollections tags: - DataCollections @@ -2826,12 +2792,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new DataCollections tags: - DataCollections @@ -2852,12 +2817,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete DataCollections by id tags: - DataCollections @@ -2880,12 +2844,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the DataCollection matching the given ID tags: - DataCollections @@ -2916,12 +2879,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DataCollections by id tags: - DataCollections @@ -2943,12 +2905,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count DataCollections tags: - DataCollections @@ -2972,12 +2933,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single DataCollection tags: - DataCollections @@ -3003,12 +2963,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get DatafileFormats tags: - DatafileFormats @@ -3036,12 +2995,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DatafileFormats tags: - DatafileFormats @@ -3069,12 +3027,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new DatafileFormats tags: - DatafileFormats @@ -3095,12 +3052,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete DatafileFormats by id tags: - DatafileFormats @@ -3123,12 +3079,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the DatafileFormat matching the given ID tags: - DatafileFormats @@ -3159,12 +3114,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DatafileFormats by id tags: - DatafileFormats @@ -3186,12 +3140,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count DatafileFormats tags: - DatafileFormats @@ -3215,12 +3168,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single DatafileFormat tags: - DatafileFormats @@ -3246,12 +3198,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get DatafileParameters tags: - DatafileParameters @@ -3279,12 +3230,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DatafileParameters tags: - DatafileParameters @@ -3312,12 +3262,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new DatafileParameters tags: - DatafileParameters @@ -3338,12 +3287,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete DatafileParameters by id tags: - DatafileParameters @@ -3366,12 +3314,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the DatafileParameter matching the given ID tags: - DatafileParameters @@ -3402,12 +3349,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DatafileParameters by id tags: - DatafileParameters @@ -3429,12 +3375,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count DatafileParameters tags: - DatafileParameters @@ -3459,12 +3404,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single DatafileParameter tags: - DatafileParameters @@ -3490,12 +3434,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Datafiles tags: - Datafiles @@ -3523,12 +3466,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Datafiles tags: - Datafiles @@ -3556,12 +3498,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Datafiles tags: - Datafiles @@ -3582,12 +3523,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Datafiles by id tags: - Datafiles @@ -3610,12 +3550,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Datafile matching the given ID tags: - Datafiles @@ -3646,12 +3585,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Datafiles by id tags: - Datafiles @@ -3673,12 +3611,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Datafiles tags: - Datafiles @@ -3702,12 +3639,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Datafile tags: - Datafiles @@ -3733,12 +3669,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get DatasetParameters tags: - DatasetParameters @@ -3766,12 +3701,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DatasetParameters tags: - DatasetParameters @@ -3799,12 +3733,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new DatasetParameters tags: - DatasetParameters @@ -3825,12 +3758,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete DatasetParameters by id tags: - DatasetParameters @@ -3853,12 +3785,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the DatasetParameter matching the given ID tags: - DatasetParameters @@ -3889,12 +3820,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DatasetParameters by id tags: - DatasetParameters @@ -3916,12 +3846,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count DatasetParameters tags: - DatasetParameters @@ -3946,12 +3875,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single DatasetParameter tags: - DatasetParameters @@ -3977,12 +3905,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get DatasetTypes tags: - DatasetTypes @@ -4010,12 +3937,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DatasetTypes tags: - DatasetTypes @@ -4043,12 +3969,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new DatasetTypes tags: - DatasetTypes @@ -4069,12 +3994,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete DatasetTypes by id tags: - DatasetTypes @@ -4097,12 +4021,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the DatasetType matching the given ID tags: - DatasetTypes @@ -4133,12 +4056,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update DatasetTypes by id tags: - DatasetTypes @@ -4160,12 +4082,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count DatasetTypes tags: - DatasetTypes @@ -4189,12 +4110,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single DatasetType tags: - DatasetTypes @@ -4220,12 +4140,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Datasets tags: - Datasets @@ -4253,12 +4172,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Datasets tags: - Datasets @@ -4286,12 +4204,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Datasets tags: - Datasets @@ -4312,12 +4229,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Datasets by id tags: - Datasets @@ -4340,12 +4256,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Dataset matching the given ID tags: - Datasets @@ -4376,12 +4291,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Datasets by id tags: - Datasets @@ -4403,12 +4317,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Datasets tags: - Datasets @@ -4432,12 +4345,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Dataset tags: - Datasets @@ -4463,12 +4375,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Facilities tags: - Facilities @@ -4496,12 +4407,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Facilities tags: - Facilities @@ -4529,12 +4439,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Facilities tags: - Facilities @@ -4555,12 +4464,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Facilities by id tags: - Facilities @@ -4583,12 +4491,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Facility matching the given ID tags: - Facilities @@ -4619,12 +4526,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Facilities by id tags: - Facilities @@ -4646,12 +4552,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Facilities tags: - Facilities @@ -4675,12 +4580,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Facility tags: - Facilities @@ -4706,12 +4610,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get FacilityCycles tags: - FacilityCycles @@ -4739,12 +4642,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update FacilityCycles tags: - FacilityCycles @@ -4772,12 +4674,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new FacilityCycles tags: - FacilityCycles @@ -4798,12 +4699,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete FacilityCycles by id tags: - FacilityCycles @@ -4826,12 +4726,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the FacilityCycle matching the given ID tags: - FacilityCycles @@ -4862,12 +4761,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update FacilityCycles by id tags: - FacilityCycles @@ -4889,12 +4787,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count FacilityCycles tags: - FacilityCycles @@ -4918,12 +4815,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single FacilityCycle tags: - FacilityCycles @@ -4949,12 +4845,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Groupings tags: - Groupings @@ -4982,12 +4877,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Groupings tags: - Groupings @@ -5015,12 +4909,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Groupings tags: - Groupings @@ -5041,12 +4934,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Groupings by id tags: - Groupings @@ -5069,12 +4961,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Grouping matching the given ID tags: - Groupings @@ -5105,12 +4996,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Groupings by id tags: - Groupings @@ -5132,12 +5022,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Groupings tags: - Groupings @@ -5161,12 +5050,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Grouping tags: - Groupings @@ -5192,12 +5080,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get InstrumentScientists tags: - InstrumentScientists @@ -5225,12 +5112,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InstrumentScientists tags: - InstrumentScientists @@ -5258,12 +5144,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new InstrumentScientists tags: - InstrumentScientists @@ -5284,12 +5169,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete InstrumentScientists by id tags: - InstrumentScientists @@ -5312,12 +5196,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the InstrumentScientist matching the given ID tags: - InstrumentScientists @@ -5348,12 +5231,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InstrumentScientists by id tags: - InstrumentScientists @@ -5375,12 +5257,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count InstrumentScientists tags: - InstrumentScientists @@ -5405,12 +5286,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single InstrumentScientist tags: - InstrumentScientists @@ -5436,12 +5316,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Instruments tags: - Instruments @@ -5469,12 +5348,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Instruments tags: - Instruments @@ -5502,12 +5380,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Instruments tags: - Instruments @@ -5528,12 +5405,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Instruments by id tags: - Instruments @@ -5556,12 +5432,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Instrument matching the given ID tags: - Instruments @@ -5592,12 +5467,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Instruments by id tags: - Instruments @@ -5619,12 +5493,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Instruments tags: - Instruments @@ -5648,12 +5521,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Instrument tags: - Instruments @@ -5679,12 +5551,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get InvestigationGroups tags: - InvestigationGroups @@ -5712,12 +5583,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationGroups tags: - InvestigationGroups @@ -5745,12 +5615,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new InvestigationGroups tags: - InvestigationGroups @@ -5771,12 +5640,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete InvestigationGroups by id tags: - InvestigationGroups @@ -5799,12 +5667,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the InvestigationGroup matching the given ID tags: - InvestigationGroups @@ -5835,12 +5702,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationGroups by id tags: - InvestigationGroups @@ -5862,12 +5728,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count InvestigationGroups tags: - InvestigationGroups @@ -5892,12 +5757,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single InvestigationGroup tags: - InvestigationGroups @@ -5924,12 +5788,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get InvestigationInstruments tags: - InvestigationInstruments @@ -5957,12 +5820,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationInstruments tags: - InvestigationInstruments @@ -5990,12 +5852,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new InvestigationInstruments tags: - InvestigationInstruments @@ -6016,12 +5877,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete InvestigationInstruments by id tags: - InvestigationInstruments @@ -6044,12 +5904,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the InvestigationInstrument matching the given ID tags: - InvestigationInstruments @@ -6080,12 +5939,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationInstruments by id tags: - InvestigationInstruments @@ -6107,12 +5965,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count InvestigationInstruments tags: - InvestigationInstruments @@ -6138,12 +5995,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single InvestigationInstrument tags: - InvestigationInstruments @@ -6169,12 +6025,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get InvestigationParameters tags: - InvestigationParameters @@ -6202,12 +6057,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationParameters tags: - InvestigationParameters @@ -6235,12 +6089,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new InvestigationParameters tags: - InvestigationParameters @@ -6261,12 +6114,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete InvestigationParameters by id tags: - InvestigationParameters @@ -6289,12 +6141,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the InvestigationParameter matching the given ID tags: - InvestigationParameters @@ -6325,12 +6176,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationParameters by id tags: - InvestigationParameters @@ -6352,12 +6202,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count InvestigationParameters tags: - InvestigationParameters @@ -6383,12 +6232,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single InvestigationParameter tags: - InvestigationParameters @@ -6414,12 +6262,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get InvestigationTypes tags: - InvestigationTypes @@ -6447,12 +6294,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationTypes tags: - InvestigationTypes @@ -6480,12 +6326,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new InvestigationTypes tags: - InvestigationTypes @@ -6506,12 +6351,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete InvestigationTypes by id tags: - InvestigationTypes @@ -6534,12 +6378,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the InvestigationType matching the given ID tags: - InvestigationTypes @@ -6570,12 +6413,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationTypes by id tags: - InvestigationTypes @@ -6597,12 +6439,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count InvestigationTypes tags: - InvestigationTypes @@ -6627,12 +6468,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single InvestigationType tags: - InvestigationTypes @@ -6658,12 +6498,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get InvestigationUsers tags: - InvestigationUsers @@ -6691,12 +6530,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationUsers tags: - InvestigationUsers @@ -6724,12 +6562,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new InvestigationUsers tags: - InvestigationUsers @@ -6750,12 +6587,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete InvestigationUsers by id tags: - InvestigationUsers @@ -6778,12 +6614,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the InvestigationUser matching the given ID tags: - InvestigationUsers @@ -6814,12 +6649,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update InvestigationUsers by id tags: - InvestigationUsers @@ -6841,12 +6675,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count InvestigationUsers tags: - InvestigationUsers @@ -6871,12 +6704,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single InvestigationUser tags: - InvestigationUsers @@ -6902,12 +6734,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Investigations tags: - Investigations @@ -6935,12 +6766,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Investigations tags: - Investigations @@ -6968,12 +6798,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Investigations tags: - Investigations @@ -6994,12 +6823,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Investigations by id tags: - Investigations @@ -7022,12 +6850,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Investigation matching the given ID tags: - Investigations @@ -7058,12 +6885,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Investigations by id tags: - Investigations @@ -7085,12 +6911,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Investigations tags: - Investigations @@ -7114,12 +6939,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Investigation tags: - Investigations @@ -7145,12 +6969,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Jobs tags: - Jobs @@ -7177,12 +7000,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Jobs tags: - Jobs @@ -7210,12 +7032,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Jobs tags: - Jobs @@ -7236,12 +7057,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Jobs by id tags: - Jobs @@ -7264,12 +7084,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Job matching the given ID tags: - Jobs @@ -7300,12 +7119,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Jobs by id tags: - Jobs @@ -7327,12 +7145,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Jobs tags: - Jobs @@ -7356,12 +7173,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Job tags: - Jobs @@ -7387,12 +7203,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Keywords tags: - Keywords @@ -7420,12 +7235,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Keywords tags: - Keywords @@ -7453,12 +7267,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Keywords tags: - Keywords @@ -7479,12 +7292,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Keywords by id tags: - Keywords @@ -7507,12 +7319,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Keyword matching the given ID tags: - Keywords @@ -7543,12 +7354,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Keywords by id tags: - Keywords @@ -7570,12 +7380,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Keywords tags: - Keywords @@ -7599,12 +7408,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Keyword tags: - Keywords @@ -7630,12 +7438,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get ParameterTypes tags: - ParameterTypes @@ -7663,12 +7470,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update ParameterTypes tags: - ParameterTypes @@ -7696,12 +7502,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new ParameterTypes tags: - ParameterTypes @@ -7722,12 +7527,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete ParameterTypes by id tags: - ParameterTypes @@ -7750,12 +7554,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the ParameterType matching the given ID tags: - ParameterTypes @@ -7786,12 +7589,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update ParameterTypes by id tags: - ParameterTypes @@ -7813,12 +7615,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count ParameterTypes tags: - ParameterTypes @@ -7842,12 +7643,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single ParameterType tags: - ParameterTypes @@ -7873,12 +7673,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get PermissibleStringValues tags: - PermissibleStringValues @@ -7906,12 +7705,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update PermissibleStringValues tags: - PermissibleStringValues @@ -7939,12 +7737,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new PermissibleStringValues tags: - PermissibleStringValues @@ -7965,12 +7762,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete PermissibleStringValues by id tags: - PermissibleStringValues @@ -7993,12 +7789,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the PermissibleStringValue matching the given ID tags: - PermissibleStringValues @@ -8029,12 +7824,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update PermissibleStringValues by id tags: - PermissibleStringValues @@ -8056,12 +7850,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count PermissibleStringValues tags: - PermissibleStringValues @@ -8087,12 +7880,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single PermissibleStringValue tags: - PermissibleStringValues @@ -8118,12 +7910,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get PublicSteps tags: - PublicSteps @@ -8151,12 +7942,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update PublicSteps tags: - PublicSteps @@ -8184,12 +7974,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new PublicSteps tags: - PublicSteps @@ -8210,12 +7999,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete PublicSteps by id tags: - PublicSteps @@ -8238,12 +8026,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the PublicStep matching the given ID tags: - PublicSteps @@ -8274,12 +8061,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update PublicSteps by id tags: - PublicSteps @@ -8301,12 +8087,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count PublicSteps tags: - PublicSteps @@ -8330,12 +8115,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single PublicStep tags: - PublicSteps @@ -8361,12 +8145,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Publications tags: - Publications @@ -8394,12 +8177,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Publications tags: - Publications @@ -8427,12 +8209,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Publications tags: - Publications @@ -8453,12 +8234,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Publications by id tags: - Publications @@ -8481,12 +8261,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Publication matching the given ID tags: - Publications @@ -8517,12 +8296,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Publications by id tags: - Publications @@ -8544,12 +8322,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Publications tags: - Publications @@ -8573,12 +8350,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Publication tags: - Publications @@ -8604,12 +8380,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get RelatedDatafiles tags: - RelatedDatafiles @@ -8637,12 +8412,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update RelatedDatafiles tags: - RelatedDatafiles @@ -8670,12 +8444,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new RelatedDatafiles tags: - RelatedDatafiles @@ -8696,12 +8469,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete RelatedDatafiles by id tags: - RelatedDatafiles @@ -8724,12 +8496,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the RelatedDatafile matching the given ID tags: - RelatedDatafiles @@ -8760,12 +8531,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update RelatedDatafiles by id tags: - RelatedDatafiles @@ -8787,12 +8557,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count RelatedDatafiles tags: - RelatedDatafiles @@ -8817,12 +8586,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single RelatedDatafile tags: - RelatedDatafiles @@ -8848,12 +8616,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Rules tags: - Rules @@ -8880,12 +8647,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Rules tags: - Rules @@ -8913,12 +8679,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Rules tags: - Rules @@ -8939,12 +8704,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Rules by id tags: - Rules @@ -8967,12 +8731,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Rule matching the given ID tags: - Rules @@ -9003,12 +8766,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Rules by id tags: - Rules @@ -9030,12 +8792,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Rules tags: - Rules @@ -9059,12 +8820,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Rule tags: - Rules @@ -9090,12 +8850,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get SampleParameters tags: - SampleParameters @@ -9123,12 +8882,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update SampleParameters tags: - SampleParameters @@ -9156,12 +8914,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new SampleParameters tags: - SampleParameters @@ -9182,12 +8939,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete SampleParameters by id tags: - SampleParameters @@ -9210,12 +8966,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the SampleParameter matching the given ID tags: - SampleParameters @@ -9246,12 +9001,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update SampleParameters by id tags: - SampleParameters @@ -9273,12 +9027,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count SampleParameters tags: - SampleParameters @@ -9303,12 +9056,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single SampleParameter tags: - SampleParameters @@ -9334,12 +9086,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get SampleTypes tags: - SampleTypes @@ -9367,12 +9118,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update SampleTypes tags: - SampleTypes @@ -9400,12 +9150,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new SampleTypes tags: - SampleTypes @@ -9426,12 +9175,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete SampleTypes by id tags: - SampleTypes @@ -9454,12 +9202,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the SampleType matching the given ID tags: - SampleTypes @@ -9490,12 +9237,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update SampleTypes by id tags: - SampleTypes @@ -9517,12 +9263,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count SampleTypes tags: - SampleTypes @@ -9546,12 +9291,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single SampleType tags: - SampleTypes @@ -9577,12 +9321,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Samples tags: - Samples @@ -9609,12 +9352,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Samples tags: - Samples @@ -9642,12 +9384,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Samples tags: - Samples @@ -9668,12 +9409,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Samples by id tags: - Samples @@ -9696,12 +9436,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Sample matching the given ID tags: - Samples @@ -9732,12 +9471,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Samples by id tags: - Samples @@ -9759,12 +9497,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Samples tags: - Samples @@ -9788,12 +9525,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Sample tags: - Samples @@ -9819,12 +9555,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Shifts tags: - Shifts @@ -9851,12 +9586,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Shifts tags: - Shifts @@ -9884,12 +9618,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Shifts tags: - Shifts @@ -9910,12 +9643,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Shifts by id tags: - Shifts @@ -9938,12 +9670,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Shift matching the given ID tags: - Shifts @@ -9974,12 +9705,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Shifts by id tags: - Shifts @@ -10001,12 +9731,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Shifts tags: - Shifts @@ -10030,12 +9759,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Shift tags: - Shifts @@ -10061,12 +9789,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Studies tags: - Studies @@ -10093,12 +9820,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Studies tags: - Studies @@ -10126,12 +9852,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Studies tags: - Studies @@ -10152,12 +9877,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Studies by id tags: - Studies @@ -10180,12 +9904,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the Study matching the given ID tags: - Studies @@ -10216,12 +9939,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Studies by id tags: - Studies @@ -10243,12 +9965,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Studies tags: - Studies @@ -10272,12 +9993,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single Study tags: - Studies @@ -10303,12 +10023,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get StudyInvestigations tags: - StudyInvestigations @@ -10336,12 +10055,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update StudyInvestigations tags: - StudyInvestigations @@ -10369,12 +10087,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new StudyInvestigations tags: - StudyInvestigations @@ -10395,12 +10112,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete StudyInvestigations by id tags: - StudyInvestigations @@ -10423,12 +10139,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the StudyInvestigation matching the given ID tags: - StudyInvestigations @@ -10459,12 +10174,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update StudyInvestigations by id tags: - StudyInvestigations @@ -10486,12 +10200,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count StudyInvestigations tags: - StudyInvestigations @@ -10516,12 +10229,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single StudyInvestigation tags: - StudyInvestigations @@ -10547,12 +10259,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get UserGroups tags: - UserGroups @@ -10580,12 +10291,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update UserGroups tags: - UserGroups @@ -10613,12 +10323,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new UserGroups tags: - UserGroups @@ -10639,12 +10348,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete UserGroups by id tags: - UserGroups @@ -10667,12 +10375,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the UserGroup matching the given ID tags: - UserGroups @@ -10703,12 +10410,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update UserGroups by id tags: - UserGroups @@ -10730,12 +10436,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count UserGroups tags: - UserGroups @@ -10759,12 +10464,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single UserGroup tags: - UserGroups @@ -10790,12 +10494,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get Users tags: - Users @@ -10822,12 +10525,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Users tags: - Users @@ -10855,12 +10557,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Create new Users tags: - Users @@ -10881,12 +10582,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Delete Users by id tags: - Users @@ -10909,12 +10609,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Find the User matching the given ID tags: - Users @@ -10945,12 +10644,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Update Users by id tags: - Users @@ -10972,12 +10670,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count Users tags: - Users @@ -11001,12 +10698,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get single User tags: - Users @@ -11019,8 +10715,7 @@ paths: '400': description: Bad request - something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': @@ -11051,8 +10746,7 @@ paths: type: object description: Success - a user's session details '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid summary: Get session details @@ -11087,8 +10781,7 @@ paths: type: object description: Success - returns a session ID '400': - description: Bad request. User credentials were not provided in request - body. + description: Bad request. User credentials not provided in request body '403': description: Forbidden. User credentials were invalid security: [] @@ -11107,8 +10800,7 @@ paths: type: string description: Success - the user's session ID that has been refreshed '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid summary: Refresh session @@ -11144,12 +10836,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get an Instrument's FacilityCycles tags: - FacilityCycles @@ -11178,12 +10869,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count an Instrument's FacilityCycles tags: - FacilityCycles @@ -11198,8 +10888,7 @@ paths: required: true schema: type: integer - - description: The id of the facility cycles to retrieve the investigations - of + - description: The id of the facility cycle to retrieve the investigations in: path name: cycle_id required: true @@ -11224,12 +10913,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Get the investigations for a given Facility Cycle & Instrument tags: - Investigations @@ -11245,8 +10933,7 @@ paths: required: true schema: type: integer - - description: The id of the facility cycles to retrieve the investigations - of + - description: The id of the facility cycle to retrieve the investigations in: path name: cycle_id required: true @@ -11265,12 +10952,11 @@ paths: '400': description: Bad request - Something was wrong with the request '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header + description: Unauthorized - No session ID found in HTTP Auth. header '403': description: Forbidden - The session ID provided is invalid '404': - description: No such record - Unable to find a record in the database + description: No such record - Unable to find a record in ICAT summary: Count investigations for a given Facility Cycle & Instrument tags: - Investigations From 33193de961d7294b3571feafa53688420f769c44 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 3 Nov 2020 16:58:32 +0000 Subject: [PATCH 09/20] #184: Add file specific ignore for 'random' usage - S311 (from Bandit) states "Standard pseudo-random generators are not suitable for security/cryptographic purposes.". The generator script doesn't generate data that would be vulnerable to security (no keys or anything of that nature is created using the random library) hence this status code is ignored --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index fa836f63..0a062432 100644 --- a/.flake8 +++ b/.flake8 @@ -6,5 +6,5 @@ max-complexity = 10 max-line-length = 80 application-import-names = datagateway_api,test,util import-order-style = google -per-file-ignores = test/*:S101 +per-file-ignores = test/*:S101,util/icat_db_generator.py:S311 enable-extensions=G From ed8aa343f6c1290de50e4c000197e2b68bf0b53d Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 4 Nov 2020 16:59:53 +0000 Subject: [PATCH 10/20] #184: Fix misc. linting issues --- .../common/filter_order_handler.py | 39 ++++++++----------- datagateway_api/common/helpers.py | 4 +- datagateway_api/common/icat/helpers.py | 2 +- .../src/swagger/apispec_flask_restful.py | 2 +- util/icat_db_generator.py | 4 +- 5 files changed, 22 insertions(+), 29 deletions(-) diff --git a/datagateway_api/common/filter_order_handler.py b/datagateway_api/common/filter_order_handler.py index da283043..01254da8 100644 --- a/datagateway_api/common/filter_order_handler.py +++ b/datagateway_api/common/filter_order_handler.py @@ -50,29 +50,22 @@ def merge_python_icat_limit_skip_filters(self): limit filter and remove the skip filter from the instance """ log.info("Merging a PythonICATSkipFilter and PythonICATLimitFilter together") - - if any( - isinstance(icat_filter, PythonICATSkipFilter) - for icat_filter in self.filters - ) and any( - isinstance(icat_filter, PythonICATLimitFilter) - for icat_filter in self.filters - ): - # Merge skip and limit filter into a single limit filter - for icat_filter in self.filters: - if isinstance(icat_filter, PythonICATSkipFilter): - skip_filter = icat_filter - request_skip_value = icat_filter.skip_value - - if isinstance(icat_filter, PythonICATLimitFilter): - limit_filter = icat_filter - - if skip_filter and limit_filter: - log.info("Merging skip filter with limit filter") - limit_filter.skip_value = skip_filter.skip_value - log.info("Removing skip filter from list of filters") - self.remove_filter(skip_filter) - log.debug("Filters: %s", self.filters) + skip_filter = None + limit_filter = None + + for icat_filter in self.filters: + if isinstance(icat_filter, PythonICATSkipFilter): + skip_filter = icat_filter + + if isinstance(icat_filter, PythonICATLimitFilter): + limit_filter = icat_filter + + if skip_filter and limit_filter: + log.info("Merging skip filter with limit filter") + limit_filter.skip_value = skip_filter.skip_value + log.info("Removing skip filter from list of filters") + self.remove_filter(skip_filter) + log.debug("Filters: %s", self.filters) def clear_python_icat_order_filters(self): """ diff --git a/datagateway_api/common/helpers.py b/datagateway_api/common/helpers.py index 4ef7b8bc..7c6a3a3f 100644 --- a/datagateway_api/common/helpers.py +++ b/datagateway_api/common/helpers.py @@ -59,7 +59,7 @@ def get_session_id_from_auth_header(): args["Authorization"].split(" ") if args["Authorization"] is not None else "" ) if auth_header == "": - raise MissingCredentialsError(f"No credentials provided in auth header") + raise MissingCredentialsError("No credentials provided in auth header") if len(auth_header) != 2 or auth_header[0] != "Bearer": raise AuthenticationError( f" Could not authenticate consumer with auth header {auth_header}", @@ -74,7 +74,7 @@ def is_valid_json(string): :return: boolean representing if the string is valid JSON """ try: - json_object = json.loads(string) + json.loads(string) except ValueError: return False except TypeError: diff --git a/datagateway_api/common/icat/helpers.py b/datagateway_api/common/icat/helpers.py index e56d659e..8bb090b3 100644 --- a/datagateway_api/common/icat/helpers.py +++ b/datagateway_api/common/icat/helpers.py @@ -210,7 +210,7 @@ def get_entity_by_id( # Set query condition for the selected ID id_condition = PythonICATWhereFilter.create_condition("id", "=", id_) - includes_value = "1" if return_related_entities == True else None + includes_value = "1" if return_related_entities else None id_query = ICATQuery( client, entity_type, conditions=id_condition, includes=includes_value, ) diff --git a/datagateway_api/src/swagger/apispec_flask_restful.py b/datagateway_api/src/swagger/apispec_flask_restful.py index 8573b0f8..b43b8559 100644 --- a/datagateway_api/src/swagger/apispec_flask_restful.py +++ b/datagateway_api/src/swagger/apispec_flask_restful.py @@ -61,7 +61,7 @@ def parse_operations(resource, operations): logging.getLogger(__name__).warning( "Cannot load docstring for {}/{}".format(resource, method), ) - operations[method.lower()] = operation or dict() + operations[method.lower()] = operation or {} class RestfulPlugin(apispec.BasePlugin): diff --git a/util/icat_db_generator.py b/util/icat_db_generator.py index a1585d49..4e53007d 100644 --- a/util/icat_db_generator.py +++ b/util/icat_db_generator.py @@ -695,8 +695,8 @@ def generate_all(i, generators): def main(): start_time = datetime.datetime.now() generators = [generator() for generator in Generator.__subclasses__()] - TIERS = 7 - for i in range(TIERS): + tiers = 7 + for i in range(tiers): generate_all(i, generators) print( From de6255d5f21dff0784bbbced3c50fea00d98ce35 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 4 Nov 2020 17:24:07 +0000 Subject: [PATCH 11/20] #184: Ensure all test classes names use PascalCase --- test/test_helpers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_helpers.py b/test/test_helpers.py index 21906488..9fb7bee9 100644 --- a/test/test_helpers.py +++ b/test/test_helpers.py @@ -29,7 +29,7 @@ from test.test_base import FlaskAppTest -class TestIs_valid_json(TestCase): +class TestIsValidJSON(TestCase): def test_array(self): self.assertTrue(is_valid_json("[]")) @@ -55,7 +55,7 @@ def test_list(self): self.assertFalse(is_valid_json([])) -class TestRequires_session_id(FlaskAppTest): +class TestRequiresSessionID(FlaskAppTest): def setUp(self): super().setUp() self.good_credentials_header = {"Authorization": "Bearer Test"} @@ -94,7 +94,7 @@ def test_good_credentials(self): ) -class TestQueries_records(TestCase): +class TestQueriesRecords(TestCase): def test_missing_record_error(self): @queries_records def raise_missing_record(): @@ -161,7 +161,7 @@ def raise_bad_request_error(): self.assertEqual(400, ctx.exception.status_code) -class TestGet_session_id_from_auth_header(FlaskAppTest): +class TestGetSessionIDFromAuthHeader(FlaskAppTest): def test_no_session_in_header(self): with self.app: self.app.get("/") @@ -178,7 +178,7 @@ def test_with_good_header(self): self.assertEqual("test", get_session_id_from_auth_header()) -class TestGet_filters_from_query_string(FlaskAppTest): +class TestGetFiltersFromQueryString(FlaskAppTest): def test_no_filters(self): with self.app: self.app.get("/") From af816bf12b5c26076531ed0839646109a7338c65 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 5 Nov 2020 18:25:49 +0000 Subject: [PATCH 12/20] #184: Fix G200 from flake8-logging-format - This linting status code is regarding passing an exception object directly into log.exception() --- datagateway_api/common/helpers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datagateway_api/common/helpers.py b/datagateway_api/common/helpers.py index 7c6a3a3f..b7210dce 100644 --- a/datagateway_api/common/helpers.py +++ b/datagateway_api/common/helpers.py @@ -31,16 +31,16 @@ def wrapper_gets_records(*args, **kwargs): try: return method(*args, **kwargs) except ApiError as e: - log.exception(e) + log.exception(*e.args) raise e except ValueError as e: - log.exception(e) + log.exception(*e.args) raise BadRequestError() except TypeError as e: - log.exception(e) + log.exception(*e.args) raise BadRequestError() except IntegrityError as e: - log.exception(e) + log.exception(*e.args) raise BadRequestError() return wrapper_gets_records From a6941295d6e9ef1060a734d03b1b54e21dc98c41 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 5 Nov 2020 19:45:52 +0000 Subject: [PATCH 13/20] #184: Make certain function less complex - I've had to increase the max complexity in .flake8 because there's not much you can do with a couple of the functions. Still made some improvements though! --- .flake8 | 2 +- datagateway_api/common/icat/filters.py | 33 +++++++++++++++++++------- datagateway_api/common/icat/helpers.py | 7 +++--- datagateway_api/common/icat/query.py | 24 +++++++------------ 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/.flake8 b/.flake8 index 0a062432..8fef7362 100644 --- a/.flake8 +++ b/.flake8 @@ -2,7 +2,7 @@ [flake8] select = A,B,B9,BLK,C,E,F,I,N,S,W ignore = E203,W503,E501 -max-complexity = 10 +max-complexity = 14 max-line-length = 80 application-import-names = datagateway_api,test,util import-order-style = google diff --git a/datagateway_api/common/icat/filters.py b/datagateway_api/common/icat/filters.py index a83c978e..01bf470c 100644 --- a/datagateway_api/common/icat/filters.py +++ b/datagateway_api/common/icat/filters.py @@ -21,6 +21,26 @@ def __init__(self, field, value, operation): self.field = field def apply_filter(self, query): + try: + log.info("Adding ICAT where filter (for %s) to query", self.value) + query.addConditions(self.create_filter()) + except ValueError: + raise FilterError( + "Something went wrong when adding WHERE filter to ICAT query", + ) + + def create_filter(self): + """ + Create what's needed for a where filter dependent on the operation provided + + The logic in this function has been abstracted away from `apply_filter()` to + make that function used for its named purpose, and no more. + + :return: A where filter (of type :class:`dict`) ready to be applied to a Query + object + :raises FilterError: If the operation provided to the instance isn't valid + """ + log.info("Creating condition for ICAT where filter") if self.operation == "eq": where_filter = self.create_condition(self.field, "=", self.value) @@ -46,13 +66,8 @@ def apply_filter(self, query): raise FilterError(f"Bad operation given to where filter: {self.operation}") log.debug("ICAT Where Filter: %s", where_filter) - try: - log.info("Adding ICAT where filter (for %s) to query", self.value) - query.addConditions(where_filter) - except ValueError: - raise FilterError( - "Something went wrong when adding WHERE filter to ICAT query", - ) + + return where_filter @staticmethod def create_condition(attribute_name, operator, value): @@ -213,8 +228,8 @@ def _extract_filter_fields(self, field): for inner_key, inner_value in value.items(): if not isinstance(inner_key, str): raise FilterError( - "Include Filter: Dictionary key should only be a string" - ", not any other type", + "Include Filter: Dictionary key should only be a" + " string, not any other type", ) # Will end up as: key.inner_key.inner_value diff --git a/datagateway_api/common/icat/helpers.py b/datagateway_api/common/icat/helpers.py index 8bb090b3..71835aa4 100644 --- a/datagateway_api/common/icat/helpers.py +++ b/datagateway_api/common/icat/helpers.py @@ -431,9 +431,10 @@ def create_entities(client, entity_type, data): try: entity_info = new_entity.getAttrInfo(client, attribute_name) if entity_info.relType.lower() == "attribute": - if isinstance(value, str): - if DateHandler.is_str_a_date(value): - value = DateHandler.str_to_datetime_object(value) + # Short circuiting ensures is_str_date() will only be executed if + # value is a string + if isinstance(value, str) and DateHandler.is_str_a_date(value): + value = DateHandler.str_to_datetime_object(value) setattr(new_entity, attribute_name, value) else: diff --git a/datagateway_api/common/icat/query.py b/datagateway_api/common/icat/query.py index 27d6dc98..fe46c1fe 100644 --- a/datagateway_api/common/icat/query.py +++ b/datagateway_api/common/icat/query.py @@ -176,6 +176,14 @@ def entity_to_dict(self, entity, includes, distinct_fields=None): include_set = (entity.InstRel | entity.InstMRel) & set(includes) for key in entity.InstAttr | entity.MetaAttr | include_set: if key in includes: + # Make a copy of distinct_fields when calling this function again later + if distinct_fields is not None: + distinct_fields_copy = self.prepare_distinct_fields( + key, distinct_fields, + ) + else: + distinct_fields_copy = None + target = getattr(entity, key) # Copy and remove don't return values so must be done separately includes_copy = includes.copy() @@ -187,31 +195,17 @@ def entity_to_dict(self, entity, includes, distinct_fields=None): " cause an issue further on in the request", ) if isinstance(target, Entity): - if distinct_fields is not None: - distinct_fields_copy = self.prepare_distinct_fields( - key, distinct_fields, - ) - else: - distinct_fields_copy = None - d[key] = self.entity_to_dict( target, includes_copy, distinct_fields_copy, ) - # Related fields with one-many relationships are stored as EntityLists elif isinstance(target, EntityList): d[key] = [] for e in target: - if distinct_fields is not None: - distinct_fields_copy = self.prepare_distinct_fields( - key, distinct_fields, - ) - else: - distinct_fields_copy = None - d[key].append( self.entity_to_dict(e, includes_copy, distinct_fields_copy), ) + # Add actual piece of data to the dictionary else: entity_data = None From 1596f73b73187d131c18cb36d0f366be65818c9b Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 5 Nov 2020 20:07:06 +0000 Subject: [PATCH 14/20] #183: Allow openapi.yaml generation to be disabled - This will mean this configurable parameter can be disabled when running the API in production, thereby avoiding any issues with read-only directories --- datagateway_api/src/main.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/datagateway_api/src/main.py b/datagateway_api/src/main.py index da8aba1d..ff922206 100644 --- a/datagateway_api/src/main.py +++ b/datagateway_api/src/main.py @@ -107,16 +107,18 @@ def handle_error(e): ) spec.path(resource=InstrumentsFacilityCyclesInvestigationsCount, api=api) -# Reorder paths (e.g. get, patch, post) so openapi.yaml only changes when there's a -# change to the Swagger docs, rather than changing on each startup -log.debug("Reordering OpenAPI docs to alphabetical order") -for entity_data in spec._paths.values(): - for endpoint_name in sorted(entity_data.keys()): - entity_data.move_to_end(endpoint_name) - -openapi_spec_path = Path(__file__).parent / "swagger/openapi.yaml" -with open(openapi_spec_path, "w") as f: - f.write(spec.to_yaml()) + +if config.is_generate_swagger(): + # Reorder paths (e.g. get, patch, post) so openapi.yaml only changes when there's a + # change to the Swagger docs, rather than changing on each startup + log.debug("Reordering OpenAPI docs to alphabetical order") + for entity_data in spec._paths.values(): + for endpoint_name in sorted(entity_data.keys()): + entity_data.move_to_end(endpoint_name) + + openapi_spec_path = Path(__file__).parent / "swagger/openapi.yaml" + with open(openapi_spec_path, "w") as f: + f.write(spec.to_yaml()) @app.route("/openapi.json") From 82aa40df10ee47ca4bdc56c5c7e214019632196a Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 6 Nov 2020 09:11:52 +0000 Subject: [PATCH 15/20] #184: Update dependencies with security issues found by safety --- poetry.lock | 36 +++++++++++++++++------------------- pyproject.toml | 4 ++-- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/poetry.lock b/poetry.lock index 26b07beb..2ba5d2c3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -291,7 +291,7 @@ dotenv = ["python-dotenv"] [[package]] name = "flask-cors" -version = "3.0.8" +version = "3.0.9" description = "A Flask extension adding a decorator for CORS support" category = "main" optional = false @@ -531,11 +531,11 @@ python-versions = "*" [[package]] name = "pyyaml" -version = "5.1.2" +version = "5.3.1" description = "YAML parser and emitter for Python" category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "regex" @@ -697,7 +697,7 @@ testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake [metadata] lock-version = "1.1" python-versions = "^3.6" -content-hash = "bfbe333aab10d4b666d71e1e0845c58f0b74456f93a11be47b0a16d94b3a791d" +content-hash = "7828680e4b89e2c44cc4de9df25e8c1efd033d4ea9809ab0c5937d1861f1bb86" [metadata.files] aniso8601 = [ @@ -794,8 +794,8 @@ flask = [ {file = "Flask-1.1.2.tar.gz", hash = "sha256:4efa1ae2d7c9865af48986de8aeb8504bf32c7f3d6fdc9353d34b21f4b127060"}, ] flask-cors = [ - {file = "Flask-Cors-3.0.8.tar.gz", hash = "sha256:72170423eb4612f0847318afff8c247b38bd516b7737adfc10d1c2cdbb382d16"}, - {file = "Flask_Cors-3.0.8-py2.py3-none-any.whl", hash = "sha256:f4d97201660e6bbcff2d89d082b5b6d31abee04b1b3003ee073a6fd25ad1d69a"}, + {file = "Flask-Cors-3.0.9.tar.gz", hash = "sha256:6bcfc100288c5d1bcb1dbb854babd59beee622ffd321e444b05f24d6d58466b8"}, + {file = "Flask_Cors-3.0.9-py2.py3-none-any.whl", hash = "sha256:cee4480aaee421ed029eaa788f4049e3e26d15b5affb6a880dade6bafad38324"}, ] flask-restful = [ {file = "Flask-RESTful-0.3.7.tar.gz", hash = "sha256:f8240ec12349afe8df1db168ea7c336c4e5b0271a36982bff7394f93275f2ca9"}, @@ -915,19 +915,17 @@ pytz = [ {file = "pytz-2020.1.tar.gz", hash = "sha256:c35965d010ce31b23eeb663ed3cc8c906275d6be1a34393a1d73a41febf4a048"}, ] pyyaml = [ - {file = "PyYAML-5.1.2-cp27-cp27m-win32.whl", hash = "sha256:5124373960b0b3f4aa7df1707e63e9f109b5263eca5976c66e08b1c552d4eaf8"}, - {file = "PyYAML-5.1.2-cp27-cp27m-win_amd64.whl", hash = "sha256:f81025eddd0327c7d4cfe9b62cf33190e1e736cc6e97502b3ec425f574b3e7a8"}, - {file = "PyYAML-5.1.2-cp34-cp34m-win32.whl", hash = "sha256:0113bc0ec2ad727182326b61326afa3d1d8280ae1122493553fd6f4397f33df9"}, - {file = "PyYAML-5.1.2-cp34-cp34m-win_amd64.whl", hash = "sha256:5ca4f10adbddae56d824b2c09668e91219bb178a1eee1faa56af6f99f11bf696"}, - {file = "PyYAML-5.1.2-cp35-cp35m-win32.whl", hash = "sha256:bf47c0607522fdbca6c9e817a6e81b08491de50f3766a7a0e6a5be7905961b41"}, - {file = "PyYAML-5.1.2-cp35-cp35m-win_amd64.whl", hash = "sha256:87ae4c829bb25b9fe99cf71fbb2140c448f534e24c998cc60f39ae4f94396a73"}, - {file = "PyYAML-5.1.2-cp36-cp36m-win32.whl", hash = "sha256:9de9919becc9cc2ff03637872a440195ac4241c80536632fffeb6a1e25a74299"}, - {file = "PyYAML-5.1.2-cp36-cp36m-win_amd64.whl", hash = "sha256:a5a85b10e450c66b49f98846937e8cfca1db3127a9d5d1e31ca45c3d0bef4c5b"}, - {file = "PyYAML-5.1.2-cp37-cp37m-win32.whl", hash = "sha256:b0997827b4f6a7c286c01c5f60384d218dca4ed7d9efa945c3e1aa623d5709ae"}, - {file = "PyYAML-5.1.2-cp37-cp37m-win_amd64.whl", hash = "sha256:7907be34ffa3c5a32b60b95f4d95ea25361c951383a894fec31be7252b2b6f34"}, - {file = "PyYAML-5.1.2-cp38-cp38m-win32.whl", hash = "sha256:7ec9b2a4ed5cad025c2278a1e6a19c011c80a3caaac804fd2d329e9cc2c287c9"}, - {file = "PyYAML-5.1.2-cp38-cp38m-win_amd64.whl", hash = "sha256:b631ef96d3222e62861443cc89d6563ba3eeb816eeb96b2629345ab795e53681"}, - {file = "PyYAML-5.1.2.tar.gz", hash = "sha256:01adf0b6c6f61bd11af6e10ca52b7d4057dd0be0343eb9283c878cf3af56aee4"}, + {file = "PyYAML-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f"}, + {file = "PyYAML-5.3.1-cp27-cp27m-win_amd64.whl", hash = "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76"}, + {file = "PyYAML-5.3.1-cp35-cp35m-win32.whl", hash = "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2"}, + {file = "PyYAML-5.3.1-cp35-cp35m-win_amd64.whl", hash = "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c"}, + {file = "PyYAML-5.3.1-cp36-cp36m-win32.whl", hash = "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2"}, + {file = "PyYAML-5.3.1-cp36-cp36m-win_amd64.whl", hash = "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648"}, + {file = "PyYAML-5.3.1-cp37-cp37m-win32.whl", hash = "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a"}, + {file = "PyYAML-5.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf"}, + {file = "PyYAML-5.3.1-cp38-cp38-win32.whl", hash = "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97"}, + {file = "PyYAML-5.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee"}, + {file = "PyYAML-5.3.1.tar.gz", hash = "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"}, ] regex = [ {file = "regex-2020.10.23-cp27-cp27m-win32.whl", hash = "sha256:781906e45ef1d10a0ed9ec8ab83a09b5e0d742de70e627b20d61ccb1b1d3964d"}, diff --git a/pyproject.toml b/pyproject.toml index c06de98f..a9ae4287 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,10 +13,10 @@ python = "^3.6" Flask-RESTful = "0.3.7" SQLAlchemy = "1.3.8" PyMySQL = "0.9.3" -Flask-Cors = "3.0.8" +Flask-Cors = "3.0.9" apispec = "3.3.0" flask-swagger-ui = "3.25.0" -PyYAML = "5.1.2" +PyYAML = "5.3.1" python-icat = "0.17.0" suds-community = "^0.8.4" From 7723d69f25b53725871e22608478108ba2bee5e7 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 5 Nov 2020 20:17:52 +0000 Subject: [PATCH 16/20] #182: Add log location configuration option --- config.json.example | 1 + datagateway_api/common/config.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/config.json.example b/config.json.example index f39c836e..c977e9b0 100644 --- a/config.json.example +++ b/config.json.example @@ -4,6 +4,7 @@ "ICAT_URL": "https://localhost.localdomain:8181", "icat_check_cert": false, "log_level": "WARN", + "log_location": "/home/user1/datagateway-api/logs.log", "debug_mode": false, "generate_swagger": false, "host": "127.0.0.1", diff --git a/datagateway_api/common/config.py b/datagateway_api/common/config.py index 0425ef98..298fcadf 100644 --- a/datagateway_api/common/config.py +++ b/datagateway_api/common/config.py @@ -46,6 +46,12 @@ def get_log_level(self): except KeyError: sys.exit("Missing config value, log_level") + def get_log_location(self): + try: + return self.config["log_location"] + except KeyError: + sys.exit("Missing config value, log_location") + def is_debug_mode(self): try: return self.config["debug_mode"] From 45b5896be4c0201b1704a719c6e59a4706781b80 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 5 Nov 2020 20:24:31 +0000 Subject: [PATCH 17/20] #182: Allow log file to be configured - In production, this will be used to store the API's logs in /var/log/ - Also remove an unused variable that I noticed --- datagateway_api/common/logger_setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/datagateway_api/common/logger_setup.py b/datagateway_api/common/logger_setup.py index 5bf13396..3c727995 100644 --- a/datagateway_api/common/logger_setup.py +++ b/datagateway_api/common/logger_setup.py @@ -3,8 +3,7 @@ from datagateway_api.common.config import config -log_level = "DEBUG" -LOG_FILE_NAME = Path(__file__).parent.parent / "logs.log" +LOG_FILE_NAME = Path(config.get_log_location()) logger_config = { "version": 1, "formatters": { From b752c854b16d1b4774ab47468175655918eefd9b Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Mon, 9 Nov 2020 13:42:00 +0000 Subject: [PATCH 18/20] #184: Fix previous changes to log.exception() lines --- datagateway_api/common/helpers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datagateway_api/common/helpers.py b/datagateway_api/common/helpers.py index b7210dce..9115b09f 100644 --- a/datagateway_api/common/helpers.py +++ b/datagateway_api/common/helpers.py @@ -31,16 +31,16 @@ def wrapper_gets_records(*args, **kwargs): try: return method(*args, **kwargs) except ApiError as e: - log.exception(*e.args) + log.exception(msg=e.args) raise e except ValueError as e: - log.exception(*e.args) + log.exception(msg=e.args) raise BadRequestError() except TypeError as e: - log.exception(*e.args) + log.exception(e.args) raise BadRequestError() except IntegrityError as e: - log.exception(*e.args) + log.exception(e.args) raise BadRequestError() return wrapper_gets_records From b01eaf503210d84cfe63fd3077d8d7cae2ad910f Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 8 Dec 2020 15:18:19 +0000 Subject: [PATCH 19/20] #184: Fix linting issues as brought up in PR - Most likely caused when I merged other branches after I created the PR --- datagateway_api/src/main.py | 1 - datagateway_api/src/swagger/initialise_spec.py | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/datagateway_api/src/main.py b/datagateway_api/src/main.py index d7d2950b..d971d724 100644 --- a/datagateway_api/src/main.py +++ b/datagateway_api/src/main.py @@ -9,7 +9,6 @@ from flask_swagger_ui import get_swaggerui_blueprint from datagateway_api.common.config import config -from datagateway_api.common.exceptions import ApiError from datagateway_api.common.logger_setup import setup_logger from datagateway_api.src.resources.entities.entity_endpoint import ( get_count_endpoint, diff --git a/datagateway_api/src/swagger/initialise_spec.py b/datagateway_api/src/swagger/initialise_spec.py index 5ad18d80..79350077 100644 --- a/datagateway_api/src/swagger/initialise_spec.py +++ b/datagateway_api/src/swagger/initialise_spec.py @@ -64,8 +64,8 @@ def initialise_spec(spec): {"type": "number"}, {"type": "integer"}, {"type": "boolean"}, - ] - } + ], + }, }, }, { @@ -105,8 +105,8 @@ def initialise_spec(spec): "oneOf": [ {"type": "number"}, {"type": "integer"}, - ] - } + ], + }, }, }, { @@ -117,8 +117,8 @@ def initialise_spec(spec): "oneOf": [ {"type": "number"}, {"type": "integer"}, - ] - } + ], + }, }, }, { From fe88196f2f7ed7291bbce6fa8108836345bbe65b Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 8 Dec 2020 15:22:31 +0000 Subject: [PATCH 20/20] #184: Make response descriptions have consistent syntax - The commit also includes a rebuilt openapi.yaml --- .../src/resources/non_entities/sessions_endpoints.py | 4 ++-- datagateway_api/src/swagger/openapi.yaml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/datagateway_api/src/resources/non_entities/sessions_endpoints.py b/datagateway_api/src/resources/non_entities/sessions_endpoints.py index 13f0a2e6..348d719c 100644 --- a/datagateway_api/src/resources/non_entities/sessions_endpoints.py +++ b/datagateway_api/src/resources/non_entities/sessions_endpoints.py @@ -50,9 +50,9 @@ def post(self): description: Session ID example: xxxxxx-yyyyyyy-zzzzzz 400: - description: Bad request. User credentials not provided in request body + description: Bad request - User credentials not provided in request body 403: - description: Forbidden. User credentials were invalid + description: Forbidden - User credentials were invalid """ if not ( request.data and "username" in request.json and "password" in request.json diff --git a/datagateway_api/src/swagger/openapi.yaml b/datagateway_api/src/swagger/openapi.yaml index f52c1b93..d04bc6c8 100644 --- a/datagateway_api/src/swagger/openapi.yaml +++ b/datagateway_api/src/swagger/openapi.yaml @@ -87,9 +87,9 @@ components: schema: type: integer WHERE_FILTER: - description: Apply where filters to the query. The possible operators are like, - gte, lte, in and eq. Please modify the examples before executing a request - if you are having issues with the example values. + description: 'Apply where filters to the query. The possible operators are: + ne, like, lt, lte, gt, gte, in and eq. Please modify the examples before executing + a request if you are having issues with the example values.' examples: eq: value: @@ -10817,9 +10817,9 @@ paths: type: object description: Success - returns a session ID '400': - description: Bad request. User credentials not provided in request body + description: Bad request - User credentials not provided in request body '403': - description: Forbidden. User credentials were invalid + description: Forbidden - User credentials were invalid security: [] summary: Login tags: