diracx-client 0.0.1a16__py3-none-any.whl → 0.0.1a17__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
diracx/client/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
diracx/client/_client.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
diracx/client/_patch.py CHANGED
@@ -15,6 +15,7 @@ import requests
15
15
 
16
16
  from pathlib import Path
17
17
  from typing import Any, Dict, List, Optional, cast
18
+ from urllib import parse
18
19
  from azure.core.credentials import AccessToken
19
20
  from azure.core.credentials import TokenCredential
20
21
  from azure.core.pipeline import PipelineRequest
@@ -138,7 +139,7 @@ class DiracClient(DiracGenerated):
138
139
  **kwargs: Any,
139
140
  ) -> None:
140
141
  diracx_preferences = diracx_preferences or get_diracx_preferences()
141
- self._endpoint = endpoint or diracx_preferences.url
142
+ self._endpoint = str(endpoint or diracx_preferences.url)
142
143
  if verify is True and diracx_preferences.ca_path:
143
144
  verify = str(diracx_preferences.ca_path)
144
145
  kwargs["connection_verify"] = verify
@@ -215,7 +216,7 @@ def get_openid_configuration(
215
216
  ) -> Dict[str, str]:
216
217
  """Get the openid configuration from the .well-known endpoint"""
217
218
  response = requests.get(
218
- url=f"{endpoint}/.well-known/openid-configuration",
219
+ url=parse.urljoin(endpoint, ".well-known/openid-configuration"),
219
220
  verify=verify,
220
221
  )
221
222
  if not response.ok:
@@ -1525,7 +1525,7 @@ class Deserializer(object):
1525
1525
  elif isinstance(response, type) and issubclass(response, Enum):
1526
1526
  return self.deserialize_enum(data, response)
1527
1527
 
1528
- if data is None:
1528
+ if data is None or data is CoreNull:
1529
1529
  return data
1530
1530
  try:
1531
1531
  attributes = response._attribute_map # type: ignore
diracx/client/_vendor.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # --------------------------------------------------------------------------
2
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
2
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
3
3
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
4
4
  # --------------------------------------------------------------------------
5
5
 
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -157,7 +157,7 @@ class DiracClient(DiracGenerated):
157
157
  if verify is True and diracx_preferences.ca_path:
158
158
  verify = str(diracx_preferences.ca_path)
159
159
  kwargs["connection_verify"] = verify
160
- self._endpoint = endpoint or diracx_preferences.url
160
+ self._endpoint = str(endpoint or diracx_preferences.url)
161
161
  self._client_id = client_id or "myDIRACClientID"
162
162
 
163
163
  # Get .well-known configuration
@@ -1,5 +1,5 @@
1
1
  # --------------------------------------------------------------------------
2
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
2
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
3
3
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
4
4
  # --------------------------------------------------------------------------
5
5
 
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -1,7 +1,7 @@
1
1
  # pylint: disable=too-many-lines,too-many-statements
2
2
  # coding=utf-8
3
3
  # --------------------------------------------------------------------------
4
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
4
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
5
5
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
6
6
  # --------------------------------------------------------------------------
7
7
  from io import IOBase
@@ -245,22 +245,25 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
245
245
  )
246
246
 
247
247
  @distributed_trace_async
248
- async def do_device_flow(self, *, user_code: str, **kwargs: Any) -> Any:
249
- """Do Device Flow.
248
+ async def initiate_device_flow(
249
+ self, *, client_id: str, scope: str, **kwargs: Any
250
+ ) -> _models.InitiateDeviceFlowResponse:
251
+ """Initiate Device Flow.
250
252
 
251
- This is called as the verification URI for the device flow.
252
- It will redirect to the actual OpenID server (IAM, CheckIn) to
253
- perform a authorization code flow.
253
+ Initiate the device flow against DIRAC authorization Server.
254
+ Scope must have exactly up to one ``group`` (otherwise default) and
255
+ one or more ``property`` scope.
256
+ If no property, then get default one
254
257
 
