diracx-client 0.0.1a19__py3-none-any.whl → 0.0.1a21__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,23 +1,12 @@
1
- # pylint: disable=too-many-lines,too-many-statements
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.0, generator: @autorest/python@6.23.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
8
8
  import sys
9
- from typing import (
10
- Any,
11
- Callable,
12
- Dict,
13
- IO,
14
- List,
15
- Optional,
16
- Type,
17
- TypeVar,
18
- Union,
19
- overload,
20
- )
9
+ from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload
21
10
 
22
11
  from azure.core import MatchConditions
23
12
  from azure.core.exceptions import (
@@ -41,7 +30,7 @@ from .._vendor import prep_if_match, prep_if_none_match, raise_if_not_implemente
41
30
  if sys.version_info >= (3, 9):
42
31
  from collections.abc import MutableMapping
43
32
  else:
44
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
33
+ from typing import MutableMapping # type: ignore
45
34
  T = TypeVar("T")
46
35
  ClsType = Optional[
47
36
  Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]
@@ -213,9 +202,9 @@ def build_auth_userinfo_request(**kwargs: Any) -> HttpRequest:
213
202
 
214
203
  def build_auth_authorization_flow_request(
215
204
  *,
216
- response_type: Union[str, _models.Enum0],
205
+ response_type: str,
217
206
  code_challenge: str,
218
- code_challenge_method: Union[str, _models.Enum1],
207
+ code_challenge_method: str,
219
208
  client_id: str,
220
209
  redirect_uri: str,
221
210
  scope: str,
@@ -469,28 +458,7 @@ def build_jobs_assign_sandbox_to_job_request(
469
458
  )
470
459
 
471
460
 
472
- def build_jobs_submit_bulk_jobs_request(**kwargs: Any) -> HttpRequest:
473
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
474
-
475
- content_type: Optional[str] = kwargs.pop(
476
- "content_type", _headers.pop("Content-Type", None)
477
- )
478
- accept = _headers.pop("Accept", "application/json")
479
-
480
- # Construct URL
481
- _url = "/api/jobs/"
482
-
483
- # Construct headers
484
- if content_type is not None:
485
- _headers["Content-Type"] = _SERIALIZER.header(
486
- "content_type", content_type, "str"
487
- )
488
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
489
-
490
- return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs)
491
-
492
-
493
- def build_jobs_delete_bulk_jobs_request(
461
+ def build_jobs_remove_bulk_jobs_request(
494
462
  *, job_ids: List[int], **kwargs: Any
495
463
  ) -> HttpRequest:
496
464
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
@@ -512,73 +480,7 @@ def build_jobs_delete_bulk_jobs_request(
512
480
  )
513
481
 
514
482
 
515
- def build_jobs_kill_bulk_jobs_request(
516
- *, job_ids: List[int], **kwargs: Any
517
- ) -> HttpRequest:
518
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
519
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
520
-
521
- accept = _headers.pop("Accept", "application/json")
522
-
523
- # Construct URL
524
- _url = "/api/jobs/kill"
525
-
526
- # Construct parameters
527
- _params["job_ids"] = _SERIALIZER.query("job_ids", job_ids, "[int]")
528
-
529
- # Construct headers
530
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
531
-
532
- return HttpRequest(
533
- method="POST", url=_url, params=_params, headers=_headers, **kwargs
534
- )
535
-
536
-
537
- def build_jobs_remove_bulk_jobs_request(
538
- *, job_ids: List[int], **kwargs: Any
539
- ) -> HttpRequest:
540
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
541
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
542
-
543
- accept = _headers.pop("Accept", "application/json")
544
-
545
- # Construct URL
546
- _url = "/api/jobs/remove"
547
-
548
- # Construct parameters
549
- _params["job_ids"] = _SERIALIZER.query("job_ids", job_ids, "[int]")
550
-
551
- # Construct headers
552
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
553
-
554
- return HttpRequest(
555
- method="POST", url=_url, params=_params, headers=_headers, **kwargs
556
- )
557
-
558
-
559
- def build_jobs_get_job_status_bulk_request(
560
- *, job_ids: List[int], **kwargs: Any
561
- ) -> HttpRequest:
562
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
563
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
564
-
565
- accept = _headers.pop("Accept", "application/json")
566
-
567
- # Construct URL
568
- _url = "/api/jobs/status"
569
-
570
- # Construct parameters
571
- _params["job_ids"] = _SERIALIZER.query("job_ids", job_ids, "[int]")
572
-
573
- # Construct headers
574
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
575
-
576
- return HttpRequest(
577
- method="GET", url=_url, params=_params, headers=_headers, **kwargs
578
- )
579
-
580
-
581
- def build_jobs_set_job_status_bulk_request(
483
+ def build_jobs_set_job_statuses_request(
582
484
  *, force: bool = False, **kwargs: Any
583
485
  ) -> HttpRequest:
584
486
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
@@ -608,30 +510,8 @@ def build_jobs_set_job_status_bulk_request(
608
510
  )
609
511
 
610
512
 
611
- def build_jobs_get_job_status_history_bulk_request( # pylint: disable=name-too-long
612
- *, job_ids: List[int], **kwargs: Any
613
- ) -> HttpRequest:
614
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
615
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
616
-
617
- accept = _headers.pop("Accept", "application/json")
618
-
619
- # Construct URL
620
- _url = "/api/jobs/status/history"
621
-
622
- # Construct parameters
623
- _params["job_ids"] = _SERIALIZER.query("job_ids", job_ids, "[int]")
624
-
625
- # Construct headers
626
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
627
-
628
- return HttpRequest(
629
- method="GET", url=_url, params=_params, headers=_headers, **kwargs
630
- )
631
-
632
-
633
513
  def build_jobs_reschedule_bulk_jobs_request(
634
- *, job_ids: List[int], **kwargs: Any
514
+ *, job_ids: List[int], reset_jobs: bool = False, **kwargs: Any
635
515
  ) -> HttpRequest:
636
516
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
637
517
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -643,6 +523,8 @@ def build_jobs_reschedule_bulk_jobs_request(
643
523
 
644
524
  # Construct parameters
645
525
  _params["job_ids"] = _SERIALIZER.query("job_ids", job_ids, "[int]")
526
+ if reset_jobs is not None:
527
+ _params["reset_jobs"] = _SERIALIZER.query("reset_jobs", reset_jobs, "bool")
646
528
 
647
529
  # Construct headers
648
530
  _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
@@ -652,25 +534,6 @@ def build_jobs_reschedule_bulk_jobs_request(
652
534
  )
653
535
 
654
536
 
655
- def build_jobs_reschedule_single_job_request(job_id: int, **kwargs: Any) -> HttpRequest:
656
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
657
-
658
- accept = _headers.pop("Accept", "application/json")
659
-
660
- # Construct URL
661
- _url = "/api/jobs/{job_id}/reschedule"
662
- path_format_arguments = {
663
- "job_id": _SERIALIZER.url("job_id", job_id, "int"),
664
- }
665
-
666
- _url: str = _url.format(**path_format_arguments) # type: ignore
667
-
668
- # Construct headers
669
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
670
-
671
- return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs)
672
-
673
-
674
537
  def build_jobs_search_request(
675
538
  *, page: int = 1, per_page: int = 100, **kwargs: Any
676
539
  ) -> HttpRequest:
@@ -724,49 +587,8 @@ def build_jobs_summary_request(**kwargs: Any) -> HttpRequest:
724
587
  return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs)
725
588
 
726
589
 
727
- def build_jobs_get_single_job_request(job_id: int, **kwargs: Any) -> HttpRequest:
728
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
729
-
730
- accept = _headers.pop("Accept", "application/json")
731
-
732
- # Construct URL
733
- _url = "/api/jobs/{job_id}"
734
- path_format_arguments = {
735
- "job_id": _SERIALIZER.url("job_id", job_id, "int"),
736
- }
737
-
738
- _url: str = _url.format(**path_format_arguments) # type: ignore
739
-
740
- # Construct headers
741
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
742
-
743
- return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs)
744
-
745
-
746
- def build_jobs_delete_single_job_request(job_id: int, **kwargs: Any) -> HttpRequest:
747
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
748
-
749
- accept = _headers.pop("Accept", "application/json")
750
-
751
- # Construct URL
752
- _url = "/api/jobs/{job_id}"
753
- path_format_arguments = {
754
- "job_id": _SERIALIZER.url("job_id", job_id, "int"),
755
- }
756
-
757
- _url: str = _url.format(**path_format_arguments) # type: ignore
758
-
759
- # Construct headers
760
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
761
-
762
- return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs)
763
-
764
-
765
- def build_jobs_set_single_job_properties_request( # pylint: disable=name-too-long
766
- job_id: int, *, json: JSON, update_timestamp: bool = False, **kwargs: Any
767
- ) -> HttpRequest:
590
+ def build_jobs_submit_bulk_jdl_jobs_request(**kwargs: Any) -> HttpRequest:
768
591
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
769
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
770
592
 
771
593
  content_type: Optional[str] = kwargs.pop(
772
594
  "content_type", _headers.pop("Content-Type", None)
@@ -774,18 +596,7 @@ def build_jobs_set_single_job_properties_request( # pylint: disable=name-too-lo
774
596
  accept = _headers.pop("Accept", "application/json")
775
597
 
776
598
  # Construct URL
777
- _url = "/api/jobs/{job_id}"
778
- path_format_arguments = {
779
- "job_id": _SERIALIZER.url("job_id", job_id, "int"),
780
- }
781
-
782
- _url: str = _url.format(**path_format_arguments) # type: ignore
783
-
784
- # Construct parameters
785
- if update_timestamp is not None:
786
- _params["update_timestamp"] = _SERIALIZER.query(
787
- "update_timestamp", update_timestamp, "bool"
788
- )
599
+ _url = "/api/jobs/jdl"
789
600
 
790
601
  # Construct headers
791
602
  if content_type is not None:
@@ -794,216 +605,97 @@ def build_jobs_set_single_job_properties_request( # pylint: disable=name-too-lo
794
605
  )
795
606
  _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
796
607
 
797
- return HttpRequest(
798
- method="PATCH", url=_url, params=_params, headers=_headers, json=json, **kwargs
799
- )
800
-
801
-
802
- def build_jobs_kill_single_job_request(job_id: int, **kwargs: Any) -> HttpRequest:
803
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
804
-
805
- accept = _headers.pop("Accept", "application/json")
608
+ return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs)
806
609
 
807
- # Construct URL
808
- _url = "/api/jobs/{job_id}/kill"
809
- path_format_arguments = {
810
- "job_id": _SERIALIZER.url("job_id", job_id, "int"),
811
- }
812
610
 
813
- _url: str = _url.format(**path_format_arguments) # type: ignore
611
+ class WellKnownOperations:
612
+ """
613
+ .. warning::
614
+ **DO NOT** instantiate this class directly.
814
615
 
815
- # Construct headers
816
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
616
+ Instead, you should access the following operations through
617
+ :class:`~generated.Dirac`'s
618
+ :attr:`well_known` attribute.
619
+ """
817
620
 
818
- return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs)
621
+ models = _models
819
622
 
623
+ def __init__(self, *args, **kwargs):
624
+ input_args = list(args)
625
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
626
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
627
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
628
+ self._deserialize = (
629
+ input_args.pop(0) if input_args else kwargs.pop("deserializer")
630
+ )
820
631
 
821
- def build_jobs_remove_single_job_request(job_id: int, **kwargs: Any) -> HttpRequest:
822
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
632
+ @distributed_trace
633
+ def openid_configuration(self, **kwargs: Any) -> Any:
634
+ """Openid Configuration.
823
635
 
824
- accept = _headers.pop("Accept", "application/json")
636
+ OpenID Connect discovery endpoint.
825
637
 
826
- # Construct URL
827
- _url = "/api/jobs/{job_id}/remove"
828
- path_format_arguments = {
829
- "job_id": _SERIALIZER.url("job_id", job_id, "int"),
830
- }
638
+ :return: any
639
+ :rtype: any
640
+ :raises ~azure.core.exceptions.HttpResponseError:
641
+ """
642
+ error_map: MutableMapping = {
643
+ 401: ClientAuthenticationError,
644
+ 404: ResourceNotFoundError,
645
+ 409: ResourceExistsError,
646
+ 304: ResourceNotModifiedError,
647
+ }
648
+ error_map.update(kwargs.pop("error_map", {}) or {})
831
649
 
832
- _url: str = _url.format(**path_format_arguments) # type: ignore
650
+ _headers = kwargs.pop("headers", {}) or {}
651
+ _params = kwargs.pop("params", {}) or {}
833
652
 
834
- # Construct headers
835
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
653
+ cls: ClsType[Any] = kwargs.pop("cls", None)
836
654
 
837
- return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs)
655
+ _request = build_well_known_openid_configuration_request(
656
+ headers=_headers,
657
+ params=_params,
658
+ )
659
+ _request.url = self._client.format_url(_request.url)
838
660
 
