-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
505 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# pylint: disable=too-many-lines,too-many-statements | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
from io import IOBase | ||
|
@@ -35,8 +35,11 @@ | |
build_auth_revoke_refresh_token_request, | ||
build_auth_userinfo_request, | ||
build_config_serve_config_request, | ||
build_jobs_assign_sandbox_request, | ||
build_jobs_delete_bulk_jobs_request, | ||
build_jobs_delete_single_job_request, | ||
build_jobs_get_job_sandbox_request, | ||
build_jobs_get_job_sandboxes_request, | ||
build_jobs_get_job_status_bulk_request, | ||
build_jobs_get_job_status_history_bulk_request, | ||
build_jobs_get_sandbox_file_request, | ||
|
@@ -97,7 +100,7 @@ def __init__(self, *args, **kwargs) -> None: | |
async def openid_configuration(self, **kwargs: Any) -> Any: | ||
"""Openid Configuration. | ||
Openid Configuration. | ||
OpenID Connect discovery endpoint. | ||
:return: any | ||
:rtype: any | ||
|
@@ -150,7 +153,7 @@ async def openid_configuration(self, **kwargs: Any) -> Any: | |
async def installation_metadata(self, **kwargs: Any) -> _models.Metadata: | ||
"""Installation Metadata. | ||
Installation Metadata. | ||
Get metadata about the dirac installation. | ||
:return: Metadata | ||
:rtype: ~client.models.Metadata | ||
|
@@ -427,7 +430,7 @@ async def finish_device_flow(self, *, code: str, state: str, **kwargs: Any) -> A | |
async def finished(self, **kwargs: Any) -> Any: | ||
"""Finished. | ||
Finished. | ||
This is the final step of the device flow. | ||
:return: any | ||
:rtype: any | ||
|
@@ -655,7 +658,13 @@ async def authorization_flow( | |
) -> Any: | ||
"""Authorization Flow. | ||
Authorization Flow. | ||
Initiate the authorization flow. | ||
It will redirect to the actual OpenID server (IAM, CheckIn) to | ||
perform a authorization code flow. | ||
We set the user details obtained from the user authorize flow in a cookie | ||
to be able to map the authorization flow with the corresponding | ||
user authorize flow. | ||
:keyword response_type: "code" Required. | ||
:paramtype response_type: str or ~client.models.Enum0 | ||
|
@@ -731,7 +740,13 @@ async def authorization_flow_complete( | |
) -> Any: | ||
"""Authorization Flow Complete. | ||
Authorization Flow Complete. | ||
Complete the authorization flow. | ||
The user is redirected back to the DIRAC auth service after completing the IAM's authorization | ||
flow. | ||
We retrieve the original flow details from the decrypted state and store the ID token requested | ||
from the IAM. | ||
The user is then redirected to the client's redirect URI. | ||
:keyword code: Required. | ||
:paramtype code: str | ||
|
@@ -1104,6 +1119,190 @@ async def initiate_sandbox_upload( | |
|
||
return deserialized # type: ignore | ||
|
||
@distributed_trace_async | ||
async def get_job_sandboxes( | ||
self, job_id: int, **kwargs: Any | ||
) -> Dict[str, List[Any]]: | ||
"""Get Job Sandboxes. | ||
Get input and output sandboxes of given job id at the same time. | ||
:param job_id: Required. | ||
:type job_id: int | ||
:return: dict mapping str to list of any | ||
:rtype: dict[str, list[any]] | ||
:raises ~azure.core.exceptions.HttpResponseError: | ||
""" | ||
error_map = { | ||
401: ClientAuthenticationError, | ||
404: ResourceNotFoundError, | ||
409: ResourceExistsError, | ||
304: ResourceNotModifiedError, | ||
} | ||
error_map.update(kwargs.pop("error_map", {}) or {}) | ||
|
||
_headers = kwargs.pop("headers", {}) or {} | ||
_params = kwargs.pop("params", {}) or {} | ||
|
||
cls: ClsType[Dict[str, List[Any]]] = kwargs.pop("cls", None) | ||
|
||
_request = build_jobs_get_job_sandboxes_request( | ||
job_id=job_id, | ||
headers=_headers, | ||
params=_params, | ||
) | ||
_request.url = self._client.format_url(_request.url) | ||
|
||
_stream = False | ||
pipeline_response: PipelineResponse = ( | ||
await self._client._pipeline.run( # pylint: disable=protected-access | ||
_request, stream=_stream, **kwargs | ||
) | ||
) | ||
|
||
response = pipeline_response.http_response | ||
|
||
if response.status_code not in [200]: | ||
if _stream: | ||
await response.read() # Load the body in memory and close the socket | ||
map_error( | ||
status_code=response.status_code, response=response, error_map=error_map | ||
) | ||
raise HttpResponseError(response=response) | ||
|
||
deserialized = self._deserialize("{[object]}", pipeline_response) | ||
|
||
if cls: | ||
return cls(pipeline_response, deserialized, {}) # type: ignore | ||
|
||
return deserialized # type: ignore | ||
|
||
@distributed_trace_async | ||
async def get_job_sandbox( | ||
self, job_id: int, sandbox_type: Union[str, _models.SandboxType], **kwargs: Any | ||
) -> List[Any]: | ||
"""Get Job Sandbox. | ||
Get input or output sandbox from given job. | ||
:param job_id: Required. | ||
:type job_id: int | ||
:param sandbox_type: Known values are: "input" and "output". Required. | ||
:type sandbox_type: str or ~client.models.SandboxType | ||
:return: list of any | ||
:rtype: list[any] | ||
:raises ~azure.core.exceptions.HttpResponseError: | ||
""" | ||
error_map = { | ||
401: ClientAuthenticationError, | ||
404: ResourceNotFoundError, | ||
409: ResourceExistsError, | ||
304: ResourceNotModifiedError, | ||
} | ||
error_map.update(kwargs.pop("error_map", {}) or {}) | ||
|
||
_headers = kwargs.pop("headers", {}) or {} | ||
_params = kwargs.pop("params", {}) or {} | ||
|
||
cls: ClsType[List[Any]] = kwargs.pop("cls", None) | ||
|
||
_request = build_jobs_get_job_sandbox_request( | ||
job_id=job_id, | ||
sandbox_type=sandbox_type, | ||
headers=_headers, | ||
params=_params, | ||
) | ||
_request.url = self._client.format_url(_request.url) | ||
|
||
_stream = False | ||
pipeline_response: PipelineResponse = ( | ||
await self._client._pipeline.run( # pylint: disable=protected-access | ||
_request, stream=_stream, **kwargs | ||
) | ||
) | ||
|
||
response = pipeline_response.http_response | ||
|
||
if response.status_code not in [200]: | ||
if _stream: | ||
await response.read() # Load the body in memory and close the socket | ||
map_error( | ||
status_code=response.status_code, response=response, error_map=error_map | ||
) | ||
raise HttpResponseError(response=response) | ||
|
||
deserialized = self._deserialize("[object]", pipeline_response) | ||
|
||
if cls: | ||
return cls(pipeline_response, deserialized, {}) # type: ignore | ||
|
||
return deserialized # type: ignore | ||
|
||
@distributed_trace_async | ||
async def assign_sandbox(self, job_id: int, body: str, **kwargs: Any) -> Any: | ||
"""Assign Sandbox. | ||
Assign Sandbox. | ||
:param job_id: Required. | ||
:type job_id: int | ||
:param body: Required. | ||
:type body: str | ||
:return: any | ||
:rtype: any | ||
:raises ~azure.core.exceptions.HttpResponseError: | ||
""" | ||
error_map = { | ||
401: ClientAuthenticationError, | ||
404: ResourceNotFoundError, | ||
409: ResourceExistsError, | ||
304: ResourceNotModifiedError, | ||
} | ||
error_map.update(kwargs.pop("error_map", {}) or {}) | ||
|
||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) | ||
_params = kwargs.pop("params", {}) or {} | ||
|
||
content_type: str = kwargs.pop( | ||
"content_type", _headers.pop("Content-Type", "application/json") | ||
) | ||
cls: ClsType[Any] = kwargs.pop("cls", None) | ||
|
||
_content = self._serialize.body(body, "str") | ||
|
||
_request = build_jobs_assign_sandbox_request( | ||
job_id=job_id, | ||
content_type=content_type, | ||
content=_content, | ||
headers=_headers, | ||
params=_params, | ||
) | ||
_request.url = self._client.format_url(_request.url) | ||
|
||
_stream = False | ||
pipeline_response: PipelineResponse = ( | ||
await self._client._pipeline.run( # pylint: disable=protected-access | ||
_request, stream=_stream, **kwargs | ||
) | ||
) | ||
|
||
response = pipeline_response.http_response | ||
|
||
if response.status_code not in [200]: | ||
if _stream: | ||
await response.read() # Load the body in memory and close the socket | ||
map_error( | ||
status_code=response.status_code, response=response, error_map=error_map | ||
) | ||
raise HttpResponseError(response=response) | ||
|
||
deserialized = self._deserialize("object", pipeline_response) | ||
|
||
if cls: | ||
return cls(pipeline_response, deserialized, {}) # type: ignore | ||
|
||
return deserialized # type: ignore | ||
|
||
@overload | ||
async def submit_bulk_jobs( | ||
self, body: List[str], *, content_type: str = "application/json", **kwargs: Any | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].2) | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].7) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
@@ -38,13 +38,14 @@ | |
from ._enums import ChecksumAlgorithm | ||
from ._enums import Enum0 | ||
from ._enums import Enum1 | ||
from ._enums import Enum10 | ||
from ._enums import Enum11 | ||
from ._enums import Enum12 | ||
from ._enums import Enum2 | ||
from ._enums import Enum3 | ||
from ._enums import Enum4 | ||
from ._enums import JobStatus | ||
from ._enums import SandboxFormat | ||
from ._enums import SandboxType | ||
from ._enums import ScalarSearchOperator | ||
from ._enums import VectorSearchOperator | ||
from ._patch import __all__ as _patch_all | ||
|
@@ -85,13 +86,14 @@ | |
"ChecksumAlgorithm", | ||
"Enum0", | ||
"Enum1", | ||
"Enum10", | ||
"Enum11", | ||
"Enum12", | ||
"Enum2", | ||
"Enum3", | ||
"Enum4", | ||
"JobStatus", | ||
"SandboxFormat", | ||
"SandboxType", | ||
"ScalarSearchOperator", | ||
"VectorSearchOperator", | ||
] | ||
|
Oops, something went wrong.