255
- We set the user_code obtained from the device flow in a cookie
256
- to be able to map the authorization flow with the corresponding
257
- device flow.
258
- (note: it can't be put as parameter or in the URL).
258
+ Offers the user to go with the browser to
259
+ ``auth/<vo>/device?user_code=XYZ``.
259
260
 
260
- :keyword user_code: Required.
261
- :paramtype user_code: str
262
- :return: any
263
- :rtype: any
261
+ :keyword client_id: Required.
262
+ :paramtype client_id: str
263
+ :keyword scope: Required.
264
+ :paramtype scope: str
265
+ :return: InitiateDeviceFlowResponse
266
+ :rtype: ~client.models.InitiateDeviceFlowResponse
264
267
  :raises ~azure.core.exceptions.HttpResponseError:
265
268
  """
266
269
  error_map: MutableMapping[int, Type[HttpResponseError]] = {
@@ -274,10 +277,11 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
274
277
  _headers = kwargs.pop("headers", {}) or {}
275
278
  _params = kwargs.pop("params", {}) or {}
276
279
 
277
- cls: ClsType[Any] = kwargs.pop("cls", None)
280
+ cls: ClsType[_models.InitiateDeviceFlowResponse] = kwargs.pop("cls", None)
278
281
 
279
- _request = build_auth_do_device_flow_request(
280
- user_code=user_code,
282
+ _request = build_auth_initiate_device_flow_request(
283
+ client_id=client_id,
284
+ scope=scope,
281
285
  headers=_headers,
282
286
  params=_params,
283
287
  )
@@ -300,7 +304,9 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
300
304
  )
301
305
  raise HttpResponseError(response=response)
302
306
 
303
- deserialized = self._deserialize("object", pipeline_response)
307
+ deserialized = self._deserialize(
308
+ "InitiateDeviceFlowResponse", pipeline_response
309
+ )
304
310
 
305
311
  if cls:
306
312
  return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -308,25 +314,22 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
308
314
  return deserialized # type: ignore
309
315
 
310
316
  @distributed_trace_async
311
- async def initiate_device_flow(
312
- self, *, client_id: str, scope: str, **kwargs: Any
313
- ) -> _models.InitiateDeviceFlowResponse:
314
- """Initiate Device Flow.
317
+ async def do_device_flow(self, *, user_code: str, **kwargs: Any) -> Any:
318
+ """Do Device Flow.
315
319
 
316
- Initiate the device flow against DIRAC authorization Server.
317
- Scope must have exactly up to one ``group`` (otherwise default) and
318
- one or more ``property`` scope.
319
- If no property, then get default one
320
+ This is called as the verification URI for the device flow.
321
+ It will redirect to the actual OpenID server (IAM, CheckIn) to
322
+ perform a authorization code flow.
320
323
 
321
- Offers the user to go with the browser to
322
- ``auth/<vo>/device?user_code=XYZ``.
324
+ We set the user_code obtained from the device flow in a cookie
325
+ to be able to map the authorization flow with the corresponding
326
+ device flow.
327
+ (note: it can't be put as parameter or in the URL).
323
328
 
324
- :keyword client_id: Required.
325
- :paramtype client_id: str
326
- :keyword scope: Required.
327
- :paramtype scope: str
328
- :return: InitiateDeviceFlowResponse
329
- :rtype: ~client.models.InitiateDeviceFlowResponse
329
+ :keyword user_code: Required.
330
+ :paramtype user_code: str
331
+ :return: any
332
+ :rtype: any
330
333
  :raises ~azure.core.exceptions.HttpResponseError:
331
334
  """
332
335
  error_map: MutableMapping[int, Type[HttpResponseError]] = {
@@ -340,11 +343,10 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
340
343
  _headers = kwargs.pop("headers", {}) or {}
341
344
  _params = kwargs.pop("params", {}) or {}
342
345
 
343
- cls: ClsType[_models.InitiateDeviceFlowResponse] = kwargs.pop("cls", None)
346
+ cls: ClsType[Any] = kwargs.pop("cls", None)
344
347
 
345
- _request = build_auth_initiate_device_flow_request(
346
- client_id=client_id,
347
- scope=scope,
348
+ _request = build_auth_do_device_flow_request(
349
+ user_code=user_code,
348
350
  headers=_headers,
349
351
  params=_params,
350
352
  )
@@ -367,9 +369,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
367
369
  )
368
370
  raise HttpResponseError(response=response)
369
371
 
370
- deserialized = self._deserialize(
371
- "InitiateDeviceFlowResponse", pipeline_response
372
- )
372
+ deserialized = self._deserialize("object", pipeline_response)
373
373
 
374
374
  if cls:
375
375
  return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -939,70 +939,6 @@ class JobsOperations: # pylint: disable=too-many-public-methods
939
939
  input_args.pop(0) if input_args else kwargs.pop("deserializer")
940
940
  )
941
941
 
942
- @distributed_trace_async
943
- async def get_sandbox_file(
944
- self, *, pfn: str, **kwargs: Any
945
- ) -> _models.SandboxDownloadResponse:
946
- """Get Sandbox File.
947
-
948
- Get a presigned URL to download a sandbox file
949
-
950
- This route cannot use a redirect response most clients will also send the
951
- authorization header when following a redirect. This is not desirable as
952
- it would leak the authorization token to the storage backend. Additionally,
953
- most storage backends return an error when they receive an authorization
954
- header for a presigned URL.
955
-
956
- :keyword pfn: Required.
957
- :paramtype pfn: str
958
- :return: SandboxDownloadResponse
959
- :rtype: ~client.models.SandboxDownloadResponse
960
- :raises ~azure.core.exceptions.HttpResponseError:
961
- """
962
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
963
- 401: ClientAuthenticationError,
964
- 404: ResourceNotFoundError,
965
- 409: ResourceExistsError,
966
- 304: ResourceNotModifiedError,
967
- }
968
- error_map.update(kwargs.pop("error_map", {}) or {})
969
-
970
- _headers = kwargs.pop("headers", {}) or {}
971
- _params = kwargs.pop("params", {}) or {}
972
-
973
- cls: ClsType[_models.SandboxDownloadResponse] = kwargs.pop("cls", None)
974
-
975
- _request = build_jobs_get_sandbox_file_request(
976
- pfn=pfn,
977
- headers=_headers,
978
- params=_params,
979
- )
980
- _request.url = self._client.format_url(_request.url)
981
-
982
- _stream = False
983
- pipeline_response: PipelineResponse = (
984
- await self._client._pipeline.run( # pylint: disable=protected-access
985
- _request, stream=_stream, **kwargs
986
- )
987
- )
988
-
989
- response = pipeline_response.http_response
990
-
991
- if response.status_code not in [200]:
992
- if _stream:
993
- await response.read() # Load the body in memory and close the socket
994
- map_error(
995
- status_code=response.status_code, response=response, error_map=error_map
996
- )
997
- raise HttpResponseError(response=response)
998
-
999
- deserialized = self._deserialize("SandboxDownloadResponse", pipeline_response)
1000
-
1001
- if cls:
1002
- return cls(pipeline_response, deserialized, {}) # type: ignore
1003
-
1004
- return deserialized # type: ignore
1005
-
1006
942
  @overload
1007
943
  async def initiate_sandbox_upload(
1008
944
  self,
@@ -1132,6 +1068,70 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1132
1068
 
1133
1069
  return deserialized # type: ignore
1134
1070
 
1071
+ @distributed_trace_async
1072
+ async def get_sandbox_file(
1073
+ self, *, pfn: str, **kwargs: Any
1074
+ ) -> _models.SandboxDownloadResponse:
1075
+ """Get Sandbox File.
1076
+
1077
+ Get a presigned URL to download a sandbox file
1078
+
1079
+ This route cannot use a redirect response most clients will also send the
1080
+ authorization header when following a redirect. This is not desirable as
1081
+ it would leak the authorization token to the storage backend. Additionally,
1082
+ most storage backends return an error when they receive an authorization
1083
+ header for a presigned URL.
1084
+
1085
+ :keyword pfn: Required.
1086
+ :paramtype pfn: str
1087
+ :return: SandboxDownloadResponse
1088
+ :rtype: ~client.models.SandboxDownloadResponse
1089
+ :raises ~azure.core.exceptions.HttpResponseError:
1090
+ """
1091
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1092
+ 401: ClientAuthenticationError,
1093
+ 404: ResourceNotFoundError,
1094
+ 409: ResourceExistsError,
1095
+ 304: ResourceNotModifiedError,
1096
+ }
1097
+ error_map.update(kwargs.pop("error_map", {}) or {})
1098
+
1099
+ _headers = kwargs.pop("headers", {}) or {}
1100
+ _params = kwargs.pop("params", {}) or {}
1101
+
1102
+ cls: ClsType[_models.SandboxDownloadResponse] = kwargs.pop("cls", None)
1103
+
1104
+ _request = build_jobs_get_sandbox_file_request(
1105
+ pfn=pfn,
1106
+ headers=_headers,
1107
+ params=_params,
1108
+ )
1109
+ _request.url = self._client.format_url(_request.url)
1110
+
1111
+ _stream = False
1112
+ pipeline_response: PipelineResponse = (
1113
+ await self._client._pipeline.run( # pylint: disable=protected-access
1114
+ _request, stream=_stream, **kwargs
1115
+ )
1116
+ )
1117
+
1118
+ response = pipeline_response.http_response
1119
+
1120
+ if response.status_code not in [200]:
1121
+ if _stream:
1122
+ await response.read() # Load the body in memory and close the socket
1123
+ map_error(
1124
+ status_code=response.status_code, response=response, error_map=error_map
1125
+ )
1126
+ raise HttpResponseError(response=response)
1127
+
1128
+ deserialized = self._deserialize("SandboxDownloadResponse", pipeline_response)
1129
+
1130
+ if cls:
1131
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1132
+
1133
+ return deserialized # type: ignore
1134
+
1135
1135
  @distributed_trace_async