661
+ _stream = False
662
+ pipeline_response: PipelineResponse = (
663
+ self._client._pipeline.run( # pylint: disable=protected-access
664
+ _request, stream=_stream, **kwargs
665
+ )
666
+ )
839
667
 
840
- def build_jobs_get_single_job_status_request(job_id: int, **kwargs: Any) -> HttpRequest:
841
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
668
+ response = pipeline_response.http_response
842
669
 
843
- accept = _headers.pop("Accept", "application/json")
670
+ if response.status_code not in [200]:
671
+ map_error(
672
+ status_code=response.status_code, response=response, error_map=error_map
673
+ )
674
+ raise HttpResponseError(response=response)
844
675
 
845
- # Construct URL
846
- _url = "/api/jobs/{job_id}/status"
847
- path_format_arguments = {
848
- "job_id": _SERIALIZER.url("job_id", job_id, "int"),
849
- }
676
+ deserialized = self._deserialize("object", pipeline_response.http_response)
850
677
 
851
- _url: str = _url.format(**path_format_arguments) # type: ignore
678
+ if cls:
679
+ return cls(pipeline_response, deserialized, {}) # type: ignore
852
680
 
853
- # Construct headers
854
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
681
+ return deserialized # type: ignore
855
682
 
856
- return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs)
683
+ @distributed_trace
684
+ def installation_metadata(self, **kwargs: Any) -> _models.Metadata:
685
+ """Installation Metadata.
857
686
 
858
-
859
- def build_jobs_set_single_job_status_request(
860
- job_id: int, *, force: bool = False, **kwargs: Any
861
- ) -> HttpRequest:
862
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
863
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
864
-
865
- content_type: Optional[str] = kwargs.pop(
866
- "content_type", _headers.pop("Content-Type", None)
867
- )
868
- accept = _headers.pop("Accept", "application/json")
869
-
870
- # Construct URL
871
- _url = "/api/jobs/{job_id}/status"
872
- path_format_arguments = {
873
- "job_id": _SERIALIZER.url("job_id", job_id, "int"),
874
- }
875
-
876
- _url: str = _url.format(**path_format_arguments) # type: ignore
877
-
878
- # Construct parameters
879
- if force is not None:
880
- _params["force"] = _SERIALIZER.query("force", force, "bool")
881
-
882
- # Construct headers
883
- if content_type is not None:
884
- _headers["Content-Type"] = _SERIALIZER.header(
885
- "content_type", content_type, "str"
886
- )
887
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
888
-
889
- return HttpRequest(
890
- method="PATCH", url=_url, params=_params, headers=_headers, **kwargs
891
- )
892
-
893
-
894
- def build_jobs_get_single_job_status_history_request( # pylint: disable=name-too-long
895
- job_id: int, **kwargs: Any
896
- ) -> HttpRequest:
897
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
898
-
899
- accept = _headers.pop("Accept", "application/json")
900
-
901
- # Construct URL
902
- _url = "/api/jobs/{job_id}/status/history"
903
- path_format_arguments = {
904
- "job_id": _SERIALIZER.url("job_id", job_id, "int"),
905
- }
906
-
907
- _url: str = _url.format(**path_format_arguments) # type: ignore
908
-
909
- # Construct headers
910
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
911
-
912
- return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs)
913
-
914
-
915
- class WellKnownOperations:
916
- """
917
- .. warning::
918
- **DO NOT** instantiate this class directly.
919
-
920
- Instead, you should access the following operations through
921
- :class:`~generated.Dirac`'s
922
- :attr:`well_known` attribute.
923
- """
924
-
925
- models = _models
926
-
927
- def __init__(self, *args, **kwargs):
928
- input_args = list(args)
929
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
930
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
931
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
932
- self._deserialize = (
933
- input_args.pop(0) if input_args else kwargs.pop("deserializer")
934
- )
935
-
936
- @distributed_trace
937
- def openid_configuration(self, **kwargs: Any) -> Any:
938
- """Openid Configuration.
939
-
940
- OpenID Connect discovery endpoint.
941
-
942
- :return: any
943
- :rtype: any
944
- :raises ~azure.core.exceptions.HttpResponseError:
945
- """
946
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
947
- { # pylint: disable=unsubscriptable-object
948
- 401: ClientAuthenticationError,
949
- 404: ResourceNotFoundError,
950
- 409: ResourceExistsError,
951
- 304: ResourceNotModifiedError,
952
- }
953
- )
954
- error_map.update(kwargs.pop("error_map", {}) or {})
955
-
956
- _headers = kwargs.pop("headers", {}) or {}
957
- _params = kwargs.pop("params", {}) or {}
958
-
959
- cls: ClsType[Any] = kwargs.pop("cls", None)
960
-
961
- _request = build_well_known_openid_configuration_request(
962
- headers=_headers,
963
- params=_params,
964
- )
965
- _request.url = self._client.format_url(_request.url)
966
-
967
- _stream = False
968
- pipeline_response: PipelineResponse = (
969
- self._client._pipeline.run( # pylint: disable=protected-access
970
- _request, stream=_stream, **kwargs
971
- )
972
- )
973
-
974
- response = pipeline_response.http_response
975
-
976
- if response.status_code not in [200]:
977
- map_error(
978
- status_code=response.status_code, response=response, error_map=error_map
979
- )
980
- raise HttpResponseError(response=response)
981
-
982
- deserialized = self._deserialize("object", pipeline_response.http_response)
983
-
984
- if cls:
985
- return cls(pipeline_response, deserialized, {}) # type: ignore
986
-
987
- return deserialized # type: ignore
988
-
989
- @distributed_trace
990
- def installation_metadata(self, **kwargs: Any) -> _models.Metadata:
991
- """Installation Metadata.
992
-
993
- Get metadata about the dirac installation.
687
+ Get metadata about the dirac installation.
994
688
 
995
689
  :return: Metadata
996
690
  :rtype: ~generated.models.Metadata
997
691
  :raises ~azure.core.exceptions.HttpResponseError:
998
692
  """
999
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1000
- { # pylint: disable=unsubscriptable-object
1001
- 401: ClientAuthenticationError,
1002
- 404: ResourceNotFoundError,
1003
- 409: ResourceExistsError,
1004
- 304: ResourceNotModifiedError,
1005
- }
1006
- )
693
+ error_map: MutableMapping = {
694
+ 401: ClientAuthenticationError,
695
+ 404: ResourceNotFoundError,
696
+ 409: ResourceExistsError,
697
+ 304: ResourceNotModifiedError,
698
+ }
1007
699
  error_map.update(kwargs.pop("error_map", {}) or {})
1008
700
 
1009
701
  _headers = kwargs.pop("headers", {}) or {}
@@ -1075,9 +767,25 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1075
767
  """Initiate Device Flow.
1076
768
 
1077
769
  Initiate the device flow against DIRAC authorization Server.
1078
- Scope must have exactly up to one ``group`` (otherwise default) and
1079
- one or more ``property`` scope.
1080
- If no property, then get default one.
770
+
771
+ Scope details:
772
+
773
+
774
+ *
775
+ If only VO is provided: Uses the default group and its properties for the VO.
776
+
777
+ *
778
+ If VO and group are provided: Uses the specified group and its properties for the VO.
779
+
780
+ *
781
+ If VO and properties are provided: Uses the default group and combines its properties with
782
+ the
783
+ provided properties.
784
+
785
+ *
786
+ If VO, group, and properties are provided: Uses the specified group and combines its
787
+ properties with the
788
+ provided properties.
1081
789
 
1082
790
  Offers the user to go with the browser to
1083
791
  ``auth/<vo>/device?user_code=XYZ``.
@@ -1090,14 +798,12 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1090
798
  :rtype: ~generated.models.InitiateDeviceFlowResponse
1091
799
  :raises ~azure.core.exceptions.HttpResponseError:
1092
800
  """
1093
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1094
- { # pylint: disable=unsubscriptable-object
1095
- 401: ClientAuthenticationError,
1096
- 404: ResourceNotFoundError,
1097
- 409: ResourceExistsError,
1098
- 304: ResourceNotModifiedError,
1099
- }
1100
- )
801
+ error_map: MutableMapping = {
802
+ 401: ClientAuthenticationError,
803
+ 404: ResourceNotFoundError,
804
+ 409: ResourceExistsError,
805
+ 304: ResourceNotModifiedError,
806
+ }
1101
807
  error_map.update(kwargs.pop("error_map", {}) or {})
1102
808
 
1103
809
  _headers = kwargs.pop("headers", {}) or {}
@@ -1156,14 +862,12 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1156
862
  :rtype: any
1157
863
  :raises ~azure.core.exceptions.HttpResponseError:
1158
864
  """
1159
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1160
- { # pylint: disable=unsubscriptable-object
1161
- 401: ClientAuthenticationError,
1162
- 404: ResourceNotFoundError,
1163
- 409: ResourceExistsError,
1164
- 304: ResourceNotModifiedError,
1165
- }
1166
- )
865
+ error_map: MutableMapping = {
866
+ 401: ClientAuthenticationError,
867
+ 404: ResourceNotFoundError,
868
+ 409: ResourceExistsError,
869
+ 304: ResourceNotModifiedError,
870
+ }
1167
871
  error_map.update(kwargs.pop("error_map", {}) or {})
1168
872
 
1169
873
  _headers = kwargs.pop("headers", {}) or {}
@@ -1218,14 +922,12 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1218
922
  :rtype: any
1219
923
  :raises ~azure.core.exceptions.HttpResponseError:
1220
924
  """
1221
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1222
- { # pylint: disable=unsubscriptable-object
1223
- 401: ClientAuthenticationError,
1224
- 404: ResourceNotFoundError,
1225
- 409: ResourceExistsError,
1226
- 304: ResourceNotModifiedError,
1227
- }
1228
- )
925
+ error_map: MutableMapping = {
926
+ 401: ClientAuthenticationError,
927
+ 404: ResourceNotFoundError,
928
+ 409: ResourceExistsError,
929
+ 304: ResourceNotModifiedError,
930
+ }
1229
931
  error_map.update(kwargs.pop("error_map", {}) or {})
1230
932
 
1231
933
  _headers = kwargs.pop("headers", {}) or {}
@@ -1273,14 +975,12 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1273
975
  :rtype: any
1274
976
  :raises ~azure.core.exceptions.HttpResponseError:
1275
977
  """
1276
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1277
- { # pylint: disable=unsubscriptable-object
1278
- 401: ClientAuthenticationError,
1279
- 404: ResourceNotFoundError,
1280
- 409: ResourceExistsError,
1281
- 304: ResourceNotModifiedError,
1282
- }
1283
- )
978
+ error_map: MutableMapping = {
979
+ 401: ClientAuthenticationError,
980
+ 404: ResourceNotFoundError,
981
+ 409: ResourceExistsError,
982
+ 304: ResourceNotModifiedError,
983
+ }
1284
984
  error_map.update(kwargs.pop("error_map", {}) or {})
1285
985
 
1286
986
  _headers = kwargs.pop("headers", {}) or {}
@@ -1327,14 +1027,12 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1327
1027
  :rtype: list[any]
1328
1028
  :raises ~azure.core.exceptions.HttpResponseError:
1329
1029
  """
1330
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1331
- { # pylint: disable=unsubscriptable-object
1332
- 401: ClientAuthenticationError,
1333
- 404: ResourceNotFoundError,
1334
- 409: ResourceExistsError,
1335
- 304: ResourceNotModifiedError,
1336
- }
1337
- )
1030
+ error_map: MutableMapping = {
1031
+ 401: ClientAuthenticationError,
1032
+ 404: ResourceNotFoundError,
1033
+ 409: ResourceExistsError,
1034
+ 304: ResourceNotModifiedError,
1035
+ }
1338
1036
  error_map.update(kwargs.pop("error_map", {}) or {})
1339
1037
 
1340
1038
  _headers = kwargs.pop("headers", {}) or {}
@@ -1383,14 +1081,12 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1383
1081
  :rtype: str
1384
1082
  :raises ~azure.core.exceptions.HttpResponseError:
1385
1083
  """
1386
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1387
- { # pylint: disable=unsubscriptable-object
1388
- 401: ClientAuthenticationError,
1389
- 404: ResourceNotFoundError,
1390
- 409: ResourceExistsError,
1391
- 304: ResourceNotModifiedError,
1392
- }
1393
- )
1084
+ error_map: MutableMapping = {
1085
+ 401: ClientAuthenticationError,
1086
+ 404: ResourceNotFoundError,
1087
+ 409: ResourceExistsError,
1088
+ 304: ResourceNotModifiedError,
1089
+ }
1394
1090
  error_map.update(kwargs.pop("error_map", {}) or {})
1395
1091
 
1396
1092
  _headers = kwargs.pop("headers", {}) or {}
@@ -1437,14 +1133,12 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1437
1133
  :rtype: ~generated.models.UserInfoResponse
1438
1134
  :raises ~azure.core.exceptions.HttpResponseError:
