Skip to content

Commit

Permalink
Add config section for reader performance query option
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Sep 18, 2024
1 parent 43f50e4 commit 720dbf4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datagateway_api/config.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ datagateway_api:
db_url: "mysql+pymysql://icatdbuser:icatdbuserpw@localhost:3306/icatdb"
icat_url: "https://localhost:8181"
icat_check_cert: false
use_reader_for_performance:
enabled: false
reader_mechanism: simple
reader_username: reader
reader_password: readerpw
search_api:
extension: "/search-api"
icat_url: "https://localhost:8181"
Expand Down
8 changes: 8 additions & 0 deletions datagateway_api/src/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ def validate_extension(extension):
return extension


class UseReaderForPerformance(BaseModel):
enabled: StrictBool
reader_mechanism: StrictStr
reader_username: StrictStr
reader_password: StrictStr


class DataGatewayAPI(BaseModel):
"""
Configuration model class that implements pydantic's BaseModel class to allow for
Expand All @@ -54,6 +61,7 @@ class DataGatewayAPI(BaseModel):
extension: StrictStr
icat_check_cert: Optional[StrictBool]
icat_url: Optional[StrictStr]
use_reader_for_performance: Optional[UseReaderForPerformance]

_validate_extension = validator("extension", allow_reuse=True)(validate_extension)

Expand Down

0 comments on commit 720dbf4

Please sign in to comment.