1136
1136
  async def unassign_bulk_jobs_sandboxes(
1137
1137
  self, *, jobs_ids: List[int], **kwargs: Any
@@ -1369,7 +1369,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1369
1369
  async def assign_sandbox_to_job(self, job_id: int, body: str, **kwargs: Any) -> Any:
1370
1370
  """Assign Sandbox To Job.
1371
1371
 
1372
- Mapp the pfn as output sandbox to job.
1372
+ Map the pfn as output sandbox to job.
1373
1373
 
1374
1374
  :param job_id: Required.
1375
1375
  :type job_id: int
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -9,7 +9,7 @@ from azure.core import CaseInsensitiveEnumMeta
9
9
 
10
10
 
11
11
  class ChecksumAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta):
12
- """An enumeration."""
12
+ """ChecksumAlgorithm."""
13
13
 
14
14
  SHA256 = "sha256"
15
15
 
@@ -47,7 +47,7 @@ class Enum4(str, Enum, metaclass=CaseInsensitiveEnumMeta):
47
47
 
48
48
 
49
49
  class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
50
- """An enumeration."""
50
+ """JobStatus."""
51
51
 
52
52
  SUBMITTING = "Submitting"
53
53
  RECEIVED = "Received"
@@ -67,7 +67,7 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
67
67
 
68
68
 
69
69
  class SandboxFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta):
70
- """An enumeration."""
70
+ """SandboxFormat."""
71
71
 
72
72
  TAR_BZ2 = "tar.bz2"
73
73
 
@@ -80,7 +80,7 @@ class SandboxType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
80
80
 
81
81
 
82
82
  class ScalarSearchOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
83
- """An enumeration."""
83
+ """ScalarSearchOperator."""
84
84
 
85
85
  EQ = "eq"
86
86
  NEQ = "neq"
@@ -90,14 +90,14 @@ class ScalarSearchOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
90
90
 
91
91
 
92
92
  class SortDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta):
93
- """An enumeration."""
93
+ """SortDirection."""
94
94
 
95
95
  ASC = "asc"
96
96
  DESC = "desc"
97
97
 
98
98
 
99
99
  class VectorSearchOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
100
- """An enumeration."""
100
+ """VectorSearchOperator."""
101
101
 
102
102
  IN_ENUM = "in"
103
103
  NOT_IN = "not in"
@@ -1,18 +1,25 @@
1
1
  # coding=utf-8
2
2
  # pylint: disable=too-many-lines
3
3
  # --------------------------------------------------------------------------
4
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
4
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
5
5
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
6
6
  # --------------------------------------------------------------------------
7
7
 
8
8
  import datetime
9
+ import sys
9
10
  from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
10
11
 
11
12
  from .. import _serialization
12
13
 
14
+ if sys.version_info >= (3, 9):
15
+ from collections.abc import MutableMapping
16
+ else:
17
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
18
+
13
19
  if TYPE_CHECKING:
14
20
  # pylint: disable=unused-import,ungrouped-imports
15
21
  from .. import models as _models
22
+ JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
16
23
 
17
24
 
18
25
  class BodyAuthToken(_serialization.Model):
@@ -144,7 +151,7 @@ class HTTPValidationError(_serialization.Model):
144
151
 
145
152
 
146
153
  class InitiateDeviceFlowResponse(_serialization.Model):
147
- """InitiateDeviceFlowResponse.
154
+ """Response for the device flow initiation.
148
155
 
149
156
  All required parameters must be populated in order to send to server.
150
157
 
@@ -319,7 +326,7 @@ class JobStatusReturn(_serialization.Model):
319
326
 
320
327
  All required parameters must be populated in order to send to server.
321
328
 
322
- :ivar status: An enumeration. Required. Known values are: "Submitting", "Received", "Checking",
329
+ :ivar status: JobStatus. Required. Known values are: "Submitting", "Received", "Checking",
323
330
  "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed",
324
331
  "Failed", "Deleted", "Killed", and "Rescheduled".
325
332
  :vartype status: str or ~client.models.JobStatus
@@ -360,9 +367,9 @@ class JobStatusReturn(_serialization.Model):
360
367
  **kwargs: Any,
361
368
  ) -> None:
362
369
  """
363
- :keyword status: An enumeration. Required. Known values are: "Submitting", "Received",
364
- "Checking", "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done",
365
- "Completed", "Failed", "Deleted", "Killed", and "Rescheduled".
370
+ :keyword status: JobStatus. Required. Known values are: "Submitting", "Received", "Checking",
371
+ "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed",
372
+ "Failed", "Deleted", "Killed", and "Rescheduled".
366
373
  :paramtype status: str or ~client.models.JobStatus
367
374
  :keyword minor_status: Minorstatus. Required.
368
375
  :paramtype minor_status: str
@@ -384,9 +391,9 @@ class JobStatusReturn(_serialization.Model):
384
391
  class JobStatusUpdate(_serialization.Model):
385
392
  """JobStatusUpdate.
386
393
 
387
- :ivar status: An enumeration. Known values are: "Submitting", "Received", "Checking",
388
- "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed",
389
- "Failed", "Deleted", "Killed", and "Rescheduled".
394
+ :ivar status: JobStatus. Known values are: "Submitting", "Received", "Checking", "Staging",
395
+ "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed", "Failed",
396
+ "Deleted", "Killed", and "Rescheduled".
390
397
  :vartype status: str or ~client.models.JobStatus
391
398
  :ivar minor_status: Minorstatus.
392
399
  :vartype minor_status: str
@@ -413,9 +420,9 @@ class JobStatusUpdate(_serialization.Model):
413
420
  **kwargs: Any,
414
421
  ) -> None:
415
422
  """
416
- :keyword status: An enumeration. Known values are: "Submitting", "Received", "Checking",
417
- "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed",
418
- "Failed", "Deleted", "Killed", and "Rescheduled".
423
+ :keyword status: JobStatus. Known values are: "Submitting", "Received", "Checking", "Staging",
424
+ "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed", "Failed",
425
+ "Deleted", "Killed", and "Rescheduled".
419
426
  :paramtype status: str or ~client.models.JobStatus
420
427
  :keyword minor_status: Minorstatus.
421
428
  :paramtype minor_status: str
@@ -478,7 +485,7 @@ class LimitedJobStatusReturn(_serialization.Model):
478
485
 
479
486
  All required parameters must be populated in order to send to server.
480
487
 
481
- :ivar status: An enumeration. Required. Known values are: "Submitting", "Received", "Checking",
488
+ :ivar status: JobStatus. Required. Known values are: "Submitting", "Received", "Checking",
482
489
  "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed",
483
490
  "Failed", "Deleted", "Killed", and "Rescheduled".
484
491
  :vartype status: str or ~client.models.JobStatus
@@ -509,9 +516,9 @@ class LimitedJobStatusReturn(_serialization.Model):
509
516
  **kwargs: Any,
510
517
  ) -> None:
