Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions monitoring/uss_qualifier/resources/interuss/query_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class QueryBehaviorSpecification(ImplicitDict):
add_request_id: Optional[bool]
"""Whether to automatically add a `request_id` field to any request with a JSON body and no pre-existing `request_id` field"""

fake_netlocs: Optional[list[str]]
"""Network locations well-known to be fake and for which a request should fail immediately without being attempted."""


class QueryBehaviorResource(Resource[QueryBehaviorSpecification]):
"""When declared, this resource adjusts the settings for all queries made by uss_qualifier.
Expand Down Expand Up @@ -81,3 +84,9 @@ def __init__(
logger.info(
f"QueryBehaviorResource: Fetch query set to {'' if settings.add_request_id else 'not '} add `request_id`"
)

if "fake_netlocs" in specification and specification.fake_netlocs is not None:
settings.fake_netlocs = tuple(specification.fake_netlocs)
logger.info(
f"QueryBehaviorResource: Fake network locations set to {settings.fake_netlocs}"
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
"null"
]
},
"fake_netlocs": {
"description": "Network locations well-known to be fake and for which a request should fail immediately without being attempted.",
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"read_timeout_seconds": {
"description": "Number of seconds to allow for a request to complete after establishing a connection. Use 0 for no timeout.",
"type": [
Expand Down
Loading