1439
1135
  """
1440
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1441
- { # pylint: disable=unsubscriptable-object
1442
- 401: ClientAuthenticationError,
1443
- 404: ResourceNotFoundError,
1444
- 409: ResourceExistsError,
1445
- 304: ResourceNotModifiedError,
1446
- }
1447
- )
1136
+ error_map: MutableMapping = {
1137
+ 401: ClientAuthenticationError,
1138
+ 404: ResourceNotFoundError,
1139
+ 409: ResourceExistsError,
1140
+ 304: ResourceNotModifiedError,
1141
+ }
1448
1142
  error_map.update(kwargs.pop("error_map", {}) or {})
1449
1143
 
1450
1144
  _headers = kwargs.pop("headers", {}) or {}
@@ -1486,9 +1180,9 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1486
1180
  def authorization_flow(
1487
1181
  self,
1488
1182
  *,
1489
- response_type: Union[str, _models.Enum0],
1183
+ response_type: str,
1490
1184
  code_challenge: str,
1491
- code_challenge_method: Union[str, _models.Enum1],
1185
+ code_challenge_method: str,
1492
1186
  client_id: str,
1493
1187
  redirect_uri: str,
1494
1188
  scope: str,
@@ -1501,16 +1195,35 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1501
1195
  It will redirect to the actual OpenID server (IAM, CheckIn) to
1502
1196
  perform a authorization code flow.
1503
1197
 
1198
+ Scope details:
1199
+
1200
+
1201
+ *
1202
+ If only VO is provided: Uses the default group and its properties for the VO.
1203
+
1204
+ *
1205
+ If VO and group are provided: Uses the specified group and its properties for the VO.
1206
+
1207
+ *
1208
+ If VO and properties are provided: Uses the default group and combines its properties with
1209
+ the
1210
+ provided properties.
1211
+
1212
+ *
1213
+ If VO, group, and properties are provided: Uses the specified group and combines its
1214
+ properties with the
1215
+ provided properties.
1216
+
1504
1217
  We set the user details obtained from the user authorize flow in a cookie
1505
1218
  to be able to map the authorization flow with the corresponding
1506
1219
  user authorize flow.
1507
1220
 
1508
- :keyword response_type: "code" Required.
1509
- :paramtype response_type: str or ~generated.models.Enum0
1221
+ :keyword response_type: Required.
1222
+ :paramtype response_type: str
1510
1223
  :keyword code_challenge: Required.
1511
1224
  :paramtype code_challenge: str
1512
- :keyword code_challenge_method: "S256" Required.
1513
- :paramtype code_challenge_method: str or ~generated.models.Enum1
1225
+ :keyword code_challenge_method: Required.
1226
+ :paramtype code_challenge_method: str
1514
1227
  :keyword client_id: Required.
1515
1228
  :paramtype client_id: str
1516
1229
  :keyword redirect_uri: Required.
@@ -1523,14 +1236,12 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1523
1236
  :rtype: any
1524
1237
  :raises ~azure.core.exceptions.HttpResponseError:
1525
1238
  """
1526
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1527
- { # pylint: disable=unsubscriptable-object
1528
- 401: ClientAuthenticationError,
1529
- 404: ResourceNotFoundError,
1530
- 409: ResourceExistsError,
1531
- 304: ResourceNotModifiedError,
1532
- }
1533
- )
1239
+ error_map: MutableMapping = {
1240
+ 401: ClientAuthenticationError,
1241
+ 404: ResourceNotFoundError,
1242
+ 409: ResourceExistsError,
1243
+ 304: ResourceNotModifiedError,
1244
+ }
1534
1245
  error_map.update(kwargs.pop("error_map", {}) or {})
1535
1246
 
1536
1247
  _headers = kwargs.pop("headers", {}) or {}
@@ -1595,14 +1306,12 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1595
1306
  :rtype: any
1596
1307
  :raises ~azure.core.exceptions.HttpResponseError:
1597
1308
  """
1598
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1599
- { # pylint: disable=unsubscriptable-object
1600
- 401: ClientAuthenticationError,
1601
- 404: ResourceNotFoundError,
1602
- 409: ResourceExistsError,
1603
- 304: ResourceNotModifiedError,
1604
- }
1605
- )
1309
+ error_map: MutableMapping = {
1310
+ 401: ClientAuthenticationError,
1311
+ 404: ResourceNotFoundError,
1312
+ 409: ResourceExistsError,
1313
+ 304: ResourceNotModifiedError,
1314
+ }
1606
1315
  error_map.update(kwargs.pop("error_map", {}) or {})
1607
1316
 
1608
1317
  _headers = kwargs.pop("headers", {}) or {}
@@ -1691,14 +1400,12 @@ class ConfigOperations:
1691
1400
  :rtype: any
1692
1401
  :raises ~azure.core.exceptions.HttpResponseError:
1693
1402
  """
1694
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1695
- { # pylint: disable=unsubscriptable-object
1696
- 401: ClientAuthenticationError,
1697
- 404: ResourceNotFoundError,
1698
- 409: ResourceExistsError,
1699
- 304: ResourceNotModifiedError,
1700
- }
1701
- )
1403
+ error_map: MutableMapping = {
1404
+ 401: ClientAuthenticationError,
1405
+ 404: ResourceNotFoundError,
1406
+ 409: ResourceExistsError,
1407
+ 304: ResourceNotModifiedError,
1408
+ }
1702
1409
  if match_condition == MatchConditions.IfNotModified:
1703
1410
  error_map[412] = ResourceModifiedError
1704
1411
  elif match_condition == MatchConditions.IfPresent:
@@ -1744,7 +1451,7 @@ class ConfigOperations:
1744
1451
  return deserialized # type: ignore
1745
1452
 
1746
1453
 
1747
- class JobsOperations: # pylint: disable=too-many-public-methods
1454
+ class JobsOperations:
1748
1455
  """
1749
1456
  .. warning::
1750
1457
  **DO NOT** instantiate this class directly.
@@ -1837,14 +1544,12 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1837
1544
  :rtype: ~generated.models.SandboxUploadResponse
1838
1545
  :raises ~azure.core.exceptions.HttpResponseError:
1839
1546
  """
1840
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1841
- { # pylint: disable=unsubscriptable-object
1842
- 401: ClientAuthenticationError,
1843
- 404: ResourceNotFoundError,
1844
- 409: ResourceExistsError,
1845
- 304: ResourceNotModifiedError,
1846
- }
1847
- )
1547
+ error_map: MutableMapping = {
1548
+ 401: ClientAuthenticationError,
1549
+ 404: ResourceNotFoundError,
1550
+ 409: ResourceExistsError,
1551
+ 304: ResourceNotModifiedError,
1552
+ }
1848
1553
  error_map.update(kwargs.pop("error_map", {}) or {})
1849
1554
 
1850
1555
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
@@ -1916,14 +1621,12 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1916
1621
  :rtype: ~generated.models.SandboxDownloadResponse
1917
1622
  :raises ~azure.core.exceptions.HttpResponseError:
1918
1623
  """
1919
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1920
- { # pylint: disable=unsubscriptable-object
1921
- 401: ClientAuthenticationError,
1922
- 404: ResourceNotFoundError,
1923
- 409: ResourceExistsError,
1924
- 304: ResourceNotModifiedError,
1925
- }
1926
- )
1624
+ error_map: MutableMapping = {
1625
+ 401: ClientAuthenticationError,
1626
+ 404: ResourceNotFoundError,
1627
+ 409: ResourceExistsError,
1628
+ 304: ResourceNotModifiedError,
1629
+ }
1927
1630
  error_map.update(kwargs.pop("error_map", {}) or {})
1928
1631
 
1929
1632
  _headers = kwargs.pop("headers", {}) or {}
@@ -1976,14 +1679,12 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1976
1679
  :rtype: any
1977
1680
  :raises ~azure.core.exceptions.HttpResponseError:
1978
1681
  """
1979
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
1980
- { # pylint: disable=unsubscriptable-object
1981
- 401: ClientAuthenticationError,
1982
- 404: ResourceNotFoundError,
1983
- 409: ResourceExistsError,
1984
- 304: ResourceNotModifiedError,
1985
- }
1986
- )
1682
+ error_map: MutableMapping = {
1683
+ 401: ClientAuthenticationError,
1684
+ 404: ResourceNotFoundError,
1685
+ 409: ResourceExistsError,
1686
+ 304: ResourceNotModifiedError,
1687
+ }
1987
1688
  error_map.update(kwargs.pop("error_map", {}) or {})
1988
1689
 
1989
1690
  _headers = kwargs.pop("headers", {}) or {}
@@ -2032,14 +1733,12 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2032
1733
  :rtype: dict[str, list[any]]
2033
1734
  :raises ~azure.core.exceptions.HttpResponseError:
2034
1735
  """
2035
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2036
- { # pylint: disable=unsubscriptable-object
2037
- 401: ClientAuthenticationError,
2038
- 404: ResourceNotFoundError,
2039
- 409: ResourceExistsError,
2040
- 304: ResourceNotModifiedError,
2041
- }
2042
- )
1736
+ error_map: MutableMapping = {
1737
+ 401: ClientAuthenticationError,
1738
+ 404: ResourceNotFoundError,
1739
+ 409: ResourceExistsError,
1740
+ 304: ResourceNotModifiedError,
1741
+ }
2043
1742
  error_map.update(kwargs.pop("error_map", {}) or {})
2044
1743
 
2045
1744
  _headers = kwargs.pop("headers", {}) or {}
@@ -2088,14 +1787,12 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2088
1787
  :rtype: any
2089
1788
  :raises ~azure.core.exceptions.HttpResponseError:
2090
1789
  """
2091
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2092
- { # pylint: disable=unsubscriptable-object
2093
- 401: ClientAuthenticationError,
2094
- 404: ResourceNotFoundError,
2095
- 409: ResourceExistsError,
2096
- 304: ResourceNotModifiedError,
2097
- }
2098
- )
1790
+ error_map: MutableMapping = {
1791
+ 401: ClientAuthenticationError,
1792
+ 404: ResourceNotFoundError,
1793
+ 409: ResourceExistsError,
1794
+ 304: ResourceNotModifiedError,
1795
+ }
2099
1796
  error_map.update(kwargs.pop("error_map", {}) or {})
2100
1797
 
2101
1798
  _headers = kwargs.pop("headers", {}) or {}
@@ -2148,14 +1845,12 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2148
1845
  :rtype: list[any]
2149
1846
  :raises ~azure.core.exceptions.HttpResponseError:
2150
1847
  """
2151
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2152
- { # pylint: disable=unsubscriptable-object
2153
- 401: ClientAuthenticationError,
2154
- 404: ResourceNotFoundError,
2155
- 409: ResourceExistsError,
2156
- 304: ResourceNotModifiedError,
2157
- }
2158
- )
1848
+ error_map: MutableMapping = {
1849
+ 401: ClientAuthenticationError,
1850
+ 404: ResourceNotFoundError,
1851
+ 409: ResourceExistsError,
1852
+ 304: ResourceNotModifiedError,
1853
+ }
2159
1854
  error_map.update(kwargs.pop("error_map", {}) or {})
2160
1855
 
2161
1856
  _headers = kwargs.pop("headers", {}) or {}
@@ -2207,14 +1902,12 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2207
1902
  :rtype: any
2208
1903
  :raises ~azure.core.exceptions.HttpResponseError:
2209
1904
  """
2210
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2211
- { # pylint: disable=unsubscriptable-object
2212
- 401: ClientAuthenticationError,
2213
- 404: ResourceNotFoundError,
2214
- 409: ResourceExistsError,
2215
- 304: ResourceNotModifiedError,
2216
- }
2217
- )
1905
+ error_map: MutableMapping = {
1906
+ 401: ClientAuthenticationError,
1907
+ 404: ResourceNotFoundError,
1908
+ 409: ResourceExistsError,
1909
+ 304: ResourceNotModifiedError,
1910
+ }
2218
1911
  error_map.update(kwargs.pop("error_map", {}) or {})
2219
1912
 
2220
1913
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
@@ -2258,64 +1951,141 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2258
1951
 
2259
1952
  return deserialized # type: ignore
2260
1953
 