511
518
  """
512
- :keyword status: An enumeration. Required. Known values are: "Submitting", "Received",
513
- "Checking", "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done",
514
- "Completed", "Failed", "Deleted", "Killed", and "Rescheduled".
519
+ :keyword status: JobStatus. Required. Known values are: "Submitting", "Received", "Checking",
520
+ "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed",
521
+ "Failed", "Deleted", "Killed", and "Rescheduled".
515
522
  :paramtype status: str or ~client.models.JobStatus
516
523
  :keyword minor_status: Minorstatus. Required.
517
524
  :paramtype minor_status: str
@@ -590,13 +597,13 @@ class SandboxInfo(_serialization.Model):
590
597
 
591
598
  All required parameters must be populated in order to send to server.
592
599
 
593
- :ivar checksum_algorithm: An enumeration. Required. "sha256"
600
+ :ivar checksum_algorithm: ChecksumAlgorithm. Required. "sha256"
594
601
  :vartype checksum_algorithm: str or ~client.models.ChecksumAlgorithm
595
602
  :ivar checksum: Checksum. Required.
596
603
  :vartype checksum: str
597
604
  :ivar size: Size. Required.
598
605
  :vartype size: int
599
- :ivar format: An enumeration. Required. "tar.bz2"
606
+ :ivar format: SandboxFormat. Required. "tar.bz2"
600
607
  :vartype format: str or ~client.models.SandboxFormat
601
608
  """
602
609
 
@@ -624,13 +631,13 @@ class SandboxInfo(_serialization.Model):
624
631
  **kwargs: Any,
625
632
  ) -> None:
626
633
  """
627
- :keyword checksum_algorithm: An enumeration. Required. "sha256"
634
+ :keyword checksum_algorithm: ChecksumAlgorithm. Required. "sha256"
628
635
  :paramtype checksum_algorithm: str or ~client.models.ChecksumAlgorithm
629
636
  :keyword checksum: Checksum. Required.
630
637
  :paramtype checksum: str
631
638
  :keyword size: Size. Required.
632
639
  :paramtype size: int
633
- :keyword format: An enumeration. Required. "tar.bz2"
640
+ :keyword format: SandboxFormat. Required. "tar.bz2"
634
641
  :paramtype format: str or ~client.models.SandboxFormat
635
642
  """
636
643
  super().__init__(**kwargs)
@@ -692,7 +699,7 @@ class ScalarSearchSpec(_serialization.Model):
692
699
 
693
700
  :ivar parameter: Parameter. Required.
694
701
  :vartype parameter: str
695
- :ivar operator: An enumeration. Required. Known values are: "eq", "neq", "gt", "lt", and
702
+ :ivar operator: ScalarSearchOperator. Required. Known values are: "eq", "neq", "gt", "lt", and
696
703
  "like".
697
704
  :vartype operator: str or ~client.models.ScalarSearchOperator
698
705
  :ivar value: Value. Required.
@@ -722,8 +729,8 @@ class ScalarSearchSpec(_serialization.Model):
722
729
  """
723
730
  :keyword parameter: Parameter. Required.
724
731
  :paramtype parameter: str
725
- :keyword operator: An enumeration. Required. Known values are: "eq", "neq", "gt", "lt", and
726
- "like".
732
+ :keyword operator: ScalarSearchOperator. Required. Known values are: "eq", "neq", "gt", "lt",
733
+ and "like".
727
734
  :paramtype operator: str or ~client.models.ScalarSearchOperator
728
735
  :keyword value: Value. Required.
729
736
  :paramtype value: ~client.models.ScalarSearchSpecValue
@@ -741,9 +748,9 @@ class ScalarSearchSpecValue(_serialization.Model):
741
748
  class SetJobStatusReturn(_serialization.Model):
742
749
  """SetJobStatusReturn.
743
750
 
744
- :ivar status: An enumeration. Known values are: "Submitting", "Received", "Checking",
745
- "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed",
746
- "Failed", "Deleted", "Killed", and "Rescheduled".
751
+ :ivar status: JobStatus. Known values are: "Submitting", "Received", "Checking", "Staging",
752
+ "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed", "Failed",
753
+ "Deleted", "Killed", and "Rescheduled".
747
754
  :vartype status: str or ~client.models.JobStatus
748
755
  :ivar minor_status: Minorstatus.
749
756
  :vartype minor_status: str
@@ -782,9 +789,9 @@ class SetJobStatusReturn(_serialization.Model):
782
789
  **kwargs: Any,
783
790
  ) -> None:
784
791
  """
785
- :keyword status: An enumeration. Known values are: "Submitting", "Received", "Checking",
786
- "Staging", "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed",
787
- "Failed", "Deleted", "Killed", and "Rescheduled".
792
+ :keyword status: JobStatus. Known values are: "Submitting", "Received", "Checking", "Staging",
793
+ "Waiting", "Matched", "Running", "Stalled", "Completing", "Done", "Completed", "Failed",
794
+ "Deleted", "Killed", and "Rescheduled".
788
795
  :paramtype status: str or ~client.models.JobStatus
789
796
  :keyword minor_status: Minorstatus.
790
797
  :paramtype minor_status: str
@@ -816,7 +823,7 @@ class SortSpec(_serialization.Model):
816
823
 
817
824
  :ivar parameter: Parameter. Required.
818
825
  :vartype parameter: str
819
- :ivar direction: An enumeration. Required. Known values are: "asc" and "desc".
826
+ :ivar direction: SortDirection. Required. Known values are: "asc" and "desc".
820
827
  :vartype direction: str or ~client.models.SortDirection
821
828
  """
822
829
 
@@ -840,7 +847,7 @@ class SortSpec(_serialization.Model):
840
847
  """
841
848
  :keyword parameter: Parameter. Required.
842
849
  :paramtype parameter: str
843
- :keyword direction: An enumeration. Required. Known values are: "asc" and "desc".
850
+ :keyword direction: SortDirection. Required. Known values are: "asc" and "desc".
844
851
  :paramtype direction: str or ~client.models.SortDirection
845
852
  """
846
853
  super().__init__(**kwargs)
@@ -944,7 +951,7 @@ class TokenResponse(_serialization.Model):
944
951
 
945
952
 
946
953
  class UserInfoResponse(_serialization.Model):
947
- """UserInfoResponse.
954
+ """Response for the userinfo endpoint.
948
955
 
949
956
  All required parameters must be populated in order to send to server.
950
957
 
@@ -954,6 +961,8 @@ class UserInfoResponse(_serialization.Model):
954
961
  :vartype vo: str
955
962
  :ivar dirac_group: Dirac Group. Required.
956
963
  :vartype dirac_group: str
964
+ :ivar policies: Policies. Required.
965
+ :vartype policies: JSON
957
966
  :ivar properties: Properties. Required.
958
967
  :vartype properties: list[str]
959
968
  :ivar preferred_username: Preferred Username. Required.
@@ -964,6 +973,7 @@ class UserInfoResponse(_serialization.Model):
964
973
  "sub": {"required": True},
965
974
  "vo": {"required": True},
966
975
  "dirac_group": {"required": True},
976
+ "policies": {"required": True},
967
977
  "properties": {"required": True},
