Skip to content

Commit e17b3f7

Browse files
committed
[QI2-1311] Added job error data fields to jobs
1 parent 219241f commit e17b3f7

File tree

8 files changed

+113
-11
lines changed

8 files changed

+113
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Authentication schemes defined for the API:
229229

230230
- **Type**: OAuth
231231
- **Flow**: accessCode
232-
- **Authorization URL**: https://quantum-inspire-development.eu.auth0.com/protocol/openid-connect/auth
232+
- **Authorization URL**: https://auth.qi2.quantum-inspire.com/realms/oidc_development/protocol/openid-connect/auth
233233
- **Scopes**: N/A
234234

235235
<a id="backend"></a>

compute_api_client/api/jobs_api.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,10 @@ async def read_jobs_jobs_get(
878878
number_of_shots__isnull: Optional[StrictBool] = None,
879879
number_of_shots: Optional[StrictInt] = None,
880880
raw_data_enabled: Optional[StrictBool] = None,
881+
session_id: Optional[StrictStr] = None,
882+
trace_id: Optional[StrictStr] = None,
883+
message: Optional[StrictStr] = None,
884+
source: Optional[StrictStr] = None,
881885
sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
882886
latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
883887
page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
@@ -925,6 +929,14 @@ async def read_jobs_jobs_get(
925929
:type number_of_shots: int
926930
:param raw_data_enabled:
927931
:type raw_data_enabled: bool
932+
:param session_id:
933+
:type session_id: str
934+
:param trace_id:
935+
:type trace_id: str
936+
:param message:
937+
:type message: str
938+
:param source:
939+
:type source: str
928940
:param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
929941
:type sort_by: str
930942
:param latest: If True gets the most recently created object.
@@ -969,6 +981,10 @@ async def read_jobs_jobs_get(
969981
number_of_shots__isnull=number_of_shots__isnull,
970982
number_of_shots=number_of_shots,
971983
raw_data_enabled=raw_data_enabled,
984+
session_id=session_id,
985+
trace_id=trace_id,
986+
message=message,
987+
source=source,
972988
sort_by=sort_by,
973989
latest=latest,
974990
page=page,
@@ -1011,6 +1027,10 @@ async def read_jobs_jobs_get_with_http_info(
10111027
number_of_shots__isnull: Optional[StrictBool] = None,
10121028
number_of_shots: Optional[StrictInt] = None,
10131029
raw_data_enabled: Optional[StrictBool] = None,
1030+
session_id: Optional[StrictStr] = None,
1031+
trace_id: Optional[StrictStr] = None,
1032+
message: Optional[StrictStr] = None,
1033+
source: Optional[StrictStr] = None,
10141034
sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
10151035
latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
10161036
page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
@@ -1058,6 +1078,14 @@ async def read_jobs_jobs_get_with_http_info(
10581078
:type number_of_shots: int
10591079
:param raw_data_enabled:
10601080
:type raw_data_enabled: bool
1081+
:param session_id:
1082+
:type session_id: str
1083+
:param trace_id:
1084+
:type trace_id: str
1085+
:param message:
1086+
:type message: str
1087+
:param source:
1088+
:type source: str
10611089
:param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
10621090
:type sort_by: str
10631091
:param latest: If True gets the most recently created object.
@@ -1102,6 +1130,10 @@ async def read_jobs_jobs_get_with_http_info(
11021130
number_of_shots__isnull=number_of_shots__isnull,
11031131
number_of_shots=number_of_shots,
11041132
raw_data_enabled=raw_data_enabled,
1133+
session_id=session_id,
1134+
trace_id=trace_id,
1135+
message=message,
1136+
source=source,
11051137
sort_by=sort_by,
11061138
latest=latest,
11071139
page=page,
@@ -1144,6 +1176,10 @@ async def read_jobs_jobs_get_without_preload_content(
11441176
number_of_shots__isnull: Optional[StrictBool] = None,
11451177
number_of_shots: Optional[StrictInt] = None,
11461178
raw_data_enabled: Optional[StrictBool] = None,
1179+
session_id: Optional[StrictStr] = None,
1180+
trace_id: Optional[StrictStr] = None,
1181+
message: Optional[StrictStr] = None,
1182+
source: Optional[StrictStr] = None,
11471183
sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
11481184
latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
11491185
page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
@@ -1191,6 +1227,14 @@ async def read_jobs_jobs_get_without_preload_content(
11911227
:type number_of_shots: int
11921228
:param raw_data_enabled:
11931229
:type raw_data_enabled: bool
1230+
:param session_id:
1231+
:type session_id: str
1232+
:param trace_id:
1233+
:type trace_id: str
1234+
:param message:
1235+
:type message: str
1236+
:param source:
1237+
:type source: str
11941238
:param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
11951239
:type sort_by: str
11961240
:param latest: If True gets the most recently created object.
@@ -1235,6 +1279,10 @@ async def read_jobs_jobs_get_without_preload_content(
12351279
number_of_shots__isnull=number_of_shots__isnull,
12361280
number_of_shots=number_of_shots,
12371281
raw_data_enabled=raw_data_enabled,
1282+
session_id=session_id,
1283+
trace_id=trace_id,
1284+
message=message,
1285+
source=source,
12381286
sort_by=sort_by,
12391287
latest=latest,
12401288
page=page,
@@ -1272,6 +1320,10 @@ def _read_jobs_jobs_get_serialize(
12721320
number_of_shots__isnull,
12731321
number_of_shots,
12741322
raw_data_enabled,
1323+
session_id,
1324+
trace_id,
1325+
message,
1326+
source,
12751327
sort_by,
12761328
latest,
12771329
page,
@@ -1376,6 +1428,22 @@ def _read_jobs_jobs_get_serialize(
13761428

13771429
_query_params.append(('raw_data_enabled', raw_data_enabled))
13781430

1431+
if session_id is not None:
1432+
1433+
_query_params.append(('session_id', session_id))
1434+
1435+
if trace_id is not None:
1436+
1437+
_query_params.append(('trace_id', trace_id))
1438+
1439+
if message is not None:
1440+
1441+
_query_params.append(('message', message))
1442+
1443+
if source is not None:
1444+
1445+
_query_params.append(('source', source))
1446+
13791447
if sort_by is not None:
13801448

13811449
_query_params.append(('sort_by', sort_by))

compute_api_client/docs/Job.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Name | Type | Description | Notes
1414
**finished_at** | **datetime** | |
1515
**number_of_shots** | **int** | |
1616
**raw_data_enabled** | **bool** | |
17+
**session_id** | **str** | |
18+
**trace_id** | **str** | |
19+
**message** | **str** | |
20+
**source** | **str** | |
1721

1822
## Example
1923

compute_api_client/docs/JobPatch.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**status** | [**JobStatus**](JobStatus.md) | |
8+
**session_id** | **str** | | [optional] [default to '']
9+
**trace_id** | **str** | | [optional] [default to '']
10+
**message** | **str** | | [optional] [default to '']
11+
**source** | **str** | | [optional] [default to '']
812

913
## Example
1014

compute_api_client/docs/JobsApi.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Name | Type | Description | Notes
244244
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
245245

246246
# **read_jobs_jobs_get**
247-
> PageJob read_jobs_jobs_get(id=id, created_on=created_on, file_id=file_id, algorithm_type=algorithm_type, status=status, batch_job_id=batch_job_id, queued_at__isnull=queued_at__isnull, queued_at=queued_at, finished_at__isnull=finished_at__isnull, finished_at=finished_at, number_of_shots__isnull=number_of_shots__isnull, number_of_shots=number_of_shots, raw_data_enabled=raw_data_enabled, sort_by=sort_by, latest=latest, page=page, size=size)
247+
> PageJob read_jobs_jobs_get(id=id, created_on=created_on, file_id=file_id, algorithm_type=algorithm_type, status=status, batch_job_id=batch_job_id, queued_at__isnull=queued_at__isnull, queued_at=queued_at, finished_at__isnull=finished_at__isnull, finished_at=finished_at, number_of_shots__isnull=number_of_shots__isnull, number_of_shots=number_of_shots, raw_data_enabled=raw_data_enabled, session_id=session_id, trace_id=trace_id, message=message, source=source, sort_by=sort_by, latest=latest, page=page, size=size)
248248
249249
List jobs
250250

@@ -300,14 +300,18 @@ async with compute_api_client.ApiClient(configuration) as api_client:
300300
number_of_shots__isnull = True # bool | (optional)
301301
number_of_shots = 56 # int | (optional)
302302
raw_data_enabled = True # bool | (optional)
303+
session_id = 'session_id_example' # str | (optional)
304+
trace_id = 'trace_id_example' # str | (optional)
305+
message = 'message_example' # str | (optional)
306+
source = 'source_example' # str | (optional)
303307
sort_by = 'sort_by_example' # str | The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'. (optional)
304308
latest = True # bool | If True gets the most recently created object. (optional)
305309
page = 1 # int | Page number (optional) (default to 1)
306310
size = 50 # int | Page size (optional) (default to 50)
307311

308312
try:
309313
# List jobs
310-
api_response = await api_instance.read_jobs_jobs_get(id=id, created_on=created_on, file_id=file_id, algorithm_type=algorithm_type, status=status, batch_job_id=batch_job_id, queued_at__isnull=queued_at__isnull, queued_at=queued_at, finished_at__isnull=finished_at__isnull, finished_at=finished_at, number_of_shots__isnull=number_of_shots__isnull, number_of_shots=number_of_shots, raw_data_enabled=raw_data_enabled, sort_by=sort_by, latest=latest, page=page, size=size)
314+
api_response = await api_instance.read_jobs_jobs_get(id=id, created_on=created_on, file_id=file_id, algorithm_type=algorithm_type, status=status, batch_job_id=batch_job_id, queued_at__isnull=queued_at__isnull, queued_at=queued_at, finished_at__isnull=finished_at__isnull, finished_at=finished_at, number_of_shots__isnull=number_of_shots__isnull, number_of_shots=number_of_shots, raw_data_enabled=raw_data_enabled, session_id=session_id, trace_id=trace_id, message=message, source=source, sort_by=sort_by, latest=latest, page=page, size=size)
311315
print("The response of JobsApi->read_jobs_jobs_get:\n")
312316
pprint(api_response)
313317
except Exception as e:
@@ -333,6 +337,10 @@ Name | Type | Description | Notes
333337
**number_of_shots__isnull** | **bool**| | [optional]
334338
**number_of_shots** | **int**| | [optional]
335339
**raw_data_enabled** | **bool**| | [optional]
340+
**session_id** | **str**| | [optional]
341+
**trace_id** | **str**| | [optional]
342+
**message** | **str**| | [optional]
343+
**source** | **str**| | [optional]
336344
**sort_by** | **str**| The field name to sort on. Prefix with &#39;-&#39; for descending order. E.g., &#39;-created_on&#39;. | [optional]
337345
**latest** | **bool**| If True gets the most recently created object. | [optional]
338346
**page** | **int**| Page number | [optional] [default to 1]

compute_api_client/models/job.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from datetime import datetime
2121
from typing import Any, ClassVar, Dict, List, Optional
22-
from pydantic import BaseModel, StrictBool, StrictInt
22+
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
2323
from compute_api_client.models.algorithm_type import AlgorithmType
2424
from compute_api_client.models.job_status import JobStatus
2525
try:
@@ -41,7 +41,11 @@ class Job(BaseModel):
4141
finished_at: Optional[datetime]
4242
number_of_shots: Optional[StrictInt]
4343
raw_data_enabled: StrictBool
44-
__properties: ClassVar[List[str]] = ["id", "created_on", "file_id", "algorithm_type", "status", "batch_job_id", "queued_at", "finished_at", "number_of_shots", "raw_data_enabled"]
44+
session_id: StrictStr
45+
trace_id: StrictStr
46+
message: StrictStr
47+
source: StrictStr
48+
__properties: ClassVar[List[str]] = ["id", "created_on", "file_id", "algorithm_type", "status", "batch_job_id", "queued_at", "finished_at", "number_of_shots", "raw_data_enabled", "session_id", "trace_id", "message", "source"]
4549

4650
model_config = {
4751
"populate_by_name": True,
@@ -115,7 +119,11 @@ def from_dict(cls, obj: Dict) -> Self:
115119
"queued_at": obj.get("queued_at"),
116120
"finished_at": obj.get("finished_at"),
117121
"number_of_shots": obj.get("number_of_shots"),
118-
"raw_data_enabled": obj.get("raw_data_enabled")
122+
"raw_data_enabled": obj.get("raw_data_enabled"),
123+
"session_id": obj.get("session_id"),
124+
"trace_id": obj.get("trace_id"),
125+
"message": obj.get("message"),
126+
"source": obj.get("source")
119127
})
120128
return _obj
121129

compute_api_client/models/job_patch.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
import json
1919

2020

21-
from typing import Any, ClassVar, Dict, List
22-
from pydantic import BaseModel
21+
from typing import Any, ClassVar, Dict, List, Optional
22+
from pydantic import BaseModel, StrictStr
23+
from pydantic import Field
24+
from typing_extensions import Annotated
2325
from compute_api_client.models.job_status import JobStatus
2426
try:
2527
from typing import Self
@@ -31,7 +33,11 @@ class JobPatch(BaseModel):
3133
JobPatch
3234
""" # noqa: E501
3335
status: JobStatus
34-
__properties: ClassVar[List[str]] = ["status"]
36+
session_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = ''
37+
trace_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = ''
38+
message: Optional[StrictStr] = ''
39+
source: Optional[StrictStr] = ''
40+
__properties: ClassVar[List[str]] = ["status", "session_id", "trace_id", "message", "source"]
3541

3642
model_config = {
3743
"populate_by_name": True,
@@ -81,7 +87,11 @@ def from_dict(cls, obj: Dict) -> Self:
8187
return cls.model_validate(obj)
8288

8389
_obj = cls.model_validate({
84-
"status": obj.get("status")
90+
"status": obj.get("status"),
91+
"session_id": obj.get("session_id") if obj.get("session_id") is not None else '',
92+
"trace_id": obj.get("trace_id") if obj.get("trace_id") is not None else '',
93+
"message": obj.get("message") if obj.get("message") is not None else '',
94+
"source": obj.get("source") if obj.get("source") is not None else ''
8595
})
8696
return _obj
8797

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "qi-compute-api-client"
3-
version = "0.44.0"
3+
version = "0.45.0"
44
description = "An API client for the Compute Job Manager of Quantum Inspire."
55
license = "Apache-2.0"
66
authors = ["Quantum Inspire <[email protected]>"]

0 commit comments

Comments
 (0)