1954
+ @distributed_trace
1955
+ def remove_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
1956
+ """Remove Bulk Jobs.
1957
+
1958
+ Fully remove a list of jobs from the WMS databases.
1959
+
1960
+ WARNING: This endpoint has been implemented for the compatibility with the legacy DIRAC WMS
1961
+ and the JobCleaningAgent. However, once this agent is ported to diracx, this endpoint should
1962
+ be removed, and a status change to Deleted (PATCH /jobs/status) should be used instead for any
1963
+ other purpose.
1964
+
1965
+ :keyword job_ids: Required.
1966
+ :paramtype job_ids: list[int]
1967
+ :return: any
1968
+ :rtype: any
1969
+ :raises ~azure.core.exceptions.HttpResponseError:
1970
+ """
1971
+ error_map: MutableMapping = {
1972
+ 401: ClientAuthenticationError,
1973
+ 404: ResourceNotFoundError,
1974
+ 409: ResourceExistsError,
1975
+ 304: ResourceNotModifiedError,
1976
+ }
1977
+ error_map.update(kwargs.pop("error_map", {}) or {})
1978
+
1979
+ _headers = kwargs.pop("headers", {}) or {}
1980
+ _params = kwargs.pop("params", {}) or {}
1981
+
1982
+ cls: ClsType[Any] = kwargs.pop("cls", None)
1983
+
1984
+ _request = build_jobs_remove_bulk_jobs_request(
1985
+ job_ids=job_ids,
1986
+ headers=_headers,
1987
+ params=_params,
1988
+ )
1989
+ _request.url = self._client.format_url(_request.url)
1990
+
1991
+ _stream = False
1992
+ pipeline_response: PipelineResponse = (
1993
+ self._client._pipeline.run( # pylint: disable=protected-access
1994
+ _request, stream=_stream, **kwargs
1995
+ )
1996
+ )
1997
+
1998
+ response = pipeline_response.http_response
1999
+
2000
+ if response.status_code not in [200]:
2001
+ map_error(
2002
+ status_code=response.status_code, response=response, error_map=error_map
2003
+ )
2004
+ raise HttpResponseError(response=response)
2005
+
2006
+ deserialized = self._deserialize("object", pipeline_response.http_response)
2007
+
2008
+ if cls:
2009
+ return cls(pipeline_response, deserialized, {}) # type: ignore
2010
+
2011
+ return deserialized # type: ignore
2012
+
2261
2013
  @overload
2262
- def submit_bulk_jobs(
2263
- self, body: List[str], *, content_type: str = "application/json", **kwargs: Any
2264
- ) -> List[_models.InsertedJob]:
2265
- """Submit Bulk Jobs.
2014
+ def set_job_statuses(
2015
+ self,
2016
+ body: Dict[str, Dict[str, _models.JobStatusUpdate]],
2017
+ *,
2018
+ force: bool = False,
2019
+ content_type: str = "application/json",
2020
+ **kwargs: Any,
2021
+ ) -> _models.SetJobStatusReturn:
2022
+ """Set Job Statuses.
2266
2023
 
2267
- Submit Bulk Jobs.
2024
+ Set Job Statuses.
2268
2025
 
2269
2026
  :param body: Required.
2270
- :type body: list[str]
2027
+ :type body: dict[str, dict[str, ~generated.models.JobStatusUpdate]]
2028
+ :keyword force: Default value is False.
2029
+ :paramtype force: bool
2271
2030
  :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2272
2031
  Default value is "application/json".
2273
2032
  :paramtype content_type: str
2274
- :return: list of InsertedJob
2275
- :rtype: list[~generated.models.InsertedJob]
2033
+ :return: SetJobStatusReturn
2034
+ :rtype: ~generated.models.SetJobStatusReturn
2276
2035
  :raises ~azure.core.exceptions.HttpResponseError:
2277
2036
  """
2278
2037
 
2279
2038
  @overload
2280
- def submit_bulk_jobs(
2281
- self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
2282
- ) -> List[_models.InsertedJob]:
2283
- """Submit Bulk Jobs.
2039
+ def set_job_statuses(
2040
+ self,
2041
+ body: IO[bytes],
2042
+ *,
2043
+ force: bool = False,
2044
+ content_type: str = "application/json",
2045
+ **kwargs: Any,
2046
+ ) -> _models.SetJobStatusReturn:
2047
+ """Set Job Statuses.
2284
2048
 
2285
- Submit Bulk Jobs.
2049
+ Set Job Statuses.
2286
2050
 
2287
2051
  :param body: Required.
2288
2052
  :type body: IO[bytes]
2053
+ :keyword force: Default value is False.
2054
+ :paramtype force: bool
2289
2055
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2290
2056
  Default value is "application/json".
2291
2057
  :paramtype content_type: str
2292
- :return: list of InsertedJob
2293
- :rtype: list[~generated.models.InsertedJob]
2058
+ :return: SetJobStatusReturn
2059
+ :rtype: ~generated.models.SetJobStatusReturn
2294
2060
  :raises ~azure.core.exceptions.HttpResponseError:
2295
2061
  """
2296
2062
 
2297
2063
  @distributed_trace
2298
- def submit_bulk_jobs(
2299
- self, body: Union[List[str], IO[bytes]], **kwargs: Any
2300
- ) -> List[_models.InsertedJob]:
2301
- """Submit Bulk Jobs.
2064
+ def set_job_statuses(
2065
+ self,
2066
+ body: Union[Dict[str, Dict[str, _models.JobStatusUpdate]], IO[bytes]],
2067
+ *,
2068
+ force: bool = False,
2069
+ **kwargs: Any,
2070
+ ) -> _models.SetJobStatusReturn:
2071
+ """Set Job Statuses.
2302
2072
 
2303
- Submit Bulk Jobs.
2073
+ Set Job Statuses.
2304
2074
 
2305
- :param body: Is either a [str] type or a IO[bytes] type. Required.
2306
- :type body: list[str] or IO[bytes]
2307
- :return: list of InsertedJob
2308
- :rtype: list[~generated.models.InsertedJob]
2075
+ :param body: Is either a {str: {str: JobStatusUpdate}} type or a IO[bytes] type. Required.
2076
+ :type body: dict[str, dict[str, ~generated.models.JobStatusUpdate]] or IO[bytes]
2077
+ :keyword force: Default value is False.
2078
+ :paramtype force: bool
2079
+ :return: SetJobStatusReturn
2080
+ :rtype: ~generated.models.SetJobStatusReturn
2309
2081
  :raises ~azure.core.exceptions.HttpResponseError:
2310
2082
  """
2311
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2312
- { # pylint: disable=unsubscriptable-object
2313
- 401: ClientAuthenticationError,
2314
- 404: ResourceNotFoundError,
2315
- 409: ResourceExistsError,
2316
- 304: ResourceNotModifiedError,
2317
- }
2318
- )
2083
+ error_map: MutableMapping = {
2084
+ 401: ClientAuthenticationError,
2085
+ 404: ResourceNotFoundError,
2086
+ 409: ResourceExistsError,
2087
+ 304: ResourceNotModifiedError,
2088
+ }
2319
2089
  error_map.update(kwargs.pop("error_map", {}) or {})
2320
2090
 
2321
2091
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
@@ -2324,7 +2094,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2324
2094
  content_type: Optional[str] = kwargs.pop(
2325
2095
  "content_type", _headers.pop("Content-Type", None)
2326
2096
  )
2327
- cls: ClsType[List[_models.InsertedJob]] = kwargs.pop("cls", None)
2097
+ cls: ClsType[_models.SetJobStatusReturn] = kwargs.pop("cls", None)
2328
2098
 
2329
2099
  content_type = content_type or "application/json"
2330
2100
  _json = None
@@ -2332,9 +2102,10 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2332
2102
  if isinstance(body, (IOBase, bytes)):
2333
2103
  _content = body
2334
2104
  else:
2335
- _json = self._serialize.body(body, "[str]")
2105
+ _json = self._serialize.body(body, "{{JobStatusUpdate}}")
2336
2106
 
2337
- _request = build_jobs_submit_bulk_jobs_request(
2107
+ _request = build_jobs_set_job_statuses_request(
2108
+ force=force,
2338
2109
  content_type=content_type,
2339
2110
  json=_json,
2340
2111
  content=_content,
@@ -2359,7 +2130,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2359
2130
  raise HttpResponseError(response=response)
2360
2131
 
2361
2132
  deserialized = self._deserialize(
2362
- "[InsertedJob]", pipeline_response.http_response
2133
+ "SetJobStatusReturn", pipeline_response.http_response
2363
2134
  )
2364
2135
 
2365
2136
  if cls:
@@ -2368,25 +2139,27 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2368
2139
  return deserialized # type: ignore
2369
2140
 
2370
2141
  @distributed_trace
2371
- def delete_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
2372
- """Delete Bulk Jobs.
2142
+ def reschedule_bulk_jobs(
2143
+ self, *, job_ids: List[int], reset_jobs: bool = False, **kwargs: Any
2144
+ ) -> Any:
2145
+ """Reschedule Bulk Jobs.
2373
2146
 
2374
- Delete Bulk Jobs.
2147
+ Reschedule Bulk Jobs.
2375
2148
 
2376
2149
  :keyword job_ids: Required.
2377
2150
  :paramtype job_ids: list[int]
2151
+ :keyword reset_jobs: Default value is False.
2152
+ :paramtype reset_jobs: bool
2378
2153
  :return: any
2379
2154
  :rtype: any
2380
2155
  :raises ~azure.core.exceptions.HttpResponseError:
2381
2156
  """
2382
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2383
- { # pylint: disable=unsubscriptable-object
2384
- 401: ClientAuthenticationError,
2385
- 404: ResourceNotFoundError,
2386
- 409: ResourceExistsError,
2387
- 304: ResourceNotModifiedError,
2388
- }
2389
- )
2157
+ error_map: MutableMapping = {
2158
+ 401: ClientAuthenticationError,
2159
+ 404: ResourceNotFoundError,
2160
+ 409: ResourceExistsError,
2161
+ 304: ResourceNotModifiedError,
2162
+ }
2390
2163
  error_map.update(kwargs.pop("error_map", {}) or {})
2391
2164
 
2392
2165
  _headers = kwargs.pop("headers", {}) or {}
@@ -2394,1050 +2167,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2394
2167
 
2395
2168
  cls: ClsType[Any] = kwargs.pop("cls", None)
2396
2169
 