968
978
  "preferred_username": {"required": True},
969
979
  }
@@ -972,6 +982,7 @@ class UserInfoResponse(_serialization.Model):
972
982
  "sub": {"key": "sub", "type": "str"},
973
983
  "vo": {"key": "vo", "type": "str"},
974
984
  "dirac_group": {"key": "dirac_group", "type": "str"},
985
+ "policies": {"key": "policies", "type": "object"},
975
986
  "properties": {"key": "properties", "type": "[str]"},
976
987
  "preferred_username": {"key": "preferred_username", "type": "str"},
977
988
  }
@@ -982,6 +993,7 @@ class UserInfoResponse(_serialization.Model):
982
993
  sub: str,
983
994
  vo: str,
984
995
  dirac_group: str,
996
+ policies: JSON,
985
997
  properties: List[str],
986
998
  preferred_username: str,
987
999
  **kwargs: Any,
@@ -993,6 +1005,8 @@ class UserInfoResponse(_serialization.Model):
993
1005
  :paramtype vo: str
994
1006
  :keyword dirac_group: Dirac Group. Required.
995
1007
  :paramtype dirac_group: str
1008
+ :keyword policies: Policies. Required.
1009
+ :paramtype policies: JSON
996
1010
  :keyword properties: Properties. Required.
997
1011
  :paramtype properties: list[str]
998
1012
  :keyword preferred_username: Preferred Username. Required.
@@ -1002,6 +1016,7 @@ class UserInfoResponse(_serialization.Model):
1002
1016
  self.sub = sub
1003
1017
  self.vo = vo
1004
1018
  self.dirac_group = dirac_group
1019
+ self.policies = policies
1005
1020
  self.properties = properties
1006
1021
  self.preferred_username = preferred_username
1007
1022
 
@@ -1064,7 +1079,7 @@ class VectorSearchSpec(_serialization.Model):
1064
1079
 
1065
1080
  :ivar parameter: Parameter. Required.
1066
1081
  :vartype parameter: str
1067
- :ivar operator: An enumeration. Required. Known values are: "in" and "not in".
1082
+ :ivar operator: VectorSearchOperator. Required. Known values are: "in" and "not in".
1068
1083
  :vartype operator: str or ~client.models.VectorSearchOperator
1069
1084
  :ivar values: Values. Required.
1070
1085
  :vartype values: ~client.models.VectorSearchSpecValues
@@ -1093,7 +1108,7 @@ class VectorSearchSpec(_serialization.Model):
1093
1108
  """
1094
1109
  :keyword parameter: Parameter. Required.
1095
1110
  :paramtype parameter: str
1096
- :keyword operator: An enumeration. Required. Known values are: "in" and "not in".
1111
+ :keyword operator: VectorSearchOperator. Required. Known values are: "in" and "not in".
1097
1112
  :paramtype operator: str or ~client.models.VectorSearchOperator
1098
1113
  :keyword values: Values. Required.
1099
1114
  :paramtype values: ~client.models.VectorSearchSpecValues
@@ -1,6 +1,6 @@
1
1
  # coding=utf-8
2
2
  # --------------------------------------------------------------------------
3
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
3
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
4
4
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  # --------------------------------------------------------------------------
6
6
 
@@ -1,7 +1,7 @@
1
1
  # pylint: disable=too-many-lines,too-many-statements
2
2
  # coding=utf-8
3
3
  # --------------------------------------------------------------------------
4
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.17)
4
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.19)
5
5
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
6
6
  # --------------------------------------------------------------------------
7
7
  from io import IOBase
@@ -84,7 +84,9 @@ def build_well_known_installation_metadata_request(
84
84
  return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs)
85
85
 
86
86
 
87
- def build_auth_do_device_flow_request(*, user_code: str, **kwargs: Any) -> HttpRequest:
87
+ def build_auth_initiate_device_flow_request(
88
+ *, client_id: str, scope: str, **kwargs: Any
89
+ ) -> HttpRequest:
88
90
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
89
91
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
90
92
 
@@ -94,19 +96,18 @@ def build_auth_do_device_flow_request(*, user_code: str, **kwargs: Any) -> HttpR
94
96
  _url = "/api/auth/device"
95
97
 
96
98
  # Construct parameters
97
- _params["user_code"] = _SERIALIZER.query("user_code", user_code, "str")
99
+ _params["client_id"] = _SERIALIZER.query("client_id", client_id, "str")
100
+ _params["scope"] = _SERIALIZER.query("scope", scope, "str")
98
101
 
99
102
  # Construct headers
100
103
  _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
101
104
 
102
105
  return HttpRequest(
103
- method="GET", url=_url, params=_params, headers=_headers, **kwargs
106
+ method="POST", url=_url, params=_params, headers=_headers, **kwargs
104
107
  )
105
108
 
106
109
 
107
- def build_auth_initiate_device_flow_request(
108
- *, client_id: str, scope: str, **kwargs: Any
109
- ) -> HttpRequest:
110
+ def build_auth_do_device_flow_request(*, user_code: str, **kwargs: Any) -> HttpRequest:
110
111
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
111
112
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
112
113
 
@@ -116,14 +117,13 @@ def build_auth_initiate_device_flow_request(
116
117
  _url = "/api/auth/device"
117
118
 
118
119
  # Construct parameters
119
- _params["client_id"] = _SERIALIZER.query("client_id", client_id, "str")
120
- _params["scope"] = _SERIALIZER.query("scope", scope, "str")
120
+ _params["user_code"] = _SERIALIZER.query("user_code", user_code, "str")
121
121
 
122
122
  # Construct headers
123
123
  _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
124
124
 
125
125
  return HttpRequest(
126
- method="POST", url=_url, params=_params, headers=_headers, **kwargs
126
+ method="GET", url=_url, params=_params, headers=_headers, **kwargs
127
127
  )
128
128
 
129
129
 
@@ -306,6 +306,29 @@ def build_config_serve_config_request(
306
306
  return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs)
307
307
 
308
308
 
309
+ def build_jobs_initiate_sandbox_upload_request(
310
+ **kwargs: Any,
311
+ ) -> HttpRequest: # pylint: disable=name-too-long
312
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
313
+
314
+ content_type: Optional[str] = kwargs.pop(
315
+ "content_type", _headers.pop("Content-Type", None)
316
+ )
317
+ accept = _headers.pop("Accept", "application/json")
318
+
319
+ # Construct URL
320
+ _url = "/api/jobs/sandbox"
321
+
322
+ # Construct headers
323
+ if content_type is not None:
324
+ _headers["Content-Type"] = _SERIALIZER.header(
325
+ "content_type", content_type, "str"
326
+ )
327
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
328
+
329
+ return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs)
330
+
331
+
309
332
  def build_jobs_get_sandbox_file_request(*, pfn: str, **kwargs: Any) -> HttpRequest:
310
333
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
311
334
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -332,29 +355,6 @@ def build_jobs_get_sandbox_file_request(*, pfn: str, **kwargs: Any) -> HttpReque
332
355
  )
333
356
 
334
357
 
335
- def build_jobs_initiate_sandbox_upload_request(
336
- **kwargs: Any,
337
- ) -> HttpRequest: # pylint: disable=name-too-long
338
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
339
-
340
- content_type: Optional[str] = kwargs.pop(
341
- "content_type", _headers.pop("Content-Type", None)
342
- )
343
- accept = _headers.pop("Accept", "application/json")
344
-
345
- # Construct URL
346
- _url = "/api/jobs/sandbox"
347
-
348
- # Construct headers
349
- if content_type is not None:
350
- _headers["Content-Type"] = _SERIALIZER.header(
351
- "content_type", content_type, "str"
352
- )
353
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
354
-
355
- return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs)
356
-
357
-
358
358
  def build_jobs_unassign_bulk_jobs_sandboxes_request( # pylint: disable=name-too-long
359
359
  *, jobs_ids: List[int], **kwargs: Any
360
360
  ) -> HttpRequest:
@@ -1069,22 +1069,25 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1069
1069
  )
1070
1070
 
1071
1071
  @distributed_trace
1072
- def do_device_flow(self, *, user_code: str, **kwargs: Any) -> Any:
1073
- """Do Device Flow.
1072
+ def initiate_device_flow(
1073
+ self, *, client_id: str, scope: str, **kwargs: Any
1074
+ ) -> _models.InitiateDeviceFlowResponse:
1075
+ """Initiate Device Flow.
1074
1076
 
1075
- This is called as the verification URI for the device flow.
1076
- It will redirect to the actual OpenID server (IAM, CheckIn) to
1077
- perform a authorization code flow.
1077
+ 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
1078
1081
 
1079
- We set the user_code obtained from the device flow in a cookie
1080
- to be able to map the authorization flow with the corresponding
1081
- device flow.
1082
- (note: it can't be put as parameter or in the URL).
1082
+ Offers the user to go with the browser to
1083
+ ``auth/<vo>/device?user_code=XYZ``.
1083
1084
 
1084
- :keyword user_code: Required.
1085
- :paramtype user_code: str
1086
- :return: any
1087
- :rtype: any
1085
+ :keyword client_id: Required.
1086
+ :paramtype client_id: str
1087
+ :keyword scope: Required.
1088
+ :paramtype scope: str
1089
+ :return: InitiateDeviceFlowResponse
1090
+ :rtype: ~client.models.InitiateDeviceFlowResponse
1088
1091
  :raises ~azure.core.exceptions.HttpResponseError:
1089
1092
  """
