Skip to content

Commit 5aa56c4

Browse files
committed
fix: change endpoint and add documentation
1 parent 290f7fc commit 5aa56c4

File tree

16 files changed

+1738
-186
lines changed

16 files changed

+1738
-186
lines changed

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

Lines changed: 185 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,13 +1186,13 @@ async def get_sandbox_file(self, *, pfn: str, **kwargs: Any) -> _models.SandboxD
11861186
return deserialized # type: ignore
11871187

11881188
@distributed_trace_async
1189-
async def unassign_bulk_jobs_sandboxes(self, *, jobs_ids: List[int], **kwargs: Any) -> Any:
1189+
async def unassign_bulk_jobs_sandboxes(self, *, job_ids: List[int], **kwargs: Any) -> Any:
11901190
"""Unassign Bulk Jobs Sandboxes.
11911191
11921192
Delete bulk jobs sandbox mapping.
11931193
1194-
:keyword jobs_ids: Required.
1195-
:paramtype jobs_ids: list[int]
1194+
:keyword job_ids: Required.
1195+
:paramtype job_ids: list[int]
11961196
:return: any
11971197
:rtype: any
11981198
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1211,7 +1211,7 @@ async def unassign_bulk_jobs_sandboxes(self, *, jobs_ids: List[int], **kwargs: A
12111211
cls: ClsType[Any] = kwargs.pop("cls", None)
12121212

12131213
_request = build_jobs_unassign_bulk_jobs_sandboxes_request(
1214-
jobs_ids=jobs_ids,
1214+
job_ids=job_ids,
12151215
headers=_headers,
12161216
params=_params,
12171217
)
@@ -1458,7 +1458,15 @@ async def set_job_statuses(
14581458
) -> _models.SetJobStatusReturn:
14591459
"""Set Job Statuses.
14601460
1461-
Set Job Statuses.
1461+
Set the status of a job or a list of jobs.
1462+
1463+
Body parameters:
1464+
1465+
1466+
* ``Status``\\ : The new status of the job.
1467+
* ``MinorStatus``\\ : The minor status of the job.
1468+
* ``ApplicationStatus``\\ : The application-specific status of the job.
1469+
* ``Source``\\ : The source of the status update (default is "Unknown").
14621470
14631471
:param body: Required.
14641472
:type body: dict[str, dict[str, ~_generated.models.JobStatusUpdate]]
@@ -1478,7 +1486,15 @@ async def set_job_statuses(
14781486
) -> _models.SetJobStatusReturn:
14791487
"""Set Job Statuses.
14801488
1481-
Set Job Statuses.
1489+
Set the status of a job or a list of jobs.
1490+
1491+
Body parameters:
1492+
1493+
1494+
* ``Status``\\ : The new status of the job.
1495+
* ``MinorStatus``\\ : The minor status of the job.
1496+
* ``ApplicationStatus``\\ : The application-specific status of the job.
1497+
* ``Source``\\ : The source of the status update (default is "Unknown").
14821498
14831499
:param body: Required.
14841500
:type body: IO[bytes]
@@ -1502,7 +1518,15 @@ async def set_job_statuses(
15021518
) -> _models.SetJobStatusReturn:
15031519
"""Set Job Statuses.
15041520
1505-
Set Job Statuses.
1521+
Set the status of a job or a list of jobs.
1522+
1523+
Body parameters:
1524+
1525+
1526+
* ``Status``\\ : The new status of the job.
1527+
* ``MinorStatus``\\ : The minor status of the job.
1528+
* ``ApplicationStatus``\\ : The application-specific status of the job.
1529+
* ``Source``\\ : The source of the status update (default is "Unknown").
15061530
15071531
:param body: Is either a {str: {str: JobStatusUpdate}} type or a IO[bytes] type. Required.
15081532
:type body: dict[str, dict[str, ~_generated.models.JobStatusUpdate]] or IO[bytes]
@@ -1679,14 +1703,79 @@ async def add_heartbeat(
16791703

16801704
return deserialized # type: ignore
16811705

1706+
@overload
1707+
async def reschedule_jobs(
1708+
self,
1709+
body: _models.BodyJobsRescheduleJobs,
1710+
*,
1711+
reset_jobs: bool = False,
1712+
content_type: str = "application/json",
1713+
**kwargs: Any
1714+
) -> Dict[str, Any]:
1715+
"""Reschedule Jobs.
1716+
1717+
Reschedule a list of killed or failed jobs.
1718+
1719+
Body parameters:
1720+
1721+
1722+
* ``job_ids``\\ : List of job IDs to reschedule.
1723+
* ``reset_jobs``\\ : If True, reset the count of reschedules for the jobs.
1724+
1725+
:param body: Required.
1726+
:type body: ~_generated.models.BodyJobsRescheduleJobs
1727+
:keyword reset_jobs: Default value is False.
1728+
:paramtype reset_jobs: bool
1729+
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1730+
Default value is "application/json".
1731+
:paramtype content_type: str
1732+
:return: dict mapping str to any
1733+
:rtype: dict[str, any]
1734+
:raises ~azure.core.exceptions.HttpResponseError:
1735+
"""
1736+
1737+
@overload
1738+
async def reschedule_jobs(
1739+
self, body: IO[bytes], *, reset_jobs: bool = False, content_type: str = "application/json", **kwargs: Any
1740+
) -> Dict[str, Any]:
1741+
"""Reschedule Jobs.
1742+
1743+
Reschedule a list of killed or failed jobs.
1744+
1745+
Body parameters:
1746+
1747+
1748+
* ``job_ids``\\ : List of job IDs to reschedule.
1749+
* ``reset_jobs``\\ : If True, reset the count of reschedules for the jobs.
1750+
1751+
:param body: Required.
1752+
:type body: IO[bytes]
1753+
:keyword reset_jobs: Default value is False.
1754+
:paramtype reset_jobs: bool
1755+
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1756+
Default value is "application/json".
1757+
:paramtype content_type: str
1758+
:return: dict mapping str to any
1759+
:rtype: dict[str, any]
1760+
:raises ~azure.core.exceptions.HttpResponseError:
1761+
"""
1762+
16821763
@distributed_trace_async
1683-
async def reschedule_jobs(self, *, job_ids: List[int], reset_jobs: bool = False, **kwargs: Any) -> Dict[str, Any]:
1764+
async def reschedule_jobs(
1765+
self, body: Union[_models.BodyJobsRescheduleJobs, IO[bytes]], *, reset_jobs: bool = False, **kwargs: Any
1766+
) -> Dict[str, Any]:
16841767
"""Reschedule Jobs.
16851768
1686-
Reschedule Jobs.
1769+
Reschedule a list of killed or failed jobs.
16871770
1688-
:keyword job_ids: Required.
1689-
:paramtype job_ids: list[int]
1771+
Body parameters:
1772+
1773+
1774+
* ``job_ids``\\ : List of job IDs to reschedule.
1775+
* ``reset_jobs``\\ : If True, reset the count of reschedules for the jobs.
1776+
1777+
:param body: Is either a BodyJobsRescheduleJobs type or a IO[bytes] type. Required.
1778+
:type body: ~_generated.models.BodyJobsRescheduleJobs or IO[bytes]
16901779
:keyword reset_jobs: Default value is False.
16911780
:paramtype reset_jobs: bool
16921781
:return: dict mapping str to any
@@ -1701,14 +1790,25 @@ async def reschedule_jobs(self, *, job_ids: List[int], reset_jobs: bool = False,
17011790
}
17021791
error_map.update(kwargs.pop("error_map", {}) or {})
17031792

1704-
_headers = kwargs.pop("headers", {}) or {}
1793+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
17051794
_params = kwargs.pop("params", {}) or {}
17061795

1796+
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
17071797
cls: ClsType[Dict[str, Any]] = kwargs.pop("cls", None)
17081798

1799+
content_type = content_type or "application/json"
1800+
_json = None
1801+
_content = None
1802+
if isinstance(body, (IOBase, bytes)):
1803+
_content = body
1804+
else:
1805+
_json = self._serialize.body(body, "BodyJobsRescheduleJobs")
1806+
17091807
_request = build_jobs_reschedule_jobs_request(
1710-
job_ids=job_ids,
17111808
reset_jobs=reset_jobs,
1809+
content_type=content_type,
1810+
json=_json,
1811+
content=_content,
17121812
headers=_headers,
17131813
params=_params,
17141814
)
@@ -1734,14 +1834,15 @@ async def reschedule_jobs(self, *, job_ids: List[int], reset_jobs: bool = False,
17341834

17351835
@overload
17361836
async def patch_metadata(
1737-
self, body: Dict[str, Dict[str, Any]], *, content_type: str = "application/json", **kwargs: Any
1837+
self, body: Dict[str, _models.JobMetaData], *, content_type: str = "application/json", **kwargs: Any
17381838
) -> None:
17391839
"""Patch Metadata.
17401840
1741-
Patch Metadata.
1841+
Update job metadata such as UserPriority, HeartBeatTime, JobType, etc.
1842+
The argument are all the attributes/parameters of a job (except the ID).
17421843
17431844
:param body: Required.
1744-
:type body: dict[str, dict[str, any]]
1845+
:type body: dict[str, ~_generated.models.JobMetaData]
17451846
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
17461847
Default value is "application/json".
17471848
:paramtype content_type: str
@@ -1754,7 +1855,8 @@ async def patch_metadata(
17541855
async def patch_metadata(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None:
17551856
"""Patch Metadata.
17561857
1757-
Patch Metadata.
1858+
Update job metadata such as UserPriority, HeartBeatTime, JobType, etc.
1859+
The argument are all the attributes/parameters of a job (except the ID).
17581860
17591861
:param body: Required.
17601862
:type body: IO[bytes]
@@ -1767,13 +1869,14 @@ async def patch_metadata(self, body: IO[bytes], *, content_type: str = "applicat
17671869
"""
17681870

17691871
@distributed_trace_async
1770-
async def patch_metadata(self, body: Union[Dict[str, Dict[str, Any]], IO[bytes]], **kwargs: Any) -> None:
1872+
async def patch_metadata(self, body: Union[Dict[str, _models.JobMetaData], IO[bytes]], **kwargs: Any) -> None:
17711873
"""Patch Metadata.
17721874
1773-
Patch Metadata.
1875+
Update job metadata such as UserPriority, HeartBeatTime, JobType, etc.
1876+
The argument are all the attributes/parameters of a job (except the ID).
17741877
1775-
:param body: Is either a {str: {str: Any}} type or a IO[bytes] type. Required.
1776-
:type body: dict[str, dict[str, any]] or IO[bytes]
1878+
:param body: Is either a {str: JobMetaData} type or a IO[bytes] type. Required.
1879+
:type body: dict[str, ~_generated.models.JobMetaData] or IO[bytes]
17771880
:return: None
17781881
:rtype: None
17791882
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1798,7 +1901,7 @@ async def patch_metadata(self, body: Union[Dict[str, Dict[str, Any]], IO[bytes]]
17981901
if isinstance(body, (IOBase, bytes)):
17991902
_content = body
18001903
else:
1801-
_json = self._serialize.body(body, "{{object}}")
1904+
_json = self._serialize.body(body, "{JobMetaData}")
18021905

18031906
_request = build_jobs_patch_metadata_request(
18041907
content_type=content_type,
@@ -1835,9 +1938,18 @@ async def search(
18351938
) -> List[Dict[str, Any]]:
18361939
"""Search.
18371940
1838-
Retrieve information about jobs.
1941+
Creates a search query to the job database. This search can be based on
1942+
different parameters, such as job ID, status, owner, etc.
1943+
1944+
**Possibilities**
1945+
18391946
1840-
**TODO: Add more docs**.
1947+
* Use ``search`` to filter jobs based on various parameters (optional).
1948+
* Use ``parameters`` to specify which job parameters to return (optional).
1949+
* Use ``sort`` to order the results based on specific parameters (optional).
1950+
1951+
By default, the search will return all jobs the user has access to, and all the fields
1952+
of the job will be returned.
18411953
18421954
:param body: Default value is None.
18431955
:type body: ~_generated.models.JobSearchParams
@@ -1865,9 +1977,18 @@ async def search(
18651977
) -> List[Dict[str, Any]]:
18661978
"""Search.
18671979
1868-
Retrieve information about jobs.
1980+
Creates a search query to the job database. This search can be based on
1981+
different parameters, such as job ID, status, owner, etc.
1982+
1983+
**Possibilities**
1984+
18691985
1870-
**TODO: Add more docs**.
1986+
* Use ``search`` to filter jobs based on various parameters (optional).
1987+
* Use ``parameters`` to specify which job parameters to return (optional).
1988+
* Use ``sort`` to order the results based on specific parameters (optional).
1989+
1990+
By default, the search will return all jobs the user has access to, and all the fields
1991+
of the job will be returned.
18711992
18721993
:param body: Default value is None.
18731994
:type body: IO[bytes]
@@ -1894,9 +2015,18 @@ async def search(
18942015
) -> List[Dict[str, Any]]:
18952016
"""Search.
18962017
1897-
Retrieve information about jobs.
2018+
Creates a search query to the job database. This search can be based on
2019+
different parameters, such as job ID, status, owner, etc.
2020+
2021+
**Possibilities**
18982022
1899-
**TODO: Add more docs**.
2023+
2024+
* Use ``search`` to filter jobs based on various parameters (optional).
2025+
* Use ``parameters`` to specify which job parameters to return (optional).
2026+
* Use ``sort`` to order the results based on specific parameters (optional).
2027+
2028+
By default, the search will return all jobs the user has access to, and all the fields
2029+
of the job will be returned.
19002030
19012031
:param body: Is either a JobSearchParams type or a IO[bytes] type. Default value is None.
19022032
:type body: ~_generated.models.JobSearchParams or IO[bytes]
@@ -1972,7 +2102,15 @@ async def summary(
19722102
) -> Any:
19732103
"""Summary.
19742104
1975-
Show information suitable for plotting.
2105+
Group jobs by a specific list of parameters. Returns an array of n-uplets, where each n-uplet
2106+
contains the
2107+
values of the grouping parameters and the number of jobs that match those values.
2108+
2109+
Body parameters:
2110+
2111+
2112+
* ``grouping``\\ : List of parameters to group the jobs by.
2113+
* ``search``\\ : List of search parameters to filter the jobs by (optional).
19762114
19772115
:param body: Required.
19782116
:type body: ~_generated.models.JobSummaryParams
@@ -1988,7 +2126,15 @@ async def summary(
19882126
async def summary(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> Any:
19892127
"""Summary.
19902128
1991-
Show information suitable for plotting.
2129+
Group jobs by a specific list of parameters. Returns an array of n-uplets, where each n-uplet
2130+
contains the
2131+
values of the grouping parameters and the number of jobs that match those values.
2132+
2133+
Body parameters:
2134+
2135+
2136+
* ``grouping``\\ : List of parameters to group the jobs by.
2137+
* ``search``\\ : List of search parameters to filter the jobs by (optional).
19922138
19932139
:param body: Required.
19942140
:type body: IO[bytes]
@@ -2004,7 +2150,15 @@ async def summary(self, body: IO[bytes], *, content_type: str = "application/jso
20042150
async def summary(self, body: Union[_models.JobSummaryParams, IO[bytes]], **kwargs: Any) -> Any:
20052151
"""Summary.
20062152
2007-
Show information suitable for plotting.
2153+
Group jobs by a specific list of parameters. Returns an array of n-uplets, where each n-uplet
2154+
contains the
2155+
values of the grouping parameters and the number of jobs that match those values.
2156+
2157+
Body parameters:
2158+
2159+
2160+
* ``grouping``\\ : List of parameters to group the jobs by.
2161+
* ``search``\\ : List of search parameters to filter the jobs by (optional).
20082162
20092163
:param body: Is either a JobSummaryParams type or a IO[bytes] type. Required.
20102164
:type body: ~_generated.models.JobSummaryParams or IO[bytes]

diracx-client/src/diracx/client/_generated/models/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@
1414
from ._models import ( # type: ignore
1515
BodyAuthGetOidcToken,
1616
BodyAuthGetOidcTokenGrantType,
17+
BodyJobsRescheduleJobs,
1718
GroupInfo,
1819
HTTPValidationError,
1920
HeartbeatData,
2021
InitiateDeviceFlowResponse,
2122
InsertedJob,
2223
JobCommand,
24+
JobMetaData,
25+
JobMetaDataAccountedFlag,
2326
JobSearchParams,
2427
JobSearchParamsSearchItem,
2528
JobStatusUpdate,
@@ -61,12 +64,15 @@
6164
__all__ = [
6265
"BodyAuthGetOidcToken",
6366
"BodyAuthGetOidcTokenGrantType",
67+
"BodyJobsRescheduleJobs",
6468
"GroupInfo",
6569
"HTTPValidationError",
6670
"HeartbeatData",
6771
"InitiateDeviceFlowResponse",
6872
"InsertedJob",
6973
"JobCommand",
74+
"JobMetaData",
75+
"JobMetaDataAccountedFlag",
7076
"JobSearchParams",
7177
"JobSearchParamsSearchItem",
7278
"JobStatusUpdate",

0 commit comments

Comments
 (0)