2397
- _request = build_jobs_delete_bulk_jobs_request(
2398
- job_ids=job_ids,
2399
- headers=_headers,
2400
- params=_params,
2401
- )
2402
- _request.url = self._client.format_url(_request.url)
2403
-
2404
- _stream = False
2405
- pipeline_response: PipelineResponse = (
2406
- self._client._pipeline.run( # pylint: disable=protected-access
2407
- _request, stream=_stream, **kwargs
2408
- )
2409
- )
2410
-
2411
- response = pipeline_response.http_response
2412
-
2413
- if response.status_code not in [200]:
2414
- map_error(
2415
- status_code=response.status_code, response=response, error_map=error_map
2416
- )
2417
- raise HttpResponseError(response=response)
2418
-
2419
- deserialized = self._deserialize("object", pipeline_response.http_response)
2420
-
2421
- if cls:
2422
- return cls(pipeline_response, deserialized, {}) # type: ignore
2423
-
2424
- return deserialized # type: ignore
2425
-
2426
- @distributed_trace
2427
- def kill_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
2428
- """Kill Bulk Jobs.
2429
-
2430
- Kill Bulk Jobs.
2431
-
2432
- :keyword job_ids: Required.
2433
- :paramtype job_ids: list[int]
2434
- :return: any
2435
- :rtype: any
2436
- :raises ~azure.core.exceptions.HttpResponseError:
2437
- """
2438
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2439
- { # pylint: disable=unsubscriptable-object
2440
- 401: ClientAuthenticationError,
2441
- 404: ResourceNotFoundError,
2442
- 409: ResourceExistsError,
2443
- 304: ResourceNotModifiedError,
2444
- }
2445
- )
2446
- error_map.update(kwargs.pop("error_map", {}) or {})
2447
-
2448
- _headers = kwargs.pop("headers", {}) or {}
2449
- _params = kwargs.pop("params", {}) or {}
2450
-
2451
- cls: ClsType[Any] = kwargs.pop("cls", None)
2452
-
2453
- _request = build_jobs_kill_bulk_jobs_request(
2454
- job_ids=job_ids,
2455
- headers=_headers,
2456
- params=_params,
2457
- )
2458
- _request.url = self._client.format_url(_request.url)
2459
-
2460
- _stream = False
2461
- pipeline_response: PipelineResponse = (
2462
- self._client._pipeline.run( # pylint: disable=protected-access
2463
- _request, stream=_stream, **kwargs
2464
- )
2465
- )
2466
-
2467
- response = pipeline_response.http_response
2468
-
2469
- if response.status_code not in [200]:
2470
- map_error(
2471
- status_code=response.status_code, response=response, error_map=error_map
2472
- )
2473
- raise HttpResponseError(response=response)
2474
-
2475
- deserialized = self._deserialize("object", pipeline_response.http_response)
2476
-
2477
- if cls:
2478
- return cls(pipeline_response, deserialized, {}) # type: ignore
2479
-
2480
- return deserialized # type: ignore
2481
-
2482
- @distributed_trace
2483
- def remove_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
2484
- """Remove Bulk Jobs.
2485
-
2486
- Fully remove a list of jobs from the WMS databases.
2487
-
2488
- WARNING: This endpoint has been implemented for the compatibility with the legacy DIRAC WMS
2489
- and the JobCleaningAgent. However, once this agent is ported to diracx, this endpoint should
2490
- be removed, and the delete endpoint should be used instead for any other purpose.
2491
-
2492
- :keyword job_ids: Required.
2493
- :paramtype job_ids: list[int]
2494
- :return: any
2495
- :rtype: any
2496
- :raises ~azure.core.exceptions.HttpResponseError:
2497
- """
2498
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2499
- { # pylint: disable=unsubscriptable-object
2500
- 401: ClientAuthenticationError,
2501
- 404: ResourceNotFoundError,
2502
- 409: ResourceExistsError,
2503
- 304: ResourceNotModifiedError,
2504
- }
2505
- )
2506
- error_map.update(kwargs.pop("error_map", {}) or {})
2507
-
2508
- _headers = kwargs.pop("headers", {}) or {}
2509
- _params = kwargs.pop("params", {}) or {}
2510
-
2511
- cls: ClsType[Any] = kwargs.pop("cls", None)
2512
-
2513
- _request = build_jobs_remove_bulk_jobs_request(
2514
- job_ids=job_ids,
2515
- headers=_headers,
2516
- params=_params,
2517
- )
2518
- _request.url = self._client.format_url(_request.url)
2519
-
2520
- _stream = False
2521
- pipeline_response: PipelineResponse = (
2522
- self._client._pipeline.run( # pylint: disable=protected-access
2523
- _request, stream=_stream, **kwargs
2524
- )
2525
- )
2526
-
2527
- response = pipeline_response.http_response
2528
-
2529
- if response.status_code not in [200]:
2530
- map_error(
2531
- status_code=response.status_code, response=response, error_map=error_map
2532
- )
2533
- raise HttpResponseError(response=response)
2534
-
2535
- deserialized = self._deserialize("object", pipeline_response.http_response)
2536
-
2537
- if cls:
2538
- return cls(pipeline_response, deserialized, {}) # type: ignore
2539
-
2540
- return deserialized # type: ignore
2541
-
2542
- @distributed_trace
2543
- def get_job_status_bulk(
2544
- self, *, job_ids: List[int], **kwargs: Any
2545
- ) -> Dict[str, _models.LimitedJobStatusReturn]:
2546
- """Get Job Status Bulk.
2547
-
2548
- Get Job Status Bulk.
2549
-
2550
- :keyword job_ids: Required.
2551
- :paramtype job_ids: list[int]
2552
- :return: dict mapping str to LimitedJobStatusReturn
2553
- :rtype: dict[str, ~generated.models.LimitedJobStatusReturn]
2554
- :raises ~azure.core.exceptions.HttpResponseError:
2555
- """
2556
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2557
- { # pylint: disable=unsubscriptable-object
2558
- 401: ClientAuthenticationError,
2559
- 404: ResourceNotFoundError,
2560
- 409: ResourceExistsError,
2561
- 304: ResourceNotModifiedError,
2562
- }
2563
- )
2564
- error_map.update(kwargs.pop("error_map", {}) or {})
2565
-
2566
- _headers = kwargs.pop("headers", {}) or {}
2567
- _params = kwargs.pop("params", {}) or {}
2568
-
2569
- cls: ClsType[Dict[str, _models.LimitedJobStatusReturn]] = kwargs.pop(
2570
- "cls", None
2571
- )
2572
-
2573
- _request = build_jobs_get_job_status_bulk_request(
2574
- job_ids=job_ids,
2575
- headers=_headers,
2576
- params=_params,
2577
- )
2578
- _request.url = self._client.format_url(_request.url)
2579
-
2580
- _stream = False
2581
- pipeline_response: PipelineResponse = (
2582
- self._client._pipeline.run( # pylint: disable=protected-access
2583
- _request, stream=_stream, **kwargs
2584
- )
2585
- )
2586
-
2587
- response = pipeline_response.http_response
2588
-
2589
- if response.status_code not in [200]:
2590
- map_error(
2591
- status_code=response.status_code, response=response, error_map=error_map
2592
- )
2593
- raise HttpResponseError(response=response)
2594
-
2595
- deserialized = self._deserialize(
2596
- "{LimitedJobStatusReturn}", pipeline_response.http_response
2597
- )
2598
-
2599
- if cls:
2600
- return cls(pipeline_response, deserialized, {}) # type: ignore
2601
-
2602
- return deserialized # type: ignore
2603
-
2604
- @overload
2605
- def set_job_status_bulk(
2606
- self,
2607
- body: Dict[str, Dict[str, _models.JobStatusUpdate]],
2608
- *,
2609
- force: bool = False,
2610
- content_type: str = "application/json",
2611
- **kwargs: Any,
2612
- ) -> Dict[str, _models.SetJobStatusReturn]:
2613
- """Set Job Status Bulk.
2614
-
2615
- Set Job Status Bulk.
2616
-
2617
- :param body: Required.
2618
- :type body: dict[str, dict[str, ~generated.models.JobStatusUpdate]]
2619
- :keyword force: Default value is False.
2620
- :paramtype force: bool
2621
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2622
- Default value is "application/json".
2623
- :paramtype content_type: str
2624
- :return: dict mapping str to SetJobStatusReturn
2625
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
2626
- :raises ~azure.core.exceptions.HttpResponseError:
2627
- """
2628
-
2629
- @overload
2630
- def set_job_status_bulk(
2631
- self,
2632
- body: IO[bytes],
2633
- *,
2634
- force: bool = False,
2635
- content_type: str = "application/json",
2636
- **kwargs: Any,
2637
- ) -> Dict[str, _models.SetJobStatusReturn]:
2638
- """Set Job Status Bulk.
2639
-
2640
- Set Job Status Bulk.
2641
-
2642
- :param body: Required.
2643
- :type body: IO[bytes]
2644
- :keyword force: Default value is False.
2645
- :paramtype force: bool
2646
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2647
- Default value is "application/json".
2648
- :paramtype content_type: str
2649
- :return: dict mapping str to SetJobStatusReturn
2650
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
2651
- :raises ~azure.core.exceptions.HttpResponseError:
2652
- """
2653
-
2654
- @distributed_trace
2655
- def set_job_status_bulk(
2656
- self,
2657
- body: Union[Dict[str, Dict[str, _models.JobStatusUpdate]], IO[bytes]],
2658
- *,
2659
- force: bool = False,
2660
- **kwargs: Any,
2661
- ) -> Dict[str, _models.SetJobStatusReturn]:
2662
- """Set Job Status Bulk.
2663
-
2664
- Set Job Status Bulk.
2665
-
2666
- :param body: Is either a {str: {str: JobStatusUpdate}} type or a IO[bytes] type. Required.
2667
- :type body: dict[str, dict[str, ~generated.models.JobStatusUpdate]] or IO[bytes]
2668
- :keyword force: Default value is False.
2669
- :paramtype force: bool
2670
- :return: dict mapping str to SetJobStatusReturn
2671
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
2672
- :raises ~azure.core.exceptions.HttpResponseError:
2673
- """
2674
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2675
- { # pylint: disable=unsubscriptable-object
2676
- 401: ClientAuthenticationError,
2677
- 404: ResourceNotFoundError,
2678
- 409: ResourceExistsError,
2679
- 304: ResourceNotModifiedError,
2680
- }
2681
- )
2682
- error_map.update(kwargs.pop("error_map", {}) or {})
2683
-
2684
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
2685
- _params = kwargs.pop("params", {}) or {}
2686
-
2687
- content_type: Optional[str] = kwargs.pop(
2688
- "content_type", _headers.pop("Content-Type", None)
2689
- )
2690
- cls: ClsType[Dict[str, _models.SetJobStatusReturn]] = kwargs.pop("cls", None)
2691
-
2692
- content_type = content_type or "application/json"
2693
- _json = None
2694
- _content = None
2695
- if isinstance(body, (IOBase, bytes)):
2696
- _content = body
2697
- else:
2698
- _json = self._serialize.body(body, "{{JobStatusUpdate}}")
2699
-
2700
- _request = build_jobs_set_job_status_bulk_request(
2701
- force=force,
2702
- content_type=content_type,
2703
- json=_json,
2704
- content=_content,
2705
- headers=_headers,
2706
- params=_params,
2707
- )
2708
- _request.url = self._client.format_url(_request.url)
2709
-
2710
- _stream = False
2711
- pipeline_response: PipelineResponse = (
2712
- self._client._pipeline.run( # pylint: disable=protected-access
2713
- _request, stream=_stream, **kwargs
2714
- )
2715
- )
2716
-
2717
- response = pipeline_response.http_response
2718
-
2719
- if response.status_code not in [200]:
2720
- map_error(
2721
- status_code=response.status_code, response=response, error_map=error_map
2722
- )
2723
- raise HttpResponseError(response=response)
2724
-
2725
- deserialized = self._deserialize(
2726
- "{SetJobStatusReturn}", pipeline_response.http_response
2727
- )
2728
-
2729
- if cls:
2730
- return cls(pipeline_response, deserialized, {}) # type: ignore
2731
-
2732
- return deserialized # type: ignore
2733
-
2734
- @distributed_trace
2735
- def get_job_status_history_bulk(
2736
- self, *, job_ids: List[int], **kwargs: Any
2737
- ) -> Dict[str, List[_models.JobStatusReturn]]:
2738
- """Get Job Status History Bulk.
2739
-
2740
- Get Job Status History Bulk.
2741
-
2742
- :keyword job_ids: Required.
2743
- :paramtype job_ids: list[int]
2744
- :return: dict mapping str to list of JobStatusReturn
2745
- :rtype: dict[str, list[~generated.models.JobStatusReturn]]
2746
- :raises ~azure.core.exceptions.HttpResponseError:
2747
- """
2748
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2749
- { # pylint: disable=unsubscriptable-object
2750
- 401: ClientAuthenticationError,
2751
- 404: ResourceNotFoundError,
2752
- 409: ResourceExistsError,
2753
- 304: ResourceNotModifiedError,
2754
- }
2755
- )
2756
- error_map.update(kwargs.pop("error_map", {}) or {})
2757
-
2758
- _headers = kwargs.pop("headers", {}) or {}
2759
- _params = kwargs.pop("params", {}) or {}
2760
-
2761
- cls: ClsType[Dict[str, List[_models.JobStatusReturn]]] = kwargs.pop("cls", None)
2762
-
2763
- _request = build_jobs_get_job_status_history_bulk_request(
2764
- job_ids=job_ids,
2765
- headers=_headers,
2766
- params=_params,
2767
- )
2768
- _request.url = self._client.format_url(_request.url)
2769
-
2770
- _stream = False
2771
- pipeline_response: PipelineResponse = (
2772
- self._client._pipeline.run( # pylint: disable=protected-access
2773
- _request, stream=_stream, **kwargs
2774
- )
2775
- )
2776
-
2777
- response = pipeline_response.http_response
2778
-
2779
- if response.status_code not in [200]:
2780
- map_error(
2781
- status_code=response.status_code, response=response, error_map=error_map
2782
- )
2783
- raise HttpResponseError(response=response)
2784
-
2785
- deserialized = self._deserialize(
2786
- "{[JobStatusReturn]}", pipeline_response.http_response
2787
- )
2788
-
2789
- if cls:
2790
- return cls(pipeline_response, deserialized, {}) # type: ignore
2791
-
2792
- return deserialized # type: ignore
2793
-
2794
- @distributed_trace
2795
- def reschedule_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
2796
- """Reschedule Bulk Jobs.
2797
-
2798
- Reschedule Bulk Jobs.
2799
-
2800
- :keyword job_ids: Required.
2801
- :paramtype job_ids: list[int]
2802
- :return: any
2803
- :rtype: any
2804
- :raises ~azure.core.exceptions.HttpResponseError:
2805
- """
2806
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2807
- { # pylint: disable=unsubscriptable-object
2808
- 401: ClientAuthenticationError,
2809
- 404: ResourceNotFoundError,
2810
- 409: ResourceExistsError,
2811
- 304: ResourceNotModifiedError,
2812
- }
2813
- )
2814
- error_map.update(kwargs.pop("error_map", {}) or {})
2815
-
2816
- _headers = kwargs.pop("headers", {}) or {}
2817
- _params = kwargs.pop("params", {}) or {}
2818
-
2819
- cls: ClsType[Any] = kwargs.pop("cls", None)
2820
-
2821
- _request = build_jobs_reschedule_bulk_jobs_request(
2822
- job_ids=job_ids,
2823
- headers=_headers,
2824
- params=_params,
2825
- )
2826
- _request.url = self._client.format_url(_request.url)
2827
-
2828
- _stream = False
2829
- pipeline_response: PipelineResponse = (
2830
- self._client._pipeline.run( # pylint: disable=protected-access
2831
- _request, stream=_stream, **kwargs
2832
- )
2833
- )
2834
-
2835
- response = pipeline_response.http_response
2836
-
2837
- if response.status_code not in [200]:
2838
- map_error(
2839
- status_code=response.status_code, response=response, error_map=error_map
2840
- )
2841
- raise HttpResponseError(response=response)
2842
-
2843
- deserialized = self._deserialize("object", pipeline_response.http_response)
2844
-
2845
- if cls:
2846
- return cls(pipeline_response, deserialized, {}) # type: ignore
2847
-
2848
- return deserialized # type: ignore
2849
-
2850
- @distributed_trace
2851
- def reschedule_single_job(self, job_id: int, **kwargs: Any) -> Any:
2852
- """Reschedule Single Job.
2853
-
2854
- Reschedule Single Job.
2855
-
2856
- :param job_id: Required.
2857
- :type job_id: int
2858
- :return: any
2859
- :rtype: any
2860
- :raises ~azure.core.exceptions.HttpResponseError:
2861
- """
2862
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2863
- { # pylint: disable=unsubscriptable-object
2864
- 401: ClientAuthenticationError,
2865
- 404: ResourceNotFoundError,
2866
- 409: ResourceExistsError,
2867
- 304: ResourceNotModifiedError,
2868
- }
2869
- )
2870
- error_map.update(kwargs.pop("error_map", {}) or {})
2871
-
2872
- _headers = kwargs.pop("headers", {}) or {}
2873
- _params = kwargs.pop("params", {}) or {}
2874
-
2875
- cls: ClsType[Any] = kwargs.pop("cls", None)
2876
-
2877
- _request = build_jobs_reschedule_single_job_request(
2878
- job_id=job_id,
2879
- headers=_headers,
2880
- params=_params,
2881
- )
2882
- _request.url = self._client.format_url(_request.url)
2883
-
2884
- _stream = False
2885
- pipeline_response: PipelineResponse = (
2886
- self._client._pipeline.run( # pylint: disable=protected-access
2887
- _request, stream=_stream, **kwargs
2888
- )
2889
- )
2890
-
2891
- response = pipeline_response.http_response
2892
-
2893
- if response.status_code not in [200]:
2894
- map_error(
2895
- status_code=response.status_code, response=response, error_map=error_map
2896
- )
2897
- raise HttpResponseError(response=response)
2898
-
2899
- deserialized = self._deserialize("object", pipeline_response.http_response)
2900
-
2901
- if cls:
2902
- return cls(pipeline_response, deserialized, {}) # type: ignore
2903
-
2904
- return deserialized # type: ignore
2905
-
2906
- @overload
2907
- def search(
2908
- self,
2909
- body: Optional[_models.JobSearchParams] = None,
2910
- *,
2911
- page: int = 1,
2912
- per_page: int = 100,
2913
- content_type: str = "application/json",
2914
- **kwargs: Any,
2915
- ) -> List[JSON]:
2916
- """Search.
2917
-
2918
- Retrieve information about jobs.
2919
-
2920
- **TODO: Add more docs**.
2921
-
2922
- :param body: Default value is None.
2923
- :type body: ~generated.models.JobSearchParams
2924
- :keyword page: Default value is 1.
2925
- :paramtype page: int
2926
- :keyword per_page: Default value is 100.
2927
- :paramtype per_page: int
2928
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2929
- Default value is "application/json".
2930
- :paramtype content_type: str
2931
- :return: list of JSON
2932
- :rtype: list[JSON]
2933
- :raises ~azure.core.exceptions.HttpResponseError:
2934
- """
2935
-
2936
- @overload
2937
- def search(
2938
- self,
2939
- body: Optional[IO[bytes]] = None,
2940
- *,
2941
- page: int = 1,
2942
- per_page: int = 100,
2943
- content_type: str = "application/json",
2944
- **kwargs: Any,
2945
- ) -> List[JSON]:
2946
- """Search.
2947
-
2948
- Retrieve information about jobs.
2949
-
2950
- **TODO: Add more docs**.
2951
-
2952
- :param body: Default value is None.
2953
- :type body: IO[bytes]
2954
- :keyword page: Default value is 1.
2955
- :paramtype page: int
2956
- :keyword per_page: Default value is 100.
2957
- :paramtype per_page: int
2958
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2959
- Default value is "application/json".
2960
- :paramtype content_type: str
2961
- :return: list of JSON
2962
- :rtype: list[JSON]
2963
- :raises ~azure.core.exceptions.HttpResponseError:
2964
- """
2965
-
2966
- @distributed_trace
2967
- def search(
2968
- self,
2969
- body: Optional[Union[_models.JobSearchParams, IO[bytes]]] = None,
2970
- *,
2971
- page: int = 1,
2972
- per_page: int = 100,
2973
- **kwargs: Any,
2974
- ) -> List[JSON]:
2975
- """Search.
2976
-
2977
- Retrieve information about jobs.
2978
-
2979
- **TODO: Add more docs**.
2980
-
2981
- :param body: Is either a JobSearchParams type or a IO[bytes] type. Default value is None.
2982
- :type body: ~generated.models.JobSearchParams or IO[bytes]
2983
- :keyword page: Default value is 1.
2984
- :paramtype page: int
2985
- :keyword per_page: Default value is 100.
2986
- :paramtype per_page: int
2987
- :return: list of JSON
2988
- :rtype: list[JSON]
2989
- :raises ~azure.core.exceptions.HttpResponseError:
2990
- """
2991
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
2992
- { # pylint: disable=unsubscriptable-object
2993
- 401: ClientAuthenticationError,
2994
- 404: ResourceNotFoundError,
2995
- 409: ResourceExistsError,
2996
- 304: ResourceNotModifiedError,
2997
- }
2998
- )
2999
- error_map.update(kwargs.pop("error_map", {}) or {})
3000
-
3001
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
3002
- _params = kwargs.pop("params", {}) or {}
3003
-
3004
- content_type: Optional[str] = kwargs.pop(
3005
- "content_type", _headers.pop("Content-Type", None)
3006
- )
3007
- cls: ClsType[List[JSON]] = kwargs.pop("cls", None)
3008
-
3009
- content_type = content_type or "application/json"
3010
- _json = None
3011
- _content = None
3012
- if isinstance(body, (IOBase, bytes)):
3013
- _content = body
3014
- else:
3015
- if body is not None:
3016
- _json = self._serialize.body(body, "JobSearchParams")
3017
- else:
3018
- _json = None
3019
-
3020
- _request = build_jobs_search_request(
3021
- page=page,
3022
- per_page=per_page,
3023
- content_type=content_type,
3024
- json=_json,
3025
- content=_content,
3026
- headers=_headers,
3027
- params=_params,
3028
- )
3029
- _request.url = self._client.format_url(_request.url)
3030
-
3031
- _stream = False
3032
- pipeline_response: PipelineResponse = (
3033
- self._client._pipeline.run( # pylint: disable=protected-access
3034
- _request, stream=_stream, **kwargs
3035
- )
3036
- )
3037
-
3038
- response = pipeline_response.http_response
3039
-
3040
- if response.status_code not in [200, 206]:
3041
- map_error(
3042
- status_code=response.status_code, response=response, error_map=error_map
3043
- )
3044
- raise HttpResponseError(response=response)
3045
-
3046
- response_headers = {}
3047
- if response.status_code == 206:
3048
- response_headers["Content-Range"] = self._deserialize(
3049
- "str", response.headers.get("Content-Range")
3050
- )
3051
-
3052
- deserialized = self._deserialize("[object]", pipeline_response.http_response)
3053
-
3054
- if cls:
3055
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
3056
-
3057
- return deserialized # type: ignore
3058
-
3059
- @overload
3060
- def summary(
3061
- self,
3062
- body: _models.JobSummaryParams,
3063
- *,
3064
- content_type: str = "application/json",
3065
- **kwargs: Any,
3066
- ) -> Any:
3067
- """Summary.
3068
-
3069
- Show information suitable for plotting.
3070
-
3071
- :param body: Required.
3072
- :type body: ~generated.models.JobSummaryParams
3073
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
3074
- Default value is "application/json".
3075
- :paramtype content_type: str
3076
- :return: any
3077
- :rtype: any
3078
- :raises ~azure.core.exceptions.HttpResponseError:
3079
- """
3080
-
3081
- @overload
3082
- def summary(
3083
- self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
3084
- ) -> Any:
3085
- """Summary.
3086
-
3087
- Show information suitable for plotting.
3088
-
3089
- :param body: Required.
3090
- :type body: IO[bytes]
3091
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
3092
- Default value is "application/json".
3093
- :paramtype content_type: str
3094
- :return: any
3095
- :rtype: any
3096
- :raises ~azure.core.exceptions.HttpResponseError:
3097
- """
3098
-
3099
- @distributed_trace
3100
- def summary(
3101
- self, body: Union[_models.JobSummaryParams, IO[bytes]], **kwargs: Any
3102
- ) -> Any:
3103
- """Summary.
3104
-
3105
- Show information suitable for plotting.
3106
-
3107
- :param body: Is either a JobSummaryParams type or a IO[bytes] type. Required.
3108
- :type body: ~generated.models.JobSummaryParams or IO[bytes]
3109
- :return: any
3110
- :rtype: any
3111
- :raises ~azure.core.exceptions.HttpResponseError:
3112
- """
3113
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
3114
- { # pylint: disable=unsubscriptable-object
3115
- 401: ClientAuthenticationError,
3116
- 404: ResourceNotFoundError,
3117
- 409: ResourceExistsError,
3118
- 304: ResourceNotModifiedError,
3119
- }
3120
- )
3121
- error_map.update(kwargs.pop("error_map", {}) or {})
3122
-
3123
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
3124
- _params = kwargs.pop("params", {}) or {}
3125
-
3126
- content_type: Optional[str] = kwargs.pop(
3127
- "content_type", _headers.pop("Content-Type", None)
3128
- )
3129
- cls: ClsType[Any] = kwargs.pop("cls", None)
3130
-
3131
- content_type = content_type or "application/json"
3132
- _json = None
3133
- _content = None
3134
- if isinstance(body, (IOBase, bytes)):
3135
- _content = body
3136
- else:
3137
- _json = self._serialize.body(body, "JobSummaryParams")
3138
-
3139
- _request = build_jobs_summary_request(
3140
- content_type=content_type,
3141
- json=_json,
3142
- content=_content,
3143
- headers=_headers,
3144
- params=_params,
3145
- )
3146
- _request.url = self._client.format_url(_request.url)
3147
-
3148
- _stream = False
3149
- pipeline_response: PipelineResponse = (
3150
- self._client._pipeline.run( # pylint: disable=protected-access
3151
- _request, stream=_stream, **kwargs
3152
- )
3153
- )
3154
-
3155
- response = pipeline_response.http_response
3156
-
3157
- if response.status_code not in [200]:
3158
- map_error(
3159
- status_code=response.status_code, response=response, error_map=error_map
3160
- )
3161
- raise HttpResponseError(response=response)
3162
-
3163
- deserialized = self._deserialize("object", pipeline_response.http_response)
3164
-
3165
- if cls:
3166
- return cls(pipeline_response, deserialized, {}) # type: ignore
3167
-
3168
- return deserialized # type: ignore
3169
-
3170
- @distributed_trace
3171
- def get_single_job(self, job_id: int, **kwargs: Any) -> Any:
3172
- """Get Single Job.
3173
-
3174
- Get Single Job.
3175
-
3176
- :param job_id: Required.
3177
- :type job_id: int
3178
- :return: any
3179
- :rtype: any
3180
- :raises ~azure.core.exceptions.HttpResponseError:
3181
- """
3182
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
3183
- { # pylint: disable=unsubscriptable-object
3184
- 401: ClientAuthenticationError,
3185
- 404: ResourceNotFoundError,
3186
- 409: ResourceExistsError,
3187
- 304: ResourceNotModifiedError,
3188
- }
3189
- )
3190
- error_map.update(kwargs.pop("error_map", {}) or {})
3191
-
3192
- _headers = kwargs.pop("headers", {}) or {}
3193
- _params = kwargs.pop("params", {}) or {}
3194
-
3195
- cls: ClsType[Any] = kwargs.pop("cls", None)
3196
-
3197
- _request = build_jobs_get_single_job_request(
3198
- job_id=job_id,
3199
- headers=_headers,
3200
- params=_params,
3201
- )
3202
- _request.url = self._client.format_url(_request.url)
3203
-
3204
- _stream = False
3205
- pipeline_response: PipelineResponse = (
3206
- self._client._pipeline.run( # pylint: disable=protected-access
3207
- _request, stream=_stream, **kwargs
3208
- )
3209
- )
3210
-
3211
- response = pipeline_response.http_response
3212
-
3213
- if response.status_code not in [200]:
3214
- map_error(
3215
- status_code=response.status_code, response=response, error_map=error_map
3216
- )
3217
- raise HttpResponseError(response=response)
3218
-
3219
- deserialized = self._deserialize("object", pipeline_response.http_response)
3220
-
3221
- if cls:
3222
- return cls(pipeline_response, deserialized, {}) # type: ignore
3223
-
3224
- return deserialized # type: ignore
3225
-
3226
- @distributed_trace
3227
- def delete_single_job(self, job_id: int, **kwargs: Any) -> Any:
3228
- """Delete Single Job.
3229
-
3230
- Delete a job by killing and setting the job status to DELETED.
3231
-
3232
- :param job_id: Required.
3233
- :type job_id: int
3234
- :return: any
3235
- :rtype: any
3236
- :raises ~azure.core.exceptions.HttpResponseError:
3237
- """
3238
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
3239
- { # pylint: disable=unsubscriptable-object
3240
- 401: ClientAuthenticationError,
3241
- 404: ResourceNotFoundError,
3242
- 409: ResourceExistsError,
3243
- 304: ResourceNotModifiedError,
3244
- }
3245
- )
3246
- error_map.update(kwargs.pop("error_map", {}) or {})
3247
-
3248
- _headers = kwargs.pop("headers", {}) or {}
3249
- _params = kwargs.pop("params", {}) or {}
3250
-
3251
- cls: ClsType[Any] = kwargs.pop("cls", None)
3252
-
3253
- _request = build_jobs_delete_single_job_request(
3254
- job_id=job_id,
3255
- headers=_headers,
3256
- params=_params,
3257
- )
3258
- _request.url = self._client.format_url(_request.url)
3259
-
3260
- _stream = False
3261
- pipeline_response: PipelineResponse = (
3262
- self._client._pipeline.run( # pylint: disable=protected-access
3263
- _request, stream=_stream, **kwargs
3264
- )
3265
- )
3266
-
3267
- response = pipeline_response.http_response
3268
-
3269
- if response.status_code not in [200]:
3270
- map_error(
3271
- status_code=response.status_code, response=response, error_map=error_map
3272
- )
3273
- raise HttpResponseError(response=response)
3274
-
3275
- deserialized = self._deserialize("object", pipeline_response.http_response)
3276
-
3277
- if cls:
3278
- return cls(pipeline_response, deserialized, {}) # type: ignore
3279
-
3280
- return deserialized # type: ignore
3281
-
3282
- @distributed_trace
3283
- def set_single_job_properties(
3284
- self, job_id: int, body: JSON, *, update_timestamp: bool = False, **kwargs: Any
3285
- ) -> Any:
3286
- """Set Single Job Properties.
3287
-
3288
- Update the given job properties (MinorStatus, ApplicationStatus, etc).
3289
-
3290
- :param job_id: Required.
3291
- :type job_id: int
3292
- :param body: Required.
3293
- :type body: JSON
3294
- :keyword update_timestamp: Default value is False.
3295
- :paramtype update_timestamp: bool
3296
- :return: any
3297
- :rtype: any
3298
- :raises ~azure.core.exceptions.HttpResponseError:
3299
- """
3300
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
3301
- { # pylint: disable=unsubscriptable-object
3302
- 401: ClientAuthenticationError,
3303
- 404: ResourceNotFoundError,
3304
- 409: ResourceExistsError,
3305
- 304: ResourceNotModifiedError,
3306
- }
3307
- )
3308
- error_map.update(kwargs.pop("error_map", {}) or {})
3309
-
3310
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
3311
- _params = kwargs.pop("params", {}) or {}
3312
-
3313
- content_type: str = kwargs.pop(
3314
- "content_type", _headers.pop("Content-Type", "application/json")
3315
- )
3316
- cls: ClsType[Any] = kwargs.pop("cls", None)
3317
-
3318
- _json = self._serialize.body(body, "object")
3319
-
3320
- _request = build_jobs_set_single_job_properties_request(
3321
- job_id=job_id,
3322
- update_timestamp=update_timestamp,
3323
- content_type=content_type,
3324
- json=_json,
3325
- headers=_headers,
3326
- params=_params,
3327
- )
3328
- _request.url = self._client.format_url(_request.url)
3329
-
3330
- _stream = False
3331
- pipeline_response: PipelineResponse = (
3332
- self._client._pipeline.run( # pylint: disable=protected-access
3333
- _request, stream=_stream, **kwargs
3334
- )
3335
- )
3336
-
3337
- response = pipeline_response.http_response
3338
-
3339
- if response.status_code not in [200]:
3340
- map_error(
3341
- status_code=response.status_code, response=response, error_map=error_map
3342
- )
3343
- raise HttpResponseError(response=response)
3344
-
3345
- deserialized = self._deserialize("object", pipeline_response.http_response)
3346
-
3347
- if cls:
3348
- return cls(pipeline_response, deserialized, {}) # type: ignore
3349
-
3350
- return deserialized # type: ignore
3351
-
3352
- @distributed_trace
3353
- def kill_single_job(self, job_id: int, **kwargs: Any) -> Any:
3354
- """Kill Single Job.
3355
-
3356
- Kill a job.
3357
-
3358
- :param job_id: Required.
3359
- :type job_id: int
3360
- :return: any
3361
- :rtype: any
3362
- :raises ~azure.core.exceptions.HttpResponseError:
3363
- """
3364
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
3365
- { # pylint: disable=unsubscriptable-object
3366
- 401: ClientAuthenticationError,
3367
- 404: ResourceNotFoundError,
3368
- 409: ResourceExistsError,
3369
- 304: ResourceNotModifiedError,
3370
- }
3371
- )
3372
- error_map.update(kwargs.pop("error_map", {}) or {})
3373
-
3374
- _headers = kwargs.pop("headers", {}) or {}
3375
- _params = kwargs.pop("params", {}) or {}
3376
-
3377
- cls: ClsType[Any] = kwargs.pop("cls", None)
3378
-
3379
- _request = build_jobs_kill_single_job_request(
3380
- job_id=job_id,
3381
- headers=_headers,
3382
- params=_params,
3383
- )
3384
- _request.url = self._client.format_url(_request.url)
3385
-
3386
- _stream = False
3387
- pipeline_response: PipelineResponse = (
3388
- self._client._pipeline.run( # pylint: disable=protected-access
3389
- _request, stream=_stream, **kwargs
3390
- )
3391
- )
3392
-
3393
- response = pipeline_response.http_response
3394
-
3395
- if response.status_code not in [200]:
3396
- map_error(
3397
- status_code=response.status_code, response=response, error_map=error_map
3398
- )
3399
- raise HttpResponseError(response=response)
3400
-
3401
- deserialized = self._deserialize("object", pipeline_response.http_response)
3402
-
3403
- if cls:
3404
- return cls(pipeline_response, deserialized, {}) # type: ignore
3405
-
3406
- return deserialized # type: ignore
3407
-
3408
- @distributed_trace
3409
- def remove_single_job(self, job_id: int, **kwargs: Any) -> Any:
3410
- """Remove Single Job.
3411
-
3412
- Fully remove a job from the WMS databases.
3413
-
3414
- WARNING: This endpoint has been implemented for the compatibility with the legacy DIRAC WMS
3415
- and the JobCleaningAgent. However, once this agent is ported to diracx, this endpoint should
3416
- be removed, and the delete endpoint should be used instead.
3417
-
3418
- :param job_id: Required.
3419
- :type job_id: int
3420
- :return: any
3421
- :rtype: any
3422
- :raises ~azure.core.exceptions.HttpResponseError:
3423
- """
3424
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
3425
- { # pylint: disable=unsubscriptable-object
3426
- 401: ClientAuthenticationError,
3427
- 404: ResourceNotFoundError,
3428
- 409: ResourceExistsError,
3429
- 304: ResourceNotModifiedError,
3430
- }
3431
- )
3432
- error_map.update(kwargs.pop("error_map", {}) or {})
3433
-
3434
- _headers = kwargs.pop("headers", {}) or {}
3435
- _params = kwargs.pop("params", {}) or {}
3436
-
3437
- cls: ClsType[Any] = kwargs.pop("cls", None)
3438
-
3439
- _request = build_jobs_remove_single_job_request(
3440
- job_id=job_id,
2170
+ _request = build_jobs_reschedule_bulk_jobs_request(
2171
+ job_ids=job_ids,
2172
+ reset_jobs=reset_jobs,
3441
2173
  headers=_headers,
3442
2174
  params=_params,
3443
2175
  )
@@ -3465,39 +2197,124 @@ class JobsOperations: # pylint: disable=too-many-public-methods
3465
2197
 
3466
2198
  return deserialized # type: ignore
3467
2199
 
2200
+ @overload
2201
+ def search(
2202
+ self,
2203
+ body: Optional[_models.JobSearchParams] = None,
2204
+ *,
2205
+ page: int = 1,
2206
+ per_page: int = 100,
2207
+ content_type: str = "application/json",
2208
+ **kwargs: Any,
2209
+ ) -> List[JSON]:
2210
+ """Search.
2211
+
2212
+ Retrieve information about jobs.
2213
+
2214
+ **TODO: Add more docs**.
2215
+
2216
+ :param body: Default value is None.
2217
+ :type body: ~generated.models.JobSearchParams
2218
+ :keyword page: Default value is 1.
2219
+ :paramtype page: int
2220
+ :keyword per_page: Default value is 100.
2221
+ :paramtype per_page: int
2222
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2223
+ Default value is "application/json".
2224
+ :paramtype content_type: str
2225
+ :return: list of JSON
2226
+ :rtype: list[JSON]
2227
+ :raises ~azure.core.exceptions.HttpResponseError:
2228
+ """
2229
+
2230
+ @overload
2231
+ def search(
2232
+ self,
2233
+ body: Optional[IO[bytes]] = None,
2234
+ *,
2235
+ page: int = 1,
2236
+ per_page: int = 100,
2237
+ content_type: str = "application/json",
2238
+ **kwargs: Any,
2239
+ ) -> List[JSON]:
2240
+ """Search.
2241
+
2242
+ Retrieve information about jobs.
2243
+
2244
+ **TODO: Add more docs**.
2245
+
2246
+ :param body: Default value is None.
2247
+ :type body: IO[bytes]
2248
+ :keyword page: Default value is 1.
2249
+ :paramtype page: int
2250
+ :keyword per_page: Default value is 100.
2251
+ :paramtype per_page: int
2252
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2253
+ Default value is "application/json".
2254
+ :paramtype content_type: str
2255
+ :return: list of JSON
2256
+ :rtype: list[JSON]
2257
+ :raises ~azure.core.exceptions.HttpResponseError:
2258
+ """
2259
+
3468
2260
  @distributed_trace
3469
- def get_single_job_status(
3470
- self, job_id: int, **kwargs: Any
3471
- ) -> Dict[str, _models.LimitedJobStatusReturn]:
3472
- """Get Single Job Status.
2261
+ def search(
2262
+ self,
2263
+ body: Optional[Union[_models.JobSearchParams, IO[bytes]]] = None,
2264
+ *,
2265
+ page: int = 1,
2266
+ per_page: int = 100,
2267
+ **kwargs: Any,
2268
+ ) -> List[JSON]:
2269
+ """Search.
3473
2270
 
3474
- Get Single Job Status.
2271
+ Retrieve information about jobs.
3475
2272
 
3476
- :param job_id: Required.
3477
- :type job_id: int
3478
- :return: dict mapping str to LimitedJobStatusReturn
3479
- :rtype: dict[str, ~generated.models.LimitedJobStatusReturn]
2273
+ **TODO: Add more docs**.
2274
+
2275
+ :param body: Is either a JobSearchParams type or a IO[bytes] type. Default value is None.
2276
+ :type body: ~generated.models.JobSearchParams or IO[bytes]
2277
+ :keyword page: Default value is 1.
2278
+ :paramtype page: int
2279
+ :keyword per_page: Default value is 100.
2280
+ :paramtype per_page: int
2281
+ :return: list of JSON
2282
+ :rtype: list[JSON]
3480
2283
  :raises ~azure.core.exceptions.HttpResponseError:
3481
2284
  """
3482
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
3483
- { # pylint: disable=unsubscriptable-object
3484
- 401: ClientAuthenticationError,
3485
- 404: ResourceNotFoundError,
3486
- 409: ResourceExistsError,
3487
- 304: ResourceNotModifiedError,
3488
- }
3489
- )
2285
+ error_map: MutableMapping = {
2286
+ 401: ClientAuthenticationError,
2287
+ 404: ResourceNotFoundError,
2288
+ 409: ResourceExistsError,
2289
+ 304: ResourceNotModifiedError,
2290
+ }
3490
2291
  error_map.update(kwargs.pop("error_map", {}) or {})
3491
2292
 
3492
- _headers = kwargs.pop("headers", {}) or {}
2293
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
3493
2294
  _params = kwargs.pop("params", {}) or {}
3494
2295
 
3495
- cls: ClsType[Dict[str, _models.LimitedJobStatusReturn]] = kwargs.pop(
3496
- "cls", None
2296
+ content_type: Optional[str] = kwargs.pop(
2297
+ "content_type", _headers.pop("Content-Type", None)
3497
2298
  )
2299
+ cls: ClsType[List[JSON]] = kwargs.pop("cls", None)
3498
2300
 
3499
- _request = build_jobs_get_single_job_status_request(
3500
- job_id=job_id,
2301
+ content_type = content_type or "application/json"
2302
+ _json = None
2303
+ _content = None
2304
+ if isinstance(body, (IOBase, bytes)):
2305
+ _content = body
2306
+ else:
2307
+ if body is not None:
2308
+ _json = self._serialize.body(body, "JobSearchParams")
2309
+ else:
2310
+ _json = None
2311
+
2312
+ _request = build_jobs_search_request(
2313
+ page=page,
2314
+ per_page=per_page,
2315
+ content_type=content_type,
2316
+ json=_json,
2317
+ content=_content,
3501
2318
  headers=_headers,
3502
2319
  params=_params,
3503
2320
  )
@@ -3512,108 +2329,85 @@ class JobsOperations: # pylint: disable=too-many-public-methods
3512
2329
 
3513
2330
  response = pipeline_response.http_response
3514
2331
 
3515
- if response.status_code not in [200]:
2332
+ if response.status_code not in [200, 206]:
3516
2333
  map_error(
3517
2334
  status_code=response.status_code, response=response, error_map=error_map
3518
2335
  )
3519
2336
  raise HttpResponseError(response=response)
3520
2337
 
3521
- deserialized = self._deserialize(
3522
- "{LimitedJobStatusReturn}", pipeline_response.http_response
3523
- )
2338
+ response_headers = {}
2339
+ if response.status_code == 206:
2340
+ response_headers["Content-Range"] = self._deserialize(
2341
+ "str", response.headers.get("Content-Range")
2342
+ )
2343
+
2344
+ deserialized = self._deserialize("[object]", pipeline_response.http_response)
3524
2345
 
3525
2346
  if cls:
3526
- return cls(pipeline_response, deserialized, {}) # type: ignore
2347
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
3527
2348
 
3528
2349
  return deserialized # type: ignore
3529
2350
 
3530
2351
  @overload
3531
- def set_single_job_status(
2352
+ def summary(
3532
2353
  self,
3533
- job_id: int,
3534
- body: Dict[str, _models.JobStatusUpdate],
2354
+ body: _models.JobSummaryParams,
3535
2355
  *,
3536
- force: bool = False,
3537
2356
  content_type: str = "application/json",
3538
2357
  **kwargs: Any,
3539
- ) -> Dict[str, _models.SetJobStatusReturn]:
3540
- """Set Single Job Status.
2358
+ ) -> Any:
2359
+ """Summary.
3541
2360
 
3542
- Set Single Job Status.
2361
+ Show information suitable for plotting.
3543
2362
 
3544
- :param job_id: Required.
3545
- :type job_id: int
3546
2363
  :param body: Required.
3547
- :type body: dict[str, ~generated.models.JobStatusUpdate]
3548
- :keyword force: Default value is False.
3549
- :paramtype force: bool
2364
+ :type body: ~generated.models.JobSummaryParams
3550
2365
  :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
3551
2366
  Default value is "application/json".
3552
2367
  :paramtype content_type: str
3553
- :return: dict mapping str to SetJobStatusReturn
3554
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
2368
+ :return: any
2369
+ :rtype: any
3555
2370
  :raises ~azure.core.exceptions.HttpResponseError:
3556
2371
  """
3557
2372
 
3558
2373
  @overload
3559
- def set_single_job_status(
3560
- self,
3561
- job_id: int,
3562
- body: IO[bytes],
3563
- *,
3564
- force: bool = False,
3565
- content_type: str = "application/json",
3566
- **kwargs: Any,
3567
- ) -> Dict[str, _models.SetJobStatusReturn]:
3568
- """Set Single Job Status.
2374
+ def summary(
2375
+ self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
2376
+ ) -> Any:
2377
+ """Summary.
3569
2378
 
3570
- Set Single Job Status.
2379
+ Show information suitable for plotting.
3571
2380
 
3572
- :param job_id: Required.
3573
- :type job_id: int
3574
2381
  :param body: Required.
3575
2382
  :type body: IO[bytes]
3576
- :keyword force: Default value is False.
3577
- :paramtype force: bool
3578
2383
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
3579
2384
  Default value is "application/json".
3580
2385
  :paramtype content_type: str
3581
- :return: dict mapping str to SetJobStatusReturn
3582
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
2386
+ :return: any
2387
+ :rtype: any
3583
2388
  :raises ~azure.core.exceptions.HttpResponseError:
3584
2389
  """
3585
2390
 
3586
2391
  @distributed_trace
3587
- def set_single_job_status(
3588
- self,
3589
- job_id: int,
3590
- body: Union[Dict[str, _models.JobStatusUpdate], IO[bytes]],
3591
- *,
3592
- force: bool = False,
3593
- **kwargs: Any,
3594
- ) -> Dict[str, _models.SetJobStatusReturn]:
3595
- """Set Single Job Status.
2392
+ def summary(
2393
+ self, body: Union[_models.JobSummaryParams, IO[bytes]], **kwargs: Any
2394
+ ) -> Any:
2395
+ """Summary.
3596
2396
 
3597
- Set Single Job Status.
2397
+ Show information suitable for plotting.
3598
2398
 
3599
- :param job_id: Required.
3600
- :type job_id: int
3601
- :param body: Is either a {str: JobStatusUpdate} type or a IO[bytes] type. Required.
3602
- :type body: dict[str, ~generated.models.JobStatusUpdate] or IO[bytes]
3603
- :keyword force: Default value is False.
3604
- :paramtype force: bool
3605
- :return: dict mapping str to SetJobStatusReturn
3606
- :rtype: dict[str, ~generated.models.SetJobStatusReturn]
2399
+ :param body: Is either a JobSummaryParams type or a IO[bytes] type. Required.
2400
+ :type body: ~generated.models.JobSummaryParams or IO[bytes]
2401
+ :return: any
2402
+ :rtype: any
3607
2403
  :raises ~azure.core.exceptions.HttpResponseError:
3608
2404
  """