1090
1093
  error_map: MutableMapping[int, Type[HttpResponseError]] = {
@@ -1098,10 +1101,11 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1098
1101
  _headers = kwargs.pop("headers", {}) or {}
1099
1102
  _params = kwargs.pop("params", {}) or {}
1100
1103
 
1101
- cls: ClsType[Any] = kwargs.pop("cls", None)
1104
+ cls: ClsType[_models.InitiateDeviceFlowResponse] = kwargs.pop("cls", None)
1102
1105
 
1103
- _request = build_auth_do_device_flow_request(
1104
- user_code=user_code,
1106
+ _request = build_auth_initiate_device_flow_request(
1107
+ client_id=client_id,
1108
+ scope=scope,
1105
1109
  headers=_headers,
1106
1110
  params=_params,
1107
1111
  )
@@ -1124,7 +1128,9 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1124
1128
  )
1125
1129
  raise HttpResponseError(response=response)
1126
1130
 
1127
- deserialized = self._deserialize("object", pipeline_response)
1131
+ deserialized = self._deserialize(
1132
+ "InitiateDeviceFlowResponse", pipeline_response
1133
+ )
1128
1134
 
1129
1135
  if cls:
1130
1136
  return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -1132,25 +1138,22 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1132
1138
  return deserialized # type: ignore
1133
1139
 
1134
1140
  @distributed_trace
1135
- def initiate_device_flow(
1136
- self, *, client_id: str, scope: str, **kwargs: Any
1137
- ) -> _models.InitiateDeviceFlowResponse:
1138
- """Initiate Device Flow.
1141
+ def do_device_flow(self, *, user_code: str, **kwargs: Any) -> Any:
1142
+ """Do Device Flow.
1139
1143
 
1140
- Initiate the device flow against DIRAC authorization Server.
1141
- Scope must have exactly up to one ``group`` (otherwise default) and
1142
- one or more ``property`` scope.
1143
- If no property, then get default one
1144
+ This is called as the verification URI for the device flow.
1145
+ It will redirect to the actual OpenID server (IAM, CheckIn) to
1146
+ perform a authorization code flow.
1144
1147
 
1145
- Offers the user to go with the browser to
1146
- ``auth/<vo>/device?user_code=XYZ``.
1148
+ We set the user_code obtained from the device flow in a cookie
1149
+ to be able to map the authorization flow with the corresponding
1150
+ device flow.
1151
+ (note: it can't be put as parameter or in the URL).
1147
1152
 
1148
- :keyword client_id: Required.
1149
- :paramtype client_id: str
1150
- :keyword scope: Required.
1151
- :paramtype scope: str
1152
- :return: InitiateDeviceFlowResponse
1153
- :rtype: ~client.models.InitiateDeviceFlowResponse
1153
+ :keyword user_code: Required.
1154
+ :paramtype user_code: str
1155
+ :return: any
1156
+ :rtype: any
1154
1157
  :raises ~azure.core.exceptions.HttpResponseError:
1155
1158
  """
1156
1159
  error_map: MutableMapping[int, Type[HttpResponseError]] = {
@@ -1164,11 +1167,10 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1164
1167
  _headers = kwargs.pop("headers", {}) or {}
1165
1168
  _params = kwargs.pop("params", {}) or {}
1166
1169
 
1167
- cls: ClsType[_models.InitiateDeviceFlowResponse] = kwargs.pop("cls", None)
1170
+ cls: ClsType[Any] = kwargs.pop("cls", None)
1168
1171
 
1169
- _request = build_auth_initiate_device_flow_request(
1170
- client_id=client_id,
1171
- scope=scope,
1172
+ _request = build_auth_do_device_flow_request(
1173
+ user_code=user_code,
1172
1174
  headers=_headers,
1173
1175
  params=_params,
1174
1176
  )
@@ -1191,9 +1193,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
1191
1193
  )
1192
1194
  raise HttpResponseError(response=response)
1193
1195
 
1194
- deserialized = self._deserialize(
1195
- "InitiateDeviceFlowResponse", pipeline_response
1196
- )
1196
+ deserialized = self._deserialize("object", pipeline_response)
1197
1197
 
1198
1198
  if cls:
1199
1199
  return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -1763,70 +1763,6 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1763
1763
  input_args.pop(0) if input_args else kwargs.pop("deserializer")
1764
1764
  )
1765
1765
 
1766
- @distributed_trace
1767
- def get_sandbox_file(
1768
- self, *, pfn: str, **kwargs: Any
1769
- ) -> _models.SandboxDownloadResponse:
1770
- """Get Sandbox File.
1771
-
1772
- Get a presigned URL to download a sandbox file
1773
-
1774
- This route cannot use a redirect response most clients will also send the
1775
- authorization header when following a redirect. This is not desirable as
1776
- it would leak the authorization token to the storage backend. Additionally,
1777
- most storage backends return an error when they receive an authorization
1778
- header for a presigned URL.
1779
-
1780
- :keyword pfn: Required.
1781
- :paramtype pfn: str
1782
- :return: SandboxDownloadResponse
1783
- :rtype: ~client.models.SandboxDownloadResponse
1784
- :raises ~azure.core.exceptions.HttpResponseError:
1785
- """
1786
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
1787
- 401: ClientAuthenticationError,
1788
- 404: ResourceNotFoundError,
1789
- 409: ResourceExistsError,
1790
- 304: ResourceNotModifiedError,
1791
- }
1792
- error_map.update(kwargs.pop("error_map", {}) or {})
1793
-
1794
- _headers = kwargs.pop("headers", {}) or {}
1795
- _params = kwargs.pop("params", {}) or {}
1796
-
1797
- cls: ClsType[_models.SandboxDownloadResponse] = kwargs.pop("cls", None)
1798
-
1799
- _request = build_jobs_get_sandbox_file_request(
1800
- pfn=pfn,
1801
- headers=_headers,
1802
- params=_params,
1803
- )
1804
- _request.url = self._client.format_url(_request.url)
1805
-
1806
- _stream = False
1807
- pipeline_response: PipelineResponse = (
1808
- self._client._pipeline.run( # pylint: disable=protected-access
1809
- _request, stream=_stream, **kwargs
1810
- )
1811
- )
1812
-
1813
- response = pipeline_response.http_response
1814
-
1815
- if response.status_code not in [200]:
1816
- if _stream:
1817
- response.read() # Load the body in memory and close the socket
1818
- map_error(
1819
- status_code=response.status_code, response=response, error_map=error_map
1820
- )
1821
- raise HttpResponseError(response=response)
1822
-
1823
- deserialized = self._deserialize("SandboxDownloadResponse", pipeline_response)
1824
-
1825
- if cls:
1826
- return cls(pipeline_response, deserialized, {}) # type: ignore
1827
-
1828
- return deserialized # type: ignore
1829
-
1830
1766
  @overload
1831
1767
  def initiate_sandbox_upload(
1832
1768
  self,
@@ -1956,6 +1892,70 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1956
1892
 
1957
1893
  return deserialized # type: ignore
1958
1894
 
1895
+ @distributed_trace
1896
+ def get_sandbox_file(
1897
+ self, *, pfn: str, **kwargs: Any
1898
+ ) -> _models.SandboxDownloadResponse:
1899
+ """Get Sandbox File.
1900
+
1901
+ Get a presigned URL to download a sandbox file
1902
+
1903
+ This route cannot use a redirect response most clients will also send the
1904
+ authorization header when following a redirect. This is not desirable as
1905
+ it would leak the authorization token to the storage backend. Additionally,
1906
+ most storage backends return an error when they receive an authorization
1907
+ header for a presigned URL.
1908
+
1909
+ :keyword pfn: Required.
1910
+ :paramtype pfn: str
1911
+ :return: SandboxDownloadResponse
1912
+ :rtype: ~client.models.SandboxDownloadResponse
1913
+ :raises ~azure.core.exceptions.HttpResponseError:
1914
+ """
1915
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1916
+ 401: ClientAuthenticationError,
1917
+ 404: ResourceNotFoundError,
1918
+ 409: ResourceExistsError,
1919
+ 304: ResourceNotModifiedError,
1920
+ }
1921
+ error_map.update(kwargs.pop("error_map", {}) or {})
1922
+
1923
+ _headers = kwargs.pop("headers", {}) or {}
1924
+ _params = kwargs.pop("params", {}) or {}
1925
+
1926
+ cls: ClsType[_models.SandboxDownloadResponse] = kwargs.pop("cls", None)
1927
+
1928
+ _request = build_jobs_get_sandbox_file_request(
1929
+ pfn=pfn,
1930
+ headers=_headers,
1931
+ params=_params,
1932
+ )
1933
+ _request.url = self._client.format_url(_request.url)
1934
+
1935
+ _stream = False
1936
+ pipeline_response: PipelineResponse = (
1937
+ self._client._pipeline.run( # pylint: disable=protected-access
1938
+ _request, stream=_stream, **kwargs
1939
+ )
1940
+ )
1941
+
1942
+ response = pipeline_response.http_response
1943
+
1944
+ if response.status_code not in [200]:
1945
+ if _stream:
1946
+ response.read() # Load the body in memory and close the socket
1947
+ map_error(
1948
+ status_code=response.status_code, response=response, error_map=error_map
1949
+ )
1950
+ raise HttpResponseError(response=response)
1951
+
1952
+ deserialized = self._deserialize("SandboxDownloadResponse", pipeline_response)
1953
+
1954
+ if cls:
1955
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1956
+
1957
+ return deserialized # type: ignore
1958
+
1959
1959
  @distributed_trace
1960
1960
  def unassign_bulk_jobs_sandboxes(
1961
1961
  self, *, jobs_ids: List[int], **kwargs: Any
@@ -2191,7 +2191,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2191
2191
  def assign_sandbox_to_job(self, job_id: int, body: str, **kwargs: Any) -> Any:
2192
2192
  """Assign Sandbox To Job.
2193
2193
 
2194
- Mapp the pfn as output sandbox to job.
2194
+ Map the pfn as output sandbox to job.
2195
2195
 
2196
2196
  :param job_id: Required.
2197
2197
  :type job_id: int
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diracx-client
3
- Version: 0.0.1a16
3
+ Version: 0.0.1a17
4
4
  Summary: TODO
5
5
  License: GPL-3.0-only
6
6
  Classifier: Intended Audience :: Science/Research
@@ -0,0 +1,26 @@
1
+ diracx/client/__init__.py,sha256=NpsBFQPgWn_D_IVhT2RbRy0Y9oIKicEh6QBD0zGYHy4,701
2
+ diracx/client/_client.py,sha256=agmWB402dpROnDRlqL_StInHTBIqDj-ZLSPinGfrxGk,4788
3
+ diracx/client/_configuration.py,sha256=87XGycT5MOvmixM7v4Hq8kGsJhDAA6Zv_8pxO2sCAvQ,1937
4
+ diracx/client/_patch.py,sha256=Dgf3pYZrSRurPsx6yxio9kMRmW30LHNEqL744ksZiPI,9130
5
+ diracx/client/_serialization.py,sha256=jd8QTNv6p8YvcNhCkJPIjiZyuVQL55YEGOpy4cVcVzI,80965
6
+ diracx/client/_vendor.py,sha256=ubmRRLS5-52w6qbvaWwOZBz-gS-MH3StxRlmXROIMvs,1937
7
+ diracx/client/py.typed,sha256=bWew9mHgMy8LqMu7RuqQXFXLBxh2CRx0dUbSx-3wE48,27
8
+ diracx/client/aio/__init__.py,sha256=NpsBFQPgWn_D_IVhT2RbRy0Y9oIKicEh6QBD0zGYHy4,701
9
+ diracx/client/aio/_client.py,sha256=zaVOzCPZfUPTTXfHohO7fm43mjo5_zPHVWFwG0ZSvOs,4909
10
+ diracx/client/aio/_configuration.py,sha256=5AiZRmwQ1B8SjUPIY6bYtD-V71eumeHxQUj7Maigs4c,1969
11
+ diracx/client/aio/_patch.py,sha256=fCRZTD-wvBE2-QZo4jiN1OsZzM2mWbtSAXk9X9Als9Q,6688
12
+ diracx/client/aio/_vendor.py,sha256=ubmRRLS5-52w6qbvaWwOZBz-gS-MH3StxRlmXROIMvs,1937
13
+ diracx/client/aio/operations/__init__.py,sha256=NpQ6cr321ysggDkN62imu0BAD6VXTF2GZNG0Zs6hqj4,869
14
+ diracx/client/aio/operations/_operations.py,sha256=mM1UgFGr3e5KeE591Bb0drPjz1VNdzLZ1-_SKtcHQ18,99720
15
+ diracx/client/aio/operations/_patch.py,sha256=3oHjHqBF7DXruMSVUTRxW0Xpv_mY1WaB8iyo47YBTec,4229
16
+ diracx/client/models/__init__.py,sha256=cidagrv48gYiRwqXgAtkiAG2CBHoEF5aMuKt8gqOOjE,3043
17
+ diracx/client/models/_enums.py,sha256=Cn1A9abUE1EK7Z5saAFj5Ea6sk_QdcvDsdMbZiyGFlo,2395
18
+ diracx/client/models/_models.py,sha256=jzLNS8kQO8U0x_CAAjtuK--K5rZrUkLXaLRdFiNV13s,38145
19
+ diracx/client/models/_patch.py,sha256=uvLwKzjWO_t-VZ4aSuLhuJ05RVxAP9UJxZV3XDeGMnU,1497
20
+ diracx/client/operations/__init__.py,sha256=NpQ6cr321ysggDkN62imu0BAD6VXTF2GZNG0Zs6hqj4,869
21
+ diracx/client/operations/_operations.py,sha256=Favj5uZ_UeRbA0UT2FYJSENNpH6qz2IkcQu0TNAjGiI,124423
22
+ diracx/client/operations/_patch.py,sha256=FvemlcswH_zZkdyoGObyTwRnwTsYIZJa3seO66C2BQI,4202
23
+ diracx_client-0.0.1a17.dist-info/METADATA,sha256=4j7me5xo62UKHy4tvS7EgJ6gcffP_Cbjg6QWoyhRH9A,679
24
+ diracx_client-0.0.1a17.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
25
+ diracx_client-0.0.1a17.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
26
+ diracx_client-0.0.1a17.dist-info/RECORD,,
@@ -1,26 +0,0 @@
1
- diracx/client/__init__.py,sha256=yqyAacKejDQf3CZBzfDiCPpHd-4lvpcY7p-ASziotIw,701
2
- diracx/client/_client.py,sha256=feYIuFadmRhqSVWr8PoN8ku86UqKpCwjajBq44TvEp8,4788
3
- diracx/client/_configuration.py,sha256=_T4-BJeKOsCoNJUIK-rsaWDPUbQEn9_yj7HQMdXWyy4,1937
4
- diracx/client/_patch.py,sha256=AU8OAYCrl8vg6zzljC8tiXmBVmKN5VtuiPap4dphtAU,9087
5
- diracx/client/_serialization.py,sha256=Xll7xvrfZ5vf-oA3wZcOYJdvE0qsSnPNDNwwGkfDObI,80945
6
- diracx/client/_vendor.py,sha256=rQKkfKRH9HgztG0FsTN5mXu2Uy6vdJlVp1oF9aZxReo,1937
7
- diracx/client/py.typed,sha256=bWew9mHgMy8LqMu7RuqQXFXLBxh2CRx0dUbSx-3wE48,27
8
- diracx/client/aio/__init__.py,sha256=yqyAacKejDQf3CZBzfDiCPpHd-4lvpcY7p-ASziotIw,701
9
- diracx/client/aio/_client.py,sha256=b2MlRz43rSMkeLp1DySpbYNnlq1EsEGDGMUwppTz3U0,4909
10
- diracx/client/aio/_configuration.py,sha256=W61IQzNXTk3PwBkmMGpXKadWOU1GEP_-836eOgdfS4U,1969
11
- diracx/client/aio/_patch.py,sha256=DBtar8kpDfh6lBzb9OaXi9L2Fy8fPFOE5kHfnS7qyso,6683
12
- diracx/client/aio/_vendor.py,sha256=rQKkfKRH9HgztG0FsTN5mXu2Uy6vdJlVp1oF9aZxReo,1937
13
- diracx/client/aio/operations/__init__.py,sha256=l9Cjvl_P5uCskFDpvXmbByECS-W3-fNrfB1TbCfIjp8,869
14
- diracx/client/aio/operations/_operations.py,sha256=JZeUZhKb5AhRJmWBwjG8Migngt7A9eKpm_WiM2_u4hk,99721
15
- diracx/client/aio/operations/_patch.py,sha256=3oHjHqBF7DXruMSVUTRxW0Xpv_mY1WaB8iyo47YBTec,4229
16
- diracx/client/models/__init__.py,sha256=H3eF5Fu1Bk3yAuwDXrZ2-JlPlG8rWVUmsoO6A6fPrzs,3043
17
- diracx/client/models/_enums.py,sha256=HcTPTYeRZk3FcpfPWAankmCbgxcStrpQUW2GW-KNoVI,2387
18
- diracx/client/models/_models.py,sha256=T6WX6GGbLhTbit1n2t0GEgdpQAAWZ6b93qBog8Xkcek,37562
19
- diracx/client/models/_patch.py,sha256=uvLwKzjWO_t-VZ4aSuLhuJ05RVxAP9UJxZV3XDeGMnU,1497
20
- diracx/client/operations/__init__.py,sha256=l9Cjvl_P5uCskFDpvXmbByECS-W3-fNrfB1TbCfIjp8,869
21
- diracx/client/operations/_operations.py,sha256=fklSFPzohi-fWr_j4xdQQxqEu-9UCeH3Pz_mFZEvN-4,124424
22
- diracx/client/operations/_patch.py,sha256=FvemlcswH_zZkdyoGObyTwRnwTsYIZJa3seO66C2BQI,4202
23
- diracx_client-0.0.1a16.dist-info/METADATA,sha256=Aw_tUfgIj6uKRAL5ggv0o8Onbgl60sPiGEQvmaN7D4w,679
24
- diracx_client-0.0.1a16.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
25
- diracx_client-0.0.1a16.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
26
- diracx_client-0.0.1a16.dist-info/RECORD,,