Skip to content

Commit 2f03c17

Browse files
author
Robin VAN DE MERGHEL
committed
fix: Some small fixes (endpoint name, client)
1 parent 3e82773 commit 2f03c17

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

diracx-client/src/diracx/client/_generated/operations/_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ def build_pilots_search_logs_request(*, page: int = 1, per_page: int = 100, **kw
782782
accept = _headers.pop("Accept", "application/json")
783783

784784
# Construct URL
785-
_url = "/api/pilots/management/search/logs"
785+
_url = "/api/pilots/search/logs"
786786

787787
# Construct parameters
788788
if page is not None:

diracx-routers/src/diracx/routers/pilots/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ async def search(
224224
}
225225

226226

227-
@router.post("/management/search/logs", responses=EXAMPLE_RESPONSES_LOGS)
227+
@router.post("/search/logs", responses=EXAMPLE_RESPONSES_LOGS)
228228
async def search_logs(
229229
pilot_logs_db: PilotLogsDB,
230230
pilot_db: PilotAgentsDB,

diracx-routers/tests/pilots/test_pilot_logging.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ async def _search(
103103

104104
params = {"per_page": per_page, "page": page}
105105

106-
r = normal_test_client.post(
107-
"/api/pilots/management/search/logs", json=body, params=params
108-
)
106+
r = normal_test_client.post("/api/pilots/search/logs", json=body, params=params)
109107

110108
if r.status_code == 400:
111109
# If we have a status_code 400, that means that the query failed
@@ -173,7 +171,7 @@ async def test_single_send_and_retrieve_logs(normal_test_client: TestClient):
173171
data = {
174172
"search": [{"parameter": "PilotStamp", "operator": "eq", "value": "stamp_1"}]
175173
}
176-
r = normal_test_client.post("/api/pilots/management/search/logs", json=data)
174+
r = normal_test_client.post("/api/pilots/search/logs", json=data)
177175
assert r.status_code == 200, r.text
178176
assert [hit["Message"] for hit in r.json()] == msg.split("\n")
179177

@@ -184,7 +182,7 @@ async def test_query_invalid_stamp(create_logs, normal_test_client):
184182
{"parameter": "PilotStamp", "operator": "eq", "value": "not_a_stamp"}
185183
]
186184
}
187-
r = normal_test_client.post("/api/pilots/management/search/logs", json=data)
185+
r = normal_test_client.post("/api/pilots/search/logs", json=data)
188186
assert r.status_code == 200, r.text
189187
assert len(r.json()) == 0
190188

@@ -194,7 +192,7 @@ async def test_query_each_length(create_logs, normal_test_client):
194192
data = {
195193
"search": [{"parameter": "PilotStamp", "operator": "eq", "value": stamp}]
196194
}
197-
r = normal_test_client.post("/api/pilots/management/search/logs", json=data)
195+
r = normal_test_client.post("/api/pilots/search/logs", json=data)
198196
assert r.status_code == 200, r.text
199197
assert len(r.json()) == 1
200198

@@ -205,7 +203,7 @@ async def test_query_each_field(create_logs, normal_test_client):
205203
"search": [{"parameter": "PilotStamp", "operator": "eq", "value": stamp}],
206204
"sort": [{"parameter": "PilotStamp", "direction": "asc"}],
207205
}
208-
r = normal_test_client.post("/api/pilots/management/search/logs", json=data)
206+
r = normal_test_client.post("/api/pilots/search/logs", json=data)
209207
assert r.status_code == 200, r.text
210208
assert len(r.json()) == 1
211209

extensions/gubbins/gubbins-client/src/gubbins/client/_generated/operations/_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ def build_pilots_search_logs_request(*, page: int = 1, per_page: int = 100, **kw
831831
accept = _headers.pop("Accept", "application/json")
832832

833833
# Construct URL
834-
_url = "/api/pilots/management/search/logs"
834+
_url = "/api/pilots/search/logs"
835835

836836
# Construct parameters
837837
if page is not None:

0 commit comments

Comments
 (0)