3609
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
3610
- { # pylint: disable=unsubscriptable-object
3611
- 401: ClientAuthenticationError,
3612
- 404: ResourceNotFoundError,
3613
- 409: ResourceExistsError,
3614
- 304: ResourceNotModifiedError,
3615
- }
3616
- )
2405
+ error_map: MutableMapping = {
2406
+ 401: ClientAuthenticationError,
2407
+ 404: ResourceNotFoundError,
2408
+ 409: ResourceExistsError,
2409
+ 304: ResourceNotModifiedError,
2410
+ }
3617
2411
  error_map.update(kwargs.pop("error_map", {}) or {})
3618
2412
 
3619
2413
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
@@ -3622,7 +2416,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
3622
2416
  content_type: Optional[str] = kwargs.pop(
3623
2417
  "content_type", _headers.pop("Content-Type", None)
3624
2418
  )
3625
- cls: ClsType[Dict[str, _models.SetJobStatusReturn]] = kwargs.pop("cls", None)
2419
+ cls: ClsType[Any] = kwargs.pop("cls", None)
3626
2420
 
3627
2421
  content_type = content_type or "application/json"
3628
2422
  _json = None
@@ -3630,11 +2424,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
3630
2424
  if isinstance(body, (IOBase, bytes)):
3631
2425
  _content = body
3632
2426
  else:
3633
- _json = self._serialize.body(body, "{JobStatusUpdate}")
2427
+ _json = self._serialize.body(body, "JobSummaryParams")
3634
2428
 
3635
- _request = build_jobs_set_single_job_status_request(
3636
- job_id=job_id,
3637
- force=force,
2429
+ _request = build_jobs_summary_request(
3638
2430
  content_type=content_type,
3639
2431
  json=_json,
3640
2432
  content=_content,
@@ -3658,46 +2450,91 @@ class JobsOperations: # pylint: disable=too-many-public-methods
3658
2450
  )
3659
2451
  raise HttpResponseError(response=response)
3660
2452
 
3661
- deserialized = self._deserialize(
3662
- "{SetJobStatusReturn}", pipeline_response.http_response
3663
- )
2453
+ deserialized = self._deserialize("object", pipeline_response.http_response)
3664
2454
 
3665
2455
  if cls:
3666
2456
  return cls(pipeline_response, deserialized, {}) # type: ignore
3667
2457
 
3668
2458
  return deserialized # type: ignore
3669
2459
 
2460
+ @overload
2461
+ def submit_bulk_jdl_jobs(
2462
+ self, body: List[str], *, content_type: str = "application/json", **kwargs: Any
2463
+ ) -> List[_models.InsertedJob]:
2464
+ """Submit Bulk Jdl Jobs.
2465
+
2466
+ Submit Bulk Jdl Jobs.
2467
+
2468
+ :param body: Required.
2469
+ :type body: list[str]
2470
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2471
+ Default value is "application/json".
2472
+ :paramtype content_type: str
2473
+ :return: list of InsertedJob
2474
+ :rtype: list[~generated.models.InsertedJob]
2475
+ :raises ~azure.core.exceptions.HttpResponseError:
2476
+ """
2477
+
2478
+ @overload
2479
+ def submit_bulk_jdl_jobs(
2480
+ self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
2481
+ ) -> List[_models.InsertedJob]:
2482
+ """Submit Bulk Jdl Jobs.
2483
+
2484
+ Submit Bulk Jdl Jobs.
2485
+
2486
+ :param body: Required.
2487
+ :type body: IO[bytes]
2488
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2489
+ Default value is "application/json".
2490
+ :paramtype content_type: str
2491
+ :return: list of InsertedJob
2492
+ :rtype: list[~generated.models.InsertedJob]
2493
+ :raises ~azure.core.exceptions.HttpResponseError:
2494
+ """
2495
+
3670
2496
  @distributed_trace
3671
- def get_single_job_status_history(
3672
- self, job_id: int, **kwargs: Any
3673
- ) -> Dict[str, List[_models.JobStatusReturn]]:
3674
- """Get Single Job Status History.
2497
+ def submit_bulk_jdl_jobs(
2498
+ self, body: Union[List[str], IO[bytes]], **kwargs: Any
2499
+ ) -> List[_models.InsertedJob]:
2500
+ """Submit Bulk Jdl Jobs.
3675
2501
 
3676
- Get Single Job Status History.
2502
+ Submit Bulk Jdl Jobs.
3677
2503
 
3678
- :param job_id: Required.
3679
- :type job_id: int
3680
- :return: dict mapping str to list of JobStatusReturn
3681
- :rtype: dict[str, list[~generated.models.JobStatusReturn]]
2504
+ :param body: Is either a [str] type or a IO[bytes] type. Required.
2505
+ :type body: list[str] or IO[bytes]
2506
+ :return: list of InsertedJob
2507
+ :rtype: list[~generated.models.InsertedJob]
3682
2508
  :raises ~azure.core.exceptions.HttpResponseError:
3683
2509
  """
3684
- error_map: MutableMapping[int, Type[HttpResponseError]] = (
3685
- { # pylint: disable=unsubscriptable-object
3686
- 401: ClientAuthenticationError,
3687
- 404: ResourceNotFoundError,
3688
- 409: ResourceExistsError,
3689
- 304: ResourceNotModifiedError,
3690
- }
3691
- )
2510
+ error_map: MutableMapping = {
2511
+ 401: ClientAuthenticationError,
2512
+ 404: ResourceNotFoundError,
2513
+ 409: ResourceExistsError,
2514
+ 304: ResourceNotModifiedError,
2515
+ }
3692
2516
  error_map.update(kwargs.pop("error_map", {}) or {})
3693
2517
 
3694
- _headers = kwargs.pop("headers", {}) or {}
2518
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
3695
2519
  _params = kwargs.pop("params", {}) or {}
3696
2520
 
3697
- cls: ClsType[Dict[str, List[_models.JobStatusReturn]]] = kwargs.pop("cls", None)
2521
+ content_type: Optional[str] = kwargs.pop(
2522
+ "content_type", _headers.pop("Content-Type", None)
2523
+ )
2524
+ cls: ClsType[List[_models.InsertedJob]] = kwargs.pop("cls", None)
2525
+
2526
+ content_type = content_type or "application/json"
2527
+ _json = None
2528
+ _content = None
2529
+ if isinstance(body, (IOBase, bytes)):
2530
+ _content = body
2531
+ else:
2532
+ _json = self._serialize.body(body, "[str]")
3698
2533
 
3699
- _request = build_jobs_get_single_job_status_history_request(
3700
- job_id=job_id,
2534
+ _request = build_jobs_submit_bulk_jdl_jobs_request(
2535
+ content_type=content_type,
2536
+ json=_json,
2537
+ content=_content,
3701
2538
  headers=_headers,
3702
2539
  params=_params,
3703
2540
  )
@@ -3719,7 +2556,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
3719
2556
  raise HttpResponseError(response=response)
3720
2557
 
3721
2558
  deserialized = self._deserialize(
3722
- "{[JobStatusReturn]}", pipeline_response.http_response
2559
+ "[InsertedJob]", pipeline_response.http_response
3723
2560
  )
3724
2561
 
3725
2562
  if cls: