-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DataGateway and PaNOSC Modes #256
Comments
no prefix (blank string) is all good as long as length of array is 1 Check that no prefix strings match across the list
Could flip them round to avoid collisions and have multiple instances of the same API? Could require further reworking of config if you wanted to point two DG API at two different ICAT instances. |
My current suggested config format: {
"datagateway_api": {
"extension": "/datagateway-api",
"backend": "python_icat",
"client_cache_size": 10,
"client_pool_init_size": 3,
"client_pool_max_size": 20,
"db_url": "mysql+pymysql://icatdbuser:icatdbuserpw@localhost:3306/icatdb",
"icat_url": "https://localhost.localdomain:8181",
"icat_check_cert": false
},
"search_api": {
"extension": "/search-api",
"icat_url": "https://localhost.localdomain:8181",
"icat_check_cert": false,
"client_pool_init_size": 3
"client_pool_max_size": 20
},
"flask_reloader": false,
"log_level": "DEBUG",
"log_location": "path/to/datagateway-api/logs.log",
"debug_mode": true,
"generate_swagger": true,
"host": "127.0.0.1",
"port": "5000",
"test_user_credentials": {"username": "root", "password": "pw"},
"test_mechanism": "simple"
} This separates specific config for DataGateway API and the search API (in the relevant objects) and keeps the general config (e.g. Having DataGateway API and search API config in separate objects means having one API or both will be easy to implement. If neither are present in the config, then the only endpoint that should be present is the openapi one. The behaviour where optional config isn't needed (i.e. no need for client config if using DB backend for DG API) should remain. |
- This format of config has not been implemented at time of commit
- Since this repository will support DataGateway API and the Search API, there needs to be some changes in directory structure to split the different files up. Essentially this means adding `datagateway_api/` and `search_api/` in `common/` and `src/resources/` - The imports will be fixed in a future commit
- This format of config has not been implemented at time of commit
- Since this repository will support DataGateway API and the Search API, there needs to be some changes in directory structure to split the different files up. Essentially this means adding `datagateway_api/` and `search_api/` in `common/` and `src/resources/` - The imports will be fixed in a future commit
- Reverting back so the tests pass until I re-implement the config
- Since this repository will support DataGateway API and the Search API, there needs to be some changes in directory structure to split the different files up. Essentially this means adding `datagateway_api/` and `search_api/` in `common/` and `src/resources/` - The imports will be fixed in a future commit
- Reverting back so the tests pass until I re-implement the config
The test that was creating a temporary file was failing (even without the config changes) due to Windows file permission issue. Though a unit test should run in isolation and should not touch the file system at all therefore I instead mocked the `builtins.open` to fake `with open`.
BREAKING CHANGE: extend configuration to allow for different API modes
Description:
As DataGateway API and our implementation of the PaNOSC Search API will be developed in this repo, there needs to be a way of dealing with this. For the first release, I think it'll be best to add a configuration option for
datagateway
andpanosc
modes.The
datagateway
mode will expose the current endpoints and thepanosc
mode will (upon implementing) expose the 11 endpoints for the search API. This config option will have to be made mandatory and can be done inconfig.py
.To do this, I need to add a config option (
mode
?) and use that option inmain.py
to branch off to the existing calls toapi_start_utils.py
and the new panosc function calls to setup the Flask app for that mode. To avoidapi_start_utils.py
from getting too long and confused, I might create asearch_api_start_utils.py
to have the endpoint definition and general app infrastructure setup there. At which point, it would probably make sense to rename the existing file todatagateway_api_start_utils.py
.In the future, we should look at supporting both at the same time (i.e. where a single instance can be run for both DataGateway API and PaNOSC Search API) by adding prefixes (perhaps something like
/datagateway/ENDPOINT
and/panosc/ENDPOINT
) but that should come later.Acceptance criteria:
mode
config option toconfig.json.example
The text was updated successfully, but these errors were encountered: