Skip to content

Commit 5760830

Browse files
fix: Generating the client
1 parent 43cfccc commit 5760830

File tree

6 files changed

+75
-43
lines changed

6 files changed

+75
-43
lines changed

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

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,6 +2559,8 @@ async def delete_pilots(self, *, pilot_stamps: List[str], **kwargs: Any) -> None
25592559
25602560
Endpoint to delete a pilot.
25612561
2562+
If at least one pilot is not found, it WILL rollback.
2563+
25622564
:keyword pilot_stamps: Stamps of the pilots we want to delete. Required.
25632565
:paramtype pilot_stamps: list[str]
25642566
:return: None
@@ -2609,7 +2611,7 @@ async def clear_pilots(
26092611
) -> None:
26102612
"""Clear Pilots.
26112613
2612-
Delete all pilots that lived more than age_in_days.
2614+
Endpoint for DIRAC to delete all pilots that lived more than age_in_days.
26132615
26142616
:keyword age_in_days: The number of days that define the maximum age of pilots to be
26152617
deleted.Pilots older than this age will be considered for deletion. Required.
@@ -2671,7 +2673,7 @@ async def create_pilot_secrets(
26712673
) -> List[_models.PilotSecretsInfo]:
26722674
"""Create Pilot Secrets.
26732675
2674-
Create Pilot Secrets.
2676+
Endpoint to create secrets.
26752677
26762678
:param body: Required.
26772679
:type body: ~_generated.models.BodyPilotsCreatePilotSecrets
@@ -2689,7 +2691,7 @@ async def create_pilot_secrets(
26892691
) -> List[_models.PilotSecretsInfo]:
26902692
"""Create Pilot Secrets.
26912693
2692-
Create Pilot Secrets.
2694+
Endpoint to create secrets.
26932695
26942696
:param body: Required.
26952697
:type body: IO[bytes]
@@ -2709,7 +2711,7 @@ async def create_pilot_secrets(
27092711
) -> List[_models.PilotSecretsInfo]:
27102712
"""Create Pilot Secrets.
27112713
2712-
Create Pilot Secrets.
2714+
Endpoint to create secrets.
27132715
27142716
:param body: Is either a BodyPilotsCreatePilotSecrets type or a IO[bytes] type. Required.
27152717
:type body: ~_generated.models.BodyPilotsCreatePilotSecrets or IO[bytes]
@@ -2894,6 +2896,8 @@ async def update_pilot_fields(
28942896
28952897
Modify a field of a pilot.
28962898
2899+
Note: Only the fields in PilotFieldsMapping are mutable, except for the PilotStamp.
2900+
28972901
:param body: Required.
28982902
:type body: ~_generated.models.BodyPilotsUpdatePilotFields
28992903
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
@@ -2912,6 +2916,8 @@ async def update_pilot_fields(
29122916
29132917
Modify a field of a pilot.
29142918
2919+
Note: Only the fields in PilotFieldsMapping are mutable, except for the PilotStamp.
2920+
29152921
:param body: Required.
29162922
:type body: IO[bytes]
29172923
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
@@ -2930,6 +2936,8 @@ async def update_pilot_fields(
29302936
29312937
Modify a field of a pilot.
29322938
2939+
Note: Only the fields in PilotFieldsMapping are mutable, except for the PilotStamp.
2940+
29332941
:param body: Is either a BodyPilotsUpdatePilotFields type or a IO[bytes] type. Required.
29342942
:type body: ~_generated.models.BodyPilotsUpdatePilotFields or IO[bytes]
29352943
:return: None
@@ -2997,7 +3005,7 @@ async def associate_pilot_with_jobs(
29973005
) -> None:
29983006
"""Associate Pilot With Jobs.
29993007
3000-
Associate Pilot With Jobs.
3008+
Endpoint only for DIRAC services, to associate a pilot with a job.
30013009
30023010
:param body: Required.
30033011
:type body: ~_generated.models.BodyPilotsAssociatePilotWithJobs
@@ -3015,7 +3023,7 @@ async def associate_pilot_with_jobs(
30153023
) -> None:
30163024
"""Associate Pilot With Jobs.
30173025
3018-
Associate Pilot With Jobs.
3026+
Endpoint only for DIRAC services, to associate a pilot with a job.
30193027
30203028
:param body: Required.
30213029
:type body: IO[bytes]
@@ -3035,7 +3043,7 @@ async def associate_pilot_with_jobs(
30353043
) -> None:
30363044
"""Associate Pilot With Jobs.
30373045
3038-
Associate Pilot With Jobs.
3046+
Endpoint only for DIRAC services, to associate a pilot with a job.
30393047
30403048
:param body: Is either a BodyPilotsAssociatePilotWithJobs type or a IO[bytes] type. Required.
30413049
:type body: ~_generated.models.BodyPilotsAssociatePilotWithJobs or IO[bytes]
@@ -3249,7 +3257,7 @@ async def pilot_login(
32493257
) -> _models.TokenResponse:
32503258
"""Pilot Login.
32513259
3252-
Endpoint without policy, the pilot uses only its secret.
3260+
This endpoint is used by the pilot to exchange a secret for a token.
32533261
32543262
:param body: Required.
32553263
:type body: ~_generated.models.BodyPilotsPilotLogin
@@ -3267,7 +3275,7 @@ async def pilot_login(
32673275
) -> _models.TokenResponse:
32683276
"""Pilot Login.
32693277
3270-
Endpoint without policy, the pilot uses only its secret.
3278+
This endpoint is used by the pilot to exchange a secret for a token.
32713279
32723280
:param body: Required.
32733281
:type body: IO[bytes]
@@ -3285,7 +3293,7 @@ async def pilot_login(
32853293
) -> _models.TokenResponse:
32863294
"""Pilot Login.
32873295
3288-
Endpoint without policy, the pilot uses only its secret.
3296+
This endpoint is used by the pilot to exchange a secret for a token.
32893297
32903298
:param body: Is either a BodyPilotsPilotLogin type or a IO[bytes] type. Required.
32913299
:type body: ~_generated.models.BodyPilotsPilotLogin or IO[bytes]

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

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3372,6 +3372,8 @@ def delete_pilots( # pylint: disable=inconsistent-return-statements
33723372
33733373
Endpoint to delete a pilot.
33743374
3375+
If at least one pilot is not found, it WILL rollback.
3376+
33753377
:keyword pilot_stamps: Stamps of the pilots we want to delete. Required.
33763378
:paramtype pilot_stamps: list[str]
33773379
:return: None
@@ -3422,7 +3424,7 @@ def clear_pilots( # pylint: disable=inconsistent-return-statements
34223424
) -> None:
34233425
"""Clear Pilots.
34243426
3425-
Delete all pilots that lived more than age_in_days.
3427+
Endpoint for DIRAC to delete all pilots that lived more than age_in_days.
34263428
34273429
:keyword age_in_days: The number of days that define the maximum age of pilots to be
34283430
deleted.Pilots older than this age will be considered for deletion. Required.
@@ -3484,7 +3486,7 @@ def create_pilot_secrets(
34843486
) -> List[_models.PilotSecretsInfo]:
34853487
"""Create Pilot Secrets.
34863488
3487-
Create Pilot Secrets.
3489+
Endpoint to create secrets.
34883490
34893491
:param body: Required.
34903492
:type body: ~_generated.models.BodyPilotsCreatePilotSecrets
@@ -3502,7 +3504,7 @@ def create_pilot_secrets(
35023504
) -> List[_models.PilotSecretsInfo]:
35033505
"""Create Pilot Secrets.
35043506
3505-
Create Pilot Secrets.
3507+
Endpoint to create secrets.
35063508
35073509
:param body: Required.
35083510
:type body: IO[bytes]
@@ -3522,7 +3524,7 @@ def create_pilot_secrets(
35223524
) -> List[_models.PilotSecretsInfo]:
35233525
"""Create Pilot Secrets.
35243526
3525-
Create Pilot Secrets.
3527+
Endpoint to create secrets.
35263528
35273529
:param body: Is either a BodyPilotsCreatePilotSecrets type or a IO[bytes] type. Required.
35283530
:type body: ~_generated.models.BodyPilotsCreatePilotSecrets or IO[bytes]
@@ -3707,6 +3709,8 @@ def update_pilot_fields(
37073709
37083710
Modify a field of a pilot.
37093711
3712+
Note: Only the fields in PilotFieldsMapping are mutable, except for the PilotStamp.
3713+
37103714
:param body: Required.
37113715
:type body: ~_generated.models.BodyPilotsUpdatePilotFields
37123716
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
@@ -3725,6 +3729,8 @@ def update_pilot_fields(
37253729
37263730
Modify a field of a pilot.
37273731
3732+
Note: Only the fields in PilotFieldsMapping are mutable, except for the PilotStamp.
3733+
37283734
:param body: Required.
37293735
:type body: IO[bytes]
37303736
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
@@ -3743,6 +3749,8 @@ def update_pilot_fields( # pylint: disable=inconsistent-return-statements
37433749
37443750
Modify a field of a pilot.
37453751
3752+
Note: Only the fields in PilotFieldsMapping are mutable, except for the PilotStamp.
3753+
37463754
:param body: Is either a BodyPilotsUpdatePilotFields type or a IO[bytes] type. Required.
37473755
:type body: ~_generated.models.BodyPilotsUpdatePilotFields or IO[bytes]
37483756
:return: None
@@ -3810,7 +3818,7 @@ def associate_pilot_with_jobs(
38103818
) -> None:
38113819
"""Associate Pilot With Jobs.
38123820
3813-
Associate Pilot With Jobs.
3821+
Endpoint only for DIRAC services, to associate a pilot with a job.
38143822
38153823
:param body: Required.
38163824
:type body: ~_generated.models.BodyPilotsAssociatePilotWithJobs
@@ -3828,7 +3836,7 @@ def associate_pilot_with_jobs(
38283836
) -> None:
38293837
"""Associate Pilot With Jobs.
38303838
3831-
Associate Pilot With Jobs.
3839+
Endpoint only for DIRAC services, to associate a pilot with a job.
38323840
38333841
:param body: Required.
38343842
:type body: IO[bytes]
@@ -3848,7 +3856,7 @@ def associate_pilot_with_jobs( # pylint: disable=inconsistent-return-statements
38483856
) -> None:
38493857
"""Associate Pilot With Jobs.
38503858
3851-
Associate Pilot With Jobs.
3859+
Endpoint only for DIRAC services, to associate a pilot with a job.
38523860
38533861
:param body: Is either a BodyPilotsAssociatePilotWithJobs type or a IO[bytes] type. Required.
38543862
:type body: ~_generated.models.BodyPilotsAssociatePilotWithJobs or IO[bytes]
@@ -4062,7 +4070,7 @@ def pilot_login(
40624070
) -> _models.TokenResponse:
40634071
"""Pilot Login.
40644072
4065-
Endpoint without policy, the pilot uses only its secret.
4073+
This endpoint is used by the pilot to exchange a secret for a token.
40664074
40674075
:param body: Required.
40684076
:type body: ~_generated.models.BodyPilotsPilotLogin
@@ -4080,7 +4088,7 @@ def pilot_login(
40804088
) -> _models.TokenResponse:
40814089
"""Pilot Login.
40824090
4083-
Endpoint without policy, the pilot uses only its secret.
4091+
This endpoint is used by the pilot to exchange a secret for a token.
40844092
40854093
:param body: Required.
40864094
:type body: IO[bytes]
@@ -4098,7 +4106,7 @@ def pilot_login(
40984106
) -> _models.TokenResponse:
40994107
"""Pilot Login.
41004108
4101-
Endpoint without policy, the pilot uses only its secret.
4109+
This endpoint is used by the pilot to exchange a secret for a token.
41024110
41034111
:param body: Is either a BodyPilotsPilotLogin type or a IO[bytes] type. Required.
41044112
:type body: ~_generated.models.BodyPilotsPilotLogin or IO[bytes]

diracx-logic/src/diracx/logic/pilots/management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def get_pilot_jobs_ids_by_stamp(
5353
return await pilot_db.get_pilot_jobs_ids_by_pilot_id(pilot_id)
5454

5555

56-
async def get_pilot_info(
56+
async def search(
5757
pilot_db: PilotAgentsDB,
5858
page: int = 1,
5959
per_page: int = 100,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from fastapi import Body, Response
77

88
from diracx.core.models import SearchParams
9-
from diracx.logic.pilots.management import get_pilot_info as get_pilot_info_bl
9+
from diracx.logic.pilots.management import search as search_bl
1010

1111
from ..dependencies import PilotAgentsDB
1212
from ..fastapi_classes import DiracxRouter
@@ -118,7 +118,7 @@ async def search(
118118
# Inspired by /api/jobs/query
119119
await check_permissions(action=ActionType.READ_PILOT_FIELDS)
120120

121-
total, pilots = await get_pilot_info_bl(
121+
total, pilots = await search_bl(
122122
pilot_db=pilot_agents_db,
123123
page=page,
124124
per_page=per_page,

0 commit comments

Comments
 (0)