ExposuresProvider / cam-kp-api

Web service API for the NCATS Data Translator CAM-KP
MIT License
3 stars 2 forks source link

Add alternate server names #511

Open gaurav opened 2 years ago

gaurav commented 2 years ago

By default, the CAM-KP-API OpenAPI page (e.g. https://cam-kp-api.renci.org/1.2.0/docs/index.html?url=docs.yaml) only allows you to query the server serving the OpenAPI page. It might be convenient to allow users to optionally query any of our production or testing servers. We can do this by marking each one as e.g. production, test, development, etc. in addition to adding the current server.

See example from MolePro: https://github.com/NCATS-Tangerine/translator-api-registry/blob/06c93a474a7abbe98370cb0657b191a474680f4a/molecular_data_provider/MolePro-TRAPI-1.2.yaml#L38-L49

See discussion of this issue: https://github.com/NCATSTranslator/TranslatorArchitecture/issues/71

gaurav commented 2 years ago

I've just realized that we have a further regression in this issue: the CAM-KP dev server OpenAPI interface (https://cam-kp-api-dev.renci.org/1.2.0/docs/index.html?url=docs.yaml) now points to the CAM-KP prod server. As far as I can tell, this is because CAM-KP v0.1.1 is currently ignoring the LOCATION variable. This might be because those are currently set in build.sbt by the JAVA_OPTS environment variable, which might be overruling the environmental variables passed in via Docker: https://github.com/ExposuresProvider/cam-kp-api/blob/b12f9269207eb7e063d630f100ec6c1e900e055b/build.sbt#L95-L100

gaurav commented 2 years ago

I've just realized that we have a further regression in this issue [...]

This regression has now been fixed in PR https://github.com/ExposuresProvider/cam-kp-api/pull/529. The bigger question of whether we should allow CAM-KP-API instances to query other prod and dev instances remains, but is a lower priority now.

gaurav commented 1 year ago

Putting all the server information in one place would also allow us to have a single SmartAPI registration instead of four (one each for CAM-KP RENCI, ITRB CI, ITRB Test and ITRB Prod). Robokop KP, Aragorn and some other providers still use this approach, but the majority seem to prefer a single SmartAPI registration now.