diracx-client 0.0.1a20__py3-none-any.whl → 0.0.1a22__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  # pylint: disable=too-many-lines
2
2
  # coding=utf-8
3
3
  # --------------------------------------------------------------------------
4
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.26.0)
4
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/python@6.27.1)
5
5
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
6
6
  # --------------------------------------------------------------------------
7
7
  from io import IOBase
@@ -36,28 +36,15 @@ from ...operations._operations import (
36
36
  build_auth_userinfo_request,
37
37
  build_config_serve_config_request,
38
38
  build_jobs_assign_sandbox_to_job_request,
39
- build_jobs_delete_bulk_jobs_request,
40
- build_jobs_delete_single_job_request,
41
39
  build_jobs_get_job_sandbox_request,
42
40
  build_jobs_get_job_sandboxes_request,
43
- build_jobs_get_job_status_bulk_request,
44
- build_jobs_get_job_status_history_bulk_request,
45
41
  build_jobs_get_sandbox_file_request,
46
- build_jobs_get_single_job_request,
47
- build_jobs_get_single_job_status_history_request,
48
- build_jobs_get_single_job_status_request,
49
42
  build_jobs_initiate_sandbox_upload_request,
50
- build_jobs_kill_bulk_jobs_request,
51
- build_jobs_kill_single_job_request,
52
43
  build_jobs_remove_bulk_jobs_request,
53
- build_jobs_remove_single_job_request,
54
44
  build_jobs_reschedule_bulk_jobs_request,
55
- build_jobs_reschedule_single_job_request,
56
45
  build_jobs_search_request,
57
- build_jobs_set_job_status_bulk_request,
58
- build_jobs_set_single_job_properties_request,
59
- build_jobs_set_single_job_status_request,
60
- build_jobs_submit_bulk_jobs_request,
46
+ build_jobs_set_job_statuses_request,
47
+ build_jobs_submit_bulk_jdl_jobs_request,
61
48
  build_jobs_summary_request,
62
49
  build_jobs_unassign_bulk_jobs_sandboxes_request,
63
50
  build_jobs_unassign_job_sandboxes_request,
@@ -236,9 +223,25 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
236
223
  """Initiate Device Flow.
237
224
 
238
225
  Initiate the device flow against DIRAC authorization Server.
239
- Scope must have exactly up to one ``group`` (otherwise default) and
240
- one or more ``property`` scope.
241
- If no property, then get default one.
226
+
227
+ Scope details:
228
+
229
+
230
+ *
231
+ If only VO is provided: Uses the default group and its properties for the VO.
232
+
233
+ *
234
+ If VO and group are provided: Uses the specified group and its properties for the VO.
235
+
236
+ *
237
+ If VO and properties are provided: Uses the default group and combines its properties with
238
+ the
239
+ provided properties.
240
+
241
+ *
242
+ If VO, group, and properties are provided: Uses the specified group and combines its
243
+ properties with the
244
+ provided properties.
242
245
 
243
246
  Offers the user to go with the browser to
244
247
  ``auth/<vo>/device?user_code=XYZ``.
@@ -633,9 +636,9 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
633
636
  async def authorization_flow(
634
637
  self,
635
638
  *,
636
- response_type: Union[str, _models.Enum0],
639
+ response_type: str,
637
640
  code_challenge: str,
638
- code_challenge_method: Union[str, _models.Enum1],
641
+ code_challenge_method: str,
639
642
  client_id: str,
640
643
  redirect_uri: str,
641
644
  scope: str,
@@ -648,16 +651,35 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
648
651
  It will redirect to the actual OpenID server (IAM, CheckIn) to
649
652
  perform a authorization code flow.
650
653
 
654
+ Scope details:
655
+
656
+
657
+ *
658
+ If only VO is provided: Uses the default group and its properties for the VO.
659
+
660
+ *
661
+ If VO and group are provided: Uses the specified group and its properties for the VO.
662
+
663
+ *
664
+ If VO and properties are provided: Uses the default group and combines its properties with
665
+ the
666
+ provided properties.
667
+
668
+ *
669
+ If VO, group, and properties are provided: Uses the specified group and combines its
670
+ properties with the
671
+ provided properties.
672
+
651
673
  We set the user details obtained from the user authorize flow in a cookie
652
674
  to be able to map the authorization flow with the corresponding
653
675
  user authorize flow.
654
676
 
655
- :keyword response_type: "code" Required.
656
- :paramtype response_type: str or ~generated.models.Enum0
677
+ :keyword response_type: Required.
678
+ :paramtype response_type: str
657
679
  :keyword code_challenge: Required.
658
680
  :paramtype code_challenge: str
659
- :keyword code_challenge_method: "S256" Required.
660
- :paramtype code_challenge_method: str or ~generated.models.Enum1
681
+ :keyword code_challenge_method: Required.
682
+ :paramtype code_challenge_method: str
661
683
  :keyword client_id: Required.
662
684
  :paramtype client_id: str
663
685
  :keyword redirect_uri: Required.
@@ -885,7 +907,7 @@ class ConfigOperations:
885
907
  return deserialized # type: ignore
886
908
 
887
909
 
888
- class JobsOperations: # pylint: disable=too-many-public-methods
910
+ class JobsOperations:
889
911
  """
890
912
  .. warning::
891
913
  **DO NOT** instantiate this class directly.
@@ -1387,54 +1409,133 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1387
1409
 
1388
1410
  return deserialized # type: ignore
1389
1411
 
1412
+ @distributed_trace_async
1413
+ async def remove_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
1414
+ """Remove Bulk Jobs.
1415
+
1416
+ Fully remove a list of jobs from the WMS databases.
1417
+
1418
+ WARNING: This endpoint has been implemented for the compatibility with the legacy DIRAC WMS
1419
+ and the JobCleaningAgent. However, once this agent is ported to diracx, this endpoint should
1420
+ be removed, and a status change to Deleted (PATCH /jobs/status) should be used instead for any
1421
+ other purpose.
1422
+
1423
+ :keyword job_ids: Required.
1424
+ :paramtype job_ids: list[int]
1425
+ :return: any
1426
+ :rtype: any
1427
+ :raises ~azure.core.exceptions.HttpResponseError:
1428
+ """
1429
+ error_map: MutableMapping = {
1430
+ 401: ClientAuthenticationError,
1431
+ 404: ResourceNotFoundError,
1432
+ 409: ResourceExistsError,
1433
+ 304: ResourceNotModifiedError,
1434
+ }
1435
+ error_map.update(kwargs.pop("error_map", {}) or {})
1436
+
1437
+ _headers = kwargs.pop("headers", {}) or {}
1438
+ _params = kwargs.pop("params", {}) or {}
1439
+
1440
+ cls: ClsType[Any] = kwargs.pop("cls", None)
1441
+
1442
+ _request = build_jobs_remove_bulk_jobs_request(
1443
+ job_ids=job_ids,
1444
+ headers=_headers,
1445
+ params=_params,
1446
+ )
1447
+ _request.url = self._client.format_url(_request.url)
1448
+
1449
+ _stream = False
1450
+ pipeline_response: PipelineResponse = (
1451
+ await self._client._pipeline.run( # pylint: disable=protected-access
1452
+ _request, stream=_stream, **kwargs
1453
+ )
1454
+ )
1455
+
1456
+ response = pipeline_response.http_response
1457
+
1458
+ if response.status_code not in [200]:
1459
+ map_error(
1460
+ status_code=response.status_code, response=response, error_map=error_map
1461
+ )
1462
+ raise HttpResponseError(response=response)
1463
+
1464
+ deserialized = self._deserialize("object", pipeline_response.http_response)
1465
+
1466
+ if cls:
1467
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1468
+
1469
+ return deserialized # type: ignore
1470
+
1390
1471
  @overload
1391
- async def submit_bulk_jobs(
1392
- self, body: List[str], *, content_type: str = "application/json", **kwargs: Any
1393
- ) -> List[_models.InsertedJob]:
1394
- """Submit Bulk Jobs.
1472
+ async def set_job_statuses(
1473
+ self,
1474
+ body: Dict[str, Dict[str, _models.JobStatusUpdate]],
1475
+ *,
1476
+ force: bool = False,
1477
+ content_type: str = "application/json",
1478
+ **kwargs: Any,
1479
+ ) -> _models.SetJobStatusReturn:
1480
+ """Set Job Statuses.
1395
1481
 
1396
- Submit Bulk Jobs.
1482
+ Set Job Statuses.
1397
1483
 
1398
1484
  :param body: Required.
1399
- :type body: list[str]
1485
+ :type body: dict[str, dict[str, ~generated.models.JobStatusUpdate]]
1486
+ :keyword force: Default value is False.
1487
+ :paramtype force: bool
1400
1488
  :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1401
1489
  Default value is "application/json".
1402
1490
  :paramtype content_type: str
1403
- :return: list of InsertedJob
1404
- :rtype: list[~generated.models.InsertedJob]
1491
+ :return: SetJobStatusReturn
1492
+ :rtype: ~generated.models.SetJobStatusReturn
1405
1493
  :raises ~azure.core.exceptions.HttpResponseError:
1406
1494
  """
1407
1495
 
1408
1496
  @overload
1409
- async def submit_bulk_jobs(
1410
- self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
1411
- ) -> List[_models.InsertedJob]:
1412
- """Submit Bulk Jobs.
1497
+ async def set_job_statuses(
1498
+ self,
1499
+ body: IO[bytes],
1500
+ *,
1501
+ force: bool = False,
1502
+ content_type: str = "application/json",
1503
+ **kwargs: Any,
1504
+ ) -> _models.SetJobStatusReturn:
1505
+ """Set Job Statuses.
1413
1506
 
1414
- Submit Bulk Jobs.
1507
+ Set Job Statuses.
1415
1508
 
1416
1509
  :param body: Required.
1417
1510
  :type body: IO[bytes]
1511
+ :keyword force: Default value is False.
1512
+ :paramtype force: bool
1418
1513
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1419
1514
  Default value is "application/json".
1420
1515
  :paramtype content_type: str
1421
- :return: list of InsertedJob
1422
- :rtype: list[~generated.models.InsertedJob]
1516
+ :return: SetJobStatusReturn
1517
+ :rtype: ~generated.models.SetJobStatusReturn
1423
1518
  :raises ~azure.core.exceptions.HttpResponseError:
1424
1519
  """
1425
1520
 
1426
1521
  @distributed_trace_async
1427
- async def submit_bulk_jobs(
1428
- self, body: Union[List[str], IO[bytes]], **kwargs: Any
1429
- ) -> List[_models.InsertedJob]:
1430
- """Submit Bulk Jobs.
1522
+ async def set_job_statuses(
1523
+ self,
1524
+ body: Union[Dict[str, Dict[str, _models.JobStatusUpdate]], IO[bytes]],
1525
+ *,
1526
+ force: bool = False,
1527
+ **kwargs: Any,
1528
+ ) -> _models.SetJobStatusReturn:
1529
+ """Set Job Statuses.
1431
1530
 
1432
- Submit Bulk Jobs.
1531
+ Set Job Statuses.
1433
1532
 
1434
- :param body: Is either a [str] type or a IO[bytes] type. Required.
1435
- :type body: list[str] or IO[bytes]
1436
- :return: list of InsertedJob
1437
- :rtype: list[~generated.models.InsertedJob]
1533
+ :param body: Is either a {str: {str: JobStatusUpdate}} type or a IO[bytes] type. Required.
1534
+ :type body: dict[str, dict[str, ~generated.models.JobStatusUpdate]] or IO[bytes]
1535
+ :keyword force: Default value is False.
1536
+ :paramtype force: bool
1537
+ :return: SetJobStatusReturn
1538
+ :rtype: ~generated.models.SetJobStatusReturn
1438
1539
  :raises ~azure.core.exceptions.HttpResponseError:
1439
1540
  """
1440
1541
  error_map: MutableMapping = {
@@ -1451,7 +1552,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1451
1552
  content_type: Optional[str] = kwargs.pop(
1452
1553
  "content_type", _headers.pop("Content-Type", None)
1453
1554
  )
1454
- cls: ClsType[List[_models.InsertedJob]] = kwargs.pop("cls", None)
1555
+ cls: ClsType[_models.SetJobStatusReturn] = kwargs.pop("cls", None)
1455
1556
 
1456
1557
  content_type = content_type or "application/json"
1457
1558
  _json = None
@@ -1459,9 +1560,10 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1459
1560
  if isinstance(body, (IOBase, bytes)):
1460
1561
  _content = body
1461
1562
  else:
1462
- _json = self._serialize.body(body, "[str]")
1563
+ _json = self._serialize.body(body, "{{JobStatusUpdate}}")
1463
1564
 
1464
- _request = build_jobs_submit_bulk_jobs_request(
1565
+ _request = build_jobs_set_job_statuses_request(
1566
+ force=force,
1465
1567
  content_type=content_type,
1466
1568
  json=_json,
1467
1569
  content=_content,
@@ -1486,7 +1588,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1486
1588
  raise HttpResponseError(response=response)
1487
1589
 
1488
1590
  deserialized = self._deserialize(
1489
- "[InsertedJob]", pipeline_response.http_response
1591
+ "SetJobStatusReturn", pipeline_response.http_response
1490
1592
  )
1491
1593
 
1492
1594
  if cls:
@@ -1495,13 +1597,17 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1495
1597
  return deserialized # type: ignore
1496
1598
 
1497
1599
  @distributed_trace_async
1498
- async def delete_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
1499
- """Delete Bulk Jobs.
1600
+ async def reschedule_bulk_jobs(
1601
+ self, *, job_ids: List[int], reset_jobs: bool = False, **kwargs: Any
1602
+ ) -> Any:
1603
+ """Reschedule Bulk Jobs.
1500
1604
 
1501
- Delete Bulk Jobs.
1605
+ Reschedule Bulk Jobs.
1502
1606
 
1503
1607
  :keyword job_ids: Required.
1504
1608
  :paramtype job_ids: list[int]
1609
+ :keyword reset_jobs: Default value is False.
1610
+ :paramtype reset_jobs: bool
1505
1611
  :return: any
1506
1612
  :rtype: any
1507
1613
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -1519,8 +1625,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1519
1625
 
1520
1626
  cls: ClsType[Any] = kwargs.pop("cls", None)
1521
1627
 
1522
- _request = build_jobs_delete_bulk_jobs_request(
1628
+ _request = build_jobs_reschedule_bulk_jobs_request(
1523
1629
  job_ids=job_ids,
1630
+ reset_jobs=reset_jobs,
1524
1631
  headers=_headers,
1525
1632
  params=_params,
1526
1633
  )
@@ -1548,16 +1655,89 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1548
1655
 
1549
1656
  return deserialized # type: ignore
1550
1657
 
1658
+ @overload
1659
+ async def search(
1660
+ self,
1661
+ body: Optional[_models.JobSearchParams] = None,
1662
+ *,
1663
+ page: int = 1,
1664
+ per_page: int = 100,
1665
+ content_type: str = "application/json",
1666
+ **kwargs: Any,
1667
+ ) -> List[JSON]:
1668
+ """Search.
1669
+
1670
+ Retrieve information about jobs.
1671
+
1672
+ **TODO: Add more docs**.
1673
+
1674
+ :param body: Default value is None.
1675
+ :type body: ~generated.models.JobSearchParams
1676
+ :keyword page: Default value is 1.
1677
+ :paramtype page: int
1678
+ :keyword per_page: Default value is 100.
1679
+ :paramtype per_page: int
1680
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1681
+ Default value is "application/json".
1682
+ :paramtype content_type: str
1683
+ :return: list of JSON
1684
+ :rtype: list[JSON]
1685
+ :raises ~azure.core.exceptions.HttpResponseError:
1686
+ """
1687
+
1688
+ @overload
1689
+ async def search(
1690
+ self,
1691
+ body: Optional[IO[bytes]] = None,
1692
+ *,
1693
+ page: int = 1,
1694
+ per_page: int = 100,
1695
+ content_type: str = "application/json",
1696
+ **kwargs: Any,
1697
+ ) -> List[JSON]:
1698
+ """Search.
1699
+
1700
+ Retrieve information about jobs.
1701
+
1702
+ **TODO: Add more docs**.
1703
+
1704
+ :param body: Default value is None.
1705
+ :type body: IO[bytes]
1706
+ :keyword page: Default value is 1.
1707
+ :paramtype page: int
1708
+ :keyword per_page: Default value is 100.
1709
+ :paramtype per_page: int
1710
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1711
+ Default value is "application/json".
1712
+ :paramtype content_type: str
1713
+ :return: list of JSON
1714
+ :rtype: list[JSON]
1715
+ :raises ~azure.core.exceptions.HttpResponseError:
1716
+ """
1717
+
1551
1718
  @distributed_trace_async
1552
- async def kill_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
1553
- """Kill Bulk Jobs.
1719
+ async def search(
1720
+ self,
1721
+ body: Optional[Union[_models.JobSearchParams, IO[bytes]]] = None,
1722
+ *,
1723
+ page: int = 1,
1724
+ per_page: int = 100,
1725
+ **kwargs: Any,
1726
+ ) -> List[JSON]:
1727
+ """Search.
1554
1728
 
1555
- Kill Bulk Jobs.
1729
+ Retrieve information about jobs.
1556
1730
 
1557
- :keyword job_ids: Required.
1558
- :paramtype job_ids: list[int]
1559
- :return: any
1560
- :rtype: any
1731
+ **TODO: Add more docs**.
1732
+
1733
+ :param body: Is either a JobSearchParams type or a IO[bytes] type. Default value is None.
1734
+ :type body: ~generated.models.JobSearchParams or IO[bytes]
1735
+ :keyword page: Default value is 1.
1736
+ :paramtype page: int
1737
+ :keyword per_page: Default value is 100.
1738
+ :paramtype per_page: int
1739
+ :return: list of JSON
1740
+ :rtype: list[JSON]
1561
1741
  :raises ~azure.core.exceptions.HttpResponseError:
1562
1742
  """
1563
1743
  error_map: MutableMapping = {
@@ -1568,13 +1748,31 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1568
1748
  }
1569
1749
  error_map.update(kwargs.pop("error_map", {}) or {})
1570
1750
 
1571
- _headers = kwargs.pop("headers", {}) or {}
1751
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1572
1752
  _params = kwargs.pop("params", {}) or {}
1573
1753
 
1574
- cls: ClsType[Any] = kwargs.pop("cls", None)
1754
+ content_type: Optional[str] = kwargs.pop(
1755
+ "content_type", _headers.pop("Content-Type", None)
1756
+ )
1757
+ cls: ClsType[List[JSON]] = kwargs.pop("cls", None)
1575
1758
 
1576
- _request = build_jobs_kill_bulk_jobs_request(
1577
- job_ids=job_ids,
1759
+ content_type = content_type or "application/json"
1760
+ _json = None
1761
+ _content = None
1762
+ if isinstance(body, (IOBase, bytes)):
1763
+ _content = body
1764
+ else:
1765
+ if body is not None:
1766
+ _json = self._serialize.body(body, "JobSearchParams")
1767
+ else:
1768
+ _json = None
1769
+
1770
+ _request = build_jobs_search_request(
1771
+ page=page,
1772
+ per_page=per_page,
1773
+ content_type=content_type,
1774
+ json=_json,
1775
+ content=_content,
1578
1776
  headers=_headers,
1579
1777
  params=_params,
1580
1778
  )
@@ -1589,991 +1787,77 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1589
1787
 
1590
1788
  response = pipeline_response.http_response
1591
1789
 
1592
- if response.status_code not in [200]:
1790
+ if response.status_code not in [200, 206]:
1593
1791
  map_error(
1594
1792
  status_code=response.status_code, response=response, error_map=error_map
1595
1793
  )
1596
1794
  raise HttpResponseError(response=response)
1597
1795
 
1598
- deserialized = self._deserialize("object", pipeline_response.http_response)
1796
+ response_headers = {}
1797
+ if response.status_code == 206:
1798
+ response_headers["Content-Range"] = self._deserialize(
1799
+ "str", response.headers.get("Content-Range")
1800
+ )
1801
+
1802
+ deserialized = self._deserialize("[object]", pipeline_response.http_response)
1599
1803
 
1600
1804
  if cls:
1601
- return cls(pipeline_response, deserialized, {}) # type: ignore
1805
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
1602
1806
 
1603
1807
  return deserialized # type: ignore
1604
1808
 
1605
- @distributed_trace_async
1606
- async def remove_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
1607
- """Remove Bulk Jobs.
1809
+ @overload
1810
+ async def summary(
1811
+ self,
1812
+ body: _models.JobSummaryParams,
1813
+ *,
1814
+ content_type: str = "application/json",
1815
+ **kwargs: Any,
1816
+ ) -> Any:
1817
+ """Summary.
1608
1818
 
1609
- Fully remove a list of jobs from the WMS databases.
1819
+ Show information suitable for plotting.
1610
1820
 
1611
- WARNING: This endpoint has been implemented for the compatibility with the legacy DIRAC WMS
1612
- and the JobCleaningAgent. However, once this agent is ported to diracx, this endpoint should
1613
- be removed, and the delete endpoint should be used instead for any other purpose.
1614
-
1615
- :keyword job_ids: Required.
1616
- :paramtype job_ids: list[int]
1617
- :return: any
1618
- :rtype: any
1619
- :raises ~azure.core.exceptions.HttpResponseError:
1620
- """
1621
- error_map: MutableMapping = {
1622
- 401: ClientAuthenticationError,
1623
- 404: ResourceNotFoundError,
1624
- 409: ResourceExistsError,
1625
- 304: ResourceNotModifiedError,
1626
- }
1627
- error_map.update(kwargs.pop("error_map", {}) or {})
1628
-
1629
- _headers = kwargs.pop("headers", {}) or {}
1630
- _params = kwargs.pop("params", {}) or {}
1631
-
1632
- cls: ClsType[Any] = kwargs.pop("cls", None)
1633
-
1634
- _request = build_jobs_remove_bulk_jobs_request(
1635
- job_ids=job_ids,
1636
- headers=_headers,
1637
- params=_params,
1638
- )
1639
- _request.url = self._client.format_url(_request.url)
1640
-
1641
- _stream = False
1642
- pipeline_response: PipelineResponse = (
1643
- await self._client._pipeline.run( # pylint: disable=protected-access
1644
- _request, stream=_stream, **kwargs
1645
- )
1646
- )
1647
-
1648
- response = pipeline_response.http_response
1649
-
1650
- if response.status_code not in [200]:
1651
- map_error(
1652
- status_code=response.status_code, response=response, error_map=error_map
1653
- )
1654
- raise HttpResponseError(response=response)
1655
-
1656
- deserialized = self._deserialize("object", pipeline_response.http_response)
1657
-
1658
- if cls:
1659
- return cls(pipeline_response, deserialized, {}) # type: ignore
1660
-
1661
- return deserialized # type: ignore
1662
-
1663
- @distributed_trace_async
1664
- async def get_job_status_bulk(
1665
- self, *, job_ids: List[int], **kwargs: Any
1666
- ) -> Dict[str, _models.LimitedJobStatusReturn]:
1667
- """Get Job Status Bulk.
1668
-
1669
- Get Job Status Bulk.
1670
-
1671
- :keyword job_ids: Required.
1672
- :paramtype job_ids: list[int]
1673
- :return: dict mapping str to LimitedJobStatusReturn
1674
- :rtype: dict[str, ~generated.models.LimitedJobStatusReturn]
1675
- :raises ~azure.core.exceptions.HttpResponseError:
1676
- """
1677
- error_map: MutableMapping = {
1678
- 401: ClientAuthenticationError,
1679
- 404: ResourceNotFoundError,
1680
- 409: ResourceExistsError,
1681
- 304: ResourceNotModifiedError,
1682
- }
1683
- error_map.update(kwargs.pop("error_map", {}) or {})
1684
-
1685
- _headers = kwargs.pop("headers", {}) or {}
1686
- _params = kwargs.pop("params", {}) or {}
1687
-
1688
- cls: ClsType[Dict[str, _models.LimitedJobStatusReturn]] = kwargs.pop(
1689
- "cls", None
1690
- )
1691
-
1692
- _request = build_jobs_get_job_status_bulk_request(
1693
- job_ids=job_ids,
1694
- headers=_headers,
1695
- params=_params,
1696
- )
1697
- _request.url = self._client.format_url(_request.url)
1698
-
1699
- _stream = False
1700
- pipeline_response: PipelineResponse = (
1701
- await self._client._pipeline.run( # pylint: disable=protected-access
1702
- _request, stream=_stream, **kwargs
1703
- )
1704
- )
1705
-
1706
- response = pipeline_response.http_response
1707
-
1708
- if response.status_code not in [200]:
1709
- map_error(
1710
- status_code=response.status_code, response=response, error_map=error_map
1711
- )
1712
- raise HttpResponseError(response=response)
1713
-
1714
- deserialized = self._deserialize(
1715
- "{LimitedJobStatusReturn}", pipeline_response.http_response
1716
- )
1717
-
1718
- if cls:
1719
- return cls(pipeline_response, deserialized, {}) # type: ignore
1720
-
1721
- return deserialized # type: ignore
1722
-
1723
- @overload
1724
- async def set_job_status_bulk(
1725
- self,
1726
- body: Dict[str, Dict[str, _models.JobStatusUpdate]],
1727
- *,
1728
- force: bool = False,
1729
- content_type: str = "application/json",
1730
- **kwargs: Any,
1731
- ) -> Dict[str, _models.SetJobStatusReturn]:
1732
- """Set Job Status Bulk.
1733
-
1734
- Set Job Status Bulk.
1735
-
1736
- :param body: Required.
1737
- :type body: dict[str, dict[str, ~generated.models.JobStatusUpdate]]
1738
- :keyword force: Default value is False.
1739
- :paramtype force: bool
1740
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1741
- Default value is "application/json".
1742
- :paramtype content_type: str
1743
- :return: dict mapping str to SetJobStatusReturn
1744
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
1745
- :raises ~azure.core.exceptions.HttpResponseError:
1746
- """
1747
-
1748
- @overload
1749
- async def set_job_status_bulk(
1750
- self,
1751
- body: IO[bytes],
1752
- *,
1753
- force: bool = False,
1754
- content_type: str = "application/json",
1755
- **kwargs: Any,
1756
- ) -> Dict[str, _models.SetJobStatusReturn]:
1757
- """Set Job Status Bulk.
1758
-
1759
- Set Job Status Bulk.
1760
-
1761
- :param body: Required.
1762
- :type body: IO[bytes]
1763
- :keyword force: Default value is False.
1764
- :paramtype force: bool
1765
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1766
- Default value is "application/json".
1767
- :paramtype content_type: str
1768
- :return: dict mapping str to SetJobStatusReturn
1769
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
1770
- :raises ~azure.core.exceptions.HttpResponseError:
1771
- """
1772
-
1773
- @distributed_trace_async
1774
- async def set_job_status_bulk(
1775
- self,
1776
- body: Union[Dict[str, Dict[str, _models.JobStatusUpdate]], IO[bytes]],
1777
- *,
1778
- force: bool = False,
1779
- **kwargs: Any,
1780
- ) -> Dict[str, _models.SetJobStatusReturn]:
1781
- """Set Job Status Bulk.
1782
-
1783
- Set Job Status Bulk.
1784
-
1785
- :param body: Is either a {str: {str: JobStatusUpdate}} type or a IO[bytes] type. Required.
1786
- :type body: dict[str, dict[str, ~generated.models.JobStatusUpdate]] or IO[bytes]
1787
- :keyword force: Default value is False.
1788
- :paramtype force: bool
1789
- :return: dict mapping str to SetJobStatusReturn
1790
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
1791
- :raises ~azure.core.exceptions.HttpResponseError:
1792
- """
1793
- error_map: MutableMapping = {
1794
- 401: ClientAuthenticationError,
1795
- 404: ResourceNotFoundError,
1796
- 409: ResourceExistsError,
1797
- 304: ResourceNotModifiedError,
1798
- }
1799
- error_map.update(kwargs.pop("error_map", {}) or {})
1800
-
1801
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1802
- _params = kwargs.pop("params", {}) or {}
1803
-
1804
- content_type: Optional[str] = kwargs.pop(
1805
- "content_type", _headers.pop("Content-Type", None)
1806
- )
1807
- cls: ClsType[Dict[str, _models.SetJobStatusReturn]] = kwargs.pop("cls", None)
1808
-
1809
- content_type = content_type or "application/json"
1810
- _json = None
1811
- _content = None
1812
- if isinstance(body, (IOBase, bytes)):
1813
- _content = body
1814
- else:
1815
- _json = self._serialize.body(body, "{{JobStatusUpdate}}")
1816
-
1817
- _request = build_jobs_set_job_status_bulk_request(
1818
- force=force,
1819
- content_type=content_type,
1820
- json=_json,
1821
- content=_content,
1822
- headers=_headers,
1823
- params=_params,
1824
- )
1825
- _request.url = self._client.format_url(_request.url)
1826
-
1827
- _stream = False
1828
- pipeline_response: PipelineResponse = (
1829
- await self._client._pipeline.run( # pylint: disable=protected-access
1830
- _request, stream=_stream, **kwargs
1831
- )
1832
- )
1833
-
1834
- response = pipeline_response.http_response
1835
-
1836
- if response.status_code not in [200]:
1837
- map_error(
1838
- status_code=response.status_code, response=response, error_map=error_map
1839
- )
1840
- raise HttpResponseError(response=response)
1841
-
1842
- deserialized = self._deserialize(
1843
- "{SetJobStatusReturn}", pipeline_response.http_response
1844
- )
1845
-
1846
- if cls:
1847
- return cls(pipeline_response, deserialized, {}) # type: ignore
1848
-
1849
- return deserialized # type: ignore
1850
-
1851
- @distributed_trace_async
1852
- async def get_job_status_history_bulk(
1853
- self, *, job_ids: List[int], **kwargs: Any
1854
- ) -> Dict[str, List[_models.JobStatusReturn]]:
1855
- """Get Job Status History Bulk.
1856
-
1857
- Get Job Status History Bulk.
1858
-
1859
- :keyword job_ids: Required.
1860
- :paramtype job_ids: list[int]
1861
- :return: dict mapping str to list of JobStatusReturn
1862
- :rtype: dict[str, list[~generated.models.JobStatusReturn]]
1863
- :raises ~azure.core.exceptions.HttpResponseError:
1864
- """
1865
- error_map: MutableMapping = {
1866
- 401: ClientAuthenticationError,
1867
- 404: ResourceNotFoundError,
1868
- 409: ResourceExistsError,
1869
- 304: ResourceNotModifiedError,
1870
- }
1871
- error_map.update(kwargs.pop("error_map", {}) or {})
1872
-
1873
- _headers = kwargs.pop("headers", {}) or {}
1874
- _params = kwargs.pop("params", {}) or {}
1875
-
1876
- cls: ClsType[Dict[str, List[_models.JobStatusReturn]]] = kwargs.pop("cls", None)
1877
-
1878
- _request = build_jobs_get_job_status_history_bulk_request(
1879
- job_ids=job_ids,
1880
- headers=_headers,
1881
- params=_params,
1882
- )
1883
- _request.url = self._client.format_url(_request.url)
1884
-
1885
- _stream = False
1886
- pipeline_response: PipelineResponse = (
1887
- await self._client._pipeline.run( # pylint: disable=protected-access
1888
- _request, stream=_stream, **kwargs
1889
- )
1890
- )
1891
-
1892
- response = pipeline_response.http_response
1893
-
1894
- if response.status_code not in [200]:
1895
- map_error(
1896
- status_code=response.status_code, response=response, error_map=error_map
1897
- )
1898
- raise HttpResponseError(response=response)
1899
-
1900
- deserialized = self._deserialize(
1901
- "{[JobStatusReturn]}", pipeline_response.http_response
1902
- )
1903
-
1904
- if cls:
1905
- return cls(pipeline_response, deserialized, {}) # type: ignore
1906
-
1907
- return deserialized # type: ignore
1908
-
1909
- @distributed_trace_async
1910
- async def reschedule_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
1911
- """Reschedule Bulk Jobs.
1912
-
1913
- Reschedule Bulk Jobs.
1914
-
1915
- :keyword job_ids: Required.
1916
- :paramtype job_ids: list[int]
1917
- :return: any
1918
- :rtype: any
1919
- :raises ~azure.core.exceptions.HttpResponseError:
1920
- """
1921
- error_map: MutableMapping = {
1922
- 401: ClientAuthenticationError,
1923
- 404: ResourceNotFoundError,
1924
- 409: ResourceExistsError,
1925
- 304: ResourceNotModifiedError,
1926
- }
1927
- error_map.update(kwargs.pop("error_map", {}) or {})
1928
-
1929
- _headers = kwargs.pop("headers", {}) or {}
1930
- _params = kwargs.pop("params", {}) or {}
1931
-
1932
- cls: ClsType[Any] = kwargs.pop("cls", None)
1933
-
1934
- _request = build_jobs_reschedule_bulk_jobs_request(
1935
- job_ids=job_ids,
1936
- headers=_headers,
1937
- params=_params,
1938
- )
1939
- _request.url = self._client.format_url(_request.url)
1940
-
1941
- _stream = False
1942
- pipeline_response: PipelineResponse = (
1943
- await self._client._pipeline.run( # pylint: disable=protected-access
1944
- _request, stream=_stream, **kwargs
1945
- )
1946
- )
1947
-
1948
- response = pipeline_response.http_response
1949
-
1950
- if response.status_code not in [200]:
1951
- map_error(
1952
- status_code=response.status_code, response=response, error_map=error_map
1953
- )
1954
- raise HttpResponseError(response=response)
1955
-
1956
- deserialized = self._deserialize("object", pipeline_response.http_response)
1957
-
1958
- if cls:
1959
- return cls(pipeline_response, deserialized, {}) # type: ignore
1960
-
1961
- return deserialized # type: ignore
1962
-
1963
- @distributed_trace_async
1964
- async def reschedule_single_job(self, job_id: int, **kwargs: Any) -> Any:
1965
- """Reschedule Single Job.
1966
-
1967
- Reschedule Single Job.
1968
-
1969
- :param job_id: Required.
1970
- :type job_id: int
1971
- :return: any
1972
- :rtype: any
1973
- :raises ~azure.core.exceptions.HttpResponseError:
1974
- """
1975
- error_map: MutableMapping = {
1976
- 401: ClientAuthenticationError,
1977
- 404: ResourceNotFoundError,
1978
- 409: ResourceExistsError,
1979
- 304: ResourceNotModifiedError,
1980
- }
1981
- error_map.update(kwargs.pop("error_map", {}) or {})
1982
-
1983
- _headers = kwargs.pop("headers", {}) or {}
1984
- _params = kwargs.pop("params", {}) or {}
1985
-
1986
- cls: ClsType[Any] = kwargs.pop("cls", None)
1987
-
1988
- _request = build_jobs_reschedule_single_job_request(
1989
- job_id=job_id,
1990
- headers=_headers,
1991
- params=_params,
1992
- )
1993
- _request.url = self._client.format_url(_request.url)
1994
-
1995
- _stream = False
1996
- pipeline_response: PipelineResponse = (
1997
- await self._client._pipeline.run( # pylint: disable=protected-access
1998
- _request, stream=_stream, **kwargs
1999
- )
2000
- )
2001
-
2002
- response = pipeline_response.http_response
2003
-
2004
- if response.status_code not in [200]:
2005
- map_error(
2006
- status_code=response.status_code, response=response, error_map=error_map
2007
- )
2008
- raise HttpResponseError(response=response)
2009
-
2010
- deserialized = self._deserialize("object", pipeline_response.http_response)
2011
-
2012
- if cls:
2013
- return cls(pipeline_response, deserialized, {}) # type: ignore
2014
-
2015
- return deserialized # type: ignore
2016
-
2017
- @overload
2018
- async def search(
2019
- self,
2020
- body: Optional[_models.JobSearchParams] = None,
2021
- *,
2022
- page: int = 1,
2023
- per_page: int = 100,
2024
- content_type: str = "application/json",
2025
- **kwargs: Any,
2026
- ) -> List[JSON]:
2027
- """Search.
2028
-
2029
- Retrieve information about jobs.
2030
-
2031
- **TODO: Add more docs**.
2032
-
2033
- :param body: Default value is None.
2034
- :type body: ~generated.models.JobSearchParams
2035
- :keyword page: Default value is 1.
2036
- :paramtype page: int
2037
- :keyword per_page: Default value is 100.
2038
- :paramtype per_page: int
2039
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2040
- Default value is "application/json".
2041
- :paramtype content_type: str
2042
- :return: list of JSON
2043
- :rtype: list[JSON]
2044
- :raises ~azure.core.exceptions.HttpResponseError:
2045
- """
2046
-
2047
- @overload
2048
- async def search(
2049
- self,
2050
- body: Optional[IO[bytes]] = None,
2051
- *,
2052
- page: int = 1,
2053
- per_page: int = 100,
2054
- content_type: str = "application/json",
2055
- **kwargs: Any,
2056
- ) -> List[JSON]:
2057
- """Search.
2058
-
2059
- Retrieve information about jobs.
2060
-
2061
- **TODO: Add more docs**.
2062
-
2063
- :param body: Default value is None.
2064
- :type body: IO[bytes]
2065
- :keyword page: Default value is 1.
2066
- :paramtype page: int
2067
- :keyword per_page: Default value is 100.
2068
- :paramtype per_page: int
2069
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2070
- Default value is "application/json".
2071
- :paramtype content_type: str
2072
- :return: list of JSON
2073
- :rtype: list[JSON]
2074
- :raises ~azure.core.exceptions.HttpResponseError:
2075
- """
2076
-
2077
- @distributed_trace_async
2078
- async def search(
2079
- self,
2080
- body: Optional[Union[_models.JobSearchParams, IO[bytes]]] = None,
2081
- *,
2082
- page: int = 1,
2083
- per_page: int = 100,
2084
- **kwargs: Any,
2085
- ) -> List[JSON]:
2086
- """Search.
2087
-
2088
- Retrieve information about jobs.
2089
-
2090
- **TODO: Add more docs**.
2091
-
2092
- :param body: Is either a JobSearchParams type or a IO[bytes] type. Default value is None.
2093
- :type body: ~generated.models.JobSearchParams or IO[bytes]
2094
- :keyword page: Default value is 1.
2095
- :paramtype page: int
2096
- :keyword per_page: Default value is 100.
2097
- :paramtype per_page: int
2098
- :return: list of JSON
2099
- :rtype: list[JSON]
2100
- :raises ~azure.core.exceptions.HttpResponseError:
2101
- """
2102
- error_map: MutableMapping = {
2103
- 401: ClientAuthenticationError,
2104
- 404: ResourceNotFoundError,
2105
- 409: ResourceExistsError,
2106
- 304: ResourceNotModifiedError,
2107
- }
2108
- error_map.update(kwargs.pop("error_map", {}) or {})
2109
-
2110
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
2111
- _params = kwargs.pop("params", {}) or {}
2112
-
2113
- content_type: Optional[str] = kwargs.pop(
2114
- "content_type", _headers.pop("Content-Type", None)
2115
- )
2116
- cls: ClsType[List[JSON]] = kwargs.pop("cls", None)
2117
-
2118
- content_type = content_type or "application/json"
2119
- _json = None
2120
- _content = None
2121
- if isinstance(body, (IOBase, bytes)):
2122
- _content = body
2123
- else:
2124
- if body is not None:
2125
- _json = self._serialize.body(body, "JobSearchParams")
2126
- else:
2127
- _json = None
2128
-
2129
- _request = build_jobs_search_request(
2130
- page=page,
2131
- per_page=per_page,
2132
- content_type=content_type,
2133
- json=_json,
2134
- content=_content,
2135
- headers=_headers,
2136
- params=_params,
2137
- )
2138
- _request.url = self._client.format_url(_request.url)
2139
-
2140
- _stream = False
2141
- pipeline_response: PipelineResponse = (
2142
- await self._client._pipeline.run( # pylint: disable=protected-access
2143
- _request, stream=_stream, **kwargs
2144
- )
2145
- )
2146
-
2147
- response = pipeline_response.http_response
2148
-
2149
- if response.status_code not in [200, 206]:
2150
- map_error(
2151
- status_code=response.status_code, response=response, error_map=error_map
2152
- )
2153
- raise HttpResponseError(response=response)
2154
-
2155
- response_headers = {}
2156
- if response.status_code == 206:
2157
- response_headers["Content-Range"] = self._deserialize(
2158
- "str", response.headers.get("Content-Range")
2159
- )
2160
-
2161
- deserialized = self._deserialize("[object]", pipeline_response.http_response)
2162
-
2163
- if cls:
2164
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
2165
-
2166
- return deserialized # type: ignore
2167
-
2168
- @overload
2169
- async def summary(
2170
- self,
2171
- body: _models.JobSummaryParams,
2172
- *,
2173
- content_type: str = "application/json",
2174
- **kwargs: Any,
2175
- ) -> Any:
2176
- """Summary.
2177
-
2178
- Show information suitable for plotting.
2179
-
2180
- :param body: Required.
2181
- :type body: ~generated.models.JobSummaryParams
2182
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2183
- Default value is "application/json".
2184
- :paramtype content_type: str
2185
- :return: any
2186
- :rtype: any
2187
- :raises ~azure.core.exceptions.HttpResponseError:
2188
- """
2189
-
2190
- @overload
2191
- async def summary(
2192
- self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
2193
- ) -> Any:
2194
- """Summary.
2195
-
2196
- Show information suitable for plotting.
2197
-
2198
- :param body: Required.
2199
- :type body: IO[bytes]
2200
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2201
- Default value is "application/json".
2202
- :paramtype content_type: str
2203
- :return: any
2204
- :rtype: any
2205
- :raises ~azure.core.exceptions.HttpResponseError:
2206
- """
2207
-
2208
- @distributed_trace_async
2209
- async def summary(
2210
- self, body: Union[_models.JobSummaryParams, IO[bytes]], **kwargs: Any
2211
- ) -> Any:
2212
- """Summary.
2213
-
2214
- Show information suitable for plotting.
2215
-
2216
- :param body: Is either a JobSummaryParams type or a IO[bytes] type. Required.
2217
- :type body: ~generated.models.JobSummaryParams or IO[bytes]
2218
- :return: any
2219
- :rtype: any
2220
- :raises ~azure.core.exceptions.HttpResponseError:
2221
- """
2222
- error_map: MutableMapping = {
2223
- 401: ClientAuthenticationError,
2224
- 404: ResourceNotFoundError,
2225
- 409: ResourceExistsError,
2226
- 304: ResourceNotModifiedError,
2227
- }
2228
- error_map.update(kwargs.pop("error_map", {}) or {})
2229
-
2230
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
2231
- _params = kwargs.pop("params", {}) or {}
2232
-
2233
- content_type: Optional[str] = kwargs.pop(
2234
- "content_type", _headers.pop("Content-Type", None)
2235
- )
2236
- cls: ClsType[Any] = kwargs.pop("cls", None)
2237
-
2238
- content_type = content_type or "application/json"
2239
- _json = None
2240
- _content = None
2241
- if isinstance(body, (IOBase, bytes)):
2242
- _content = body
2243
- else:
2244
- _json = self._serialize.body(body, "JobSummaryParams")
2245
-
2246
- _request = build_jobs_summary_request(
2247
- content_type=content_type,
2248
- json=_json,
2249
- content=_content,
2250
- headers=_headers,
2251
- params=_params,
2252
- )
2253
- _request.url = self._client.format_url(_request.url)
2254
-
2255
- _stream = False
2256
- pipeline_response: PipelineResponse = (
2257
- await self._client._pipeline.run( # pylint: disable=protected-access
2258
- _request, stream=_stream, **kwargs
2259
- )
2260
- )
2261
-
2262
- response = pipeline_response.http_response
2263
-
2264
- if response.status_code not in [200]:
2265
- map_error(
2266
- status_code=response.status_code, response=response, error_map=error_map
2267
- )
2268
- raise HttpResponseError(response=response)
2269
-
2270
- deserialized = self._deserialize("object", pipeline_response.http_response)
2271
-
2272
- if cls:
2273
- return cls(pipeline_response, deserialized, {}) # type: ignore
2274
-
2275
- return deserialized # type: ignore
2276
-
2277
- @distributed_trace_async
2278
- async def get_single_job(self, job_id: int, **kwargs: Any) -> Any:
2279
- """Get Single Job.
2280
-
2281
- Get Single Job.
2282
-
2283
- :param job_id: Required.
2284
- :type job_id: int
2285
- :return: any
2286
- :rtype: any
2287
- :raises ~azure.core.exceptions.HttpResponseError:
2288
- """
2289
- error_map: MutableMapping = {
2290
- 401: ClientAuthenticationError,
2291
- 404: ResourceNotFoundError,
2292
- 409: ResourceExistsError,
2293
- 304: ResourceNotModifiedError,
2294
- }
2295
- error_map.update(kwargs.pop("error_map", {}) or {})
2296
-
2297
- _headers = kwargs.pop("headers", {}) or {}
2298
- _params = kwargs.pop("params", {}) or {}
2299
-
2300
- cls: ClsType[Any] = kwargs.pop("cls", None)
2301
-
2302
- _request = build_jobs_get_single_job_request(
2303
- job_id=job_id,
2304
- headers=_headers,
2305
- params=_params,
2306
- )
2307
- _request.url = self._client.format_url(_request.url)
2308
-
2309
- _stream = False
2310
- pipeline_response: PipelineResponse = (
2311
- await self._client._pipeline.run( # pylint: disable=protected-access
2312
- _request, stream=_stream, **kwargs
2313
- )
2314
- )
2315
-
2316
- response = pipeline_response.http_response
2317
-
2318
- if response.status_code not in [200]:
2319
- map_error(
2320
- status_code=response.status_code, response=response, error_map=error_map
2321
- )
2322
- raise HttpResponseError(response=response)
2323
-
2324
- deserialized = self._deserialize("object", pipeline_response.http_response)
2325
-
2326
- if cls:
2327
- return cls(pipeline_response, deserialized, {}) # type: ignore
2328
-
2329
- return deserialized # type: ignore
2330
-
2331
- @distributed_trace_async
2332
- async def delete_single_job(self, job_id: int, **kwargs: Any) -> Any:
2333
- """Delete Single Job.
2334
-
2335
- Delete a job by killing and setting the job status to DELETED.
2336
-
2337
- :param job_id: Required.
2338
- :type job_id: int
2339
- :return: any
2340
- :rtype: any
2341
- :raises ~azure.core.exceptions.HttpResponseError:
2342
- """
2343
- error_map: MutableMapping = {
2344
- 401: ClientAuthenticationError,
2345
- 404: ResourceNotFoundError,
2346
- 409: ResourceExistsError,
2347
- 304: ResourceNotModifiedError,
2348
- }
2349
- error_map.update(kwargs.pop("error_map", {}) or {})
2350
-
2351
- _headers = kwargs.pop("headers", {}) or {}
2352
- _params = kwargs.pop("params", {}) or {}
2353
-
2354
- cls: ClsType[Any] = kwargs.pop("cls", None)
2355
-
2356
- _request = build_jobs_delete_single_job_request(
2357
- job_id=job_id,
2358
- headers=_headers,
2359
- params=_params,
2360
- )
2361
- _request.url = self._client.format_url(_request.url)
2362
-
2363
- _stream = False
2364
- pipeline_response: PipelineResponse = (
2365
- await self._client._pipeline.run( # pylint: disable=protected-access
2366
- _request, stream=_stream, **kwargs
2367
- )
2368
- )
2369
-
2370
- response = pipeline_response.http_response
2371
-
2372
- if response.status_code not in [200]:
2373
- map_error(
2374
- status_code=response.status_code, response=response, error_map=error_map
2375
- )
2376
- raise HttpResponseError(response=response)
2377
-
2378
- deserialized = self._deserialize("object", pipeline_response.http_response)
2379
-
2380
- if cls:
2381
- return cls(pipeline_response, deserialized, {}) # type: ignore
2382
-
2383
- return deserialized # type: ignore
2384
-
2385
- @distributed_trace_async
2386
- async def set_single_job_properties(
2387
- self, job_id: int, body: JSON, *, update_timestamp: bool = False, **kwargs: Any
2388
- ) -> Any:
2389
- """Set Single Job Properties.
2390
-
2391
- Update the given job properties (MinorStatus, ApplicationStatus, etc).
2392
-
2393
- :param job_id: Required.
2394
- :type job_id: int
2395
- :param body: Required.
2396
- :type body: JSON
2397
- :keyword update_timestamp: Default value is False.
2398
- :paramtype update_timestamp: bool
2399
- :return: any
2400
- :rtype: any
2401
- :raises ~azure.core.exceptions.HttpResponseError:
2402
- """
2403
- error_map: MutableMapping = {
2404
- 401: ClientAuthenticationError,
2405
- 404: ResourceNotFoundError,
2406
- 409: ResourceExistsError,
2407
- 304: ResourceNotModifiedError,
2408
- }
2409
- error_map.update(kwargs.pop("error_map", {}) or {})
2410
-
2411
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
2412
- _params = kwargs.pop("params", {}) or {}
2413
-
2414
- content_type: str = kwargs.pop(
2415
- "content_type", _headers.pop("Content-Type", "application/json")
2416
- )
2417
- cls: ClsType[Any] = kwargs.pop("cls", None)
2418
-
2419
- _json = self._serialize.body(body, "object")
2420
-
2421
- _request = build_jobs_set_single_job_properties_request(
2422
- job_id=job_id,
2423
- update_timestamp=update_timestamp,
2424
- content_type=content_type,
2425
- json=_json,
2426
- headers=_headers,
2427
- params=_params,
2428
- )
2429
- _request.url = self._client.format_url(_request.url)
2430
-
2431
- _stream = False
2432
- pipeline_response: PipelineResponse = (
2433
- await self._client._pipeline.run( # pylint: disable=protected-access
2434
- _request, stream=_stream, **kwargs
2435
- )
2436
- )
2437
-
2438
- response = pipeline_response.http_response
2439
-
2440
- if response.status_code not in [200]:
2441
- map_error(
2442
- status_code=response.status_code, response=response, error_map=error_map
2443
- )
2444
- raise HttpResponseError(response=response)
2445
-
2446
- deserialized = self._deserialize("object", pipeline_response.http_response)
2447
-
2448
- if cls:
2449
- return cls(pipeline_response, deserialized, {}) # type: ignore
2450
-
2451
- return deserialized # type: ignore
2452
-
2453
- @distributed_trace_async
2454
- async def kill_single_job(self, job_id: int, **kwargs: Any) -> Any:
2455
- """Kill Single Job.
2456
-
2457
- Kill a job.
2458
-
2459
- :param job_id: Required.
2460
- :type job_id: int
1821
+ :param body: Required.
1822
+ :type body: ~generated.models.JobSummaryParams
1823
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1824
+ Default value is "application/json".
1825
+ :paramtype content_type: str
2461
1826
  :return: any
2462
1827
  :rtype: any
2463
1828
  :raises ~azure.core.exceptions.HttpResponseError:
2464
1829
  """
2465
- error_map: MutableMapping = {
2466
- 401: ClientAuthenticationError,
2467
- 404: ResourceNotFoundError,
2468
- 409: ResourceExistsError,
2469
- 304: ResourceNotModifiedError,
2470
- }
2471
- error_map.update(kwargs.pop("error_map", {}) or {})
2472
-
2473
- _headers = kwargs.pop("headers", {}) or {}
2474
- _params = kwargs.pop("params", {}) or {}
2475
-
2476
- cls: ClsType[Any] = kwargs.pop("cls", None)
2477
-
2478
- _request = build_jobs_kill_single_job_request(
2479
- job_id=job_id,
2480
- headers=_headers,
2481
- params=_params,
2482
- )
2483
- _request.url = self._client.format_url(_request.url)
2484
-
2485
- _stream = False
2486
- pipeline_response: PipelineResponse = (
2487
- await self._client._pipeline.run( # pylint: disable=protected-access
2488
- _request, stream=_stream, **kwargs
2489
- )
2490
- )
2491
-
2492
- response = pipeline_response.http_response
2493
-
2494
- if response.status_code not in [200]:
2495
- map_error(
2496
- status_code=response.status_code, response=response, error_map=error_map
2497
- )
2498
- raise HttpResponseError(response=response)
2499
-
2500
- deserialized = self._deserialize("object", pipeline_response.http_response)
2501
-
2502
- if cls:
2503
- return cls(pipeline_response, deserialized, {}) # type: ignore
2504
-
2505
- return deserialized # type: ignore
2506
-
2507
- @distributed_trace_async
2508
- async def remove_single_job(self, job_id: int, **kwargs: Any) -> Any:
2509
- """Remove Single Job.
2510
1830
 
2511
- Fully remove a job from the WMS databases.
1831
+ @overload
1832
+ async def summary(
1833
+ self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
1834
+ ) -> Any:
1835
+ """Summary.
2512
1836
 
2513
- WARNING: This endpoint has been implemented for the compatibility with the legacy DIRAC WMS
2514
- and the JobCleaningAgent. However, once this agent is ported to diracx, this endpoint should
2515
- be removed, and the delete endpoint should be used instead.
1837
+ Show information suitable for plotting.
2516
1838
 
2517
- :param job_id: Required.
2518
- :type job_id: int
1839
+ :param body: Required.
1840
+ :type body: IO[bytes]
1841
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1842
+ Default value is "application/json".
1843
+ :paramtype content_type: str
2519
1844
  :return: any
2520
1845
  :rtype: any
2521
1846
  :raises ~azure.core.exceptions.HttpResponseError:
2522
1847
  """
2523
- error_map: MutableMapping = {
2524
- 401: ClientAuthenticationError,
2525
- 404: ResourceNotFoundError,
2526
- 409: ResourceExistsError,
2527
- 304: ResourceNotModifiedError,
2528
- }
2529
- error_map.update(kwargs.pop("error_map", {}) or {})
2530
-
2531
- _headers = kwargs.pop("headers", {}) or {}
2532
- _params = kwargs.pop("params", {}) or {}
2533
-
2534
- cls: ClsType[Any] = kwargs.pop("cls", None)
2535
-
2536
- _request = build_jobs_remove_single_job_request(
2537
- job_id=job_id,
2538
- headers=_headers,
2539
- params=_params,
2540
- )
2541
- _request.url = self._client.format_url(_request.url)
2542
-
2543
- _stream = False
2544
- pipeline_response: PipelineResponse = (
2545
- await self._client._pipeline.run( # pylint: disable=protected-access
2546
- _request, stream=_stream, **kwargs
2547
- )
2548
- )
2549
-
2550
- response = pipeline_response.http_response
2551
-
2552
- if response.status_code not in [200]:
2553
- map_error(
2554
- status_code=response.status_code, response=response, error_map=error_map
2555
- )
2556
- raise HttpResponseError(response=response)
2557
-
2558
- deserialized = self._deserialize("object", pipeline_response.http_response)
2559
-
2560
- if cls:
2561
- return cls(pipeline_response, deserialized, {}) # type: ignore
2562
-
2563
- return deserialized # type: ignore
2564
1848
 
2565
1849
  @distributed_trace_async
2566
- async def get_single_job_status(
2567
- self, job_id: int, **kwargs: Any
2568
- ) -> Dict[str, _models.LimitedJobStatusReturn]:
2569
- """Get Single Job Status.
1850
+ async def summary(
1851
+ self, body: Union[_models.JobSummaryParams, IO[bytes]], **kwargs: Any
1852
+ ) -> Any:
1853
+ """Summary.
2570
1854
 
2571
- Get Single Job Status.
1855
+ Show information suitable for plotting.
2572
1856
 
2573
- :param job_id: Required.
2574
- :type job_id: int
2575
- :return: dict mapping str to LimitedJobStatusReturn
2576
- :rtype: dict[str, ~generated.models.LimitedJobStatusReturn]
1857
+ :param body: Is either a JobSummaryParams type or a IO[bytes] type. Required.
1858
+ :type body: ~generated.models.JobSummaryParams or IO[bytes]
1859
+ :return: any
1860
+ :rtype: any
2577
1861
  :raises ~azure.core.exceptions.HttpResponseError:
2578
1862
  """
2579
1863
  error_map: MutableMapping = {
@@ -2584,15 +1868,26 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2584
1868
  }
2585
1869
  error_map.update(kwargs.pop("error_map", {}) or {})
2586
1870
 
2587
- _headers = kwargs.pop("headers", {}) or {}
1871
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
2588
1872
  _params = kwargs.pop("params", {}) or {}
2589
1873
 
2590
- cls: ClsType[Dict[str, _models.LimitedJobStatusReturn]] = kwargs.pop(
2591
- "cls", None
1874
+ content_type: Optional[str] = kwargs.pop(
1875
+ "content_type", _headers.pop("Content-Type", None)
2592
1876
  )
1877
+ cls: ClsType[Any] = kwargs.pop("cls", None)
2593
1878
 
2594
- _request = build_jobs_get_single_job_status_request(
2595
- job_id=job_id,
1879
+ content_type = content_type or "application/json"
1880
+ _json = None
1881
+ _content = None
1882
+ if isinstance(body, (IOBase, bytes)):
1883
+ _content = body
1884
+ else:
1885
+ _json = self._serialize.body(body, "JobSummaryParams")
1886
+
1887
+ _request = build_jobs_summary_request(
1888
+ content_type=content_type,
1889
+ json=_json,
1890
+ content=_content,
2596
1891
  headers=_headers,
2597
1892
  params=_params,
2598
1893
  )
@@ -2613,9 +1908,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2613
1908
  )
2614
1909
  raise HttpResponseError(response=response)
2615
1910
 
2616
- deserialized = self._deserialize(
2617
- "{LimitedJobStatusReturn}", pipeline_response.http_response
2618
- )
1911
+ deserialized = self._deserialize("object", pipeline_response.http_response)
2619
1912
 
2620
1913
  if cls:
2621
1914
  return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -2623,82 +1916,53 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2623
1916
  return deserialized # type: ignore
2624
1917
 
2625
1918
  @overload
2626
- async def set_single_job_status(
2627
- self,
2628
- job_id: int,
2629
- body: Dict[str, _models.JobStatusUpdate],
2630
- *,
2631
- force: bool = False,
2632
- content_type: str = "application/json",
2633
- **kwargs: Any,
2634
- ) -> Dict[str, _models.SetJobStatusReturn]:
2635
- """Set Single Job Status.
1919
+ async def submit_bulk_jdl_jobs(
1920
+ self, body: List[str], *, content_type: str = "application/json", **kwargs: Any
1921
+ ) -> List[_models.InsertedJob]:
1922
+ """Submit Bulk Jdl Jobs.
2636
1923
 
2637
- Set Single Job Status.
1924
+ Submit Bulk Jdl Jobs.
2638
1925
 
2639
- :param job_id: Required.
2640
- :type job_id: int
2641
1926
  :param body: Required.
2642
- :type body: dict[str, ~generated.models.JobStatusUpdate]
2643
- :keyword force: Default value is False.
2644
- :paramtype force: bool
1927
+ :type body: list[str]
2645
1928
  :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2646
1929
  Default value is "application/json".
2647
1930
  :paramtype content_type: str
2648
- :return: dict mapping str to SetJobStatusReturn
2649
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
1931
+ :return: list of InsertedJob
1932
+ :rtype: list[~generated.models.InsertedJob]
2650
1933
  :raises ~azure.core.exceptions.HttpResponseError:
2651
1934
  """
2652
1935
 
2653
1936
  @overload
2654
- async def set_single_job_status(
2655
- self,
2656
- job_id: int,
2657
- body: IO[bytes],
2658
- *,
2659
- force: bool = False,
2660
- content_type: str = "application/json",
2661
- **kwargs: Any,
2662
- ) -> Dict[str, _models.SetJobStatusReturn]:
2663
- """Set Single Job Status.
1937
+ async def submit_bulk_jdl_jobs(
1938
+ self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
1939
+ ) -> List[_models.InsertedJob]:
1940
+ """Submit Bulk Jdl Jobs.
2664
1941
 
2665
- Set Single Job Status.
1942
+ Submit Bulk Jdl Jobs.
2666
1943
 
2667
- :param job_id: Required.
2668
- :type job_id: int
2669
1944
  :param body: Required.
2670
1945
  :type body: IO[bytes]
2671
- :keyword force: Default value is False.
2672
- :paramtype force: bool
2673
1946
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2674
1947
  Default value is "application/json".
2675
1948
  :paramtype content_type: str
2676
- :return: dict mapping str to SetJobStatusReturn
2677
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
1949
+ :return: list of InsertedJob
1950
+ :rtype: list[~generated.models.InsertedJob]
2678
1951
  :raises ~azure.core.exceptions.HttpResponseError:
2679
1952
  """
2680
1953
 
2681
1954
  @distributed_trace_async
2682
- async def set_single_job_status(
2683
- self,
2684
- job_id: int,
2685
- body: Union[Dict[str, _models.JobStatusUpdate], IO[bytes]],
2686
- *,
2687
- force: bool = False,
2688
- **kwargs: Any,
2689
- ) -> Dict[str, _models.SetJobStatusReturn]:
2690
- """Set Single Job Status.
1955
+ async def submit_bulk_jdl_jobs(
1956
+ self, body: Union[List[str], IO[bytes]], **kwargs: Any
1957
+ ) -> List[_models.InsertedJob]:
1958
+ """Submit Bulk Jdl Jobs.
2691
1959
 
2692
- Set Single Job Status.
1960
+ Submit Bulk Jdl Jobs.
2693
1961
 
2694
- :param job_id: Required.
2695
- :type job_id: int
2696
- :param body: Is either a {str: JobStatusUpdate} type or a IO[bytes] type. Required.
2697
- :type body: dict[str, ~generated.models.JobStatusUpdate] or IO[bytes]
2698
- :keyword force: Default value is False.
2699
- :paramtype force: bool
2700
- :return: dict mapping str to SetJobStatusReturn
2701
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
1962
+ :param body: Is either a [str] type or a IO[bytes] type. Required.
1963
+ :type body: list[str] or IO[bytes]
1964
+ :return: list of InsertedJob
1965
+ :rtype: list[~generated.models.InsertedJob]
2702
1966
  :raises ~azure.core.exceptions.HttpResponseError:
2703
1967
  """
2704
1968
  error_map: MutableMapping = {
@@ -2715,7 +1979,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2715
1979
  content_type: Optional[str] = kwargs.pop(
2716
1980
  "content_type", _headers.pop("Content-Type", None)
2717
1981
  )
2718
- cls: ClsType[Dict[str, _models.SetJobStatusReturn]] = kwargs.pop("cls", None)
1982
+ cls: ClsType[List[_models.InsertedJob]] = kwargs.pop("cls", None)
2719
1983
 
2720
1984
  content_type = content_type or "application/json"
2721
1985
  _json = None
@@ -2723,11 +1987,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2723
1987
  if isinstance(body, (IOBase, bytes)):
2724
1988
  _content = body
2725
1989
  else:
2726
- _json = self._serialize.body(body, "{JobStatusUpdate}")
1990
+ _json = self._serialize.body(body, "[str]")
2727
1991
 
2728
- _request = build_jobs_set_single_job_status_request(
2729
- job_id=job_id,
2730
- force=force,
1992
+ _request = build_jobs_submit_bulk_jdl_jobs_request(
2731
1993
  content_type=content_type,
2732
1994
  json=_json,
2733
1995
  content=_content,
@@ -2752,65 +2014,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2752
2014
  raise HttpResponseError(response=response)
2753
2015
 
2754
2016
  deserialized = self._deserialize(
2755
- "{SetJobStatusReturn}", pipeline_response.http_response
2756
- )
2757
-
2758
- if cls:
2759
- return cls(pipeline_response, deserialized, {}) # type: ignore
2760
-
2761
- return deserialized # type: ignore
2762
-
2763
- @distributed_trace_async
2764
- async def get_single_job_status_history(
2765
- self, job_id: int, **kwargs: Any
2766
- ) -> Dict[str, List[_models.JobStatusReturn]]:
2767
- """Get Single Job Status History.
2768
-
2769
- Get Single Job Status History.
2770
-
2771
- :param job_id: Required.
2772
- :type job_id: int
2773
- :return: dict mapping str to list of JobStatusReturn
2774
- :rtype: dict[str, list[~generated.models.JobStatusReturn]]
2775
- :raises ~azure.core.exceptions.HttpResponseError:
2776
- """
2777
- error_map: MutableMapping = {
2778
- 401: ClientAuthenticationError,
2779
- 404: ResourceNotFoundError,
2780
- 409: ResourceExistsError,
2781
- 304: ResourceNotModifiedError,
2782
- }
2783
- error_map.update(kwargs.pop("error_map", {}) or {})
2784
-
2785
- _headers = kwargs.pop("headers", {}) or {}
2786
- _params = kwargs.pop("params", {}) or {}
2787
-
2788
- cls: ClsType[Dict[str, List[_models.JobStatusReturn]]] = kwargs.pop("cls", None)
2789
-
2790
- _request = build_jobs_get_single_job_status_history_request(
2791
- job_id=job_id,
2792
- headers=_headers,
2793
- params=_params,
2794
- )
2795
- _request.url = self._client.format_url(_request.url)
2796
-
2797
- _stream = False
2798
- pipeline_response: PipelineResponse = (
2799
- await self._client._pipeline.run( # pylint: disable=protected-access
2800
- _request, stream=_stream, **kwargs
2801
- )
2802
- )
2803
-
2804
- response = pipeline_response.http_response
2805
-
2806
- if response.status_code not in [200]:
2807
- map_error(
2808
- status_code=response.status_code, response=response, error_map=error_map
2809
- )
2810
- raise HttpResponseError(response=response)
2811
-
2812
- deserialized = self._deserialize(
2813
- "{[JobStatusReturn]}", pipeline_response.http_response
2017
+ "[InsertedJob]", pipeline_response.http_response
2814
2018
  )
2815
2019
 
2816
2020
  if cls: